summaryrefslogtreecommitdiffstats
path: root/src/widgets/util
diff options
context:
space:
mode:
authorStephan Binner <stephan.binner@basyskom.com>2017-03-02 13:39:22 +0100
committerStephan Binner <stephan.binner@basyskom.com>2017-03-03 20:34:58 +0000
commitdc2512f3088d6f836ef06d35cbf1a5f7acb4ce7b (patch)
tree57d49188948653679bc98704e36629523008445f /src/widgets/util
parent46bf3d71e58457afcc8177a68243ac71308534db (diff)
Add feature.label and feature.formlayout
Change-Id: Ic8dc0aee7f3fc0d8218ba709352b1378078c6070 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/widgets/util')
-rw-r--r--src/widgets/util/qsystemtrayicon.cpp12
-rw-r--r--src/widgets/util/qsystemtrayicon_x11.cpp3
2 files changed, 14 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);
diff --git a/src/widgets/util/qsystemtrayicon_x11.cpp b/src/widgets/util/qsystemtrayicon_x11.cpp
index ac6c14dc63..cbd5d9eb80 100644
--- a/src/widgets/util/qsystemtrayicon_x11.cpp
+++ b/src/widgets/util/qsystemtrayicon_x11.cpp
@@ -37,7 +37,10 @@
**
****************************************************************************/
+#include "qtwidgetsglobal.h"
+#if QT_CONFIG(label)
#include "qlabel.h"
+#endif
#include "qpainter.h"
#include "qpixmap.h"
#include "qbitmap.h"