forked from qt-creator/qt-creator
ProjectExplorer: Allow labels with pixmaps in string based aspects
Can be used to show warning icons etc. Change-Id: I3ec845c11ea8147482ed90a0fac3c008bcffdec3 Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
This commit is contained in:
@@ -350,6 +350,13 @@ void BaseStringAspect::setLabelText(const QString &labelText)
|
||||
m_label->setText(labelText);
|
||||
}
|
||||
|
||||
void BaseStringAspect::setLabelPixmap(const QPixmap &labelPixmap)
|
||||
{
|
||||
m_labelPixmap = labelPixmap;
|
||||
if (m_label)
|
||||
m_label->setPixmap(labelPixmap);
|
||||
}
|
||||
|
||||
QString BaseStringAspect::labelText() const
|
||||
{
|
||||
return m_labelText;
|
||||
@@ -406,6 +413,7 @@ void BaseStringAspect::addToConfigurationLayout(QFormLayout *layout)
|
||||
QWidget *parent = layout->parentWidget();
|
||||
m_label = new QLabel(parent);
|
||||
m_label->setTextInteractionFlags(Qt::TextSelectableByMouse);
|
||||
m_label->setPixmap(m_labelPixmap);
|
||||
|
||||
auto hbox = new QHBoxLayout;
|
||||
switch (m_displayStyle) {
|
||||
|
||||
@@ -173,6 +173,7 @@ public:
|
||||
|
||||
QString labelText() const;
|
||||
void setLabelText(const QString &labelText);
|
||||
void setLabelPixmap(const QPixmap &labelPixmap);
|
||||
|
||||
void setDisplayFilter(const std::function<QString (const QString &)> &displayFilter);
|
||||
void setPlaceHolderText(const QString &placeHolderText);
|
||||
@@ -209,6 +210,7 @@ private:
|
||||
QPointer<QLabel> m_labelDisplay;
|
||||
QPointer<Utils::FancyLineEdit> m_lineEditDisplay;
|
||||
QPointer<Utils::PathChooser> m_pathChooserDisplay;
|
||||
QPixmap m_labelPixmap;
|
||||
};
|
||||
|
||||
class PROJECTEXPLORER_EXPORT ExecutableAspect : public IRunConfigurationAspect
|
||||
|
||||
Reference in New Issue
Block a user