summaryrefslogtreecommitdiff
path: root/src/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/projectexplorer/projectconfigurationaspects.cpp17
-rw-r--r--src/plugins/projectexplorer/projectconfigurationaspects.h5
2 files changed, 18 insertions, 4 deletions
diff --git a/src/plugins/projectexplorer/projectconfigurationaspects.cpp b/src/plugins/projectexplorer/projectconfigurationaspects.cpp
index 74b260a696..d5d45e51dc 100644
--- a/src/plugins/projectexplorer/projectconfigurationaspects.cpp
+++ b/src/plugins/projectexplorer/projectconfigurationaspects.cpp
@@ -161,7 +161,8 @@ class TextDisplayPrivate
public:
QString m_message;
QString m_tooltip;
- QPointer<QLabel> m_label;
+ Utils::InfoLabel::InfoType m_type;
+ QPointer<InfoLabel> m_label;
};
} // Internal
@@ -894,10 +895,11 @@ void StringListAspect::setValue(const QStringList &value)
\class ProjectExplorer::TextDisplay
*/
-TextDisplay::TextDisplay(const QString &message)
+TextDisplay::TextDisplay(const QString &message, InfoLabel::InfoType type)
: d(new Internal::TextDisplayPrivate)
{
d->m_message = message;
+ d->m_type = type;
}
TextDisplay::~TextDisplay() = default;
@@ -905,9 +907,11 @@ TextDisplay::~TextDisplay() = default;
void TextDisplay::addToLayout(LayoutBuilder &builder)
{
if (!d->m_label) {
- d->m_label = new QLabel(d->m_message);
+ d->m_label = new InfoLabel(d->m_message, d->m_type);
d->m_label->setTextInteractionFlags(Qt::TextSelectableByMouse);
d->m_label->setToolTip(d->m_tooltip);
+ d->m_label->setElideMode(Qt::ElideNone);
+ d->m_label->setWordWrap(true);
}
builder.addItem(d->m_label.data());
d->m_label->setVisible(isVisible());
@@ -927,6 +931,13 @@ void TextDisplay::setToolTip(const QString &tooltip)
d->m_label->setToolTip(tooltip);
}
+void TextDisplay::setIconType(InfoLabel::InfoType t)
+{
+ d->m_type = t;
+ if (d->m_label)
+ d->m_label->setType(t);
+}
+
/*!
\class ProjectExplorer::AspectContainer
*/
diff --git a/src/plugins/projectexplorer/projectconfigurationaspects.h b/src/plugins/projectexplorer/projectconfigurationaspects.h
index 11d266d9c9..df0dc94eaa 100644
--- a/src/plugins/projectexplorer/projectconfigurationaspects.h
+++ b/src/plugins/projectexplorer/projectconfigurationaspects.h
@@ -29,6 +29,7 @@
#include "environmentaspect.h"
#include <utils/fileutils.h>
+#include <utils/infolabel.h>
#include <utils/macroexpander.h>
#include <utils/pathchooser.h>
@@ -262,13 +263,15 @@ class PROJECTEXPLORER_EXPORT TextDisplay : public ProjectConfigurationAspect
Q_OBJECT
public:
- TextDisplay(const QString &message = {});
+ TextDisplay(const QString &message = {},
+ Utils::InfoLabel::InfoType type = Utils::InfoLabel::None);
~TextDisplay() override;
void addToLayout(LayoutBuilder &builder) override;
void setVisible(bool visible);
void setToolTip(const QString &tooltip);
+ void setIconType(Utils::InfoLabel::InfoType t);
private:
std::unique_ptr<Internal::TextDisplayPrivate> d;