summaryrefslogtreecommitdiffstats
path: root/src/widgets/util/qsystemtrayicon.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/widgets/util/qsystemtrayicon.cpp')
-rw-r--r--src/widgets/util/qsystemtrayicon.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/widgets/util/qsystemtrayicon.cpp b/src/widgets/util/qsystemtrayicon.cpp
index 83c1764f38..4ea776d0b1 100644
--- a/src/widgets/util/qsystemtrayicon.cpp
+++ b/src/widgets/util/qsystemtrayicon.cpp
@@ -46,7 +46,10 @@
#include "qlist.h"
#include "qevent.h"
#include "qpoint.h"
+#if QT_CONFIG(label)
#include "qlabel.h"
+#include "private/qlabel_p.h"
+#endif
#include "qpushbutton.h"
#include "qpainterpath.h"
#include "qpainter.h"
@@ -55,7 +58,6 @@
#include "qapplication.h"
#include "qdesktopwidget.h"
#include "qbitmap.h"
-#include "private/qlabel_p.h"
QT_BEGIN_NAMESPACE
@@ -481,6 +483,7 @@ QBalloonTip::QBalloonTip(const QIcon &icon, const QString &title,
setAttribute(Qt::WA_DeleteOnClose);
QObject::connect(ti, SIGNAL(destroyed()), this, SLOT(close()));
+#if QT_CONFIG(label)
QLabel *titleLabel = new QLabel;
titleLabel->installEventFilter(this);
titleLabel->setText(title);
@@ -488,6 +491,7 @@ QBalloonTip::QBalloonTip(const QIcon &icon, const QString &title,
f.setBold(true);
titleLabel->setFont(f);
titleLabel->setTextFormat(Qt::PlainText); // to maintain compat with windows
+#endif
const int iconSize = 18;
const int closeButtonSize = 15;
@@ -499,6 +503,7 @@ QBalloonTip::QBalloonTip(const QIcon &icon, const QString &title,
closeButton->setFixedSize(closeButtonSize, closeButtonSize);
QObject::connect(closeButton, SIGNAL(clicked()), this, SLOT(close()));
+#if QT_CONFIG(label)
QLabel *msgLabel = new QLabel;
msgLabel->installEventFilter(this);
msgLabel->setText(message);
@@ -521,8 +526,10 @@ QBalloonTip::QBalloonTip(const QIcon &icon, const QString &title,
// to emulate the weird standard windows behavior.
msgLabel->setFixedSize(limit, msgLabel->heightForWidth(limit));
}
+#endif
QGridLayout *layout = new QGridLayout;
+#if QT_CONFIG(label)
if (!icon.isNull()) {
QLabel *iconLabel = new QLabel;
iconLabel->setPixmap(icon.pixmap(iconSize, iconSize));
@@ -533,9 +540,12 @@ QBalloonTip::QBalloonTip(const QIcon &icon, const QString &title,
} else {
layout->addWidget(titleLabel, 0, 0, 1, 2);
}
+#endif
layout->addWidget(closeButton, 0, 2);
+#if QT_CONFIG(label)
layout->addWidget(msgLabel, 1, 0, 1, 3);
+#endif
layout->setSizeConstraint(QLayout::SetFixedSize);
layout->setMargin(3);
setLayout(layout);