forked from qt-creator/qt-creator
PE: Make TextDisplay a pure text display
Remove the pixmap part as pixmap and label text are
mutually exclusive and currently not used.
Beside this we must not call setVisible() before adding
the label to an already existing widget or layout or it
will be temporarily pop up as separate widget.
Amends 9e54e1776e
.
Change-Id: Iaa57bfd1ca105d7360eaa360d68dbde38eaf0aeb
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -161,7 +161,6 @@ class TextDisplayPrivate
|
||||
public:
|
||||
QString m_message;
|
||||
QString m_tooltip;
|
||||
QPixmap m_pixmap;
|
||||
QPointer<QLabel> m_label;
|
||||
};
|
||||
|
||||
@@ -908,11 +907,10 @@ void TextDisplay::addToLayout(LayoutBuilder &builder)
|
||||
if (!d->m_label) {
|
||||
d->m_label = new QLabel(d->m_message);
|
||||
d->m_label->setTextInteractionFlags(Qt::TextSelectableByMouse);
|
||||
d->m_label->setVisible(isVisible());
|
||||
d->m_label->setToolTip(d->m_tooltip);
|
||||
d->m_label->setPixmap(d->m_pixmap);
|
||||
}
|
||||
builder.addItem(d->m_label.data());
|
||||
d->m_label->setVisible(isVisible());
|
||||
}
|
||||
|
||||
void TextDisplay::setVisible(bool visible)
|
||||
@@ -929,13 +927,6 @@ void TextDisplay::setToolTip(const QString &tooltip)
|
||||
d->m_label->setToolTip(tooltip);
|
||||
}
|
||||
|
||||
void TextDisplay::setPixmap(const QPixmap &pixmap)
|
||||
{
|
||||
d->m_pixmap = pixmap;
|
||||
if (d->m_label)
|
||||
d->m_label->setPixmap(pixmap);
|
||||
}
|
||||
|
||||
/*!
|
||||
\class ProjectExplorer::AspectContainer
|
||||
*/
|
||||
|
@@ -269,7 +269,6 @@ public:
|
||||
|
||||
void setVisible(bool visible);
|
||||
void setToolTip(const QString &tooltip);
|
||||
void setPixmap(const QPixmap &pixmap);
|
||||
|
||||
private:
|
||||
std::unique_ptr<Internal::TextDisplayPrivate> d;
|
||||
|
Reference in New Issue
Block a user