diff options
author | Stephan Binner <stephan.binner@basyskom.com> | 2017-09-02 20:49:54 +0200 |
---|---|---|
committer | Stephan Binner <stephan.binner@basyskom.com> | 2017-09-12 18:12:47 +0000 |
commit | bef8b905afec924936d7efcf150760ae86cc9e20 (patch) | |
tree | 5e27144bd5a3746c388277028757d9cff395059a /src/widgets | |
parent | ba1b73175b5b47ff0565c58f0d6c51d515c21831 (diff) |
Convert features.sizegrip to QT_[REQUIRE_]CONFIG
Change-Id: Ieac4ae1f0b8b84e943c00da9903346a44e57138c
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Diffstat (limited to 'src/widgets')
-rw-r--r-- | src/widgets/dialogs/qdialog.cpp | 16 | ||||
-rw-r--r-- | src/widgets/dialogs/qdialog_p.h | 4 | ||||
-rw-r--r-- | src/widgets/kernel/qlayout.cpp | 2 | ||||
-rw-r--r-- | src/widgets/styles/qcommonstyle.cpp | 4 | ||||
-rw-r--r-- | src/widgets/styles/qmacstyle_mac.mm | 4 | ||||
-rw-r--r-- | src/widgets/styles/qmacstyle_mac_p_p.h | 2 | ||||
-rw-r--r-- | src/widgets/styles/qstyleoption.cpp | 4 | ||||
-rw-r--r-- | src/widgets/widgets/qmdisubwindow.cpp | 28 | ||||
-rw-r--r-- | src/widgets/widgets/qmdisubwindow_p.h | 6 | ||||
-rw-r--r-- | src/widgets/widgets/qsizegrip.cpp | 4 | ||||
-rw-r--r-- | src/widgets/widgets/qsizegrip.h | 5 | ||||
-rw-r--r-- | src/widgets/widgets/qstatusbar.cpp | 22 | ||||
-rw-r--r-- | src/widgets/widgets/qwidgetresizehandler.cpp | 2 | ||||
-rw-r--r-- | src/widgets/widgets/widgets.pri | 7 |
14 files changed, 61 insertions, 49 deletions
diff --git a/src/widgets/dialogs/qdialog.cpp b/src/widgets/dialogs/qdialog.cpp index 1cd587b78d..51e4b76298 100644 --- a/src/widgets/dialogs/qdialog.cpp +++ b/src/widgets/dialogs/qdialog.cpp @@ -52,7 +52,9 @@ #include "qdesktopwidget.h" #include "qapplication.h" #include "qlayout.h" +#if QT_CONFIG(sizegrip) #include "qsizegrip.h" +#endif #if QT_CONFIG(whatsthis) #include "qwhatsthis.h" #endif @@ -1005,7 +1007,7 @@ void QDialog::showExtension(bool showIt) setFixedSize(w, height() + s.height()); } d->extension->show(); -#ifndef QT_NO_SIZEGRIP +#if QT_CONFIG(sizegrip) const bool sizeGripEnabled = isSizeGripEnabled(); setSizeGripEnabled(false); d->sizeGripEnabled = sizeGripEnabled; @@ -1018,7 +1020,7 @@ void QDialog::showExtension(bool showIt) resize(d->size); if (layout()) layout()->setEnabled(true); -#ifndef QT_NO_SIZEGRIP +#if QT_CONFIG(sizegrip) setSizeGripEnabled(d->sizeGripEnabled); #endif } @@ -1079,7 +1081,7 @@ void QDialog::setModal(bool modal) bool QDialog::isSizeGripEnabled() const { -#ifndef QT_NO_SIZEGRIP +#if QT_CONFIG(sizegrip) Q_D(const QDialog); return !!d->resizer; #else @@ -1090,11 +1092,11 @@ bool QDialog::isSizeGripEnabled() const void QDialog::setSizeGripEnabled(bool enabled) { -#ifdef QT_NO_SIZEGRIP +#if !QT_CONFIG(sizegrip) Q_UNUSED(enabled); #else Q_D(QDialog); -#ifndef QT_NO_SIZEGRIP +#if QT_CONFIG(sizegrip) d->sizeGripEnabled = enabled; if (enabled && d->doShowExtension) return; @@ -1115,7 +1117,7 @@ void QDialog::setSizeGripEnabled(bool enabled) d->resizer = 0; } } -#endif //QT_NO_SIZEGRIP +#endif // QT_CONFIG(sizegrip) } @@ -1123,7 +1125,7 @@ void QDialog::setSizeGripEnabled(bool enabled) /*! \reimp */ void QDialog::resizeEvent(QResizeEvent *) { -#ifndef QT_NO_SIZEGRIP +#if QT_CONFIG(sizegrip) Q_D(QDialog); if (d->resizer) { if (isRightToLeft()) diff --git a/src/widgets/dialogs/qdialog_p.h b/src/widgets/dialogs/qdialog_p.h index 9ee89863f6..2ed414bd45 100644 --- a/src/widgets/dialogs/qdialog_p.h +++ b/src/widgets/dialogs/qdialog_p.h @@ -78,7 +78,7 @@ public: mainDef(0), #endif orientation(Qt::Horizontal),extension(0), doShowExtension(false), -#ifndef QT_NO_SIZEGRIP +#if QT_CONFIG(sizegrip) resizer(0), sizeGripEnabled(false), #endif @@ -99,7 +99,7 @@ public: QWidget *extension; bool doShowExtension; QSize size, min, max; -#ifndef QT_NO_SIZEGRIP +#if QT_CONFIG(sizegrip) QSizeGrip *resizer; bool sizeGripEnabled; #endif diff --git a/src/widgets/kernel/qlayout.cpp b/src/widgets/kernel/qlayout.cpp index 56edd019bb..1e455b0d64 100644 --- a/src/widgets/kernel/qlayout.cpp +++ b/src/widgets/kernel/qlayout.cpp @@ -45,7 +45,9 @@ #include "qmenubar.h" #endif #include "qtoolbar.h" +#if QT_CONFIG(sizegrip) #include "qsizegrip.h" +#endif #include "qevent.h" #include "qstyle.h" #include "qvariant.h" diff --git a/src/widgets/styles/qcommonstyle.cpp b/src/widgets/styles/qcommonstyle.cpp index 36e1938a4f..0eb256611d 100644 --- a/src/widgets/styles/qcommonstyle.cpp +++ b/src/widgets/styles/qcommonstyle.cpp @@ -1940,7 +1940,7 @@ void QCommonStyle::drawControl(ControlElement element, const QStyleOption *opt, } break; #endif // QT_CONFIG(tabbar) -#ifndef QT_NO_SIZEGRIP +#if QT_CONFIG(sizegrip) case CE_SizeGrip: { p->save(); int x, y, w, h; @@ -2013,7 +2013,7 @@ void QCommonStyle::drawControl(ControlElement element, const QStyleOption *opt, } p->restore(); break; } -#endif // QT_NO_SIZEGRIP +#endif // QT_CONFIG(sizegrip) #if QT_CONFIG(rubberband) case CE_RubberBand: { if (const QStyleOptionRubberBand *rbOpt = qstyleoption_cast<const QStyleOptionRubberBand *>(opt)) { diff --git a/src/widgets/styles/qmacstyle_mac.mm b/src/widgets/styles/qmacstyle_mac.mm index 6494be1a3c..3603255076 100644 --- a/src/widgets/styles/qmacstyle_mac.mm +++ b/src/widgets/styles/qmacstyle_mac.mm @@ -100,7 +100,9 @@ #if QT_CONFIG(scrollbar) #include <qscrollbar.h> #endif +#if QT_CONFIG(sizegrip) #include <qsizegrip.h> +#endif #include <qstyleoption.h> #include <qtoolbar.h> #if QT_CONFIG(toolbutton) @@ -687,7 +689,7 @@ static QSize qt_aqua_get_known_size(QStyle::ContentsType ct, const QWidget *widg else if (qobject_cast<const QMenuBar *>(widg)) ct = QStyle::CT_MenuBar; #endif -#ifndef QT_NO_SIZEGRIP +#if QT_CONFIG(sizegrip) else if (qobject_cast<const QSizeGrip *>(widg)) ct = QStyle::CT_SizeGrip; #endif diff --git a/src/widgets/styles/qmacstyle_mac_p_p.h b/src/widgets/styles/qmacstyle_mac_p_p.h index 9155a73212..01bb8a1ba1 100644 --- a/src/widgets/styles/qmacstyle_mac_p_p.h +++ b/src/widgets/styles/qmacstyle_mac_p_p.h @@ -99,7 +99,9 @@ #if QT_CONFIG(rubberband) #include <qrubberband.h> #endif +#if QT_CONFIG(sizegrip) #include <qsizegrip.h> +#endif #include <qspinbox.h> #if QT_CONFIG(splitter) #include <qsplitter.h> diff --git a/src/widgets/styles/qstyleoption.cpp b/src/widgets/styles/qstyleoption.cpp index 5d11b86ae7..d0fda36fc2 100644 --- a/src/widgets/styles/qstyleoption.cpp +++ b/src/widgets/styles/qstyleoption.cpp @@ -3558,7 +3558,7 @@ QStyleOptionTabBarBase::QStyleOptionTabBarBase(int version) #endif // QT_CONFIG(tabbar) -#ifndef QT_NO_SIZEGRIP +#if QT_CONFIG(sizegrip) /*! \class QStyleOptionSizeGrip \brief The QStyleOptionSizeGrip class is used to describe the @@ -3638,7 +3638,7 @@ QStyleOptionSizeGrip::QStyleOptionSizeGrip(int version) \sa StyleOptionType */ -#endif // QT_NO_SIZEGRIP +#endif // QT_CONFIG(sizegrip) /*! \class QStyleOptionGraphicsItem diff --git a/src/widgets/widgets/qmdisubwindow.cpp b/src/widgets/widgets/qmdisubwindow.cpp index 6a19c48d30..db3d21d436 100644 --- a/src/widgets/widgets/qmdisubwindow.cpp +++ b/src/widgets/widgets/qmdisubwindow.cpp @@ -862,7 +862,7 @@ QMdiSubWindowPrivate::QMdiSubWindowPrivate() : baseWidget(0), restoreFocusWidget(0), controlContainer(0), -#ifndef QT_NO_SIZEGRIP +#if QT_CONFIG(sizegrip) sizeGrip(0), #endif #if QT_CONFIG(rubberband) @@ -1303,7 +1303,7 @@ void QMdiSubWindowPrivate::setNormalMode() restoreSize.setWidth(-1); restoreSize.setHeight(-1); -#ifndef QT_NO_SIZEGRIP +#if QT_CONFIG(sizegrip) setSizeGripVisible(true); #endif @@ -1350,7 +1350,7 @@ void QMdiSubWindowPrivate::setMaximizeMode() storeFocusWidget(); -#ifndef QT_NO_SIZEGRIP +#if QT_CONFIG(sizegrip) setSizeGripVisible(false); #endif @@ -2118,7 +2118,7 @@ void QMdiSubWindowPrivate::setWindowFlags(Qt::WindowFlags windowFlags) } #endif -#ifndef QT_NO_SIZEGRIP +#if QT_CONFIG(sizegrip) if ((windowFlags & Qt::FramelessWindowHint) && sizeGrip) delete sizeGrip; #endif @@ -2179,7 +2179,7 @@ QSize QMdiSubWindowPrivate::iconSize() const return QSize(q->style()->pixelMetric(QStyle::PM_MdiSubWindowMinimizedWidth, 0, q), titleBarHeight()); } -#ifndef QT_NO_SIZEGRIP +#if QT_CONFIG(sizegrip) /*! \internal @@ -2223,7 +2223,7 @@ void QMdiSubWindowPrivate::setSizeGripVisible(bool visible) const grip->setVisible(visible); } -#endif // QT_NO_SIZEGRIP +#endif // QT_CONFIG(sizegrip) /*! \internal @@ -2334,7 +2334,7 @@ void QMdiSubWindow::setWidget(QWidget *widget) else widget->setParent(this); -#ifndef QT_NO_SIZEGRIP +#if QT_CONFIG(sizegrip) QSizeGrip *sizeGrip = widget->findChild<QSizeGrip *>(); if (sizeGrip) sizeGrip->installEventFilter(this); @@ -2639,7 +2639,7 @@ void QMdiSubWindow::showShaded() if (hasFocus() || isAncestorOf(QApplication::focusWidget())) d->ensureWindowState(Qt::WindowActive); -#ifndef QT_NO_SIZEGRIP +#if QT_CONFIG(sizegrip) d->setSizeGripVisible(false); #endif @@ -2715,7 +2715,7 @@ bool QMdiSubWindow::eventFilter(QObject *object, QEvent *event) } #endif -#ifndef QT_NO_SIZEGRIP +#if QT_CONFIG(sizegrip) if (object != d->baseWidget && parent() && qobject_cast<QSizeGrip *>(object)) { if (event->type() != QEvent::MouseButtonPress || !testOption(QMdiSubWindow::RubberBandResize)) return QWidget::eventFilter(object, event); @@ -2846,7 +2846,7 @@ bool QMdiSubWindow::event(QEvent *event) d->isMaximizeMode = false; d->isWidgetHiddenByUs = false; if (!parent()) { -#if !defined(QT_NO_SIZEGRIP) && QT_CONFIG(style_mac) +#if QT_CONFIG(sizegrip) && QT_CONFIG(style_mac) if (qobject_cast<QMacStyle *>(style())) delete d->sizeGrip; #endif @@ -2941,7 +2941,7 @@ void QMdiSubWindow::showEvent(QShowEvent *showEvent) return; } -#if !defined(QT_NO_SIZEGRIP) && QT_CONFIG(style_mac) +#if QT_CONFIG(sizegrip) && QT_CONFIG(style_mac) if (qobject_cast<QMacStyle *>(style()) && !d->sizeGrip && !(windowFlags() & Qt::FramelessWindowHint)) { d->setSizeGrip(new QSizeGrip(this)); @@ -3079,7 +3079,7 @@ void QMdiSubWindow::leaveEvent(QEvent * /*leaveEvent*/) void QMdiSubWindow::resizeEvent(QResizeEvent *resizeEvent) { Q_D(QMdiSubWindow); -#ifndef QT_NO_SIZEGRIP +#if QT_CONFIG(sizegrip) if (d->sizeGrip) { d->sizeGrip->move(isLeftToRight() ? width() - d->sizeGrip->width() : 0, height() - d->sizeGrip->height()); @@ -3483,7 +3483,7 @@ void QMdiSubWindow::childEvent(QChildEvent *childEvent) { if (childEvent->type() != QEvent::ChildPolished) return; -#ifndef QT_NO_SIZEGRIP +#if QT_CONFIG(sizegrip) if (QSizeGrip *sizeGrip = qobject_cast<QSizeGrip *>(childEvent->child())) d_func()->setSizeGrip(sizeGrip); #endif @@ -3541,7 +3541,7 @@ QSize QMdiSubWindow::minimumSizeHint() const } } -#ifndef QT_NO_SIZEGRIP +#if QT_CONFIG(sizegrip) // SizeGrip int sizeGripHeight = 0; if (d->sizeGrip && d->sizeGrip->isVisibleTo(const_cast<QMdiSubWindow *>(this))) diff --git a/src/widgets/widgets/qmdisubwindow_p.h b/src/widgets/widgets/qmdisubwindow_p.h index 37e276d7c3..23bdf10fd9 100644 --- a/src/widgets/widgets/qmdisubwindow_p.h +++ b/src/widgets/widgets/qmdisubwindow_p.h @@ -59,7 +59,9 @@ #if QT_CONFIG(menubar) #include <QMenuBar> #endif +#if QT_CONFIG(sizegrip) #include <QSizeGrip> +#endif #include <QPointer> #include <QDebug> #include <private/qwidget_p.h> @@ -178,7 +180,7 @@ public: QPointer<QWidget> baseWidget; QPointer<QWidget> restoreFocusWidget; QPointer<QMdi::ControlContainer> controlContainer; -#ifndef QT_NO_SIZEGRIP +#if QT_CONFIG(sizegrip) QPointer<QSizeGrip> sizeGrip; #endif #if QT_CONFIG(rubberband) @@ -278,7 +280,7 @@ public: #endif #endif // QT_NO_ACTION QSize iconSize() const; -#ifndef QT_NO_SIZEGRIP +#if QT_CONFIG(sizegrip) void setSizeGrip(QSizeGrip *sizeGrip); void setSizeGripVisible(bool visible = true) const; #endif diff --git a/src/widgets/widgets/qsizegrip.cpp b/src/widgets/widgets/qsizegrip.cpp index 3efb902805..1e1d847751 100644 --- a/src/widgets/widgets/qsizegrip.cpp +++ b/src/widgets/widgets/qsizegrip.cpp @@ -39,8 +39,6 @@ #include "qsizegrip.h" -#ifndef QT_NO_SIZEGRIP - #include "qapplication.h" #include "qevent.h" #include "qpainter.h" @@ -507,5 +505,3 @@ bool QSizeGrip::event(QEvent *event) QT_END_NAMESPACE #include "moc_qsizegrip.cpp" - -#endif //QT_NO_SIZEGRIP diff --git a/src/widgets/widgets/qsizegrip.h b/src/widgets/widgets/qsizegrip.h index 831b146dd2..6ad2405339 100644 --- a/src/widgets/widgets/qsizegrip.h +++ b/src/widgets/widgets/qsizegrip.h @@ -43,10 +43,10 @@ #include <QtWidgets/qtwidgetsglobal.h> #include <QtWidgets/qwidget.h> -QT_BEGIN_NAMESPACE +QT_REQUIRE_CONFIG(sizegrip); +QT_BEGIN_NAMESPACE -#ifndef QT_NO_SIZEGRIP class QSizeGripPrivate; class Q_WIDGETS_EXPORT QSizeGrip : public QWidget { @@ -76,7 +76,6 @@ private: Q_DISABLE_COPY(QSizeGrip) Q_PRIVATE_SLOT(d_func(), void _q_showIfNotHidden()) }; -#endif // QT_NO_SIZEGRIP QT_END_NAMESPACE diff --git a/src/widgets/widgets/qstatusbar.cpp b/src/widgets/widgets/qstatusbar.cpp index c3b66cb64b..4635b73a81 100644 --- a/src/widgets/widgets/qstatusbar.cpp +++ b/src/widgets/widgets/qstatusbar.cpp @@ -47,7 +47,9 @@ #include "qtimer.h" #include "qstyle.h" #include "qstyleoption.h" +#if QT_CONFIG(sizegrip) #include "qsizegrip.h" +#endif #if QT_CONFIG(mainwindow) #include "qmainwindow.h" #endif @@ -81,7 +83,7 @@ public: QBoxLayout * box; QTimer * timer; -#ifndef QT_NO_SIZEGRIP +#if QT_CONFIG(sizegrip) QSizeGrip * resizer; bool showSizeGrip; #endif @@ -103,7 +105,7 @@ public: return i; } -#ifndef QT_NO_SIZEGRIP +#if QT_CONFIG(sizegrip) void tryToShowSizeGrip() { if (!showSizeGrip) @@ -129,7 +131,7 @@ QRect QStatusBarPrivate::messageRect() const int left = 6; int right = q->width() - 12; -#ifndef QT_NO_SIZEGRIP +#if QT_CONFIG(sizegrip) if (resizer && resizer->isVisible()) { if (rtl) left = resizer->x() + resizer->width(); @@ -234,7 +236,7 @@ QStatusBar::QStatusBar(QWidget * parent) d->box = 0; d->timer = 0; -#ifndef QT_NO_SIZEGRIP +#if QT_CONFIG(sizegrip) d->resizer = 0; setSizeGripEnabled(true); // causes reformat() #else @@ -431,7 +433,7 @@ void QStatusBar::removeWidget(QWidget *widget) bool QStatusBar::isSizeGripEnabled() const { -#ifdef QT_NO_SIZEGRIP +#if !QT_CONFIG(sizegrip) return false; #else Q_D(const QStatusBar); @@ -441,7 +443,7 @@ bool QStatusBar::isSizeGripEnabled() const void QStatusBar::setSizeGripEnabled(bool enabled) { -#ifdef QT_NO_SIZEGRIP +#if !QT_CONFIG(sizegrip) Q_UNUSED(enabled); #else Q_D(QStatusBar); @@ -477,7 +479,7 @@ void QStatusBar::reformat() delete d->box; QBoxLayout *vbox; -#ifndef QT_NO_SIZEGRIP +#if QT_CONFIG(sizegrip) if (d->resizer) { d->box = new QHBoxLayout(this); d->box->setMargin(0); @@ -518,7 +520,7 @@ void QStatusBar::reformat() int itemH = qMin(qSmartMinSize(item->w).height(), item->w->maximumHeight()); maxH = qMax(maxH, itemH); } -#ifndef QT_NO_SIZEGRIP +#if QT_CONFIG(sizegrip) if (d->resizer) { maxH = qMax(maxH, d->resizer->sizeHint().height()); d->box->addSpacing(1); @@ -649,7 +651,7 @@ void QStatusBar::hideOrShow() */ void QStatusBar::showEvent(QShowEvent *) { -#ifndef QT_NO_SIZEGRIP +#if QT_CONFIG(sizegrip) Q_D(QStatusBar); if (d->resizer && d->showSizeGrip) d->tryToShowSizeGrip(); @@ -722,7 +724,7 @@ bool QStatusBar::event(QEvent *e) maxH = qMax(maxH, itemH); } -#ifndef QT_NO_SIZEGRIP +#if QT_CONFIG(sizegrip) if (d->resizer) maxH = qMax(maxH, d->resizer->sizeHint().height()); #endif diff --git a/src/widgets/widgets/qwidgetresizehandler.cpp b/src/widgets/widgets/qwidgetresizehandler.cpp index 37ba5ba992..5bd87ac91c 100644 --- a/src/widgets/widgets/qwidgetresizehandler.cpp +++ b/src/widgets/widgets/qwidgetresizehandler.cpp @@ -43,7 +43,9 @@ #include "qapplication.h" #include "qdesktopwidget.h" #include "qcursor.h" +#if QT_CONFIG(sizegrip) #include "qsizegrip.h" +#endif #include "qevent.h" #include "qdebug.h" #include "private/qlayoutengine_p.h" diff --git a/src/widgets/widgets/widgets.pri b/src/widgets/widgets/widgets.pri index c131060df8..5c91882c68 100644 --- a/src/widgets/widgets/widgets.pri +++ b/src/widgets/widgets/widgets.pri @@ -9,7 +9,6 @@ HEADERS += \ widgets/qlineedit_p.h \ widgets/qmenu.h \ widgets/qmenu_p.h \ - widgets/qsizegrip.h \ widgets/qslider.h \ widgets/qspinbox.h \ widgets/qtextedit.h \ @@ -33,7 +32,6 @@ SOURCES += \ widgets/qlineedit_p.cpp \ widgets/qlineedit.cpp \ widgets/qmenu.cpp \ - widgets/qsizegrip.cpp \ widgets/qslider.cpp \ widgets/qspinbox.cpp \ widgets/qtextedit.cpp \ @@ -253,6 +251,11 @@ qtConfig(scrollbar) { SOURCES += widgets/qscrollbar.cpp } +qtConfig(sizegrip) { + HEADERS += widgets/qsizegrip.h + SOURCES += widgets/qsizegrip.cpp +} + qtConfig(splashscreen) { HEADERS += \ widgets/qsplashscreen.h |