diff options
Diffstat (limited to 'src/widgets/util')
-rw-r--r-- | src/widgets/util/qcompleter.cpp | 3 | ||||
-rw-r--r-- | src/widgets/util/qscroller.h | 2 | ||||
-rw-r--r-- | src/widgets/util/qscrollerproperties.h | 2 | ||||
-rw-r--r-- | src/widgets/util/qsystemtrayicon.cpp | 19 | ||||
-rw-r--r-- | src/widgets/util/qsystemtrayicon_x11.cpp | 3 | ||||
-rw-r--r-- | src/widgets/util/util.pri | 22 |
6 files changed, 41 insertions, 10 deletions
diff --git a/src/widgets/util/qcompleter.cpp b/src/widgets/util/qcompleter.cpp index 3006f0c9ce..e8f23f08bc 100644 --- a/src/widgets/util/qcompleter.cpp +++ b/src/widgets/util/qcompleter.cpp @@ -1347,11 +1347,12 @@ bool QCompleter::eventFilter(QObject *o, QEvent *e) } // default implementation for keys not handled by the widget when popup is open +#if QT_CONFIG(shortcut) if (ke->matches(QKeySequence::Cancel)) { d->popup->hide(); return true; } - +#endif switch (key) { #ifdef QT_KEYPAD_NAVIGATION case Qt::Key_Select: diff --git a/src/widgets/util/qscroller.h b/src/widgets/util/qscroller.h index 561dcfaefc..ca8d059f50 100644 --- a/src/widgets/util/qscroller.h +++ b/src/widgets/util/qscroller.h @@ -45,6 +45,8 @@ #include <QtCore/QPointF> #include <QtWidgets/QScrollerProperties> +QT_REQUIRE_CONFIG(scroller); + QT_BEGIN_NAMESPACE diff --git a/src/widgets/util/qscrollerproperties.h b/src/widgets/util/qscrollerproperties.h index 4fdc9bd32f..2fc1a5dc18 100644 --- a/src/widgets/util/qscrollerproperties.h +++ b/src/widgets/util/qscrollerproperties.h @@ -45,6 +45,8 @@ #include <QtCore/QMetaType> #include <QtCore/QVariant> +QT_REQUIRE_CONFIG(scroller); + QT_BEGIN_NAMESPACE diff --git a/src/widgets/util/qsystemtrayicon.cpp b/src/widgets/util/qsystemtrayicon.cpp index 83c1764f38..1e0d2ab857 100644 --- a/src/widgets/util/qsystemtrayicon.cpp +++ b/src/widgets/util/qsystemtrayicon.cpp @@ -46,8 +46,13 @@ #include "qlist.h" #include "qevent.h" #include "qpoint.h" +#if QT_CONFIG(label) #include "qlabel.h" +#include "private/qlabel_p.h" +#endif +#if QT_CONFIG(pushbutton) #include "qpushbutton.h" +#endif #include "qpainterpath.h" #include "qpainter.h" #include "qstyle.h" @@ -55,7 +60,6 @@ #include "qapplication.h" #include "qdesktopwidget.h" #include "qbitmap.h" -#include "private/qlabel_p.h" QT_BEGIN_NAMESPACE @@ -481,6 +485,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,17 +493,21 @@ 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; +#if QT_CONFIG(pushbutton) QPushButton *closeButton = new QPushButton; closeButton->setIcon(style()->standardIcon(QStyle::SP_TitleBarCloseButton)); closeButton->setIconSize(QSize(closeButtonSize, closeButtonSize)); closeButton->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); closeButton->setFixedSize(closeButtonSize, closeButtonSize); QObject::connect(closeButton, SIGNAL(clicked()), this, SLOT(close())); +#endif +#if QT_CONFIG(label) QLabel *msgLabel = new QLabel; msgLabel->installEventFilter(this); msgLabel->setText(message); @@ -521,8 +530,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 +544,15 @@ QBalloonTip::QBalloonTip(const QIcon &icon, const QString &title, } else { layout->addWidget(titleLabel, 0, 0, 1, 2); } +#endif +#if QT_CONFIG(pushbutton) layout->addWidget(closeButton, 0, 2); +#endif + +#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" diff --git a/src/widgets/util/util.pri b/src/widgets/util/util.pri index cb19c1fc95..b9b62d9bb0 100644 --- a/src/widgets/util/util.pri +++ b/src/widgets/util/util.pri @@ -6,11 +6,6 @@ HEADERS += \ util/qcompleter.h \ util/qcompleter_p.h \ util/qsystemtrayicon_p.h \ - util/qscroller.h \ - util/qscroller_p.h \ - util/qscrollerproperties.h \ - util/qscrollerproperties_p.h \ - util/qflickgesture_p.h \ util/qundogroup.h \ util/qundostack.h \ util/qundostack_p.h \ @@ -20,13 +15,24 @@ SOURCES += \ util/qsystemtrayicon.cpp \ util/qcolormap.cpp \ util/qcompleter.cpp \ - util/qscroller.cpp \ - util/qscrollerproperties.cpp \ - util/qflickgesture.cpp \ util/qundogroup.cpp \ util/qundostack.cpp \ util/qundoview.cpp +qtConfig(scroller) { + HEADERS += \ + util/qscroller.h \ + util/qscroller_p.h \ + util/qscrollerproperties.h \ + util/qscrollerproperties_p.h \ + util/qflickgesture_p.h + + SOURCES += \ + util/qscroller.cpp \ + util/qscrollerproperties.cpp \ + util/qflickgesture.cpp \ +} + win32:!winrt { SOURCES += util/qsystemtrayicon_win.cpp } else: qtConfig(xcb) { |