From bd263452cdb1b311c72fb3d6d05cbfa37b16f16e Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 14 Jun 2017 14:39:16 +0200 Subject: Revert "QWidgetEffectSourcePrivate::draw(): Call render() when no shared painter exists" The change causes drawing artifacts in Qt Creator. This reverts commit 8b1377fde16a2049a1c27f6d005bff84a8f85f28. Task-number: QTCREATORBUG-18322 Task-number: QTBUG-60231 Change-Id: Ic05507b0c23ea612fa5a9b92163380059b6e710d Reviewed-by: Andy Shaw --- src/widgets/kernel/qwidget.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/widgets') diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp index 6112d33974..f467bcfff5 100644 --- a/src/widgets/kernel/qwidget.cpp +++ b/src/widgets/kernel/qwidget.cpp @@ -5860,7 +5860,7 @@ QRectF QWidgetEffectSourcePrivate::boundingRect(Qt::CoordinateSystem system) con void QWidgetEffectSourcePrivate::draw(QPainter *painter) { - if (!context || context->painter != painter || !context->sharedPainter) { + if (!context || context->painter != painter) { m_widget->render(painter); return; } -- cgit v1.2.3 From d138a239d27b3f2d3b654b4768f8000bb2a555a1 Mon Sep 17 00:00:00 2001 From: Gabriel de Dietrich Date: Fri, 23 Jun 2017 10:47:23 -0700 Subject: Fix current tab text color on Mac when a proxy style is installed MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We move the code forcing white text on the current tab to QMacStyle. This removes the small encapsulation violation even though we need to check for the tab text color in the style and modify the palette. Amends 2fbc1432025dd478cf9e940e3c2a1952b218c6dc. Change-Id: If31dc11ae389ee5315e84ab03cf1c08540d81640 Reviewed-by: Błażej Szczygieł Reviewed-by: Jake Petroules --- src/widgets/styles/qmacstyle_mac.mm | 6 ++++++ src/widgets/widgets/qtabbar.cpp | 4 ---- 2 files changed, 6 insertions(+), 4 deletions(-) (limited to 'src/widgets') diff --git a/src/widgets/styles/qmacstyle_mac.mm b/src/widgets/styles/qmacstyle_mac.mm index 8d0fe1196c..cf2929db7e 100644 --- a/src/widgets/styles/qmacstyle_mac.mm +++ b/src/widgets/styles/qmacstyle_mac.mm @@ -4210,6 +4210,12 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter // outside world, unless they read the source, in which case, it's // their own fault). bool nonDefaultFont = p->font() != qt_app_fonts_hash()->value("QComboMenuItem"); + + if (!myTab.documentMode && (myTab.state & State_Selected) && (myTab.state & State_Active)) + if (const auto *tabBar = qobject_cast(w)) + if (!tabBar->tabTextColor(tabBar->currentIndex()).isValid()) + myTab.palette.setColor(QPalette::WindowText, Qt::white); + if (verticalTabs || nonDefaultFont || !tab->icon.isNull() || !myTab.leftButtonSize.isEmpty() || !myTab.rightButtonSize.isEmpty()) { int heightOffset = 0; diff --git a/src/widgets/widgets/qtabbar.cpp b/src/widgets/widgets/qtabbar.cpp index 060d1f9a03..4cd9522bfb 100644 --- a/src/widgets/widgets/qtabbar.cpp +++ b/src/widgets/widgets/qtabbar.cpp @@ -176,10 +176,6 @@ void QTabBarPrivate::initBasicStyleOption(QStyleOptionTab *option, int tabIndex) if (tab.textColor.isValid()) option->palette.setColor(q->foregroundRole(), tab.textColor); - else if (q->style()->inherits("QMacStyle") - && isCurrent && !documentMode && q->isActiveWindow()) { - option->palette.setColor(QPalette::WindowText, Qt::white); - } option->icon = tab.icon; option->iconSize = q->iconSize(); // Will get the default value then. -- cgit v1.2.3 From 5ede5706a8b8052280981aa1d9c42999a24b74b5 Mon Sep 17 00:00:00 2001 From: Stephan Binner Date: Tue, 30 May 2017 22:22:22 +0200 Subject: Convert features.wheelevent to QT_CONFIG Change-Id: I46083a9115c199d1ebe024ed5f64b160a27462f1 Reviewed-by: Oswald Buddenhagen --- src/widgets/graphicsview/qgraphicsproxywidget.cpp | 2 +- src/widgets/graphicsview/qgraphicsproxywidget.h | 2 +- src/widgets/graphicsview/qgraphicsview.cpp | 4 ++-- src/widgets/graphicsview/qgraphicsview.h | 2 +- src/widgets/itemviews/qlistview.cpp | 4 ++-- src/widgets/itemviews/qlistview.h | 2 +- src/widgets/kernel/qapplication.cpp | 8 ++++---- src/widgets/kernel/qapplication.h | 4 ++-- src/widgets/kernel/qapplication_p.h | 2 +- src/widgets/kernel/qwidget.cpp | 8 ++++---- src/widgets/kernel/qwidget.h | 2 +- src/widgets/kernel/qwidgetwindow.cpp | 6 +++--- src/widgets/kernel/qwidgetwindow_p.h | 2 +- src/widgets/statemachine/qguistatemachine.cpp | 4 ++-- src/widgets/util/qsystemtrayicon_x11.cpp | 2 +- src/widgets/widgets/qabstractbutton.cpp | 2 +- src/widgets/widgets/qabstractscrollarea.cpp | 4 ++-- src/widgets/widgets/qabstractscrollarea.h | 2 +- src/widgets/widgets/qabstractslider.cpp | 4 ++-- src/widgets/widgets/qabstractslider.h | 2 +- src/widgets/widgets/qabstractspinbox.cpp | 2 +- src/widgets/widgets/qabstractspinbox.h | 2 +- src/widgets/widgets/qcalendarwidget.cpp | 4 ++-- src/widgets/widgets/qcombobox.cpp | 2 +- src/widgets/widgets/qcombobox.h | 2 +- src/widgets/widgets/qdatetimeedit.cpp | 2 +- src/widgets/widgets/qdatetimeedit.h | 2 +- src/widgets/widgets/qmenu.cpp | 2 +- src/widgets/widgets/qmenu.h | 2 +- src/widgets/widgets/qplaintextedit.cpp | 2 +- src/widgets/widgets/qplaintextedit.h | 2 +- src/widgets/widgets/qscrollbar.cpp | 2 +- src/widgets/widgets/qscrollbar.h | 2 +- src/widgets/widgets/qtabbar.cpp | 4 ++-- src/widgets/widgets/qtabbar.h | 2 +- src/widgets/widgets/qtextedit.cpp | 2 +- src/widgets/widgets/qtextedit.h | 2 +- 37 files changed, 53 insertions(+), 53 deletions(-) (limited to 'src/widgets') diff --git a/src/widgets/graphicsview/qgraphicsproxywidget.cpp b/src/widgets/graphicsview/qgraphicsproxywidget.cpp index 0b9e6e7216..eface182ae 100644 --- a/src/widgets/graphicsview/qgraphicsproxywidget.cpp +++ b/src/widgets/graphicsview/qgraphicsproxywidget.cpp @@ -1273,7 +1273,7 @@ void QGraphicsProxyWidget::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event /*! \reimp */ -#ifndef QT_NO_WHEELEVENT +#if QT_CONFIG(wheelevent) void QGraphicsProxyWidget::wheelEvent(QGraphicsSceneWheelEvent *event) { Q_D(QGraphicsProxyWidget); diff --git a/src/widgets/graphicsview/qgraphicsproxywidget.h b/src/widgets/graphicsview/qgraphicsproxywidget.h index 8112c65d63..c1564cba34 100644 --- a/src/widgets/graphicsview/qgraphicsproxywidget.h +++ b/src/widgets/graphicsview/qgraphicsproxywidget.h @@ -103,7 +103,7 @@ protected: void mousePressEvent(QGraphicsSceneMouseEvent *event) Q_DECL_OVERRIDE; void mouseReleaseEvent(QGraphicsSceneMouseEvent *event) Q_DECL_OVERRIDE; void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event) Q_DECL_OVERRIDE; -#ifndef QT_NO_WHEELEVENT +#if QT_CONFIG(wheelevent) void wheelEvent(QGraphicsSceneWheelEvent *event) Q_DECL_OVERRIDE; #endif diff --git a/src/widgets/graphicsview/qgraphicsview.cpp b/src/widgets/graphicsview/qgraphicsview.cpp index 9d7412340f..f5f24649c2 100644 --- a/src/widgets/graphicsview/qgraphicsview.cpp +++ b/src/widgets/graphicsview/qgraphicsview.cpp @@ -3409,7 +3409,7 @@ void QGraphicsView::mouseReleaseEvent(QMouseEvent *event) #endif } -#ifndef QT_NO_WHEELEVENT +#if QT_CONFIG(wheelevent) /*! \reimp */ @@ -3437,7 +3437,7 @@ void QGraphicsView::wheelEvent(QWheelEvent *event) if (!event->isAccepted()) QAbstractScrollArea::wheelEvent(event); } -#endif // QT_NO_WHEELEVENT +#endif // QT_CONFIG(wheelevent) /*! \reimp diff --git a/src/widgets/graphicsview/qgraphicsview.h b/src/widgets/graphicsview/qgraphicsview.h index 64d5f5b430..fb975b9d71 100644 --- a/src/widgets/graphicsview/qgraphicsview.h +++ b/src/widgets/graphicsview/qgraphicsview.h @@ -259,7 +259,7 @@ protected: void mousePressEvent(QMouseEvent *event) Q_DECL_OVERRIDE; void mouseMoveEvent(QMouseEvent *event) Q_DECL_OVERRIDE; void mouseReleaseEvent(QMouseEvent *event) Q_DECL_OVERRIDE; -#ifndef QT_NO_WHEELEVENT +#if QT_CONFIG(wheelevent) void wheelEvent(QWheelEvent *event) Q_DECL_OVERRIDE; #endif void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE; diff --git a/src/widgets/itemviews/qlistview.cpp b/src/widgets/itemviews/qlistview.cpp index e7a3c11b44..93b2b0b5e0 100644 --- a/src/widgets/itemviews/qlistview.cpp +++ b/src/widgets/itemviews/qlistview.cpp @@ -801,7 +801,7 @@ void QListView::mouseReleaseEvent(QMouseEvent *e) } } -#ifndef QT_NO_WHEELEVENT +#if QT_CONFIG(wheelevent) /*! \reimp */ @@ -828,7 +828,7 @@ void QListView::wheelEvent(QWheelEvent *e) QApplication::sendEvent(d->hbar, e); } } -#endif // QT_NO_WHEELEVENT +#endif // QT_CONFIG(wheelevent) /*! \reimp diff --git a/src/widgets/itemviews/qlistview.h b/src/widgets/itemviews/qlistview.h index e918e66d38..6b164aeec8 100644 --- a/src/widgets/itemviews/qlistview.h +++ b/src/widgets/itemviews/qlistview.h @@ -153,7 +153,7 @@ protected: void mouseMoveEvent(QMouseEvent *e) Q_DECL_OVERRIDE; void mouseReleaseEvent(QMouseEvent *e) Q_DECL_OVERRIDE; -#ifndef QT_NO_WHEELEVENT +#if QT_CONFIG(wheelevent) void wheelEvent(QWheelEvent *e) Q_DECL_OVERRIDE; #endif diff --git a/src/widgets/kernel/qapplication.cpp b/src/widgets/kernel/qapplication.cpp index 4ab43628b9..6ef9c1da51 100644 --- a/src/widgets/kernel/qapplication.cpp +++ b/src/widgets/kernel/qapplication.cpp @@ -407,7 +407,7 @@ QWidget *QApplicationPrivate::main_widget = 0; // main application widget QWidget *QApplicationPrivate::focus_widget = 0; // has keyboard input focus QWidget *QApplicationPrivate::hidden_focus_widget = 0; // will get keyboard input focus after show() QWidget *QApplicationPrivate::active_window = 0; // toplevel with keyboard focus -#ifndef QT_NO_WHEELEVENT +#if QT_CONFIG(wheelevent) QPointer QApplicationPrivate::wheel_widget; #endif bool qt_in_tab_key_event = false; @@ -2984,7 +2984,7 @@ bool QApplication::notify(QObject *receiver, QEvent *e) case QEvent::KeyPress: case QEvent::KeyRelease: case QEvent::MouseMove: -#ifndef QT_NO_WHEELEVENT +#if QT_CONFIG(wheelevent) case QEvent::Wheel: #endif case QEvent::TouchBegin: @@ -3227,7 +3227,7 @@ bool QApplication::notify(QObject *receiver, QEvent *e) d->hoverGlobalPos = mouse->globalPos(); } break; -#ifndef QT_NO_WHEELEVENT +#if QT_CONFIG(wheelevent) case QEvent::Wheel: { QWidget* w = static_cast(receiver); @@ -4041,7 +4041,7 @@ int QApplication::keyboardInputInterval() \sa QStyleHints::wheelScrollLines() */ -#ifndef QT_NO_WHEELEVENT +#if QT_CONFIG(wheelevent) int QApplication::wheelScrollLines() { return styleHints()->wheelScrollLines(); diff --git a/src/widgets/kernel/qapplication.h b/src/widgets/kernel/qapplication.h index be5ec2ad05..396d0c9474 100644 --- a/src/widgets/kernel/qapplication.h +++ b/src/widgets/kernel/qapplication.h @@ -76,7 +76,7 @@ class Q_WIDGETS_EXPORT QApplication : public QGuiApplication Q_PROPERTY(int cursorFlashTime READ cursorFlashTime WRITE setCursorFlashTime) Q_PROPERTY(int doubleClickInterval READ doubleClickInterval WRITE setDoubleClickInterval) Q_PROPERTY(int keyboardInputInterval READ keyboardInputInterval WRITE setKeyboardInputInterval) -#ifndef QT_NO_WHEELEVENT +#if QT_CONFIG(wheelevent) Q_PROPERTY(int wheelScrollLines READ wheelScrollLines WRITE setWheelScrollLines) #endif Q_PROPERTY(QSize globalStrut READ globalStrut WRITE setGlobalStrut) @@ -154,7 +154,7 @@ public: static void setKeyboardInputInterval(int); static int keyboardInputInterval(); -#ifndef QT_NO_WHEELEVENT +#if QT_CONFIG(wheelevent) static void setWheelScrollLines(int); static int wheelScrollLines(); #endif diff --git a/src/widgets/kernel/qapplication_p.h b/src/widgets/kernel/qapplication_p.h index 271844a23e..1a189cb2b9 100644 --- a/src/widgets/kernel/qapplication_p.h +++ b/src/widgets/kernel/qapplication_p.h @@ -195,7 +195,7 @@ public: static QWidget *focus_widget; static QWidget *hidden_focus_widget; static QWidget *active_window; -#ifndef QT_NO_WHEELEVENT +#if QT_CONFIG(wheelevent) static int wheel_scroll_lines; static QPointer wheel_widget; #endif diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp index f467bcfff5..b710d13e67 100644 --- a/src/widgets/kernel/qwidget.cpp +++ b/src/widgets/kernel/qwidget.cpp @@ -8777,7 +8777,7 @@ bool QWidget::event(QEvent *event) case QEvent::ContextMenu: case QEvent::KeyPress: case QEvent::KeyRelease: -#ifndef QT_NO_WHEELEVENT +#if QT_CONFIG(wheelevent) case QEvent::Wheel: #endif return false; @@ -8801,7 +8801,7 @@ bool QWidget::event(QEvent *event) case QEvent::MouseButtonDblClick: mouseDoubleClickEvent((QMouseEvent*)event); break; -#ifndef QT_NO_WHEELEVENT +#if QT_CONFIG(wheelevent) case QEvent::Wheel: wheelEvent((QWheelEvent*)event); break; @@ -9418,7 +9418,7 @@ void QWidget::mouseDoubleClickEvent(QMouseEvent *event) mousePressEvent(event); } -#ifndef QT_NO_WHEELEVENT +#if QT_CONFIG(wheelevent) /*! This event handler, for event \a event, can be reimplemented in a subclass to receive wheel events for the widget. @@ -9437,7 +9437,7 @@ void QWidget::wheelEvent(QWheelEvent *event) { event->ignore(); } -#endif // QT_NO_WHEELEVENT +#endif // QT_CONFIG(wheelevent) #ifndef QT_NO_TABLETEVENT /*! diff --git a/src/widgets/kernel/qwidget.h b/src/widgets/kernel/qwidget.h index 1c378924a0..ef456ef1da 100644 --- a/src/widgets/kernel/qwidget.h +++ b/src/widgets/kernel/qwidget.h @@ -613,7 +613,7 @@ protected: virtual void mouseReleaseEvent(QMouseEvent *event); virtual void mouseDoubleClickEvent(QMouseEvent *event); virtual void mouseMoveEvent(QMouseEvent *event); -#ifndef QT_NO_WHEELEVENT +#if QT_CONFIG(wheelevent) virtual void wheelEvent(QWheelEvent *event); #endif virtual void keyPressEvent(QKeyEvent *event); diff --git a/src/widgets/kernel/qwidgetwindow.cpp b/src/widgets/kernel/qwidgetwindow.cpp index 6741555c0c..f9f67cb449 100644 --- a/src/widgets/kernel/qwidgetwindow.cpp +++ b/src/widgets/kernel/qwidgetwindow.cpp @@ -265,7 +265,7 @@ bool QWidgetWindow::event(QEvent *event) handleResizeEvent(static_cast(event)); return true; -#ifndef QT_NO_WHEELEVENT +#if QT_CONFIG(wheelevent) case QEvent::Wheel: handleWheelEvent(static_cast(event)); return true; @@ -778,7 +778,7 @@ void QWidgetWindow::handleCloseEvent(QCloseEvent *event) event->setAccepted(is_closing); } -#ifndef QT_NO_WHEELEVENT +#if QT_CONFIG(wheelevent) void QWidgetWindow::handleWheelEvent(QWheelEvent *event) { @@ -808,7 +808,7 @@ void QWidgetWindow::handleWheelEvent(QWheelEvent *event) QGuiApplication::sendSpontaneousEvent(widget, &translated); } -#endif // QT_NO_WHEELEVENT +#endif // QT_CONFIG(wheelevent) #ifndef QT_NO_DRAGANDDROP diff --git a/src/widgets/kernel/qwidgetwindow_p.h b/src/widgets/kernel/qwidgetwindow_p.h index a81355160e..944f845e3c 100644 --- a/src/widgets/kernel/qwidgetwindow_p.h +++ b/src/widgets/kernel/qwidgetwindow_p.h @@ -89,7 +89,7 @@ protected: void handleTouchEvent(QTouchEvent *); void handleMoveEvent(QMoveEvent *); void handleResizeEvent(QResizeEvent *); -#ifndef QT_NO_WHEELEVENT +#if QT_CONFIG(wheelevent) void handleWheelEvent(QWheelEvent *); #endif #ifndef QT_NO_DRAGANDDROP diff --git a/src/widgets/statemachine/qguistatemachine.cpp b/src/widgets/statemachine/qguistatemachine.cpp index 8d722a4475..a0ae614a03 100644 --- a/src/widgets/statemachine/qguistatemachine.cpp +++ b/src/widgets/statemachine/qguistatemachine.cpp @@ -100,10 +100,10 @@ static QEvent *cloneEvent(QEvent *e) return new QEvent(*e); case QEvent::HideToParent: return new QEvent(*e); -#ifndef QT_NO_WHEELEVENT +#if QT_CONFIG(wheelevent) case QEvent::Wheel: return new QWheelEvent(*static_cast(e)); -#endif //QT_NO_WHEELEVENT +#endif // QT_CONFIG(wheelevent) case QEvent::WindowTitleChange: return new QEvent(*e); case QEvent::WindowIconChange: diff --git a/src/widgets/util/qsystemtrayicon_x11.cpp b/src/widgets/util/qsystemtrayicon_x11.cpp index cbd5d9eb80..fd9fdfb507 100644 --- a/src/widgets/util/qsystemtrayicon_x11.cpp +++ b/src/widgets/util/qsystemtrayicon_x11.cpp @@ -210,7 +210,7 @@ bool QSystemTrayIconSys::event(QEvent *e) case QEvent::ToolTip: QApplication::sendEvent(q, e); break; -#ifndef QT_NO_WHEELEVENT +#if QT_CONFIG(wheelevent) case QEvent::Wheel: return QApplication::sendEvent(q, e); #endif diff --git a/src/widgets/widgets/qabstractbutton.cpp b/src/widgets/widgets/qabstractbutton.cpp index 77fb203b82..e65613d5cd 100644 --- a/src/widgets/widgets/qabstractbutton.cpp +++ b/src/widgets/widgets/qabstractbutton.cpp @@ -935,7 +935,7 @@ bool QAbstractButton::event(QEvent *e) case QEvent::HoverEnter: case QEvent::HoverLeave: case QEvent::ContextMenu: -#ifndef QT_NO_WHEELEVENT +#if QT_CONFIG(wheelevent) case QEvent::Wheel: #endif return true; diff --git a/src/widgets/widgets/qabstractscrollarea.cpp b/src/widgets/widgets/qabstractscrollarea.cpp index abdd946c49..673983d575 100644 --- a/src/widgets/widgets/qabstractscrollarea.cpp +++ b/src/widgets/widgets/qabstractscrollarea.cpp @@ -1188,7 +1188,7 @@ bool QAbstractScrollArea::viewportEvent(QEvent *e) case QEvent::TouchEnd: case QEvent::MouseMove: case QEvent::ContextMenu: -#ifndef QT_NO_WHEELEVENT +#if QT_CONFIG(wheelevent) case QEvent::Wheel: #endif #ifndef QT_NO_DRAGANDDROP @@ -1305,7 +1305,7 @@ void QAbstractScrollArea::mouseMoveEvent(QMouseEvent *e) \sa QWidget::wheelEvent() */ -#ifndef QT_NO_WHEELEVENT +#if QT_CONFIG(wheelevent) void QAbstractScrollArea::wheelEvent(QWheelEvent *e) { Q_D(QAbstractScrollArea); diff --git a/src/widgets/widgets/qabstractscrollarea.h b/src/widgets/widgets/qabstractscrollarea.h index 476914b781..193fabce56 100644 --- a/src/widgets/widgets/qabstractscrollarea.h +++ b/src/widgets/widgets/qabstractscrollarea.h @@ -116,7 +116,7 @@ protected: void mouseReleaseEvent(QMouseEvent *) Q_DECL_OVERRIDE; void mouseDoubleClickEvent(QMouseEvent *) Q_DECL_OVERRIDE; void mouseMoveEvent(QMouseEvent *) Q_DECL_OVERRIDE; -#ifndef QT_NO_WHEELEVENT +#if QT_CONFIG(wheelevent) void wheelEvent(QWheelEvent *) Q_DECL_OVERRIDE; #endif #ifndef QT_NO_CONTEXTMENU diff --git a/src/widgets/widgets/qabstractslider.cpp b/src/widgets/widgets/qabstractslider.cpp index 0ea9250695..99ee1eccb7 100644 --- a/src/widgets/widgets/qabstractslider.cpp +++ b/src/widgets/widgets/qabstractslider.cpp @@ -710,7 +710,7 @@ bool QAbstractSliderPrivate::scrollByDelta(Qt::Orientation orientation, Qt::Keyb // offset), we might end up with a fraction (e.g. scroll 1.3 lines). We can // only scroll whole lines, so we keep the reminder until next event. qreal stepsToScrollF = -#ifndef QT_NO_WHEELEVENT +#if QT_CONFIG(wheelevent) QApplication::wheelScrollLines() * #endif offset * effectiveSingleStep(); @@ -759,7 +759,7 @@ bool QAbstractSliderPrivate::scrollByDelta(Qt::Orientation orientation, Qt::Keyb /*! \reimp */ -#ifndef QT_NO_WHEELEVENT +#if QT_CONFIG(wheelevent) void QAbstractSlider::wheelEvent(QWheelEvent * e) { Q_D(QAbstractSlider); diff --git a/src/widgets/widgets/qabstractslider.h b/src/widgets/widgets/qabstractslider.h index 8979685724..d26d6a879c 100644 --- a/src/widgets/widgets/qabstractslider.h +++ b/src/widgets/widgets/qabstractslider.h @@ -146,7 +146,7 @@ protected: void keyPressEvent(QKeyEvent *ev) Q_DECL_OVERRIDE; void timerEvent(QTimerEvent *) Q_DECL_OVERRIDE; -#ifndef QT_NO_WHEELEVENT +#if QT_CONFIG(wheelevent) void wheelEvent(QWheelEvent *e) Q_DECL_OVERRIDE; #endif void changeEvent(QEvent *e) Q_DECL_OVERRIDE; diff --git a/src/widgets/widgets/qabstractspinbox.cpp b/src/widgets/widgets/qabstractspinbox.cpp index 501d9560d9..4a3abe0c32 100644 --- a/src/widgets/widgets/qabstractspinbox.cpp +++ b/src/widgets/widgets/qabstractspinbox.cpp @@ -1119,7 +1119,7 @@ void QAbstractSpinBox::keyReleaseEvent(QKeyEvent *event) \reimp */ -#ifndef QT_NO_WHEELEVENT +#if QT_CONFIG(wheelevent) void QAbstractSpinBox::wheelEvent(QWheelEvent *event) { Q_D(QAbstractSpinBox); diff --git a/src/widgets/widgets/qabstractspinbox.h b/src/widgets/widgets/qabstractspinbox.h index b60178b94c..d81cbfdc34 100644 --- a/src/widgets/widgets/qabstractspinbox.h +++ b/src/widgets/widgets/qabstractspinbox.h @@ -137,7 +137,7 @@ protected: void resizeEvent(QResizeEvent *event) override; void keyPressEvent(QKeyEvent *event) override; void keyReleaseEvent(QKeyEvent *event) override; -#ifndef QT_NO_WHEELEVENT +#if QT_CONFIG(wheelevent) void wheelEvent(QWheelEvent *event) override; #endif void focusInEvent(QFocusEvent *event) override; diff --git a/src/widgets/widgets/qcalendarwidget.cpp b/src/widgets/widgets/qcalendarwidget.cpp index f81377a85c..c5db3a7c9a 100644 --- a/src/widgets/widgets/qcalendarwidget.cpp +++ b/src/widgets/widgets/qcalendarwidget.cpp @@ -957,7 +957,7 @@ protected: void mousePressEvent(QMouseEvent *event) Q_DECL_OVERRIDE; void mouseMoveEvent(QMouseEvent *event) Q_DECL_OVERRIDE; void mouseReleaseEvent(QMouseEvent *event) Q_DECL_OVERRIDE; -#ifndef QT_NO_WHEELEVENT +#if QT_CONFIG(wheelevent) void wheelEvent(QWheelEvent *event) Q_DECL_OVERRIDE; #endif void keyPressEvent(QKeyEvent *event) Q_DECL_OVERRIDE; @@ -1412,7 +1412,7 @@ void QCalendarView::keyPressEvent(QKeyEvent *event) QTableView::keyPressEvent(event); } -#ifndef QT_NO_WHEELEVENT +#if QT_CONFIG(wheelevent) void QCalendarView::wheelEvent(QWheelEvent *event) { const int numDegrees = event->delta() / 8; diff --git a/src/widgets/widgets/qcombobox.cpp b/src/widgets/widgets/qcombobox.cpp index 45dfffe8bd..5520e9d28f 100644 --- a/src/widgets/widgets/qcombobox.cpp +++ b/src/widgets/widgets/qcombobox.cpp @@ -3285,7 +3285,7 @@ void QComboBox::keyReleaseEvent(QKeyEvent *e) /*! \reimp */ -#ifndef QT_NO_WHEELEVENT +#if QT_CONFIG(wheelevent) void QComboBox::wheelEvent(QWheelEvent *e) { #ifdef Q_OS_DARWIN diff --git a/src/widgets/widgets/qcombobox.h b/src/widgets/widgets/qcombobox.h index 2da1ceb047..8f99594a76 100644 --- a/src/widgets/widgets/qcombobox.h +++ b/src/widgets/widgets/qcombobox.h @@ -234,7 +234,7 @@ protected: void mouseReleaseEvent(QMouseEvent *e) Q_DECL_OVERRIDE; void keyPressEvent(QKeyEvent *e) Q_DECL_OVERRIDE; void keyReleaseEvent(QKeyEvent *e) Q_DECL_OVERRIDE; -#ifndef QT_NO_WHEELEVENT +#if QT_CONFIG(wheelevent) void wheelEvent(QWheelEvent *e) Q_DECL_OVERRIDE; #endif #ifndef QT_NO_CONTEXTMENU diff --git a/src/widgets/widgets/qdatetimeedit.cpp b/src/widgets/widgets/qdatetimeedit.cpp index 2e0a8a3cd7..e136363b17 100644 --- a/src/widgets/widgets/qdatetimeedit.cpp +++ b/src/widgets/widgets/qdatetimeedit.cpp @@ -1194,7 +1194,7 @@ void QDateTimeEdit::keyPressEvent(QKeyEvent *event) \reimp */ -#ifndef QT_NO_WHEELEVENT +#if QT_CONFIG(wheelevent) void QDateTimeEdit::wheelEvent(QWheelEvent *event) { QAbstractSpinBox::wheelEvent(event); diff --git a/src/widgets/widgets/qdatetimeedit.h b/src/widgets/widgets/qdatetimeedit.h index b54b0e7cf0..30e4a58bb3 100644 --- a/src/widgets/widgets/qdatetimeedit.h +++ b/src/widgets/widgets/qdatetimeedit.h @@ -177,7 +177,7 @@ public Q_SLOTS: protected: void keyPressEvent(QKeyEvent *event) override; -#ifndef QT_NO_WHEELEVENT +#if QT_CONFIG(wheelevent) void wheelEvent(QWheelEvent *event) override; #endif void focusInEvent(QFocusEvent *event) override; diff --git a/src/widgets/widgets/qmenu.cpp b/src/widgets/widgets/qmenu.cpp index 5732131578..95bb976566 100644 --- a/src/widgets/widgets/qmenu.cpp +++ b/src/widgets/widgets/qmenu.cpp @@ -2797,7 +2797,7 @@ void QMenu::paintEvent(QPaintEvent *e) style()->drawControl(QStyle::CE_MenuEmptyArea, &menuOpt, &p, this); } -#ifndef QT_NO_WHEELEVENT +#if QT_CONFIG(wheelevent) /*! \reimp */ diff --git a/src/widgets/widgets/qmenu.h b/src/widgets/widgets/qmenu.h index e9a5db1112..9d1a17a5b3 100644 --- a/src/widgets/widgets/qmenu.h +++ b/src/widgets/widgets/qmenu.h @@ -237,7 +237,7 @@ protected: void mouseReleaseEvent(QMouseEvent *) Q_DECL_OVERRIDE; void mousePressEvent(QMouseEvent *) Q_DECL_OVERRIDE; void mouseMoveEvent(QMouseEvent *) Q_DECL_OVERRIDE; -#ifndef QT_NO_WHEELEVENT +#if QT_CONFIG(wheelevent) void wheelEvent(QWheelEvent *) Q_DECL_OVERRIDE; #endif void enterEvent(QEvent *) Q_DECL_OVERRIDE; diff --git a/src/widgets/widgets/qplaintextedit.cpp b/src/widgets/widgets/qplaintextedit.cpp index 746dc20122..173be7aa88 100644 --- a/src/widgets/widgets/qplaintextedit.cpp +++ b/src/widgets/widgets/qplaintextedit.cpp @@ -2296,7 +2296,7 @@ void QPlainTextEdit::changeEvent(QEvent *e) /*! \reimp */ -#ifndef QT_NO_WHEELEVENT +#if QT_CONFIG(wheelevent) void QPlainTextEdit::wheelEvent(QWheelEvent *e) { Q_D(QPlainTextEdit); diff --git a/src/widgets/widgets/qplaintextedit.h b/src/widgets/widgets/qplaintextedit.h index 432ec85a57..d773c4791c 100644 --- a/src/widgets/widgets/qplaintextedit.h +++ b/src/widgets/widgets/qplaintextedit.h @@ -250,7 +250,7 @@ protected: virtual void focusOutEvent(QFocusEvent *e) Q_DECL_OVERRIDE; virtual void showEvent(QShowEvent *) Q_DECL_OVERRIDE; virtual void changeEvent(QEvent *e) Q_DECL_OVERRIDE; -#ifndef QT_NO_WHEELEVENT +#if QT_CONFIG(wheelevent) virtual void wheelEvent(QWheelEvent *e) Q_DECL_OVERRIDE; #endif diff --git a/src/widgets/widgets/qscrollbar.cpp b/src/widgets/widgets/qscrollbar.cpp index 66f1a4c689..a98f3fe085 100644 --- a/src/widgets/widgets/qscrollbar.cpp +++ b/src/widgets/widgets/qscrollbar.cpp @@ -493,7 +493,7 @@ bool QScrollBar::event(QEvent *event) /*! \reimp */ -#ifndef QT_NO_WHEELEVENT +#if QT_CONFIG(wheelevent) void QScrollBar::wheelEvent(QWheelEvent *event) { event->ignore(); diff --git a/src/widgets/widgets/qscrollbar.h b/src/widgets/widgets/qscrollbar.h index b99ad219eb..963ae4263b 100644 --- a/src/widgets/widgets/qscrollbar.h +++ b/src/widgets/widgets/qscrollbar.h @@ -64,7 +64,7 @@ public: bool event(QEvent *event) Q_DECL_OVERRIDE; protected: -#ifndef QT_NO_WHEELEVENT +#if QT_CONFIG(wheelevent) void wheelEvent(QWheelEvent *) Q_DECL_OVERRIDE; #endif void paintEvent(QPaintEvent *) Q_DECL_OVERRIDE; diff --git a/src/widgets/widgets/qtabbar.cpp b/src/widgets/widgets/qtabbar.cpp index 4cd9522bfb..b9020253a5 100644 --- a/src/widgets/widgets/qtabbar.cpp +++ b/src/widgets/widgets/qtabbar.cpp @@ -2181,7 +2181,7 @@ void QTabBar::keyPressEvent(QKeyEvent *event) /*!\reimp */ -#ifndef QT_NO_WHEELEVENT +#if QT_CONFIG(wheelevent) void QTabBar::wheelEvent(QWheelEvent *event) { #ifndef Q_OS_MAC @@ -2193,7 +2193,7 @@ void QTabBar::wheelEvent(QWheelEvent *event) Q_UNUSED(event) #endif } -#endif //QT_NO_WHEELEVENT +#endif // QT_CONFIG(wheelevent) void QTabBarPrivate::setCurrentNextEnabledIndex(int offset) { diff --git a/src/widgets/widgets/qtabbar.h b/src/widgets/widgets/qtabbar.h index 71ca58c993..c7d9f95d93 100644 --- a/src/widgets/widgets/qtabbar.h +++ b/src/widgets/widgets/qtabbar.h @@ -203,7 +203,7 @@ protected: void mousePressEvent (QMouseEvent *) Q_DECL_OVERRIDE; void mouseMoveEvent (QMouseEvent *) Q_DECL_OVERRIDE; void mouseReleaseEvent (QMouseEvent *) Q_DECL_OVERRIDE; -#ifndef QT_NO_WHEELEVENT +#if QT_CONFIG(wheelevent) void wheelEvent(QWheelEvent *event) Q_DECL_OVERRIDE; #endif void keyPressEvent(QKeyEvent *) Q_DECL_OVERRIDE; diff --git a/src/widgets/widgets/qtextedit.cpp b/src/widgets/widgets/qtextedit.cpp index 1abc9bef8e..6973cec429 100644 --- a/src/widgets/widgets/qtextedit.cpp +++ b/src/widgets/widgets/qtextedit.cpp @@ -1831,7 +1831,7 @@ void QTextEdit::changeEvent(QEvent *e) /*! \reimp */ -#ifndef QT_NO_WHEELEVENT +#if QT_CONFIG(wheelevent) void QTextEdit::wheelEvent(QWheelEvent *e) { Q_D(QTextEdit); diff --git a/src/widgets/widgets/qtextedit.h b/src/widgets/widgets/qtextedit.h index b0e19193a9..745b644511 100644 --- a/src/widgets/widgets/qtextedit.h +++ b/src/widgets/widgets/qtextedit.h @@ -288,7 +288,7 @@ protected: virtual void focusOutEvent(QFocusEvent *e) Q_DECL_OVERRIDE; virtual void showEvent(QShowEvent *) Q_DECL_OVERRIDE; virtual void changeEvent(QEvent *e) Q_DECL_OVERRIDE; -#ifndef QT_NO_WHEELEVENT +#if QT_CONFIG(wheelevent) virtual void wheelEvent(QWheelEvent *e) Q_DECL_OVERRIDE; #endif -- cgit v1.2.3 From 7f62c5fedc4a677fd9d9b002c4dfb9fd52a8a1a3 Mon Sep 17 00:00:00 2001 From: Stephan Binner Date: Tue, 30 May 2017 23:04:21 +0200 Subject: Convert features.tabletevent to QT_CONFIG Change-Id: Ibd7ed7f269a64afddadee70979b20f1c58398378 Reviewed-by: Oswald Buddenhagen --- src/widgets/kernel/qapplication.cpp | 6 +++--- src/widgets/kernel/qwidget.cpp | 6 +++--- src/widgets/kernel/qwidget.h | 2 +- src/widgets/kernel/qwidgetwindow.cpp | 6 +++--- src/widgets/kernel/qwidgetwindow_p.h | 2 +- src/widgets/statemachine/qguistatemachine.cpp | 8 ++++---- 6 files changed, 15 insertions(+), 15 deletions(-) (limited to 'src/widgets') diff --git a/src/widgets/kernel/qapplication.cpp b/src/widgets/kernel/qapplication.cpp index 6ef9c1da51..fe7a9c2500 100644 --- a/src/widgets/kernel/qapplication.cpp +++ b/src/widgets/kernel/qapplication.cpp @@ -2990,7 +2990,7 @@ bool QApplication::notify(QObject *receiver, QEvent *e) case QEvent::TouchBegin: case QEvent::TouchUpdate: case QEvent::TouchEnd: -#ifndef QT_NO_TABLETEVENT +#if QT_CONFIG(tabletevent) case QEvent::TabletMove: case QEvent::TabletPress: case QEvent::TabletRelease: @@ -3349,7 +3349,7 @@ bool QApplication::notify(QObject *receiver, QEvent *e) } break; #endif // QT_NO_CONTEXTMENU -#ifndef QT_NO_TABLETEVENT +#if QT_CONFIG(tabletevent) case QEvent::TabletMove: case QEvent::TabletPress: case QEvent::TabletRelease: @@ -3379,7 +3379,7 @@ bool QApplication::notify(QObject *receiver, QEvent *e) tablet->setAccepted(eventAccepted); } break; -#endif // QT_NO_TABLETEVENT +#endif // QT_CONFIG(tabletevent) #if !defined(QT_NO_TOOLTIP) || !defined(QT_NO_WHATSTHIS) case QEvent::ToolTip: diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp index b710d13e67..deb638f410 100644 --- a/src/widgets/kernel/qwidget.cpp +++ b/src/widgets/kernel/qwidget.cpp @@ -8806,7 +8806,7 @@ bool QWidget::event(QEvent *event) wheelEvent((QWheelEvent*)event); break; #endif -#ifndef QT_NO_TABLETEVENT +#if QT_CONFIG(tabletevent) case QEvent::TabletMove: if (static_cast(event)->buttons() == Qt::NoButton && !testAttribute(Qt::WA_TabletTracking)) break; @@ -9439,7 +9439,7 @@ void QWidget::wheelEvent(QWheelEvent *event) } #endif // QT_CONFIG(wheelevent) -#ifndef QT_NO_TABLETEVENT +#if QT_CONFIG(tabletevent) /*! This event handler, for event \a event, can be reimplemented in a subclass to receive tablet events for the widget. @@ -9464,7 +9464,7 @@ void QWidget::tabletEvent(QTabletEvent *event) { event->ignore(); } -#endif // QT_NO_TABLETEVENT +#endif // QT_CONFIG(tabletevent) /*! This event handler, for event \a event, can be reimplemented in a diff --git a/src/widgets/kernel/qwidget.h b/src/widgets/kernel/qwidget.h index ef456ef1da..59e2ddd24d 100644 --- a/src/widgets/kernel/qwidget.h +++ b/src/widgets/kernel/qwidget.h @@ -629,7 +629,7 @@ protected: #ifndef QT_NO_CONTEXTMENU virtual void contextMenuEvent(QContextMenuEvent *event); #endif -#ifndef QT_NO_TABLETEVENT +#if QT_CONFIG(tabletevent) virtual void tabletEvent(QTabletEvent *event); #endif #ifndef QT_NO_ACTION diff --git a/src/widgets/kernel/qwidgetwindow.cpp b/src/widgets/kernel/qwidgetwindow.cpp index f9f67cb449..abaebad821 100644 --- a/src/widgets/kernel/qwidgetwindow.cpp +++ b/src/widgets/kernel/qwidgetwindow.cpp @@ -299,7 +299,7 @@ bool QWidgetWindow::event(QEvent *event) } return true; -#ifndef QT_NO_TABLETEVENT +#if QT_CONFIG(tabletevent) case QEvent::TabletPress: case QEvent::TabletMove: case QEvent::TabletRelease: @@ -974,7 +974,7 @@ bool QWidgetWindow::nativeEvent(const QByteArray &eventType, void *message, long return m_widget->nativeEvent(eventType, message, result); } -#ifndef QT_NO_TABLETEVENT +#if QT_CONFIG(tabletevent) void QWidgetWindow::handleTabletEvent(QTabletEvent *event) { static QPointer qt_tablet_target = 0; @@ -1004,7 +1004,7 @@ void QWidgetWindow::handleTabletEvent(QTabletEvent *event) if (event->type() == QEvent::TabletRelease && event->buttons() == Qt::NoButton) qt_tablet_target = 0; } -#endif // QT_NO_TABLETEVENT +#endif // QT_CONFIG(tabletevent) #ifndef QT_NO_GESTURES void QWidgetWindow::handleGestureEvent(QNativeGestureEvent *e) diff --git a/src/widgets/kernel/qwidgetwindow_p.h b/src/widgets/kernel/qwidgetwindow_p.h index 944f845e3c..50a2cfd57c 100644 --- a/src/widgets/kernel/qwidgetwindow_p.h +++ b/src/widgets/kernel/qwidgetwindow_p.h @@ -100,7 +100,7 @@ protected: void handleExposeEvent(QExposeEvent *); void handleWindowStateChangedEvent(QWindowStateChangeEvent *event); bool nativeEvent(const QByteArray &eventType, void *message, long *result) Q_DECL_OVERRIDE; -#ifndef QT_NO_TABLETEVENT +#if QT_CONFIG(tabletevent) void handleTabletEvent(QTabletEvent *); #endif #ifndef QT_NO_GESTURES diff --git a/src/widgets/statemachine/qguistatemachine.cpp b/src/widgets/statemachine/qguistatemachine.cpp index a0ae614a03..26d0a9615f 100644 --- a/src/widgets/statemachine/qguistatemachine.cpp +++ b/src/widgets/statemachine/qguistatemachine.cpp @@ -183,12 +183,12 @@ static QEvent *cloneEvent(QEvent *e) return new QEvent(*e); case QEvent::Style: return new QEvent(*e); -#ifndef QT_NO_TABLETEVENT +#if QT_CONFIG(tabletevent) case QEvent::TabletMove: case QEvent::TabletPress: case QEvent::TabletRelease: return new QTabletEvent(*static_cast(e)); -#endif //QT_NO_TABLETEVENT +#endif // QT_CONFIG(tabletevent) case QEvent::OkRequest: return new QEvent(*e); case QEvent::HelpRequest: @@ -372,11 +372,11 @@ static QEvent *cloneEvent(QEvent *e) case QEvent::DynamicPropertyChange: return new QDynamicPropertyChangeEvent(*static_cast(e)); -#ifndef QT_NO_TABLETEVENT +#if QT_CONFIG(tabletevent) case QEvent::TabletEnterProximity: case QEvent::TabletLeaveProximity: return new QTabletEvent(*static_cast(e)); -#endif //QT_NO_TABLETEVENT +#endif // QT_CONFIG(tabletevent) case QEvent::NonClientAreaMouseMove: case QEvent::NonClientAreaMouseButtonPress: -- cgit v1.2.3 From a6073d4b30f7f948460fc1b1c1b498296e4bd115 Mon Sep 17 00:00:00 2001 From: Stephan Binner Date: Mon, 12 Jun 2017 21:29:48 +0200 Subject: Convert features.tablewidget to QT_[REQUIRE_]CONFIG Also fix dependency of cupsjobwidget feature Change-Id: I2184bf3df814a6bb0f38755bb597ed1797dec587 Reviewed-by: Oswald Buddenhagen --- src/widgets/itemviews/itemviews.pri | 11 ++++++++--- src/widgets/itemviews/qtablewidget.cpp | 3 --- src/widgets/itemviews/qtablewidget.h | 8 ++------ src/widgets/itemviews/qtablewidget_p.h | 4 +--- 4 files changed, 11 insertions(+), 15 deletions(-) (limited to 'src/widgets') diff --git a/src/widgets/itemviews/itemviews.pri b/src/widgets/itemviews/itemviews.pri index ed0e3fe072..799458e4ad 100644 --- a/src/widgets/itemviews/itemviews.pri +++ b/src/widgets/itemviews/itemviews.pri @@ -19,8 +19,6 @@ HEADERS += \ itemviews/qdirmodel.h \ itemviews/qlistwidget.h \ itemviews/qlistwidget_p.h \ - itemviews/qtablewidget.h \ - itemviews/qtablewidget_p.h \ itemviews/qtreewidget.h \ itemviews/qtreewidget_p.h \ itemviews/qwidgetitemdata_p.h \ @@ -41,7 +39,6 @@ SOURCES += \ itemviews/qitemdelegate.cpp \ itemviews/qdirmodel.cpp \ itemviews/qlistwidget.cpp \ - itemviews/qtablewidget.cpp \ itemviews/qtreewidget.cpp \ itemviews/qitemeditorfactory.cpp \ itemviews/qtreewidgetitemiterator.cpp \ @@ -60,6 +57,14 @@ qtConfig(columnview) { itemviews/qcolumnviewgrip.cpp } +qtConfig(tablewidget) { + HEADERS += \ + itemviews/qtablewidget.h \ + itemviews/qtablewidget_p.h + + SOURCES += itemviews/qtablewidget.cpp +} + HEADERS += \ itemviews/qfileiconprovider.h \ itemviews/qfileiconprovider_p.h \ diff --git a/src/widgets/itemviews/qtablewidget.cpp b/src/widgets/itemviews/qtablewidget.cpp index 663cd4adc6..3ff75cc23b 100644 --- a/src/widgets/itemviews/qtablewidget.cpp +++ b/src/widgets/itemviews/qtablewidget.cpp @@ -39,7 +39,6 @@ #include "qtablewidget.h" -#ifndef QT_NO_TABLEWIDGET #include #include #include @@ -2715,5 +2714,3 @@ QT_END_NAMESPACE #include "moc_qtablewidget.cpp" #include "moc_qtablewidget_p.cpp" - -#endif // QT_NO_TABLEWIDGET diff --git a/src/widgets/itemviews/qtablewidget.h b/src/widgets/itemviews/qtablewidget.h index b91bcf7ce4..d3bcba57dd 100644 --- a/src/widgets/itemviews/qtablewidget.h +++ b/src/widgets/itemviews/qtablewidget.h @@ -44,12 +44,10 @@ #include #include #include -//#include - -QT_BEGIN_NAMESPACE +QT_REQUIRE_CONFIG(tablewidget); -#ifndef QT_NO_TABLEWIDGET +QT_BEGIN_NAMESPACE class Q_WIDGETS_EXPORT QTableWidgetSelectionRange { @@ -369,8 +367,6 @@ inline void QTableWidgetItem::setSelected(bool aselect) inline bool QTableWidgetItem::isSelected() const { return (view ? view->isItemSelected(this) : false); } -#endif // QT_NO_TABLEWIDGET - QT_END_NAMESPACE #endif // QTABLEWIDGET_H diff --git a/src/widgets/itemviews/qtablewidget_p.h b/src/widgets/itemviews/qtablewidget_p.h index 2db7337cd6..6412477be0 100644 --- a/src/widgets/itemviews/qtablewidget_p.h +++ b/src/widgets/itemviews/qtablewidget_p.h @@ -58,7 +58,7 @@ #include #include -#ifndef QT_NO_TABLEWIDGET +QT_REQUIRE_CONFIG(tablewidget); QT_BEGIN_NAMESPACE @@ -218,6 +218,4 @@ public: QT_END_NAMESPACE -#endif // QT_NO_TABLEWIDGET - #endif // QTABLEWIDGET_P_H -- cgit v1.2.3 From ebe1c953c0b73867733f7890ea36e949940002e8 Mon Sep 17 00:00:00 2001 From: Stephan Binner Date: Tue, 13 Jun 2017 21:03:57 +0200 Subject: Convert features.listwidget to QT_[REQUIRE_]CONFIG Also fix too specific #includes on the way Change-Id: Id626928513e89dd4a8854640994661f0d329470b Reviewed-by: Oswald Buddenhagen --- src/widgets/dialogs/qinputdialog.cpp | 2 +- src/widgets/dialogs/qsidebar_p.h | 2 +- src/widgets/itemviews/itemviews.pri | 11 ++++++++--- src/widgets/itemviews/qlistwidget.cpp | 3 --- src/widgets/itemviews/qlistwidget.h | 7 ++----- src/widgets/itemviews/qlistwidget_p.h | 4 +--- 6 files changed, 13 insertions(+), 16 deletions(-) (limited to 'src/widgets') diff --git a/src/widgets/dialogs/qinputdialog.cpp b/src/widgets/dialogs/qinputdialog.cpp index 4ca3923d8d..47551ae6fd 100644 --- a/src/widgets/dialogs/qinputdialog.cpp +++ b/src/widgets/dialogs/qinputdialog.cpp @@ -48,7 +48,7 @@ #include "qlayout.h" #include "qlineedit.h" #include "qplaintextedit.h" -#include "qlistwidget.h" +#include "qlistview.h" #include "qpushbutton.h" #include "qspinbox.h" #include "qstackedlayout.h" diff --git a/src/widgets/dialogs/qsidebar_p.h b/src/widgets/dialogs/qsidebar_p.h index 0685e81b2b..ee57f2fb48 100644 --- a/src/widgets/dialogs/qsidebar_p.h +++ b/src/widgets/dialogs/qsidebar_p.h @@ -52,7 +52,7 @@ // #include -#include +#include #include #include #include diff --git a/src/widgets/itemviews/itemviews.pri b/src/widgets/itemviews/itemviews.pri index 799458e4ad..a1401aff98 100644 --- a/src/widgets/itemviews/itemviews.pri +++ b/src/widgets/itemviews/itemviews.pri @@ -17,8 +17,6 @@ HEADERS += \ itemviews/qabstractitemdelegate_p.h \ itemviews/qitemdelegate.h \ itemviews/qdirmodel.h \ - itemviews/qlistwidget.h \ - itemviews/qlistwidget_p.h \ itemviews/qtreewidget.h \ itemviews/qtreewidget_p.h \ itemviews/qwidgetitemdata_p.h \ @@ -38,7 +36,6 @@ SOURCES += \ itemviews/qabstractitemdelegate.cpp \ itemviews/qitemdelegate.cpp \ itemviews/qdirmodel.cpp \ - itemviews/qlistwidget.cpp \ itemviews/qtreewidget.cpp \ itemviews/qitemeditorfactory.cpp \ itemviews/qtreewidgetitemiterator.cpp \ @@ -57,6 +54,14 @@ qtConfig(columnview) { itemviews/qcolumnviewgrip.cpp } +qtConfig(listwidget) { + HEADERS += \ + itemviews/qlistwidget.h \ + itemviews/qlistwidget_p.h + + SOURCES += itemviews/qlistwidget.cpp +} + qtConfig(tablewidget) { HEADERS += \ itemviews/qtablewidget.h \ diff --git a/src/widgets/itemviews/qlistwidget.cpp b/src/widgets/itemviews/qlistwidget.cpp index 0a1f85facb..21747d4e6e 100644 --- a/src/widgets/itemviews/qlistwidget.cpp +++ b/src/widgets/itemviews/qlistwidget.cpp @@ -39,7 +39,6 @@ #include "qlistwidget.h" -#ifndef QT_NO_LISTWIDGET #include #include #include @@ -1969,5 +1968,3 @@ QT_END_NAMESPACE #include "moc_qlistwidget.cpp" #include "moc_qlistwidget_p.cpp" - -#endif // QT_NO_LISTWIDGET diff --git a/src/widgets/itemviews/qlistwidget.h b/src/widgets/itemviews/qlistwidget.h index 85ca639e50..4e67486708 100644 --- a/src/widgets/itemviews/qlistwidget.h +++ b/src/widgets/itemviews/qlistwidget.h @@ -46,10 +46,9 @@ #include #include -QT_BEGIN_NAMESPACE - +QT_REQUIRE_CONFIG(listwidget); -#ifndef QT_NO_LISTWIDGET +QT_BEGIN_NAMESPACE class QListWidget; class QListModel; @@ -329,8 +328,6 @@ inline void QListWidgetItem::setHidden(bool ahide) inline bool QListWidgetItem::isHidden() const { return (view ? view->isItemHidden(this) : false); } -#endif // QT_NO_LISTWIDGET - QT_END_NAMESPACE #endif // QLISTWIDGET_H diff --git a/src/widgets/itemviews/qlistwidget_p.h b/src/widgets/itemviews/qlistwidget_p.h index 0594fd511e..e8f5540f9c 100644 --- a/src/widgets/itemviews/qlistwidget_p.h +++ b/src/widgets/itemviews/qlistwidget_p.h @@ -58,7 +58,7 @@ #include #include -#ifndef QT_NO_LISTWIDGET +QT_REQUIRE_CONFIG(listwidget); QT_BEGIN_NAMESPACE @@ -171,6 +171,4 @@ public: QT_END_NAMESPACE -#endif // QT_NO_LISTWIDGET - #endif // QLISTWIDGET_P_H -- cgit v1.2.3 From 1d8a3d600d006b04251ec338b548440f0cdde46d Mon Sep 17 00:00:00 2001 From: Stephan Binner Date: Tue, 13 Jun 2017 21:06:50 +0200 Subject: Convert features.treewidget to QT_[REQUIRE_]CONFIG Also fix too specific #include on the way Change-Id: Ieff5f40584ecc5f680f09a8a4b95d5604ff1e940 Reviewed-by: Oswald Buddenhagen --- src/widgets/accessible/itemviews.cpp | 2 +- src/widgets/itemviews/itemviews.pri | 16 +++++++++++----- src/widgets/itemviews/qtreewidget.cpp | 3 --- src/widgets/itemviews/qtreewidget.h | 7 ++----- src/widgets/itemviews/qtreewidget_p.h | 4 +--- src/widgets/itemviews/qtreewidgetitemiterator.cpp | 4 ---- src/widgets/itemviews/qtreewidgetitemiterator.h | 7 ++----- 7 files changed, 17 insertions(+), 26 deletions(-) (limited to 'src/widgets') diff --git a/src/widgets/accessible/itemviews.cpp b/src/widgets/accessible/itemviews.cpp index eec9a0021c..3cef564781 100644 --- a/src/widgets/accessible/itemviews.cpp +++ b/src/widgets/accessible/itemviews.cpp @@ -43,7 +43,7 @@ #include #include #include -#include +#include #ifndef QT_NO_ACCESSIBILITY diff --git a/src/widgets/itemviews/itemviews.pri b/src/widgets/itemviews/itemviews.pri index a1401aff98..af0a6f6898 100644 --- a/src/widgets/itemviews/itemviews.pri +++ b/src/widgets/itemviews/itemviews.pri @@ -17,12 +17,9 @@ HEADERS += \ itemviews/qabstractitemdelegate_p.h \ itemviews/qitemdelegate.h \ itemviews/qdirmodel.h \ - itemviews/qtreewidget.h \ - itemviews/qtreewidget_p.h \ itemviews/qwidgetitemdata_p.h \ itemviews/qitemeditorfactory.h \ itemviews/qitemeditorfactory_p.h \ - itemviews/qtreewidgetitemiterator.h \ itemviews/qdatawidgetmapper.h \ itemviews/qstyleditemdelegate.h @@ -36,9 +33,7 @@ SOURCES += \ itemviews/qabstractitemdelegate.cpp \ itemviews/qitemdelegate.cpp \ itemviews/qdirmodel.cpp \ - itemviews/qtreewidget.cpp \ itemviews/qitemeditorfactory.cpp \ - itemviews/qtreewidgetitemiterator.cpp \ itemviews/qdatawidgetmapper.cpp \ itemviews/qstyleditemdelegate.cpp } @@ -70,6 +65,17 @@ qtConfig(tablewidget) { SOURCES += itemviews/qtablewidget.cpp } +qtConfig(treewidget) { + HEADERS += \ + itemviews/qtreewidget.h \ + itemviews/qtreewidget_p.h \ + itemviews/qtreewidgetitemiterator.h + + SOURCES += \ + itemviews/qtreewidget.cpp \ + itemviews/qtreewidgetitemiterator.cpp +} + HEADERS += \ itemviews/qfileiconprovider.h \ itemviews/qfileiconprovider_p.h \ diff --git a/src/widgets/itemviews/qtreewidget.cpp b/src/widgets/itemviews/qtreewidget.cpp index 8ce36ab47e..337089056d 100644 --- a/src/widgets/itemviews/qtreewidget.cpp +++ b/src/widgets/itemviews/qtreewidget.cpp @@ -39,7 +39,6 @@ #include "qtreewidget.h" -#ifndef QT_NO_TREEWIDGET #include #include #include @@ -3461,5 +3460,3 @@ QT_END_NAMESPACE #include "moc_qtreewidget.cpp" #include "moc_qtreewidget_p.cpp" - -#endif // QT_NO_TREEWIDGET diff --git a/src/widgets/itemviews/qtreewidget.h b/src/widgets/itemviews/qtreewidget.h index fc0bccf2fe..27b7fa4fb1 100644 --- a/src/widgets/itemviews/qtreewidget.h +++ b/src/widgets/itemviews/qtreewidget.h @@ -46,10 +46,9 @@ #include #include -QT_BEGIN_NAMESPACE - +QT_REQUIRE_CONFIG(treewidget); -#ifndef QT_NO_TREEWIDGET +QT_BEGIN_NAMESPACE class QTreeWidget; class QTreeModel; @@ -422,8 +421,6 @@ inline void QTreeWidgetItem::setDisabled(bool disabled) inline bool QTreeWidgetItem::isDisabled() const { return !(flags() & Qt::ItemIsEnabled); } -#endif // QT_NO_TREEWIDGET - QT_END_NAMESPACE #endif // QTREEWIDGET_H diff --git a/src/widgets/itemviews/qtreewidget_p.h b/src/widgets/itemviews/qtreewidget_p.h index 7789693db4..7aa4daefc0 100644 --- a/src/widgets/itemviews/qtreewidget_p.h +++ b/src/widgets/itemviews/qtreewidget_p.h @@ -59,7 +59,7 @@ #include #include -#ifndef QT_NO_TREEWIDGET +QT_REQUIRE_CONFIG(treewidget); QT_BEGIN_NAMESPACE @@ -242,6 +242,4 @@ public: QT_END_NAMESPACE -#endif // QT_NO_TREEWIDGET - #endif // QTREEWIDGET_P_H diff --git a/src/widgets/itemviews/qtreewidgetitemiterator.cpp b/src/widgets/itemviews/qtreewidgetitemiterator.cpp index 4f27af70a8..1c1f60bc37 100644 --- a/src/widgets/itemviews/qtreewidgetitemiterator.cpp +++ b/src/widgets/itemviews/qtreewidgetitemiterator.cpp @@ -42,8 +42,6 @@ #include "qtreewidget_p.h" #include "qwidgetitemdata_p.h" -#ifndef QT_NO_TREEWIDGET - QT_BEGIN_NAMESPACE /*! @@ -453,5 +451,3 @@ void QTreeWidgetItemIteratorPrivate::ensureValidIterator(const QTreeWidgetItem * */ QT_END_NAMESPACE - -#endif // QT_NO_TREEWIDGET diff --git a/src/widgets/itemviews/qtreewidgetitemiterator.h b/src/widgets/itemviews/qtreewidgetitemiterator.h index db17a96abd..39e0244776 100644 --- a/src/widgets/itemviews/qtreewidgetitemiterator.h +++ b/src/widgets/itemviews/qtreewidgetitemiterator.h @@ -43,10 +43,9 @@ #include #include -QT_BEGIN_NAMESPACE - +QT_REQUIRE_CONFIG(treewidget); -#ifndef QT_NO_TREEWIDGET +QT_BEGIN_NAMESPACE class QTreeWidget; class QTreeWidgetItem; @@ -146,7 +145,5 @@ inline QTreeWidgetItem *QTreeWidgetItemIterator::operator*() const Q_DECLARE_OPERATORS_FOR_FLAGS(QTreeWidgetItemIterator::IteratorFlags) - QT_END_NAMESPACE -#endif // QT_NO_TREEWIDGET #endif // QTREEWIDGETITEMITERATOR_H -- cgit v1.2.3 From 769769a2ec9ac5ab48df1108f34410df8bfad814 Mon Sep 17 00:00:00 2001 From: Stephan Binner Date: Tue, 13 Jun 2017 21:09:48 +0200 Subject: Convert features.undoview to QT_[REQUIRE_]CONFIG Change-Id: Ic2945b9317f074301acd88602e3dae45e28b7c87 Reviewed-by: Oswald Buddenhagen --- src/widgets/util/qundoview.cpp | 4 ---- src/widgets/util/qundoview.h | 3 +-- src/widgets/util/util.pri | 11 +++++++---- 3 files changed, 8 insertions(+), 10 deletions(-) (limited to 'src/widgets') diff --git a/src/widgets/util/qundoview.cpp b/src/widgets/util/qundoview.cpp index 93c1778ea2..94610520b5 100644 --- a/src/widgets/util/qundoview.cpp +++ b/src/widgets/util/qundoview.cpp @@ -40,8 +40,6 @@ #include "qundostack.h" #include "qundoview.h" -#ifndef QT_NO_UNDOVIEW - #include "qundogroup.h" #include #include @@ -473,5 +471,3 @@ QT_END_NAMESPACE #include "qundoview.moc" #include "moc_qundoview.cpp" - -#endif // QT_NO_UNDOVIEW diff --git a/src/widgets/util/qundoview.h b/src/widgets/util/qundoview.h index 3ed9ea5989..35cffb0a28 100644 --- a/src/widgets/util/qundoview.h +++ b/src/widgets/util/qundoview.h @@ -44,7 +44,7 @@ #include #include -#ifndef QT_NO_UNDOVIEW +QT_REQUIRE_CONFIG(undoview); QT_BEGIN_NAMESPACE @@ -92,5 +92,4 @@ private: QT_END_NAMESPACE -#endif // QT_NO_UNDOVIEW #endif // QUNDOVIEW_H diff --git a/src/widgets/util/util.pri b/src/widgets/util/util.pri index b9b62d9bb0..60d4cd0872 100644 --- a/src/widgets/util/util.pri +++ b/src/widgets/util/util.pri @@ -8,16 +8,14 @@ HEADERS += \ util/qsystemtrayicon_p.h \ util/qundogroup.h \ util/qundostack.h \ - util/qundostack_p.h \ - util/qundoview.h + util/qundostack_p.h SOURCES += \ util/qsystemtrayicon.cpp \ util/qcolormap.cpp \ util/qcompleter.cpp \ util/qundogroup.cpp \ - util/qundostack.cpp \ - util/qundoview.cpp + util/qundostack.cpp qtConfig(scroller) { HEADERS += \ @@ -33,6 +31,11 @@ qtConfig(scroller) { util/qflickgesture.cpp \ } +qtConfig(undoview) { + HEADERS += util/qundoview.h + SOURCES += util/qundoview.cpp +} + win32:!winrt { SOURCES += util/qsystemtrayicon_win.cpp } else: qtConfig(xcb) { -- cgit v1.2.3 From 61b47df3915abeec44b830fda211cb1105070500 Mon Sep 17 00:00:00 2001 From: Stephan Binner Date: Tue, 13 Jun 2017 21:11:17 +0200 Subject: Convert features.undogroup to QT_[REQUIRE_]CONFIG Change-Id: I2fe0a3335e140875c425b28dc6e2d3081f534965 Reviewed-by: Oswald Buddenhagen --- src/widgets/util/qundogroup.cpp | 4 ---- src/widgets/util/qundogroup.h | 7 ++----- src/widgets/util/qundostack.cpp | 10 ++++++---- src/widgets/util/qundoview.cpp | 16 +++++++++------- src/widgets/util/qundoview.h | 6 +++--- src/widgets/util/util.pri | 7 +++++-- 6 files changed, 25 insertions(+), 25 deletions(-) (limited to 'src/widgets') diff --git a/src/widgets/util/qundogroup.cpp b/src/widgets/util/qundogroup.cpp index ec4fc2788a..f9605c7a2f 100644 --- a/src/widgets/util/qundogroup.cpp +++ b/src/widgets/util/qundogroup.cpp @@ -41,8 +41,6 @@ #include "qundostack.h" #include "qundostack_p.h" -#ifndef QT_NO_UNDOGROUP - QT_BEGIN_NAMESPACE class QUndoGroupPrivate : public QObjectPrivate @@ -502,5 +500,3 @@ QAction *QUndoGroup::createRedoAction(QObject *parent, const QString &prefix) co QT_END_NAMESPACE #include "moc_qundogroup.cpp" - -#endif // QT_NO_UNDOGROUP diff --git a/src/widgets/util/qundogroup.h b/src/widgets/util/qundogroup.h index 4e2fdeed26..dba79ea706 100644 --- a/src/widgets/util/qundogroup.h +++ b/src/widgets/util/qundogroup.h @@ -44,15 +44,14 @@ #include #include +QT_REQUIRE_CONFIG(undogroup); + QT_BEGIN_NAMESPACE class QUndoGroupPrivate; class QUndoStack; class QAction; - -#ifndef QT_NO_UNDOGROUP - class Q_WIDGETS_EXPORT QUndoGroup : public QObject { Q_OBJECT @@ -97,8 +96,6 @@ private: Q_DISABLE_COPY(QUndoGroup) }; -#endif // QT_NO_UNDOGROUP - QT_END_NAMESPACE #endif // QUNDOGROUP_H diff --git a/src/widgets/util/qundostack.cpp b/src/widgets/util/qundostack.cpp index dc0b6855ac..849b3c78f2 100644 --- a/src/widgets/util/qundostack.cpp +++ b/src/widgets/util/qundostack.cpp @@ -39,7 +39,9 @@ #include #include "qundostack.h" +#if QT_CONFIG(undogroup) #include "qundogroup.h" +#endif #include "qundostack_p.h" #ifndef QT_NO_UNDOCOMMAND @@ -544,7 +546,7 @@ bool QUndoStackPrivate::checkUndoLimit() QUndoStack::QUndoStack(QObject *parent) : QObject(*(new QUndoStackPrivate), parent) { -#ifndef QT_NO_UNDOGROUP +#if QT_CONFIG(undogroup) if (QUndoGroup *group = qobject_cast(parent)) group->addStack(this); #endif @@ -559,7 +561,7 @@ QUndoStack::QUndoStack(QObject *parent) QUndoStack::~QUndoStack() { -#ifndef QT_NO_UNDOGROUP +#if QT_CONFIG(undogroup) Q_D(QUndoStack); if (d->group != 0) d->group->removeStack(this); @@ -1247,7 +1249,7 @@ int QUndoStack::undoLimit() const void QUndoStack::setActive(bool active) { -#ifdef QT_NO_UNDOGROUP +#if !QT_CONFIG(undogroup) Q_UNUSED(active); #else Q_D(QUndoStack); @@ -1263,7 +1265,7 @@ void QUndoStack::setActive(bool active) bool QUndoStack::isActive() const { -#ifdef QT_NO_UNDOGROUP +#if !QT_CONFIG(undogroup) return true; #else Q_D(const QUndoStack); diff --git a/src/widgets/util/qundoview.cpp b/src/widgets/util/qundoview.cpp index 94610520b5..b56aa42aed 100644 --- a/src/widgets/util/qundoview.cpp +++ b/src/widgets/util/qundoview.cpp @@ -40,7 +40,9 @@ #include "qundostack.h" #include "qundoview.h" +#if QT_CONFIG(undogroup) #include "qundogroup.h" +#endif #include #include #include @@ -271,12 +273,12 @@ class QUndoViewPrivate : public QListViewPrivate Q_DECLARE_PUBLIC(QUndoView) public: QUndoViewPrivate() : -#ifndef QT_NO_UNDOGROUP +#if QT_CONFIG(undogroup) group(0), #endif model(0) {} -#ifndef QT_NO_UNDOGROUP +#if QT_CONFIG(undogroup) QPointer group; #endif QUndoModel *model; @@ -316,7 +318,7 @@ QUndoView::QUndoView(QUndoStack *stack, QWidget *parent) setStack(stack); } -#ifndef QT_NO_UNDOGROUP +#if QT_CONFIG(undogroup) /*! Constructs a new view with parent \a parent and sets the observed group to \a group. @@ -332,7 +334,7 @@ QUndoView::QUndoView(QUndoGroup *group, QWidget *parent) setGroup(group); } -#endif // QT_NO_UNDOGROUP +#endif // QT_CONFIG(undogroup) /*! Destroys this view. @@ -367,13 +369,13 @@ QUndoStack *QUndoView::stack() const void QUndoView::setStack(QUndoStack *stack) { Q_D(QUndoView); -#ifndef QT_NO_UNDOGROUP +#if QT_CONFIG(undogroup) setGroup(0); #endif d->model->setStack(stack); } -#ifndef QT_NO_UNDOGROUP +#if QT_CONFIG(undogroup) /*! Sets the group displayed by this view to \a group. If \a group is 0, the view will @@ -421,7 +423,7 @@ QUndoGroup *QUndoView::group() const return d->group; } -#endif // QT_NO_UNDOGROUP +#endif // QT_CONFIG(undogroup) /*! \property QUndoView::emptyLabel diff --git a/src/widgets/util/qundoview.h b/src/widgets/util/qundoview.h index 35cffb0a28..0bfcdd0c18 100644 --- a/src/widgets/util/qundoview.h +++ b/src/widgets/util/qundoview.h @@ -64,13 +64,13 @@ class Q_WIDGETS_EXPORT QUndoView : public QListView public: explicit QUndoView(QWidget *parent = Q_NULLPTR); explicit QUndoView(QUndoStack *stack, QWidget *parent = Q_NULLPTR); -#ifndef QT_NO_UNDOGROUP +#if QT_CONFIG(undogroup) explicit QUndoView(QUndoGroup *group, QWidget *parent = Q_NULLPTR); #endif ~QUndoView(); QUndoStack *stack() const; -#ifndef QT_NO_UNDOGROUP +#if QT_CONFIG(undogroup) QUndoGroup *group() const; #endif @@ -82,7 +82,7 @@ public: public Q_SLOTS: void setStack(QUndoStack *stack); -#ifndef QT_NO_UNDOGROUP +#if QT_CONFIG(undogroup) void setGroup(QUndoGroup *group); #endif diff --git a/src/widgets/util/util.pri b/src/widgets/util/util.pri index 60d4cd0872..99a1a62887 100644 --- a/src/widgets/util/util.pri +++ b/src/widgets/util/util.pri @@ -6,7 +6,6 @@ HEADERS += \ util/qcompleter.h \ util/qcompleter_p.h \ util/qsystemtrayicon_p.h \ - util/qundogroup.h \ util/qundostack.h \ util/qundostack_p.h @@ -14,7 +13,6 @@ SOURCES += \ util/qsystemtrayicon.cpp \ util/qcolormap.cpp \ util/qcompleter.cpp \ - util/qundogroup.cpp \ util/qundostack.cpp qtConfig(scroller) { @@ -31,6 +29,11 @@ qtConfig(scroller) { util/qflickgesture.cpp \ } +qtConfig(undogroup) { + HEADERS += util/qundogroup.h + SOURCES += util/qundogroup.cpp +} + qtConfig(undoview) { HEADERS += util/qundoview.h SOURCES += util/qundoview.cpp -- cgit v1.2.3 From a4d190554ae3d35b53cd7e7823a23f548bd24cfe Mon Sep 17 00:00:00 2001 From: Stephan Binner Date: Sun, 25 Jun 2017 09:31:35 +0200 Subject: Convert features.undostack to QT_CONFIG Change-Id: I7fc3aa44625fc97b802def4954f88c091c53f876 Reviewed-by: Oswald Buddenhagen --- src/widgets/util/qundostack.cpp | 4 ++-- src/widgets/util/qundostack.h | 4 ++-- src/widgets/util/qundostack_p.h | 5 ++--- 3 files changed, 6 insertions(+), 7 deletions(-) (limited to 'src/widgets') diff --git a/src/widgets/util/qundostack.cpp b/src/widgets/util/qundostack.cpp index 849b3c78f2..fd0035962e 100644 --- a/src/widgets/util/qundostack.cpp +++ b/src/widgets/util/qundostack.cpp @@ -344,7 +344,7 @@ const QUndoCommand *QUndoCommand::child(int index) const #endif // QT_NO_UNDOCOMMAND -#ifndef QT_NO_UNDOSTACK +#if QT_CONFIG(undostack) /*! \class QUndoStack @@ -1334,4 +1334,4 @@ QT_END_NAMESPACE #include "moc_qundostack.cpp" #include "moc_qundostack_p.cpp" -#endif // QT_NO_UNDOSTACK +#endif // QT_CONFIG(undostack) diff --git a/src/widgets/util/qundostack.h b/src/widgets/util/qundostack.h index 2a8f4decb6..e402e16eae 100644 --- a/src/widgets/util/qundostack.h +++ b/src/widgets/util/qundostack.h @@ -85,7 +85,7 @@ private: #endif // QT_NO_UNDOCOMMAND -#ifndef QT_NO_UNDOSTACK +#if QT_CONFIG(undostack) class Q_WIDGETS_EXPORT QUndoStack : public QObject { @@ -150,7 +150,7 @@ private: friend class QUndoGroup; }; -#endif // QT_NO_UNDOSTACK +#endif // QT_CONFIG(undostack) QT_END_NAMESPACE diff --git a/src/widgets/util/qundostack_p.h b/src/widgets/util/qundostack_p.h index e92a1fe620..04bc381114 100644 --- a/src/widgets/util/qundostack_p.h +++ b/src/widgets/util/qundostack_p.h @@ -74,7 +74,7 @@ public: bool obsolete; }; -#ifndef QT_NO_UNDOSTACK +#if QT_CONFIG(undostack) class QUndoStackPrivate : public QObjectPrivate { @@ -108,7 +108,6 @@ private: }; #endif // QT_NO_ACTION - QT_END_NAMESPACE -#endif // QT_NO_UNDOSTACK +#endif // QT_CONFIG(undostack) #endif // QUNDOSTACK_P_H -- cgit v1.2.3 From fa0ff2988eb6387bbc89160c85df8a5e1d6acccc Mon Sep 17 00:00:00 2001 From: Stephan Binner Date: Sun, 25 Jun 2017 09:40:36 +0200 Subject: Convert features.undocommand to QT_[REQUIRE_]CONFIG Change-Id: I1016f7e6bb1297e9c2f73e26e0d3641c873c4d4d Reviewed-by: Oswald Buddenhagen --- src/widgets/util/qundostack.cpp | 4 ---- src/widgets/util/qundostack.h | 7 ++----- src/widgets/util/util.pri | 15 ++++++++++----- 3 files changed, 12 insertions(+), 14 deletions(-) (limited to 'src/widgets') diff --git a/src/widgets/util/qundostack.cpp b/src/widgets/util/qundostack.cpp index fd0035962e..b371e903a6 100644 --- a/src/widgets/util/qundostack.cpp +++ b/src/widgets/util/qundostack.cpp @@ -44,8 +44,6 @@ #endif #include "qundostack_p.h" -#ifndef QT_NO_UNDOCOMMAND - QT_BEGIN_NAMESPACE /*! @@ -342,8 +340,6 @@ const QUndoCommand *QUndoCommand::child(int index) const return d->child_list.at(index); } -#endif // QT_NO_UNDOCOMMAND - #if QT_CONFIG(undostack) /*! diff --git a/src/widgets/util/qundostack.h b/src/widgets/util/qundostack.h index e402e16eae..7ab90b507a 100644 --- a/src/widgets/util/qundostack.h +++ b/src/widgets/util/qundostack.h @@ -44,15 +44,14 @@ #include #include -QT_BEGIN_NAMESPACE +QT_REQUIRE_CONFIG(undocommand); +QT_BEGIN_NAMESPACE class QAction; class QUndoCommandPrivate; class QUndoStackPrivate; -#ifndef QT_NO_UNDOCOMMAND - class Q_WIDGETS_EXPORT QUndoCommand { QUndoCommandPrivate *d; @@ -83,8 +82,6 @@ private: friend class QUndoStack; }; -#endif // QT_NO_UNDOCOMMAND - #if QT_CONFIG(undostack) class Q_WIDGETS_EXPORT QUndoStack : public QObject diff --git a/src/widgets/util/util.pri b/src/widgets/util/util.pri index 99a1a62887..8b28ac8bf0 100644 --- a/src/widgets/util/util.pri +++ b/src/widgets/util/util.pri @@ -5,15 +5,12 @@ HEADERS += \ util/qcolormap.h \ util/qcompleter.h \ util/qcompleter_p.h \ - util/qsystemtrayicon_p.h \ - util/qundostack.h \ - util/qundostack_p.h + util/qsystemtrayicon_p.h SOURCES += \ util/qsystemtrayicon.cpp \ util/qcolormap.cpp \ - util/qcompleter.cpp \ - util/qundostack.cpp + util/qcompleter.cpp qtConfig(scroller) { HEADERS += \ @@ -29,6 +26,14 @@ qtConfig(scroller) { util/qflickgesture.cpp \ } +qtConfig(undocommand) { + HEADERS += \ + util/qundostack.h \ + util/qundostack_p.h + + SOURCES += util/qundostack.cpp +} + qtConfig(undogroup) { HEADERS += util/qundogroup.h SOURCES += util/qundogroup.cpp -- cgit v1.2.3 From 4f7be34a42458db87ce2f11ed34ea2d2aa020009 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 21 Jun 2017 13:45:53 +0200 Subject: Windows code: Add Q_FALLTHROUGH or break to unmarked fallthroughs seen by GCC 7 Rearrange code handling QtWindows::DisplayChangedEvent. Change-Id: If9f32516108fb64c4a252c84392f2fd7f1872bf1 Reviewed-by: Oliver Wolff --- src/widgets/styles/qwindowsvistastyle.cpp | 1 + src/widgets/styles/qwindowsxpstyle.cpp | 9 ++++----- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'src/widgets') diff --git a/src/widgets/styles/qwindowsvistastyle.cpp b/src/widgets/styles/qwindowsvistastyle.cpp index 5a53627e95..a1aabc20c6 100644 --- a/src/widgets/styles/qwindowsvistastyle.cpp +++ b/src/widgets/styles/qwindowsvistastyle.cpp @@ -2153,6 +2153,7 @@ QRect QWindowsVistaStyle::subControlRect(ComplexControl control, const QStyleOpt rect = visualRect(cb->direction, cb->rect, rect); return rect; } + break; #endif // QT_NO_COMBOBOX case CC_TitleBar: if (const QStyleOptionTitleBar *tb = qstyleoption_cast(option)) { diff --git a/src/widgets/styles/qwindowsxpstyle.cpp b/src/widgets/styles/qwindowsxpstyle.cpp index b50c4b6be4..25321559b3 100644 --- a/src/widgets/styles/qwindowsxpstyle.cpp +++ b/src/widgets/styles/qwindowsxpstyle.cpp @@ -1509,10 +1509,9 @@ case PE_Frame: return; } else if (fillType == BT_NONE) { return; - } else { - break; } } + break; } case PE_FrameLineEdit: { // we try to check if this lineedit is a delegate on a QAbstractItemView-derived class. @@ -2428,6 +2427,7 @@ void QWindowsXPStyle::drawControl(ControlElement element, const QStyleOption *op p->restore(); return; } + break; #endif // QT_NO_RUBBERBAND case CE_HeaderEmptyArea: if (option->state & State_Horizontal) @@ -3754,10 +3754,9 @@ int QWindowsXPStyle::styleHint(StyleHint hint, const QStyleOption *option, const break; #ifndef QT_NO_RUBBERBAND case SH_RubberBand_Mask: - if (qstyleoption_cast(option)) { + if (qstyleoption_cast(option)) res = 0; - break; - } + break; #endif // QT_NO_RUBBERBAND case SH_ItemView_DrawDelegateFrame: -- cgit v1.2.3 From 6e9d24212db60743f13497f942713961d6601844 Mon Sep 17 00:00:00 2001 From: Oleg Yadrov Date: Fri, 16 Jun 2017 17:06:53 -0400 Subject: QTabBar: fix expanded tabs appearance Fix regression introduced by 175f33ed8. 'expanding' property set to true was ignored when QStyle::styleHint() returned Qt::AlignRight for SH_TabBar_Alignment. When we calculate tabs geometry, we put an empty tab at the front and back and set its expansive attribute depending on tab alignment AND 'expanding' property. Task-number: QTBUG-61480 Change-Id: I6a1827ae8a3f2c6bee5124c18c7f2b1c0a7862f3 Reviewed-by: Gabriel de Dietrich --- src/widgets/widgets/qtabbar.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/widgets') diff --git a/src/widgets/widgets/qtabbar.cpp b/src/widgets/widgets/qtabbar.cpp index b9020253a5..85bc9a4a09 100644 --- a/src/widgets/widgets/qtabbar.cpp +++ b/src/widgets/widgets/qtabbar.cpp @@ -447,9 +447,10 @@ void QTabBarPrivate::layoutTabs() QVector tabChain(tabList.count() + 2); // We put an empty item at the front and back and set its expansive attribute - // depending on tabAlignment. + // depending on tabAlignment and expanding. tabChain[tabChainIndex].init(); - tabChain[tabChainIndex].expansive = (tabAlignment != Qt::AlignLeft) + tabChain[tabChainIndex].expansive = (!expanding) + && (tabAlignment != Qt::AlignLeft) && (tabAlignment != Qt::AlignJustify); tabChain[tabChainIndex].empty = true; ++tabChainIndex; @@ -514,13 +515,12 @@ void QTabBarPrivate::layoutTabs() maxExtent = maxWidth; } - if (!expanding) { - // Mirror our front item. - tabChain[tabChainIndex].init(); - tabChain[tabChainIndex].expansive = (tabAlignment != Qt::AlignRight) - && (tabAlignment != Qt::AlignJustify); - tabChain[tabChainIndex].empty = true; - } + // Mirror our front item. + tabChain[tabChainIndex].init(); + tabChain[tabChainIndex].expansive = (!expanding) + && (tabAlignment != Qt::AlignRight) + && (tabAlignment != Qt::AlignJustify); + tabChain[tabChainIndex].empty = true; Q_ASSERT(tabChainIndex == tabChain.count() - 1); // add an assert just to make sure. // Do the calculation -- cgit v1.2.3 From 150ee7f4f1fb6280aa7fd8c15b6d72d806c0f68c Mon Sep 17 00:00:00 2001 From: Stephan Binner Date: Sat, 10 Jun 2017 07:09:50 +0200 Subject: Convert features.whatsthis to QT_[REQUIRE_]CONFIG Move feature definition to gui/configure.json Change-Id: I00b35c0e259d0a695d84a9bf6803eba74d41465a Reviewed-by: Oswald Buddenhagen --- src/widgets/accessible/complexwidgets.cpp | 2 ++ src/widgets/accessible/qaccessiblewidget.cpp | 4 +++- src/widgets/configure.json | 7 ------- src/widgets/dialogs/qdialog.cpp | 6 ++++-- src/widgets/itemviews/qabstractitemdelegate.cpp | 4 +++- src/widgets/itemviews/qabstractitemview.cpp | 1 - src/widgets/itemviews/qheaderview.cpp | 6 ++++-- src/widgets/itemviews/qlistwidget.h | 4 ++-- src/widgets/itemviews/qtablewidget.h | 4 ++-- src/widgets/itemviews/qtreewidget.h | 4 ++-- src/widgets/kernel/kernel.pri | 7 +++++-- src/widgets/kernel/qapplication.cpp | 8 ++++---- src/widgets/kernel/qshortcut.cpp | 4 +++- src/widgets/kernel/qwhatsthis.cpp | 4 ---- src/widgets/kernel/qwhatsthis.h | 7 ++----- src/widgets/kernel/qwidget.cpp | 10 ++++++---- src/widgets/kernel/qwidget.h | 4 ++-- src/widgets/kernel/qwidget_p.h | 2 +- src/widgets/statemachine/qguistatemachine.cpp | 4 ++-- src/widgets/widgets/qlineedit.cpp | 1 - src/widgets/widgets/qmdisubwindow.cpp | 4 +++- src/widgets/widgets/qmenu.cpp | 16 ++++++++-------- src/widgets/widgets/qmenubar.cpp | 6 ++++-- src/widgets/widgets/qtabbar.cpp | 10 ++++++---- src/widgets/widgets/qtabbar.h | 2 +- src/widgets/widgets/qtabbar_p.h | 2 +- src/widgets/widgets/qtabwidget.cpp | 4 ++-- src/widgets/widgets/qtabwidget.h | 2 +- src/widgets/widgets/qtextbrowser.cpp | 4 +++- src/widgets/widgets/qtoolbutton.cpp | 2 +- 30 files changed, 77 insertions(+), 68 deletions(-) (limited to 'src/widgets') diff --git a/src/widgets/accessible/complexwidgets.cpp b/src/widgets/accessible/complexwidgets.cpp index 397a58a5d4..4770c513cf 100644 --- a/src/widgets/accessible/complexwidgets.cpp +++ b/src/widgets/accessible/complexwidgets.cpp @@ -51,7 +51,9 @@ #include #include #include +#if QT_CONFIG(whatsthis) #include +#endif #include #include #include diff --git a/src/widgets/accessible/qaccessiblewidget.cpp b/src/widgets/accessible/qaccessiblewidget.cpp index d5f7449e57..f18930f273 100644 --- a/src/widgets/accessible/qaccessiblewidget.cpp +++ b/src/widgets/accessible/qaccessiblewidget.cpp @@ -48,7 +48,9 @@ #include "qlabel.h" #endif #include "qtooltip.h" +#if QT_CONFIG(whatsthis) #include "qwhatsthis.h" +#endif #include "qwidget.h" #include "qdebug.h" #include @@ -436,7 +438,7 @@ QString QAccessibleWidget::text(QAccessible::Text t) const #endif break; case QAccessible::Help: -#ifndef QT_NO_WHATSTHIS +#if QT_CONFIG(whatsthis) str = widget()->whatsThis(); #endif break; diff --git a/src/widgets/configure.json b/src/widgets/configure.json index f0fce9b52b..7e2f8e1552 100644 --- a/src/widgets/configure.json +++ b/src/widgets/configure.json @@ -432,13 +432,6 @@ "section": "Widgets", "output": [ "publicFeature", "feature" ] }, - "whatsthis": { - "label": "QWhatsThis", - "purpose": "Supports displaying \"What's this\" help.", - "section": "Widgets", - "condition": "features.toolbutton", - "output": [ "publicFeature", "feature" ] - }, "sizegrip": { "label": "QSizeGrip", "purpose": "Provides corner-grips for resizing top-level windows.", diff --git a/src/widgets/dialogs/qdialog.cpp b/src/widgets/dialogs/qdialog.cpp index 60e1c43721..a6e9cda8ce 100644 --- a/src/widgets/dialogs/qdialog.cpp +++ b/src/widgets/dialogs/qdialog.cpp @@ -46,7 +46,9 @@ #include "qapplication.h" #include "qlayout.h" #include "qsizegrip.h" +#if QT_CONFIG(whatsthis) #include "qwhatsthis.h" +#endif #include "qmenu.h" #include "qcursor.h" #include "qmessagebox.h" @@ -607,7 +609,7 @@ bool QDialog::eventFilter(QObject *o, QEvent *e) /*! \reimp */ void QDialog::contextMenuEvent(QContextMenuEvent *e) { -#if defined(QT_NO_WHATSTHIS) || defined(QT_NO_MENU) +#if !QT_CONFIG(whatsthis) || defined(QT_NO_MENU) Q_UNUSED(e); #else QWidget *w = childAt(e->pos()); @@ -672,7 +674,7 @@ void QDialog::keyPressEvent(QKeyEvent *e) /*! \reimp */ void QDialog::closeEvent(QCloseEvent *e) { -#ifndef QT_NO_WHATSTHIS +#if QT_CONFIG(whatsthis) if (isModal() && QWhatsThis::inWhatsThisMode()) QWhatsThis::leaveWhatsThisMode(); #endif diff --git a/src/widgets/itemviews/qabstractitemdelegate.cpp b/src/widgets/itemviews/qabstractitemdelegate.cpp index f7c170f0bb..5b119cc79e 100644 --- a/src/widgets/itemviews/qabstractitemdelegate.cpp +++ b/src/widgets/itemviews/qabstractitemdelegate.cpp @@ -43,7 +43,9 @@ #include #include #include +#if QT_CONFIG(whatsthis) #include +#endif #include #include #include @@ -393,7 +395,7 @@ bool QAbstractItemDelegate::helpEvent(QHelpEvent *event, } break;} #endif -#ifndef QT_NO_WHATSTHIS +#if QT_CONFIG(whatsthis) case QEvent::QueryWhatsThis: { if (index.data(Qt::WhatsThisRole).isValid()) return true; diff --git a/src/widgets/itemviews/qabstractitemview.cpp b/src/widgets/itemviews/qabstractitemview.cpp index d24456edef..e8db228256 100644 --- a/src/widgets/itemviews/qabstractitemview.cpp +++ b/src/widgets/itemviews/qabstractitemview.cpp @@ -48,7 +48,6 @@ #include #include #include -#include #include #include #include diff --git a/src/widgets/itemviews/qheaderview.cpp b/src/widgets/itemviews/qheaderview.cpp index 76f80c680e..c31b00959d 100644 --- a/src/widgets/itemviews/qheaderview.cpp +++ b/src/widgets/itemviews/qheaderview.cpp @@ -47,7 +47,9 @@ #include #include #include +#if QT_CONFIG(whatsthis) #include +#endif #include #include #include @@ -2641,7 +2643,7 @@ bool QHeaderView::viewportEvent(QEvent *e) } break; } #endif -#ifndef QT_NO_WHATSTHIS +#if QT_CONFIG(whatsthis) case QEvent::QueryWhatsThis: { QHelpEvent *he = static_cast(e); int logical = logicalIndexAt(he->pos()); @@ -2661,7 +2663,7 @@ bool QHeaderView::viewportEvent(QEvent *e) } } break; } -#endif // QT_NO_WHATSTHIS +#endif // QT_CONFIG(whatsthis) #ifndef QT_NO_STATUSTIP case QEvent::StatusTip: { QHelpEvent *he = static_cast(e); diff --git a/src/widgets/itemviews/qlistwidget.h b/src/widgets/itemviews/qlistwidget.h index 4e67486708..8471645fb0 100644 --- a/src/widgets/itemviews/qlistwidget.h +++ b/src/widgets/itemviews/qlistwidget.h @@ -99,7 +99,7 @@ public: inline void setToolTip(const QString &toolTip); #endif -#ifndef QT_NO_WHATSTHIS +#if QT_CONFIG(whatsthis) inline QString whatsThis() const { return data(Qt::WhatsThisRole).toString(); } inline void setWhatsThis(const QString &whatsThis); @@ -179,7 +179,7 @@ inline void QListWidgetItem::setToolTip(const QString &atoolTip) { setData(Qt::ToolTipRole, atoolTip); } #endif -#ifndef QT_NO_WHATSTHIS +#if QT_CONFIG(whatsthis) inline void QListWidgetItem::setWhatsThis(const QString &awhatsThis) { setData(Qt::WhatsThisRole, awhatsThis); } #endif diff --git a/src/widgets/itemviews/qtablewidget.h b/src/widgets/itemviews/qtablewidget.h index d3bcba57dd..3fecf194e4 100644 --- a/src/widgets/itemviews/qtablewidget.h +++ b/src/widgets/itemviews/qtablewidget.h @@ -116,7 +116,7 @@ public: inline void setToolTip(const QString &toolTip); #endif -#ifndef QT_NO_WHATSTHIS +#if QT_CONFIG(whatsthis) inline QString whatsThis() const { return data(Qt::WhatsThisRole).toString(); } inline void setWhatsThis(const QString &whatsThis); @@ -196,7 +196,7 @@ inline void QTableWidgetItem::setToolTip(const QString &atoolTip) { setData(Qt::ToolTipRole, atoolTip); } #endif -#ifndef QT_NO_WHATSTHIS +#if QT_CONFIG(whatsthis) inline void QTableWidgetItem::setWhatsThis(const QString &awhatsThis) { setData(Qt::WhatsThisRole, awhatsThis); } #endif diff --git a/src/widgets/itemviews/qtreewidget.h b/src/widgets/itemviews/qtreewidget.h index 27b7fa4fb1..d258f76621 100644 --- a/src/widgets/itemviews/qtreewidget.h +++ b/src/widgets/itemviews/qtreewidget.h @@ -119,7 +119,7 @@ public: inline void setToolTip(int column, const QString &toolTip); #endif -#ifndef QT_NO_WHATSTHIS +#if QT_CONFIG(whatsthis) inline QString whatsThis(int column) const { return data(column, Qt::WhatsThisRole).toString(); } inline void setWhatsThis(int column, const QString &whatsThis); @@ -234,7 +234,7 @@ inline void QTreeWidgetItem::setToolTip(int column, const QString &atoolTip) { setData(column, Qt::ToolTipRole, atoolTip); } #endif -#ifndef QT_NO_WHATSTHIS +#if QT_CONFIG(whatsthis) inline void QTreeWidgetItem::setWhatsThis(int column, const QString &awhatsThis) { setData(column, Qt::WhatsThisRole, awhatsThis); } #endif diff --git a/src/widgets/kernel/kernel.pri b/src/widgets/kernel/kernel.pri index c91be918b6..3e3c795839 100644 --- a/src/widgets/kernel/kernel.pri +++ b/src/widgets/kernel/kernel.pri @@ -24,7 +24,6 @@ HEADERS += \ kernel/qsizepolicy.h \ kernel/qstackedlayout.h \ kernel/qtooltip.h \ - kernel/qwhatsthis.h \ kernel/qwidget.h \ kernel/qwidget_p.h \ kernel/qwidgetaction.h \ @@ -52,7 +51,6 @@ SOURCES += \ kernel/qsizepolicy.cpp \ kernel/qstackedlayout.cpp \ kernel/qtooltip.cpp \ - kernel/qwhatsthis.cpp \ kernel/qwidget.cpp \ kernel/qwidgetaction.cpp \ kernel/qgesture.cpp \ @@ -87,3 +85,8 @@ qtConfig(formlayout) { HEADERS += kernel/qformlayout.h SOURCES += kernel/qformlayout.cpp } + +qtConfig(whatsthis) { + HEADERS += kernel/qwhatsthis.h + SOURCES += kernel/qwhatsthis.cpp +} diff --git a/src/widgets/kernel/qapplication.cpp b/src/widgets/kernel/qapplication.cpp index fe7a9c2500..01bd1c5033 100644 --- a/src/widgets/kernel/qapplication.cpp +++ b/src/widgets/kernel/qapplication.cpp @@ -73,7 +73,7 @@ #include #include #include -#ifndef QT_NO_WHATSTHIS +#if QT_CONFIG(whatsthis) #include #endif @@ -1999,7 +1999,7 @@ bool QApplication::event(QEvent *e) } else if (te->timerId() == d->toolTipFallAsleep.timerId()) { d->toolTipFallAsleep.stop(); } -#ifndef QT_NO_WHATSTHIS +#if QT_CONFIG(whatsthis) } else if (e->type() == QEvent::EnterWhatsThisMode) { QWhatsThis::enterWhatsThisMode(); return true; @@ -3381,7 +3381,7 @@ bool QApplication::notify(QObject *receiver, QEvent *e) break; #endif // QT_CONFIG(tabletevent) -#if !defined(QT_NO_TOOLTIP) || !defined(QT_NO_WHATSTHIS) +#if !defined(QT_NO_TOOLTIP) || QT_CONFIG(whatsthis) case QEvent::ToolTip: case QEvent::WhatsThis: case QEvent::QueryWhatsThis: @@ -3406,7 +3406,7 @@ bool QApplication::notify(QObject *receiver, QEvent *e) } break; #endif -#if !defined(QT_NO_STATUSTIP) || !defined(QT_NO_WHATSTHIS) +#if !defined(QT_NO_STATUSTIP) || QT_CONFIG(whatsthis) case QEvent::StatusTip: case QEvent::WhatsThisClicked: { diff --git a/src/widgets/kernel/qshortcut.cpp b/src/widgets/kernel/qshortcut.cpp index be5788274e..a09cba0ddc 100644 --- a/src/widgets/kernel/qshortcut.cpp +++ b/src/widgets/kernel/qshortcut.cpp @@ -42,7 +42,9 @@ #ifndef QT_NO_SHORTCUT #include +#if QT_CONFIG(whatsthis) #include +#endif #include #include #include @@ -641,7 +643,7 @@ bool QShortcut::event(QEvent *e) if (d->sc_enabled && e->type() == QEvent::Shortcut) { QShortcutEvent *se = static_cast(e); if (se->shortcutId() == d->sc_id && se->key() == d->sc_sequence){ -#ifndef QT_NO_WHATSTHIS +#if QT_CONFIG(whatsthis) if (QWhatsThis::inWhatsThisMode()) { QWhatsThis::showText(QCursor::pos(), d->sc_whatsthis); handled = true; diff --git a/src/widgets/kernel/qwhatsthis.cpp b/src/widgets/kernel/qwhatsthis.cpp index 4286019717..e2cfebb8a1 100644 --- a/src/widgets/kernel/qwhatsthis.cpp +++ b/src/widgets/kernel/qwhatsthis.cpp @@ -38,7 +38,6 @@ ****************************************************************************/ #include "qwhatsthis.h" -#ifndef QT_NO_WHATSTHIS #include "qpointer.h" #include "qapplication.h" #include @@ -54,7 +53,6 @@ #include "qtextdocument.h" #include #include "private/qtextdocumentlayout_p.h" -#include "qtoolbutton.h" #include "qdebug.h" #ifndef QT_NO_ACCESSIBILITY #include "qaccessible.h" @@ -681,5 +679,3 @@ QAction *QWhatsThis::createAction(QObject *parent) QT_END_NAMESPACE #include "qwhatsthis.moc" - -#endif // QT_NO_WHATSTHIS diff --git a/src/widgets/kernel/qwhatsthis.h b/src/widgets/kernel/qwhatsthis.h index 746fd3ff22..3211796d3e 100644 --- a/src/widgets/kernel/qwhatsthis.h +++ b/src/widgets/kernel/qwhatsthis.h @@ -44,10 +44,9 @@ #include #include -QT_BEGIN_NAMESPACE - +QT_REQUIRE_CONFIG(whatsthis); -#ifndef QT_NO_WHATSTHIS +QT_BEGIN_NAMESPACE class QAction; @@ -67,8 +66,6 @@ public: }; -#endif // QT_NO_WHATSTHIS - QT_END_NAMESPACE #endif // QWHATSTHIS_H diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp index deb638f410..3104f72e82 100644 --- a/src/widgets/kernel/qwidget.cpp +++ b/src/widgets/kernel/qwidget.cpp @@ -71,7 +71,9 @@ #include "private/qwidgetwindow_p.h" #include "qpainter.h" #include "qtooltip.h" +#if QT_CONFIG(whatsthis) #include "qwhatsthis.h" +#endif #include "qdebug.h" #include "private/qstylesheetstyle_p.h" #include "private/qstyle_p.h" @@ -8853,7 +8855,7 @@ bool QWidget::event(QEvent *event) } } #endif -#ifndef QT_NO_WHATSTHIS +#if QT_CONFIG(whatsthis) if (!k->isAccepted() && k->modifiers() & Qt::ShiftModifier && k->key() == Qt::Key_F1 && d->whatsThis.size()) { @@ -9152,7 +9154,7 @@ bool QWidget::event(QEvent *event) event->ignore(); break; #endif -#ifndef QT_NO_WHATSTHIS +#if QT_CONFIG(whatsthis) case QEvent::WhatsThis: if (d->whatsThis.size()) QWhatsThis::showText(static_cast(event)->globalPos(), d->whatsThis, this); @@ -11579,7 +11581,7 @@ QString QWidget::statusTip() const } #endif // QT_NO_STATUSTIP -#ifndef QT_NO_WHATSTHIS +#if QT_CONFIG(whatsthis) /*! \property QWidget::whatsThis @@ -11600,7 +11602,7 @@ QString QWidget::whatsThis() const Q_D(const QWidget); return d->whatsThis; } -#endif // QT_NO_WHATSTHIS +#endif // QT_CONFIG(whatsthis) #ifndef QT_NO_ACCESSIBILITY /*! diff --git a/src/widgets/kernel/qwidget.h b/src/widgets/kernel/qwidget.h index 59e2ddd24d..48bc120324 100644 --- a/src/widgets/kernel/qwidget.h +++ b/src/widgets/kernel/qwidget.h @@ -186,7 +186,7 @@ class Q_WIDGETS_EXPORT QWidget : public QObject, public QPaintDevice #ifndef QT_NO_STATUSTIP Q_PROPERTY(QString statusTip READ statusTip WRITE setStatusTip) #endif -#ifndef QT_NO_WHATSTHIS +#if QT_CONFIG(whatsthis) Q_PROPERTY(QString whatsThis READ whatsThis WRITE setWhatsThis) #endif #ifndef QT_NO_ACCESSIBILITY @@ -390,7 +390,7 @@ public: void setStatusTip(const QString &); QString statusTip() const; #endif -#ifndef QT_NO_WHATSTHIS +#if QT_CONFIG(whatsthis) void setWhatsThis(const QString &); QString whatsThis() const; #endif diff --git a/src/widgets/kernel/qwidget_p.h b/src/widgets/kernel/qwidget_p.h index 68e063c25a..cc0940fc08 100644 --- a/src/widgets/kernel/qwidget_p.h +++ b/src/widgets/kernel/qwidget_p.h @@ -697,7 +697,7 @@ public: #ifndef QT_NO_STATUSTIP QString statusTip; #endif -#ifndef QT_NO_WHATSTHIS +#if QT_CONFIG(whatsthis) QString whatsThis; #endif #ifndef QT_NO_ACCESSIBILITY diff --git a/src/widgets/statemachine/qguistatemachine.cpp b/src/widgets/statemachine/qguistatemachine.cpp index 26d0a9615f..bbe723a55a 100644 --- a/src/widgets/statemachine/qguistatemachine.cpp +++ b/src/widgets/statemachine/qguistatemachine.cpp @@ -243,10 +243,10 @@ static QEvent *cloneEvent(QEvent *e) case QEvent::ShortcutOverride: return new QKeyEvent(*static_cast(e)); -#ifndef QT_NO_WHATSTHIS +#if QT_CONFIG(whatsthis) case QEvent::WhatsThisClicked: return new QWhatsThisClickedEvent(*static_cast(e)); -#endif //QT_NO_WHATSTHIS +#endif // QT_CONFIG(whatsthis) #ifndef QT_NO_TOOLBAR case QEvent::ToolBarChange: diff --git a/src/widgets/widgets/qlineedit.cpp b/src/widgets/widgets/qlineedit.cpp index 7e24704de3..863c1e9bbe 100644 --- a/src/widgets/widgets/qlineedit.cpp +++ b/src/widgets/widgets/qlineedit.cpp @@ -60,7 +60,6 @@ #include "qvalidator.h" #include "qvariant.h" #include "qvector.h" -#include "qwhatsthis.h" #include "qdebug.h" #include "qtextedit.h" #include diff --git a/src/widgets/widgets/qmdisubwindow.cpp b/src/widgets/widgets/qmdisubwindow.cpp index a8cdca1719..b4f2c97e04 100644 --- a/src/widgets/widgets/qmdisubwindow.cpp +++ b/src/widgets/widgets/qmdisubwindow.cpp @@ -153,7 +153,9 @@ #include #include #include +#if QT_CONFIG(whatsthis) #include +#endif #include #include #include @@ -1490,7 +1492,7 @@ void QMdiSubWindowPrivate::processClickedSubControl() Q_Q(QMdiSubWindow); switch (activeSubControl) { case QStyle::SC_TitleBarContextHelpButton: -#ifndef QT_NO_WHATSTHIS +#if QT_CONFIG(whatsthis) QWhatsThis::enterWhatsThisMode(); #endif break; diff --git a/src/widgets/widgets/qmenu.cpp b/src/widgets/widgets/qmenu.cpp index 95bb976566..0b874cb09a 100644 --- a/src/widgets/widgets/qmenu.cpp +++ b/src/widgets/widgets/qmenu.cpp @@ -59,7 +59,7 @@ #ifndef QT_NO_EFFECTS # include #endif -#ifndef QT_NO_WHATSTHIS +#if QT_CONFIG(whatsthis) # include #endif @@ -187,7 +187,7 @@ private: void QMenuPrivate::init() { Q_Q(QMenu); -#ifndef QT_NO_WHATSTHIS +#if QT_CONFIG(whatsthis) q->setAttribute(Qt::WA_CustomWhatsThis); #endif q->setAttribute(Qt::WA_X11NetWmWindowTypePopupMenu); @@ -1327,12 +1327,12 @@ void QMenuPrivate::activateCausedStack(const QVector > &caused void QMenuPrivate::activateAction(QAction *action, QAction::ActionEvent action_e, bool self) { Q_Q(QMenu); -#ifndef QT_NO_WHATSTHIS +#if QT_CONFIG(whatsthis) bool inWhatsThisMode = QWhatsThis::inWhatsThisMode(); #endif if (!action || !q->isEnabled() || (action_e == QAction::Trigger -#ifndef QT_NO_WHATSTHIS +#if QT_CONFIG(whatsthis) && !inWhatsThisMode #endif && (action->isSeparator() ||!action->isEnabled()))) @@ -1343,7 +1343,7 @@ void QMenuPrivate::activateAction(QAction *action, QAction::ActionEvent action_e */ const QVector > causedStack = calcCausedStack(); if (action_e == QAction::Trigger) { -#ifndef QT_NO_WHATSTHIS +#if QT_CONFIG(whatsthis) if (!inWhatsThisMode) actionAboutToTrigger = action; #endif @@ -1362,7 +1362,7 @@ void QMenuPrivate::activateAction(QAction *action, QAction::ActionEvent action_e } } -#ifndef QT_NO_WHATSTHIS +#if QT_CONFIG(whatsthis) if (inWhatsThisMode) { QString s = action->whatsThis(); if (s.isEmpty()) @@ -2971,7 +2971,7 @@ QMenu::event(QEvent *e) } break; #endif // QT_NO_TOOLTIP -#ifndef QT_NO_WHATSTHIS +#if QT_CONFIG(whatsthis) case QEvent::QueryWhatsThis: e->setAccepted(d->whatsThis.size()); if (QAction *action = d->actionAt(static_cast(e)->pos())) { @@ -3233,7 +3233,7 @@ void QMenu::keyPressEvent(QKeyEvent *e) key_consumed = true; break; } -#ifndef QT_NO_WHATSTHIS +#if QT_CONFIG(whatsthis) case Qt::Key_F1: if (!d->currentAction || d->currentAction->whatsThis().isNull()) break; diff --git a/src/widgets/widgets/qmenubar.cpp b/src/widgets/widgets/qmenubar.cpp index c16b2a5ac1..8ec2a3ed94 100644 --- a/src/widgets/widgets/qmenubar.cpp +++ b/src/widgets/widgets/qmenubar.cpp @@ -52,7 +52,9 @@ #include #include #include +#if QT_CONFIG(whatsthis) #include +#endif #include #include "private/qguiapplication_p.h" #include "qpa/qplatformintegration.h" @@ -1013,7 +1015,7 @@ void QMenuBar::mousePressEvent(QMouseEvent *e) QAction *action = d->actionAt(e->pos()); if (!action || !d->isVisible(action) || !action->isEnabled()) { d->setCurrentAction(0); -#ifndef QT_NO_WHATSTHIS +#if QT_CONFIG(whatsthis) if (QWhatsThis::inWhatsThisMode()) QWhatsThis::showText(e->globalPos(), d->whatsThis, this); #endif @@ -1432,7 +1434,7 @@ bool QMenuBar::event(QEvent *e) } break; #endif -#ifndef QT_NO_WHATSTHIS +#if QT_CONFIG(whatsthis) case QEvent::QueryWhatsThis: e->setAccepted(d->whatsThis.size()); if (QAction *action = d->actionAt(static_cast(e)->pos())) { diff --git a/src/widgets/widgets/qtabbar.cpp b/src/widgets/widgets/qtabbar.cpp index 85bc9a4a09..9e803f4388 100644 --- a/src/widgets/widgets/qtabbar.cpp +++ b/src/widgets/widgets/qtabbar.cpp @@ -49,7 +49,9 @@ #include "qstylepainter.h" #include "qtabwidget.h" #include "qtooltip.h" +#if QT_CONFIG(whatsthis) #include "qwhatsthis.h" +#endif #include "private/qtextengine_p.h" #ifndef QT_NO_ACCESSIBILITY #include "qaccessible.h" @@ -1220,7 +1222,7 @@ QString QTabBar::tabToolTip(int index) const } #endif // QT_NO_TOOLTIP -#ifndef QT_NO_WHATSTHIS +#if QT_CONFIG(whatsthis) /*! \since 4.1 @@ -1248,7 +1250,7 @@ QString QTabBar::tabWhatsThis(int index) const return QString(); } -#endif // QT_NO_WHATSTHIS +#endif // QT_CONFIG(whatsthis) /*! Sets the data of the tab at position \a index to \a data. @@ -1628,7 +1630,7 @@ bool QTabBar::event(QEvent *event) } } #endif // QT_NO_TOOLTIP -#ifndef QT_NO_WHATSTHIS +#if QT_CONFIG(whatsthis) } else if (event->type() == QEvent::QueryWhatsThis) { const QTabBarPrivate::Tab *tab = d->at(d->indexAtPos(static_cast(event)->pos())); if (!tab || tab->whatsThis.isEmpty()) @@ -1642,7 +1644,7 @@ bool QTabBar::event(QEvent *event) return true; } } -#endif // QT_NO_WHATSTHIS +#endif // QT_CONFIG(whatsthis) #ifndef QT_NO_SHORTCUT } else if (event->type() == QEvent::Shortcut) { QShortcutEvent *se = static_cast(event); diff --git a/src/widgets/widgets/qtabbar.h b/src/widgets/widgets/qtabbar.h index c7d9f95d93..2a27a98661 100644 --- a/src/widgets/widgets/qtabbar.h +++ b/src/widgets/widgets/qtabbar.h @@ -123,7 +123,7 @@ public: QString tabToolTip(int index) const; #endif -#ifndef QT_NO_WHATSTHIS +#if QT_CONFIG(whatsthis) void setTabWhatsThis(int index, const QString &text); QString tabWhatsThis(int index) const; #endif diff --git a/src/widgets/widgets/qtabbar_p.h b/src/widgets/widgets/qtabbar_p.h index 7c653a95e9..354c2fc05a 100644 --- a/src/widgets/widgets/qtabbar_p.h +++ b/src/widgets/widgets/qtabbar_p.h @@ -118,7 +118,7 @@ public: #ifndef QT_NO_TOOLTIP QString toolTip; #endif -#ifndef QT_NO_WHATSTHIS +#if QT_CONFIG(whatsthis) QString whatsThis; #endif QIcon icon; diff --git a/src/widgets/widgets/qtabwidget.cpp b/src/widgets/widgets/qtabwidget.cpp index 7c75f859ed..c84c78275d 100644 --- a/src/widgets/widgets/qtabwidget.cpp +++ b/src/widgets/widgets/qtabwidget.cpp @@ -1163,7 +1163,7 @@ QString QTabWidget::tabToolTip(int index) const } #endif // QT_NO_TOOLTIP -#ifndef QT_NO_WHATSTHIS +#if QT_CONFIG(whatsthis) /*! \since 4.1 @@ -1187,7 +1187,7 @@ QString QTabWidget::tabWhatsThis(int index) const Q_D(const QTabWidget); return d->tabs->tabWhatsThis(index); } -#endif // QT_NO_WHATSTHIS +#endif // QT_CONFIG(whatsthis) /*! This virtual handler is called after a new tab was added or diff --git a/src/widgets/widgets/qtabwidget.h b/src/widgets/widgets/qtabwidget.h index 59fcea223f..7d8864241a 100644 --- a/src/widgets/widgets/qtabwidget.h +++ b/src/widgets/widgets/qtabwidget.h @@ -94,7 +94,7 @@ public: QString tabToolTip(int index) const; #endif -#ifndef QT_NO_WHATSTHIS +#if QT_CONFIG(whatsthis) void setTabWhatsThis(int index, const QString &text); QString tabWhatsThis(int index) const; #endif diff --git a/src/widgets/widgets/qtextbrowser.cpp b/src/widgets/widgets/qtextbrowser.cpp index df92fc0e1e..902a6afb8a 100644 --- a/src/widgets/widgets/qtextbrowser.cpp +++ b/src/widgets/widgets/qtextbrowser.cpp @@ -52,7 +52,9 @@ #include #include #include +#if QT_CONFIG(whatsthis) #include +#endif #include #include @@ -307,7 +309,7 @@ void QTextBrowserPrivate::setSource(const QUrl &url) #ifndef QT_NO_CURSOR QApplication::restoreOverrideCursor(); #endif -#ifndef QT_NO_WHATSTHIS +#if QT_CONFIG(whatsthis) QWhatsThis::showText(QCursor::pos(), txt, q); #endif return; diff --git a/src/widgets/widgets/qtoolbutton.cpp b/src/widgets/widgets/qtoolbutton.cpp index 80a061e6d5..1d06f57d7b 100644 --- a/src/widgets/widgets/qtoolbutton.cpp +++ b/src/widgets/widgets/qtoolbutton.cpp @@ -922,7 +922,7 @@ void QToolButton::setDefaultAction(QAction *action) #ifndef QT_NO_STATUSTIP setStatusTip(action->statusTip()); #endif -#ifndef QT_NO_WHATSTHIS +#if QT_CONFIG(whatsthis) setWhatsThis(action->whatsThis()); #endif #ifndef QT_NO_MENU -- cgit v1.2.3 From 1ebe68b01f6ab7e32f4f383d979588842b050dfb Mon Sep 17 00:00:00 2001 From: Stephan Binner Date: Tue, 30 May 2017 20:25:50 +0200 Subject: Convert features.filedialog to QT_[REQUIRE_]CONFIG Change-Id: I9bc229b0d1430b81eeb2cfca2b24474736d5d561 Reviewed-by: Oswald Buddenhagen --- src/widgets/dialogs/dialogs.pri | 20 +++++++++++++------- src/widgets/dialogs/qdialog.cpp | 4 +++- src/widgets/dialogs/qfiledialog.cpp | 3 --- src/widgets/dialogs/qfiledialog.h | 8 ++------ src/widgets/dialogs/qfiledialog_p.h | 6 ++---- src/widgets/dialogs/qsidebar.cpp | 4 ---- src/widgets/dialogs/qsidebar_p.h | 4 +--- 7 files changed, 21 insertions(+), 28 deletions(-) (limited to 'src/widgets') diff --git a/src/widgets/dialogs/dialogs.pri b/src/widgets/dialogs/dialogs.pri index c9438696fa..584aef1da1 100644 --- a/src/widgets/dialogs/dialogs.pri +++ b/src/widgets/dialogs/dialogs.pri @@ -4,14 +4,11 @@ HEADERS += \ dialogs/qcolordialog.h \ dialogs/qfscompleter_p.h \ dialogs/qerrormessage.h \ - dialogs/qfiledialog.h \ - dialogs/qfiledialog_p.h \ dialogs/qfontdialog.h \ dialogs/qfontdialog_p.h \ dialogs/qinputdialog.h \ dialogs/qmessagebox.h \ dialogs/qprogressdialog.h \ - dialogs/qsidebar_p.h \ dialogs/qfilesystemmodel.h \ dialogs/qfilesystemmodel_p.h \ dialogs/qfileinfogatherer_p.h \ @@ -22,18 +19,14 @@ win32 { SOURCES += dialogs/qwizard_win.cpp } -FORMS += dialogs/qfiledialog.ui - INCLUDEPATH += $$PWD SOURCES += \ dialogs/qcolordialog.cpp \ dialogs/qerrormessage.cpp \ - dialogs/qfiledialog.cpp \ dialogs/qfontdialog.cpp \ dialogs/qinputdialog.cpp \ dialogs/qmessagebox.cpp \ dialogs/qprogressdialog.cpp \ - dialogs/qsidebar.cpp \ dialogs/qfilesystemmodel.cpp \ dialogs/qfileinfogatherer.cpp \ dialogs/qwizard.cpp \ @@ -47,4 +40,17 @@ qtConfig(dialog) { dialogs/qdialog.cpp } +qtConfig(filedialog) { + HEADERS += \ + dialogs/qfiledialog.h \ + dialogs/qfiledialog_p.h \ + dialogs/qsidebar_p.h + + SOURCES += \ + dialogs/qfiledialog.cpp \ + dialogs/qsidebar.cpp + + FORMS += dialogs/qfiledialog.ui +} + RESOURCES += dialogs/qmessagebox.qrc diff --git a/src/widgets/dialogs/qdialog.cpp b/src/widgets/dialogs/qdialog.cpp index a6e9cda8ce..6169951b49 100644 --- a/src/widgets/dialogs/qdialog.cpp +++ b/src/widgets/dialogs/qdialog.cpp @@ -39,7 +39,9 @@ #include "qcolordialog.h" #include "qfontdialog.h" +#if QT_CONFIG(filedialog) #include "qfiledialog.h" +#endif #include "qevent.h" #include "qdesktopwidget.h" @@ -64,7 +66,7 @@ QT_BEGIN_NAMESPACE static inline int themeDialogType(const QDialog *dialog) { -#ifndef QT_NO_FILEDIALOG +#if QT_CONFIG(filedialog) if (qobject_cast(dialog)) return QPlatformTheme::FileDialog; #endif diff --git a/src/widgets/dialogs/qfiledialog.cpp b/src/widgets/dialogs/qfiledialog.cpp index 98f8147236..5c4b42a470 100644 --- a/src/widgets/dialogs/qfiledialog.cpp +++ b/src/widgets/dialogs/qfiledialog.cpp @@ -43,7 +43,6 @@ #include #include "qfiledialog.h" -#ifndef QT_NO_FILEDIALOG #include "qfiledialog_p.h" #include #include @@ -4134,5 +4133,3 @@ QStringList QFSCompleter::splitPath(const QString &path) const QT_END_NAMESPACE #include "moc_qfiledialog.cpp" - -#endif // QT_NO_FILEDIALOG diff --git a/src/widgets/dialogs/qfiledialog.h b/src/widgets/dialogs/qfiledialog.h index 733dd03092..b9092e036d 100644 --- a/src/widgets/dialogs/qfiledialog.h +++ b/src/widgets/dialogs/qfiledialog.h @@ -44,13 +44,11 @@ #include #include #include - -#ifndef QT_NO_FILEDIALOG - #include -QT_BEGIN_NAMESPACE +QT_REQUIRE_CONFIG(filedialog); +QT_BEGIN_NAMESPACE class QModelIndex; class QItemSelection; @@ -316,6 +314,4 @@ Q_DECLARE_OPERATORS_FOR_FLAGS(QFileDialog::Options) QT_END_NAMESPACE -#endif // QT_NO_FILEDIALOG - #endif // QFILEDIALOG_H diff --git a/src/widgets/dialogs/qfiledialog_p.h b/src/widgets/dialogs/qfiledialog_p.h index d5df7542b6..d06a089e42 100644 --- a/src/widgets/dialogs/qfiledialog_p.h +++ b/src/widgets/dialogs/qfiledialog_p.h @@ -53,8 +53,6 @@ #include -#ifndef QT_NO_FILEDIALOG - #include "qfiledialog.h" #include "private/qdialog_p.h" #include "qplatformdefs.h" @@ -81,6 +79,8 @@ #include #endif +QT_REQUIRE_CONFIG(filedialog); + QT_BEGIN_NAMESPACE class QFileDialogListView; @@ -432,6 +432,4 @@ QString QFileDialogPrivate::selectedNameFilter_sys() const QT_END_NAMESPACE -#endif // QT_NO_FILEDIALOG - #endif // QFILEDIALOG_P_H diff --git a/src/widgets/dialogs/qsidebar.cpp b/src/widgets/dialogs/qsidebar.cpp index 9bb046db61..b8b042ddb5 100644 --- a/src/widgets/dialogs/qsidebar.cpp +++ b/src/widgets/dialogs/qsidebar.cpp @@ -40,8 +40,6 @@ #include "qsidebar_p.h" #include "qfilesystemmodel.h" -#ifndef QT_NO_FILEDIALOG - #include #include #include @@ -518,5 +516,3 @@ bool QSidebar::event(QEvent * event) QT_END_NAMESPACE #include "moc_qsidebar_p.cpp" - -#endif diff --git a/src/widgets/dialogs/qsidebar_p.h b/src/widgets/dialogs/qsidebar_p.h index ee57f2fb48..17d576e54d 100644 --- a/src/widgets/dialogs/qsidebar_p.h +++ b/src/widgets/dialogs/qsidebar_p.h @@ -58,7 +58,7 @@ #include #include -#ifndef QT_NO_FILEDIALOG +QT_REQUIRE_CONFIG(filedialog); QT_BEGIN_NAMESPACE @@ -159,7 +159,5 @@ private: QT_END_NAMESPACE -#endif // QT_NO_FILEDIALOG - #endif // QSIDEBAR_H -- cgit v1.2.3 From fd4f9c5e0cba786b34225718f9bb7bf1a1bafec1 Mon Sep 17 00:00:00 2001 From: Stephan Binner Date: Tue, 30 May 2017 20:43:59 +0200 Subject: Convert features.progressdialog to QT_[REQUIRE_]CONFIG Change-Id: Ic12a30480260e426f106baf7e2121889ea01db88 Reviewed-by: Oswald Buddenhagen --- src/widgets/dialogs/dialogs.pri | 7 +++++-- src/widgets/dialogs/qprogressdialog.cpp | 4 ---- src/widgets/dialogs/qprogressdialog.h | 7 ++----- 3 files changed, 7 insertions(+), 11 deletions(-) (limited to 'src/widgets') diff --git a/src/widgets/dialogs/dialogs.pri b/src/widgets/dialogs/dialogs.pri index 584aef1da1..9307a80009 100644 --- a/src/widgets/dialogs/dialogs.pri +++ b/src/widgets/dialogs/dialogs.pri @@ -8,7 +8,6 @@ HEADERS += \ dialogs/qfontdialog_p.h \ dialogs/qinputdialog.h \ dialogs/qmessagebox.h \ - dialogs/qprogressdialog.h \ dialogs/qfilesystemmodel.h \ dialogs/qfilesystemmodel_p.h \ dialogs/qfileinfogatherer_p.h \ @@ -26,7 +25,6 @@ SOURCES += \ dialogs/qfontdialog.cpp \ dialogs/qinputdialog.cpp \ dialogs/qmessagebox.cpp \ - dialogs/qprogressdialog.cpp \ dialogs/qfilesystemmodel.cpp \ dialogs/qfileinfogatherer.cpp \ dialogs/qwizard.cpp \ @@ -53,4 +51,9 @@ qtConfig(filedialog) { FORMS += dialogs/qfiledialog.ui } +qtConfig(progressdialog) { + HEADERS += dialogs/qprogressdialog.h + SOURCES += dialogs/qprogressdialog.cpp +} + RESOURCES += dialogs/qmessagebox.qrc diff --git a/src/widgets/dialogs/qprogressdialog.cpp b/src/widgets/dialogs/qprogressdialog.cpp index 26a8fcc92d..893920cbd9 100644 --- a/src/widgets/dialogs/qprogressdialog.cpp +++ b/src/widgets/dialogs/qprogressdialog.cpp @@ -39,8 +39,6 @@ #include "qprogressdialog.h" -#ifndef QT_NO_PROGRESSDIALOG - #include "qshortcut.h" #include "qpainter.h" #include "qdrawutil.h" @@ -886,5 +884,3 @@ void QProgressDialog::open(QObject *receiver, const char *member) QT_END_NAMESPACE #include "moc_qprogressdialog.cpp" - -#endif // QT_NO_PROGRESSDIALOG diff --git a/src/widgets/dialogs/qprogressdialog.h b/src/widgets/dialogs/qprogressdialog.h index f4e63fb088..902a4de5d2 100644 --- a/src/widgets/dialogs/qprogressdialog.h +++ b/src/widgets/dialogs/qprogressdialog.h @@ -42,12 +42,11 @@ #include -#ifndef QT_NO_PROGRESSDIALOG - #include -QT_BEGIN_NAMESPACE +QT_REQUIRE_CONFIG(progressdialog); +QT_BEGIN_NAMESPACE class QPushButton; class QLabel; @@ -130,6 +129,4 @@ private: QT_END_NAMESPACE -#endif // QT_NO_PROGRESSDIALOG - #endif // QPROGRESSDIALOG_H -- cgit v1.2.3 From 003dc8e29a89c18729fc696ea9ca224645e792fd Mon Sep 17 00:00:00 2001 From: Stephan Binner Date: Tue, 30 May 2017 20:52:39 +0200 Subject: Convert features.inputdialog to QT_[REQUIRE_]CONFIG Change-Id: Ie480efcfc1fdc00e2b2697cf4c5abb231b42cc0e Reviewed-by: Oswald Buddenhagen --- src/widgets/dialogs/dialogs.pri | 7 +++++-- src/widgets/dialogs/qfiledialog.cpp | 1 - src/widgets/dialogs/qinputdialog.cpp | 4 ---- src/widgets/dialogs/qinputdialog.h | 7 ++----- src/widgets/styles/qwindowsvistastyle.cpp | 12 ++++++------ 5 files changed, 13 insertions(+), 18 deletions(-) (limited to 'src/widgets') diff --git a/src/widgets/dialogs/dialogs.pri b/src/widgets/dialogs/dialogs.pri index 9307a80009..b745607c90 100644 --- a/src/widgets/dialogs/dialogs.pri +++ b/src/widgets/dialogs/dialogs.pri @@ -6,7 +6,6 @@ HEADERS += \ dialogs/qerrormessage.h \ dialogs/qfontdialog.h \ dialogs/qfontdialog_p.h \ - dialogs/qinputdialog.h \ dialogs/qmessagebox.h \ dialogs/qfilesystemmodel.h \ dialogs/qfilesystemmodel_p.h \ @@ -23,7 +22,6 @@ SOURCES += \ dialogs/qcolordialog.cpp \ dialogs/qerrormessage.cpp \ dialogs/qfontdialog.cpp \ - dialogs/qinputdialog.cpp \ dialogs/qmessagebox.cpp \ dialogs/qfilesystemmodel.cpp \ dialogs/qfileinfogatherer.cpp \ @@ -51,6 +49,11 @@ qtConfig(filedialog) { FORMS += dialogs/qfiledialog.ui } +qtConfig(inputdialog) { + HEADERS += dialogs/qinputdialog.h + SOURCES += dialogs/qinputdialog.cpp +} + qtConfig(progressdialog) { HEADERS += dialogs/qprogressdialog.h SOURCES += dialogs/qprogressdialog.cpp diff --git a/src/widgets/dialogs/qfiledialog.cpp b/src/widgets/dialogs/qfiledialog.cpp index 5c4b42a470..61ee933dc6 100644 --- a/src/widgets/dialogs/qfiledialog.cpp +++ b/src/widgets/dialogs/qfiledialog.cpp @@ -52,7 +52,6 @@ #include #include #include -#include #include #include #include diff --git a/src/widgets/dialogs/qinputdialog.cpp b/src/widgets/dialogs/qinputdialog.cpp index 47551ae6fd..04d13045e5 100644 --- a/src/widgets/dialogs/qinputdialog.cpp +++ b/src/widgets/dialogs/qinputdialog.cpp @@ -39,8 +39,6 @@ #include "qinputdialog.h" -#ifndef QT_NO_INPUTDIALOG - #include "qapplication.h" #include "qcombobox.h" #include "qdialogbuttonbox.h" @@ -1507,5 +1505,3 @@ QT_END_NAMESPACE #include "qinputdialog.moc" #include "moc_qinputdialog.cpp" - -#endif // QT_NO_INPUTDIALOG diff --git a/src/widgets/dialogs/qinputdialog.h b/src/widgets/dialogs/qinputdialog.h index 7b43e774a7..5f06785886 100644 --- a/src/widgets/dialogs/qinputdialog.h +++ b/src/widgets/dialogs/qinputdialog.h @@ -44,12 +44,11 @@ #include #include -#ifndef QT_NO_INPUTDIALOG - #include -QT_BEGIN_NAMESPACE +QT_REQUIRE_CONFIG(inputdialog); +QT_BEGIN_NAMESPACE class QInputDialogPrivate; @@ -212,6 +211,4 @@ Q_DECLARE_OPERATORS_FOR_FLAGS(QInputDialog::InputDialogOptions) QT_END_NAMESPACE -#endif // QT_NO_INPUTDIALOG - #endif // QINPUTDIALOG_H diff --git a/src/widgets/styles/qwindowsvistastyle.cpp b/src/widgets/styles/qwindowsvistastyle.cpp index a1aabc20c6..ae1b83957c 100644 --- a/src/widgets/styles/qwindowsvistastyle.cpp +++ b/src/widgets/styles/qwindowsvistastyle.cpp @@ -780,10 +780,10 @@ void QWindowsVistaStyle::drawPrimitive(PrimitiveElement element, const QStyleOpt if (qobject_cast (widget)) buttonBox = widget->findChild(QLatin1String("qt_msgbox_buttonbox")); -#ifndef QT_NO_INPUTDIALOG +#if QT_CONFIG(inputdialog) else if (qobject_cast (widget)) buttonBox = widget->findChild(QLatin1String("qt_inputdlg_buttonbox")); -#endif // QT_NO_INPUTDIALOG +#endif // QT_CONFIG(inputdialog) if (buttonBox) { //draw white panel part @@ -2324,7 +2324,7 @@ void QWindowsVistaStyle::polish(QWidget *widget) buttonBox->setContentsMargins(0, 9, 0, 0); #endif } -#ifndef QT_NO_INPUTDIALOG +#if QT_CONFIG(inputdialog) else if (qobject_cast (widget)) { widget->setAttribute(Qt::WA_StyledBackground); #if QT_CONFIG(dialogbuttonbox) @@ -2333,7 +2333,7 @@ void QWindowsVistaStyle::polish(QWidget *widget) buttonBox->setContentsMargins(0, 9, 0, 0); #endif } -#endif // QT_NO_INPUTDIALOG +#endif // QT_CONFIG(inputdialog) else if (QTreeView *tree = qobject_cast (widget)) { tree->viewport()->setAttribute(Qt::WA_Hover); } @@ -2368,7 +2368,7 @@ void QWindowsVistaStyle::unpolish(QWidget *widget) buttonBox->setContentsMargins(0, 0, 0, 0); #endif } -#ifndef QT_NO_INPUTDIALOG +#if QT_CONFIG(inputdialog) else if (qobject_cast (widget)) { widget->setAttribute(Qt::WA_StyledBackground, false); #if QT_CONFIG(dialogbuttonbox) @@ -2377,7 +2377,7 @@ void QWindowsVistaStyle::unpolish(QWidget *widget) buttonBox->setContentsMargins(0, 0, 0, 0); #endif } -#endif // QT_NO_INPUTDIALOG +#endif // QT_CONFIG(inputdialog) else if (QTreeView *tree = qobject_cast (widget)) { tree->viewport()->setAttribute(Qt::WA_Hover, false); } else if (qobject_cast(widget)) { -- cgit v1.2.3 From 63cc734abb7b31a73c60767b9af521783c102bd4 Mon Sep 17 00:00:00 2001 From: Stephan Binner Date: Wed, 31 May 2017 20:43:28 +0200 Subject: Convert features.messagebox to QT_[REQUIRE_]CONFIG Change-Id: Ie25dc672f8a675c06585c7757255f7dbadbfc5ec Reviewed-by: Oswald Buddenhagen --- src/widgets/dialogs/dialogs.pri | 10 ++++++---- src/widgets/dialogs/qdialog.cpp | 4 +++- src/widgets/dialogs/qerrormessage.cpp | 4 +++- src/widgets/dialogs/qfiledialog.cpp | 24 +++++++++++++----------- src/widgets/dialogs/qfilesystemmodel.cpp | 6 ++++-- src/widgets/dialogs/qmessagebox.cpp | 4 ---- src/widgets/dialogs/qmessagebox.h | 7 ++----- src/widgets/kernel/qapplication.cpp | 6 ++++-- 8 files changed, 35 insertions(+), 30 deletions(-) (limited to 'src/widgets') diff --git a/src/widgets/dialogs/dialogs.pri b/src/widgets/dialogs/dialogs.pri index b745607c90..1ea5403b79 100644 --- a/src/widgets/dialogs/dialogs.pri +++ b/src/widgets/dialogs/dialogs.pri @@ -6,7 +6,6 @@ HEADERS += \ dialogs/qerrormessage.h \ dialogs/qfontdialog.h \ dialogs/qfontdialog_p.h \ - dialogs/qmessagebox.h \ dialogs/qfilesystemmodel.h \ dialogs/qfilesystemmodel_p.h \ dialogs/qfileinfogatherer_p.h \ @@ -22,7 +21,6 @@ SOURCES += \ dialogs/qcolordialog.cpp \ dialogs/qerrormessage.cpp \ dialogs/qfontdialog.cpp \ - dialogs/qmessagebox.cpp \ dialogs/qfilesystemmodel.cpp \ dialogs/qfileinfogatherer.cpp \ dialogs/qwizard.cpp \ @@ -54,9 +52,13 @@ qtConfig(inputdialog) { SOURCES += dialogs/qinputdialog.cpp } +qtConfig(messagebox) { + HEADERS += dialogs/qmessagebox.h + SOURCES += dialogs/qmessagebox.cpp + RESOURCES += dialogs/qmessagebox.qrc +} + qtConfig(progressdialog) { HEADERS += dialogs/qprogressdialog.h SOURCES += dialogs/qprogressdialog.cpp } - -RESOURCES += dialogs/qmessagebox.qrc diff --git a/src/widgets/dialogs/qdialog.cpp b/src/widgets/dialogs/qdialog.cpp index 6169951b49..e1a38438d1 100644 --- a/src/widgets/dialogs/qdialog.cpp +++ b/src/widgets/dialogs/qdialog.cpp @@ -53,7 +53,9 @@ #endif #include "qmenu.h" #include "qcursor.h" +#if QT_CONFIG(messagebox) #include "qmessagebox.h" +#endif #include "qerrormessage.h" #include #include "private/qdialog_p.h" @@ -78,7 +80,7 @@ static inline int themeDialogType(const QDialog *dialog) if (qobject_cast(dialog)) return QPlatformTheme::FontDialog; #endif -#ifndef QT_NO_MESSAGEBOX +#if QT_CONFIG(messagebox) if (qobject_cast(dialog)) return QPlatformTheme::MessageDialog; #endif diff --git a/src/widgets/dialogs/qerrormessage.cpp b/src/widgets/dialogs/qerrormessage.cpp index 4ec4da6e1a..38f0954b1c 100644 --- a/src/widgets/dialogs/qerrormessage.cpp +++ b/src/widgets/dialogs/qerrormessage.cpp @@ -45,7 +45,9 @@ #include "qcheckbox.h" #include "qlabel.h" #include "qlayout.h" +#if QT_CONFIG(messagebox) #include "qmessagebox.h" +#endif #include "qpushbutton.h" #include "qstringlist.h" #include "qtextedit.h" @@ -234,7 +236,7 @@ QErrorMessage::QErrorMessage(QWidget * parent) grid->setColumnStretch(1, 42); grid->setRowStretch(0, 42); -#ifndef QT_NO_MESSAGEBOX +#if QT_CONFIG(messagebox) d->icon->setPixmap(QMessageBox::standardIcon(QMessageBox::Information)); d->icon->setAlignment(Qt::AlignHCenter | Qt::AlignTop); #endif diff --git a/src/widgets/dialogs/qfiledialog.cpp b/src/widgets/dialogs/qfiledialog.cpp index 61ee933dc6..0c609dc5f7 100644 --- a/src/widgets/dialogs/qfiledialog.cpp +++ b/src/widgets/dialogs/qfiledialog.cpp @@ -51,7 +51,9 @@ #include #include #include +#if QT_CONFIG(messagebox) #include +#endif #include #include #include @@ -2627,11 +2629,11 @@ void QFileDialog::accept() if (!info.exists()) info = QFileInfo(d->getEnvironmentVariable(fn)); if (!info.exists()) { -#ifndef QT_NO_MESSAGEBOX +#if QT_CONFIG(messagebox) QString message = tr("%1\nDirectory not found.\nPlease verify the " "correct directory name was given."); QMessageBox::warning(this, windowTitle(), message.arg(info.fileName())); -#endif // QT_NO_MESSAGEBOX +#endif // QT_CONFIG(messagebox) return; } if (info.isDir()) { @@ -2659,7 +2661,7 @@ void QFileDialog::accept() if (!info.exists() || !confirmOverwrite() || acceptMode() == AcceptOpen) { d->emitFilesSelected(QStringList(fn)); QDialog::accept(); -#ifndef QT_NO_MESSAGEBOX +#if QT_CONFIG(messagebox) } else { if (QMessageBox::warning(this, windowTitle(), tr("%1 already exists.\nDo you want to replace it?") @@ -2681,11 +2683,11 @@ void QFileDialog::accept() if (!info.exists()) info = QFileInfo(d->getEnvironmentVariable(file)); if (!info.exists()) { -#ifndef QT_NO_MESSAGEBOX +#if QT_CONFIG(messagebox) QString message = tr("%1\nFile not found.\nPlease verify the " "correct file name was given."); QMessageBox::warning(this, windowTitle(), message.arg(info.fileName())); -#endif // QT_NO_MESSAGEBOX +#endif // QT_CONFIG(messagebox) return; } if (info.isDir()) { @@ -3428,7 +3430,7 @@ void QFileDialogPrivate::_q_deleteCurrent() bool isDir = model->isDir(index); QFile::Permissions p(index.parent().data(QFileSystemModel::FilePermissions).toInt()); -#ifndef QT_NO_MESSAGEBOX +#if QT_CONFIG(messagebox) Q_Q(QFileDialog); if (!(p & QFile::WriteUser) && (QMessageBox::warning(q_func(), QFileDialog::tr("Delete"), QFileDialog::tr("'%1' is write protected.\nDo you want to delete it anyway?") @@ -3444,12 +3446,12 @@ void QFileDialogPrivate::_q_deleteCurrent() #else if (!(p & QFile::WriteUser)) return; -#endif // QT_NO_MESSAGEBOX +#endif // QT_CONFIG(messagebox) // the event loop has run, we can NOT reuse index because the model might have removed it. if (isDir) { if (!removeDirectory(filePath)) { -#ifndef QT_NO_MESSAGEBOX +#if QT_CONFIG(messagebox) QMessageBox::warning(q, q->windowTitle(), QFileDialog::tr("Could not delete directory.")); #endif @@ -3630,7 +3632,7 @@ void QFileDialogPrivate::_q_enterDirectory(const QModelIndex &index) */ void QFileDialogPrivate::_q_goToDirectory(const QString &path) { - #ifndef QT_NO_MESSAGEBOX + #if QT_CONFIG(messagebox) Q_Q(QFileDialog); #endif QModelIndex index = qFileDialogUi->lookInCombo->model()->index(qFileDialogUi->lookInCombo->currentIndex(), @@ -3649,12 +3651,12 @@ void QFileDialogPrivate::_q_goToDirectory(const QString &path) if (dir.exists() || path2.isEmpty() || path2 == model->myComputer().toString()) { _q_enterDirectory(index); -#ifndef QT_NO_MESSAGEBOX +#if QT_CONFIG(messagebox) } else { QString message = QFileDialog::tr("%1\nDirectory not found.\nPlease verify the " "correct directory name was given."); QMessageBox::warning(q, q->windowTitle(), message.arg(path2)); -#endif // QT_NO_MESSAGEBOX +#endif // QT_CONFIG(messagebox) } } diff --git a/src/widgets/dialogs/qfilesystemmodel.cpp b/src/widgets/dialogs/qfilesystemmodel.cpp index db1ce3fe0e..0ada9c6c58 100644 --- a/src/widgets/dialogs/qfilesystemmodel.cpp +++ b/src/widgets/dialogs/qfilesystemmodel.cpp @@ -43,7 +43,9 @@ #include #include #include +#if QT_CONFIG(messagebox) #include +#endif #include #include @@ -881,12 +883,12 @@ bool QFileSystemModel::setData(const QModelIndex &idx, const QVariant &value, in if (newName.isEmpty() || QDir::toNativeSeparators(newName).contains(QDir::separator()) || !QDir(parentPath).rename(oldName, newName)) { -#ifndef QT_NO_MESSAGEBOX +#if QT_CONFIG(messagebox) QMessageBox::information(0, QFileSystemModel::tr("Invalid filename"), QFileSystemModel::tr("The name \"%1\" can not be used.

Try using another name, with fewer characters or no punctuations marks.") .arg(newName), QMessageBox::Ok); -#endif // QT_NO_MESSAGEBOX +#endif // QT_CONFIG(messagebox) return false; } else { /* diff --git a/src/widgets/dialogs/qmessagebox.cpp b/src/widgets/dialogs/qmessagebox.cpp index 7a98fae99c..843a1bf341 100644 --- a/src/widgets/dialogs/qmessagebox.cpp +++ b/src/widgets/dialogs/qmessagebox.cpp @@ -39,8 +39,6 @@ #include -#ifndef QT_NO_MESSAGEBOX - #include #include "private/qlabel_p.h" #include "private/qapplication_p.h" @@ -2737,5 +2735,3 @@ QT_END_NAMESPACE #include "moc_qmessagebox.cpp" #include "qmessagebox.moc" - -#endif // QT_NO_MESSAGEBOX diff --git a/src/widgets/dialogs/qmessagebox.h b/src/widgets/dialogs/qmessagebox.h index 40e5c701fe..6d5179602b 100644 --- a/src/widgets/dialogs/qmessagebox.h +++ b/src/widgets/dialogs/qmessagebox.h @@ -42,12 +42,11 @@ #include -#ifndef QT_NO_MESSAGEBOX - #include -QT_BEGIN_NAMESPACE +QT_REQUIRE_CONFIG(messagebox); +QT_BEGIN_NAMESPACE class QLabel; class QMessageBoxPrivate; @@ -325,6 +324,4 @@ str)).arg(QString::fromLatin1(qVersion())); QMessageBox::critical(0, QApplicatio QT_END_NAMESPACE -#endif // QT_NO_MESSAGEBOX - #endif // QMESSAGEBOX_H diff --git a/src/widgets/kernel/qapplication.cpp b/src/widgets/kernel/qapplication.cpp index 01bd1c5033..9f90fe4d00 100644 --- a/src/widgets/kernel/qapplication.cpp +++ b/src/widgets/kernel/qapplication.cpp @@ -65,7 +65,9 @@ #include "qdebug.h" #include "private/qstylesheetstyle_p.h" #include "private/qstyle_p.h" +#if QT_CONFIG(messagebox) #include "qmessagebox.h" +#endif #include "qwidgetwindow_p.h" #include #include @@ -1916,9 +1918,9 @@ void QApplication::closeAllWindows() */ void QApplication::aboutQt() { -#ifndef QT_NO_MESSAGEBOX +#if QT_CONFIG(messagebox) QMessageBox::aboutQt(activeWindow()); -#endif // QT_NO_MESSAGEBOX +#endif // QT_CONFIG(messagebox) } /*! -- cgit v1.2.3 From bf6f91e527e0fec49a8cd82eb4b9a55ff3db6d98 Mon Sep 17 00:00:00 2001 From: Stephan Binner Date: Mon, 12 Jun 2017 08:44:53 +0200 Subject: Convert features.statustip to QT_CONFIG Change-Id: Ic719ab93ed1802fcc713885ad0421cb44c7a998b Reviewed-by: Oswald Buddenhagen --- src/widgets/itemviews/qabstractitemview.cpp | 6 +++--- src/widgets/itemviews/qheaderview.cpp | 4 ++-- src/widgets/itemviews/qtreewidget.h | 2 +- src/widgets/kernel/qaction.cpp | 2 +- src/widgets/kernel/qapplication.cpp | 2 +- src/widgets/kernel/qwidget.cpp | 8 ++++---- src/widgets/kernel/qwidget.h | 4 ++-- src/widgets/kernel/qwidget_p.h | 2 +- src/widgets/statemachine/qguistatemachine.cpp | 4 ++-- src/widgets/widgets/qmainwindow.cpp | 4 ++-- src/widgets/widgets/qmenu.cpp | 2 +- src/widgets/widgets/qmenubar.cpp | 4 ++-- src/widgets/widgets/qtoolbutton.cpp | 2 +- 13 files changed, 23 insertions(+), 23 deletions(-) (limited to 'src/widgets') diff --git a/src/widgets/itemviews/qabstractitemview.cpp b/src/widgets/itemviews/qabstractitemview.cpp index e8db228256..c8fdf06d64 100644 --- a/src/widgets/itemviews/qabstractitemview.cpp +++ b/src/widgets/itemviews/qabstractitemview.cpp @@ -173,7 +173,7 @@ void QAbstractItemViewPrivate::checkMouseMove(const QPersistentModelIndex &index if (index.isValid()) { emit q->entered(index); -#ifndef QT_NO_STATUSTIP +#if QT_CONFIG(statustip) QString statustip = model->data(index, Qt::StatusTipRole).toString(); if (parent && (shouldClearStatusTip || !statustip.isEmpty())) { QStatusTipEvent tip(statustip); @@ -182,7 +182,7 @@ void QAbstractItemViewPrivate::checkMouseMove(const QPersistentModelIndex &index } #endif } else { -#ifndef QT_NO_STATUSTIP +#if QT_CONFIG(statustip) if (parent && shouldClearStatusTip) { QString emptyString; QStatusTipEvent tip( emptyString ); @@ -1703,7 +1703,7 @@ bool QAbstractItemView::viewportEvent(QEvent *event) break; case QEvent::Leave: d->setHoverIndex(QModelIndex()); // If we've left, no hover should be needed anymore - #ifndef QT_NO_STATUSTIP + #if QT_CONFIG(statustip) if (d->shouldClearStatusTip && d->parent) { QString empty; QStatusTipEvent tip(empty); diff --git a/src/widgets/itemviews/qheaderview.cpp b/src/widgets/itemviews/qheaderview.cpp index c31b00959d..6a6991ebb8 100644 --- a/src/widgets/itemviews/qheaderview.cpp +++ b/src/widgets/itemviews/qheaderview.cpp @@ -2664,7 +2664,7 @@ bool QHeaderView::viewportEvent(QEvent *e) } break; } #endif // QT_CONFIG(whatsthis) -#ifndef QT_NO_STATUSTIP +#if QT_CONFIG(statustip) case QEvent::StatusTip: { QHelpEvent *he = static_cast(e); int logical = logicalIndexAt(he->pos()); @@ -2675,7 +2675,7 @@ bool QHeaderView::viewportEvent(QEvent *e) setStatusTip(statustip); } return true; } -#endif // QT_NO_STATUSTIP +#endif // QT_CONFIG(statustip) case QEvent::FontChange: case QEvent::StyleChange: d->invalidateCachedSizeHint(); diff --git a/src/widgets/itemviews/qtreewidget.h b/src/widgets/itemviews/qtreewidget.h index d258f76621..3bdeae08d8 100644 --- a/src/widgets/itemviews/qtreewidget.h +++ b/src/widgets/itemviews/qtreewidget.h @@ -224,7 +224,7 @@ inline void QTreeWidgetItem::setText(int column, const QString &atext) inline void QTreeWidgetItem::setIcon(int column, const QIcon &aicon) { setData(column, Qt::DecorationRole, aicon); } -#ifndef QT_NO_STATUSTIP +#if QT_CONFIG(statustip) inline void QTreeWidgetItem::setStatusTip(int column, const QString &astatusTip) { setData(column, Qt::StatusTipRole, astatusTip); } #endif diff --git a/src/widgets/kernel/qaction.cpp b/src/widgets/kernel/qaction.cpp index 4582a55394..7dd2f72f03 100644 --- a/src/widgets/kernel/qaction.cpp +++ b/src/widgets/kernel/qaction.cpp @@ -91,7 +91,7 @@ QActionPrivate::~QActionPrivate() bool QActionPrivate::showStatusText(QWidget *widget, const QString &str) { -#ifdef QT_NO_STATUSTIP +#if !QT_CONFIG(statustip) Q_UNUSED(widget); Q_UNUSED(str); #else diff --git a/src/widgets/kernel/qapplication.cpp b/src/widgets/kernel/qapplication.cpp index 9f90fe4d00..6536da4e90 100644 --- a/src/widgets/kernel/qapplication.cpp +++ b/src/widgets/kernel/qapplication.cpp @@ -3408,7 +3408,7 @@ bool QApplication::notify(QObject *receiver, QEvent *e) } break; #endif -#if !defined(QT_NO_STATUSTIP) || QT_CONFIG(whatsthis) +#if QT_CONFIG(statustip) || QT_CONFIG(whatsthis) case QEvent::StatusTip: case QEvent::WhatsThisClicked: { diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp index 3104f72e82..1265052281 100644 --- a/src/widgets/kernel/qwidget.cpp +++ b/src/widgets/kernel/qwidget.cpp @@ -8923,7 +8923,7 @@ bool QWidget::event(QEvent *event) break; case QEvent::Enter: -#ifndef QT_NO_STATUSTIP +#if QT_CONFIG(statustip) if (d->statusTip.size()) { QStatusTipEvent tip(d->statusTip); QApplication::sendEvent(const_cast(this), &tip); @@ -8933,7 +8933,7 @@ bool QWidget::event(QEvent *event) break; case QEvent::Leave: -#ifndef QT_NO_STATUSTIP +#if QT_CONFIG(statustip) if (d->statusTip.size()) { QString empty; QStatusTipEvent tip(empty); @@ -11559,7 +11559,7 @@ int QWidget::toolTipDuration() const #endif // QT_NO_TOOLTIP -#ifndef QT_NO_STATUSTIP +#if QT_CONFIG(statustip) /*! \property QWidget::statusTip \brief the widget's status tip @@ -11579,7 +11579,7 @@ QString QWidget::statusTip() const Q_D(const QWidget); return d->statusTip; } -#endif // QT_NO_STATUSTIP +#endif // QT_CONFIG(statustip) #if QT_CONFIG(whatsthis) /*! diff --git a/src/widgets/kernel/qwidget.h b/src/widgets/kernel/qwidget.h index 48bc120324..87a841c729 100644 --- a/src/widgets/kernel/qwidget.h +++ b/src/widgets/kernel/qwidget.h @@ -183,7 +183,7 @@ class Q_WIDGETS_EXPORT QWidget : public QObject, public QPaintDevice Q_PROPERTY(QString toolTip READ toolTip WRITE setToolTip) Q_PROPERTY(int toolTipDuration READ toolTipDuration WRITE setToolTipDuration) #endif -#ifndef QT_NO_STATUSTIP +#if QT_CONFIG(statustip) Q_PROPERTY(QString statusTip READ statusTip WRITE setStatusTip) #endif #if QT_CONFIG(whatsthis) @@ -386,7 +386,7 @@ public: void setToolTipDuration(int msec); int toolTipDuration() const; #endif -#ifndef QT_NO_STATUSTIP +#if QT_CONFIG(statustip) void setStatusTip(const QString &); QString statusTip() const; #endif diff --git a/src/widgets/kernel/qwidget_p.h b/src/widgets/kernel/qwidget_p.h index cc0940fc08..da3e9bd2f6 100644 --- a/src/widgets/kernel/qwidget_p.h +++ b/src/widgets/kernel/qwidget_p.h @@ -694,7 +694,7 @@ public: QString toolTip; int toolTipDuration; #endif -#ifndef QT_NO_STATUSTIP +#if QT_CONFIG(statustip) QString statusTip; #endif #if QT_CONFIG(whatsthis) diff --git a/src/widgets/statemachine/qguistatemachine.cpp b/src/widgets/statemachine/qguistatemachine.cpp index bbe723a55a..543011b754 100644 --- a/src/widgets/statemachine/qguistatemachine.cpp +++ b/src/widgets/statemachine/qguistatemachine.cpp @@ -223,10 +223,10 @@ static QEvent *cloneEvent(QEvent *e) return new QHelpEvent(*static_cast(e)); case QEvent::WhatsThis: return new QHelpEvent(*static_cast(e)); -#ifndef QT_NO_STATUSTIP +#if QT_CONFIG(statustip) case QEvent::StatusTip: return new QStatusTipEvent(*static_cast(e)); -#endif //QT_NO_STATUSTIP +#endif // QT_CONFIG(statustip) #ifndef QT_NO_ACTION case QEvent::ActionChanged: case QEvent::ActionAdded: diff --git a/src/widgets/widgets/qmainwindow.cpp b/src/widgets/widgets/qmainwindow.cpp index c9349ac72d..2cc7ce35da 100644 --- a/src/widgets/widgets/qmainwindow.cpp +++ b/src/widgets/widgets/qmainwindow.cpp @@ -1498,7 +1498,7 @@ bool QMainWindow::event(QEvent *event) } #endif -#ifndef QT_NO_STATUSTIP +#if QT_CONFIG(statustip) case QEvent::StatusTip: #ifndef QT_NO_STATUSBAR if (QStatusBar *sb = d->layout->statusBar()) @@ -1507,7 +1507,7 @@ bool QMainWindow::event(QEvent *event) #endif static_cast(event)->ignore(); return true; -#endif // QT_NO_STATUSTIP +#endif // QT_CONFIG(statustip) case QEvent::StyleChange: #ifndef QT_NO_DOCKWIDGET diff --git a/src/widgets/widgets/qmenu.cpp b/src/widgets/widgets/qmenu.cpp index 0b874cb09a..167a10efc3 100644 --- a/src/widgets/widgets/qmenu.cpp +++ b/src/widgets/widgets/qmenu.cpp @@ -657,7 +657,7 @@ void QMenuPrivate::setCurrentAction(QAction *action, int popup, SelectionReason } } } -#ifndef QT_NO_STATUSTIP +#if QT_CONFIG(statustip) } else if (previousAction) { previousAction->d_func()->showStatusText(topCausedWidget(), QString()); #endif diff --git a/src/widgets/widgets/qmenubar.cpp b/src/widgets/widgets/qmenubar.cpp index 8ec2a3ed94..552409a4ed 100644 --- a/src/widgets/widgets/qmenubar.cpp +++ b/src/widgets/widgets/qmenubar.cpp @@ -378,7 +378,7 @@ void QMenuBarPrivate::setCurrentAction(QAction *action, bool popup, bool activat q->update(actionRect(currentAction)); popupState = popup; -#ifndef QT_NO_STATUSTIP +#if QT_CONFIG(statustip) QAction *previousAction = currentAction; #endif currentAction = action; @@ -387,7 +387,7 @@ void QMenuBarPrivate::setCurrentAction(QAction *action, bool popup, bool activat if(popup) popupAction(action, activateFirst); q->update(actionRect(action)); -#ifndef QT_NO_STATUSTIP +#if QT_CONFIG(statustip) } else if (previousAction) { QString empty; QStatusTipEvent tip(empty); diff --git a/src/widgets/widgets/qtoolbutton.cpp b/src/widgets/widgets/qtoolbutton.cpp index 1d06f57d7b..13595575e6 100644 --- a/src/widgets/widgets/qtoolbutton.cpp +++ b/src/widgets/widgets/qtoolbutton.cpp @@ -919,7 +919,7 @@ void QToolButton::setDefaultAction(QAction *action) #ifndef QT_NO_TOOLTIP setToolTip(action->toolTip()); #endif -#ifndef QT_NO_STATUSTIP +#if QT_CONFIG(statustip) setStatusTip(action->statusTip()); #endif #if QT_CONFIG(whatsthis) -- cgit v1.2.3 From 3aed1fccda2e3bcc0d8328543ef511b411b230d6 Mon Sep 17 00:00:00 2001 From: Stephan Binner Date: Tue, 30 May 2017 21:25:32 +0200 Subject: Convert features.fontcombobox to QT_[REQUIRE_]CONFIG Change-Id: I98f85cdb3b1c1ceae010362a5d5747d62ba62a22 Reviewed-by: Oswald Buddenhagen --- src/widgets/widgets/qfontcombobox.cpp | 4 ---- src/widgets/widgets/qfontcombobox.h | 4 +--- src/widgets/widgets/widgets.pri | 7 +++++-- 3 files changed, 6 insertions(+), 9 deletions(-) (limited to 'src/widgets') diff --git a/src/widgets/widgets/qfontcombobox.cpp b/src/widgets/widgets/qfontcombobox.cpp index 9bd33409ae..f206d01999 100644 --- a/src/widgets/widgets/qfontcombobox.cpp +++ b/src/widgets/widgets/qfontcombobox.cpp @@ -39,8 +39,6 @@ #include "qfontcombobox.h" -#ifndef QT_NO_FONTCOMBOBOX - #include #include #include @@ -563,5 +561,3 @@ QT_END_NAMESPACE #include "qfontcombobox.moc" #include "moc_qfontcombobox.cpp" - -#endif // QT_NO_FONTCOMBOBOX diff --git a/src/widgets/widgets/qfontcombobox.h b/src/widgets/widgets/qfontcombobox.h index 983d5224dd..1e4555ce2d 100644 --- a/src/widgets/widgets/qfontcombobox.h +++ b/src/widgets/widgets/qfontcombobox.h @@ -44,11 +44,10 @@ #include #include -#ifndef QT_NO_FONTCOMBOBOX +QT_REQUIRE_CONFIG(fontcombobox); QT_BEGIN_NAMESPACE - class QFontComboBoxPrivate; class Q_WIDGETS_EXPORT QFontComboBox : public QComboBox @@ -101,5 +100,4 @@ Q_DECLARE_OPERATORS_FOR_FLAGS(QFontComboBox::FontFilters) QT_END_NAMESPACE -#endif // QT_NO_FONTCOMBOBOX #endif diff --git a/src/widgets/widgets/widgets.pri b/src/widgets/widgets/widgets.pri index 1779c8d183..726235ef4e 100644 --- a/src/widgets/widgets/widgets.pri +++ b/src/widgets/widgets/widgets.pri @@ -14,7 +14,6 @@ HEADERS += \ widgets/qdockwidget.h \ widgets/qdockwidget_p.h \ widgets/qdockarealayout_p.h \ - widgets/qfontcombobox.h \ widgets/qframe.h \ widgets/qframe_p.h \ widgets/qgroupbox.h \ @@ -78,7 +77,6 @@ SOURCES += \ widgets/qdockwidget.cpp \ widgets/qdockarealayout.cpp \ widgets/qeffects.cpp \ - widgets/qfontcombobox.cpp \ widgets/qframe.cpp \ widgets/qgroupbox.cpp \ widgets/qkeysequenceedit.cpp \ @@ -152,6 +150,11 @@ qtConfig(commandlinkbutton) { widgets/qcommandlinkbutton.cpp } +qtConfig(fontcombobox) { + HEADERS += widgets/qfontcombobox.h + SOURCES += widgets/qfontcombobox.cpp +} + qtConfig(label) { HEADERS += \ widgets/qlabel.h \ -- cgit v1.2.3 From fd897629bf698c9efb4628188db79f2937ef3d89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9rgio=20Martins?= Date: Tue, 13 Jun 2017 12:09:59 +0100 Subject: Fix moving a hidden QOpenGLWidget to another window A visibile QOpenGLWidget receives a QEvent::WindowChangeInternal which triggers a QOpenGLWidget::reset(). A hidden QOpenGLWidget never received this event so it was never reset, resulting in a black rendering. Includes unit-test that fails without this patch. Change-Id: I9d2c57d66fa629f631a9829a5ebf4de09998ad75 Task-Id: QTBUG-60896 Reviewed-by: Laszlo Agocs --- src/widgets/kernel/qopenglwidget.cpp | 2 ++ src/widgets/kernel/qwidget.cpp | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'src/widgets') diff --git a/src/widgets/kernel/qopenglwidget.cpp b/src/widgets/kernel/qopenglwidget.cpp index 9aab0bd76a..218d3c4a46 100644 --- a/src/widgets/kernel/qopenglwidget.cpp +++ b/src/widgets/kernel/qopenglwidget.cpp @@ -1342,6 +1342,8 @@ bool QOpenGLWidget::event(QEvent *e) break; if (d->initialized) d->reset(); + if (isHidden()) + break; // FALLTHROUGH case QEvent::Show: // reparenting may not lead to a resize so reinitalize on Show too if (!d->initialized && !size().isEmpty() && window() && window()->windowHandle()) { diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp index 1265052281..d4cbe81c2d 100644 --- a/src/widgets/kernel/qwidget.cpp +++ b/src/widgets/kernel/qwidget.cpp @@ -10511,7 +10511,7 @@ static void sendWindowChangeToTextureChildrenRecursively(QWidget *widget) for (int i = 0; i < d->children.size(); ++i) { QWidget *w = qobject_cast(d->children.at(i)); - if (w && !w->isWindow() && !w->isHidden() && QWidgetPrivate::get(w)->textureChildSeen) + if (w && !w->isWindow() && QWidgetPrivate::get(w)->textureChildSeen) sendWindowChangeToTextureChildrenRecursively(w); } } -- cgit v1.2.3 From 7a1b7c74209cdd26510edd440651b259897b8769 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9rgio=20Martins?= Date: Wed, 7 Jun 2017 09:58:01 +0100 Subject: docs: Reference QOpenGLWidget::grabFramebuffer, not QGLWidget::grabFrameBuffer QGLWidget is obsolete Change-Id: I8db3bfd534a328d41815d445557d899dc17d6061 Reviewed-by: Friedemann Kleint Reviewed-by: Laszlo Agocs --- src/widgets/kernel/qwidget.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/widgets') diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp index d4cbe81c2d..f1319d9cda 100644 --- a/src/widgets/kernel/qwidget.cpp +++ b/src/widgets/kernel/qwidget.cpp @@ -5133,8 +5133,11 @@ void qt_qpa_set_cursor(QWidget *w, bool force) \snippet code/src_gui_kernel_qwidget.cpp 8 - \note To obtain the contents of an OpenGL widget, use QGLWidget::grabFrameBuffer() - or QGLWidget::renderPixmap() instead. + \note To obtain the contents of a QOpenGLWidget, use QOpenGLWidget::grabFramebuffer() + instead. + + \note To obtain the contents of a QGLWidget (deprecated), use + QGLWidget::grabFrameBuffer() or QGLWidget::renderPixmap() instead. */ void QWidget::render(QPaintDevice *target, const QPoint &targetOffset, const QRegion &sourceRegion, RenderFlags renderFlags) -- cgit v1.2.3 From 3ab0ba7bf2b27f73b38a6f60181426c05f1d3af0 Mon Sep 17 00:00:00 2001 From: Stephan Binner Date: Wed, 31 May 2017 21:00:22 +0200 Subject: Convert features.colordialog to QT_[REQUIRE_]CONFIG Change-Id: If2ac57a10f38002db5a49be3882dfc507a84a3df Reviewed-by: Oswald Buddenhagen --- src/widgets/dialogs/dialogs.pri | 7 +++++-- src/widgets/dialogs/qcolordialog.cpp | 5 ----- src/widgets/dialogs/qcolordialog.h | 7 ++----- src/widgets/dialogs/qdialog.cpp | 5 ++++- 4 files changed, 11 insertions(+), 13 deletions(-) (limited to 'src/widgets') diff --git a/src/widgets/dialogs/dialogs.pri b/src/widgets/dialogs/dialogs.pri index 1ea5403b79..0ebb912ffc 100644 --- a/src/widgets/dialogs/dialogs.pri +++ b/src/widgets/dialogs/dialogs.pri @@ -1,7 +1,6 @@ # Qt dialogs module HEADERS += \ - dialogs/qcolordialog.h \ dialogs/qfscompleter_p.h \ dialogs/qerrormessage.h \ dialogs/qfontdialog.h \ @@ -18,13 +17,17 @@ win32 { INCLUDEPATH += $$PWD SOURCES += \ - dialogs/qcolordialog.cpp \ dialogs/qerrormessage.cpp \ dialogs/qfontdialog.cpp \ dialogs/qfilesystemmodel.cpp \ dialogs/qfileinfogatherer.cpp \ dialogs/qwizard.cpp \ +qtConfig(colordialog) { + HEADERS += dialogs/qcolordialog.h + SOURCES += dialogs/qcolordialog.cpp +} + qtConfig(dialog) { HEADERS += \ dialogs/qdialog.h \ diff --git a/src/widgets/dialogs/qcolordialog.cpp b/src/widgets/dialogs/qcolordialog.cpp index dbcd2d7fe2..f361770c3e 100644 --- a/src/widgets/dialogs/qcolordialog.cpp +++ b/src/widgets/dialogs/qcolordialog.cpp @@ -39,8 +39,6 @@ #include "qcolordialog.h" -#ifndef QT_NO_COLORDIALOG - #include "qapplication.h" #include "qdesktopwidget.h" #include "qdrawutil.h" @@ -2289,6 +2287,3 @@ QT_END_NAMESPACE #include "qcolordialog.moc" #include "moc_qcolordialog.cpp" - -#endif // QT_NO_COLORDIALOG - diff --git a/src/widgets/dialogs/qcolordialog.h b/src/widgets/dialogs/qcolordialog.h index fb5b843ce4..a27cfaf953 100644 --- a/src/widgets/dialogs/qcolordialog.h +++ b/src/widgets/dialogs/qcolordialog.h @@ -42,12 +42,11 @@ #include -#ifndef QT_NO_COLORDIALOG - #include -QT_BEGIN_NAMESPACE +QT_REQUIRE_CONFIG(colordialog); +QT_BEGIN_NAMESPACE class QColorDialogPrivate; @@ -127,6 +126,4 @@ Q_DECLARE_OPERATORS_FOR_FLAGS(QColorDialog::ColorDialogOptions) QT_END_NAMESPACE -#endif // QT_NO_COLORDIALOG - #endif // QCOLORDIALOG_H diff --git a/src/widgets/dialogs/qdialog.cpp b/src/widgets/dialogs/qdialog.cpp index e1a38438d1..851f195633 100644 --- a/src/widgets/dialogs/qdialog.cpp +++ b/src/widgets/dialogs/qdialog.cpp @@ -37,7 +37,10 @@ ** ****************************************************************************/ +#include +#if QT_CONFIG(colordialog) #include "qcolordialog.h" +#endif #include "qfontdialog.h" #if QT_CONFIG(filedialog) #include "qfiledialog.h" @@ -72,7 +75,7 @@ static inline int themeDialogType(const QDialog *dialog) if (qobject_cast(dialog)) return QPlatformTheme::FileDialog; #endif -#ifndef QT_NO_COLORDIALOG +#if QT_CONFIG(colordialog) if (qobject_cast(dialog)) return QPlatformTheme::ColorDialog; #endif -- cgit v1.2.3 From 330f0245898dd2c163a3a8b8dfb7b672cf8def3b Mon Sep 17 00:00:00 2001 From: Stephan Binner Date: Wed, 31 May 2017 21:28:32 +0200 Subject: Convert features.wizard to QT_[REQUIRE_]CONFIG Change-Id: I43e3d9f55a21ae0f602fc43c570321d0152cd8b6 Reviewed-by: Oswald Buddenhagen --- src/widgets/dialogs/dialogs.pri | 21 ++++++++++++--------- src/widgets/dialogs/qwizard.cpp | 4 ---- src/widgets/dialogs/qwizard.h | 8 ++------ src/widgets/dialogs/qwizard_win.cpp | 4 ---- src/widgets/dialogs/qwizard_win_p.h | 4 ++-- src/widgets/styles/qcommonstyle.cpp | 4 +++- src/widgets/styles/qfusionstyle.cpp | 4 +++- src/widgets/styles/qmacstyle_mac.mm | 4 +++- src/widgets/styles/qmacstyle_mac_p_p.h | 1 - src/widgets/styles/qwindowsstyle.cpp | 4 +++- 10 files changed, 28 insertions(+), 30 deletions(-) (limited to 'src/widgets') diff --git a/src/widgets/dialogs/dialogs.pri b/src/widgets/dialogs/dialogs.pri index 0ebb912ffc..718db3bb5d 100644 --- a/src/widgets/dialogs/dialogs.pri +++ b/src/widgets/dialogs/dialogs.pri @@ -7,21 +7,14 @@ HEADERS += \ dialogs/qfontdialog_p.h \ dialogs/qfilesystemmodel.h \ dialogs/qfilesystemmodel_p.h \ - dialogs/qfileinfogatherer_p.h \ - dialogs/qwizard.h - -win32 { - HEADERS += dialogs/qwizard_win_p.h - SOURCES += dialogs/qwizard_win.cpp -} + dialogs/qfileinfogatherer_p.h INCLUDEPATH += $$PWD SOURCES += \ dialogs/qerrormessage.cpp \ dialogs/qfontdialog.cpp \ dialogs/qfilesystemmodel.cpp \ - dialogs/qfileinfogatherer.cpp \ - dialogs/qwizard.cpp \ + dialogs/qfileinfogatherer.cpp qtConfig(colordialog) { HEADERS += dialogs/qcolordialog.h @@ -65,3 +58,13 @@ qtConfig(progressdialog) { HEADERS += dialogs/qprogressdialog.h SOURCES += dialogs/qprogressdialog.cpp } + +qtConfig(wizard) { + HEADERS += dialogs/qwizard.h + SOURCES += dialogs/qwizard.cpp + + win32 { + HEADERS += dialogs/qwizard_win_p.h + SOURCES += dialogs/qwizard_win.cpp + } +} diff --git a/src/widgets/dialogs/qwizard.cpp b/src/widgets/dialogs/qwizard.cpp index d1abbc85d2..432b6f1879 100644 --- a/src/widgets/dialogs/qwizard.cpp +++ b/src/widgets/dialogs/qwizard.cpp @@ -40,8 +40,6 @@ #include "qwizard.h" #include -#ifndef QT_NO_WIZARD - #include "qabstractspinbox.h" #include "qalgorithms.h" #include "qapplication.h" @@ -3987,5 +3985,3 @@ QWizard *QWizardPage::wizard() const QT_END_NAMESPACE #include "moc_qwizard.cpp" - -#endif // QT_NO_WIZARD diff --git a/src/widgets/dialogs/qwizard.h b/src/widgets/dialogs/qwizard.h index 3236ee90df..4d03bf91d4 100644 --- a/src/widgets/dialogs/qwizard.h +++ b/src/widgets/dialogs/qwizard.h @@ -41,13 +41,11 @@ #define QWIZARD_H #include - -#ifndef QT_NO_WIZARD - #include -QT_BEGIN_NAMESPACE +QT_REQUIRE_CONFIG(wizard); +QT_BEGIN_NAMESPACE class QAbstractButton; class QWizardPage; @@ -261,6 +259,4 @@ private: QT_END_NAMESPACE -#endif // QT_NO_WIZARD - #endif // QWIZARD_H diff --git a/src/widgets/dialogs/qwizard_win.cpp b/src/widgets/dialogs/qwizard_win.cpp index 4ab01aca66..666b192e9c 100644 --- a/src/widgets/dialogs/qwizard_win.cpp +++ b/src/widgets/dialogs/qwizard_win.cpp @@ -37,8 +37,6 @@ ** ****************************************************************************/ -#ifndef QT_NO_WIZARD - #include #if QT_CONFIG(style_windowsvista) @@ -724,5 +722,3 @@ int QVistaHelper::topOffset() QT_END_NAMESPACE #endif // style_windowsvista - -#endif // QT_NO_WIZARD diff --git a/src/widgets/dialogs/qwizard_win_p.h b/src/widgets/dialogs/qwizard_win_p.h index bbba53b879..f9122865c2 100644 --- a/src/widgets/dialogs/qwizard_win_p.h +++ b/src/widgets/dialogs/qwizard_win_p.h @@ -53,7 +53,6 @@ #include -#ifndef QT_NO_WIZARD #if QT_CONFIG(style_windowsvista) #include @@ -63,6 +62,8 @@ #include #include +QT_REQUIRE_CONFIG(wizard); + QT_BEGIN_NAMESPACE class QVistaBackButton : public QAbstractButton @@ -157,5 +158,4 @@ private: QT_END_NAMESPACE #endif // style_windowsvista -#endif // QT_NO_WIZARD #endif // QWIZARD_WIN_P_H diff --git a/src/widgets/styles/qcommonstyle.cpp b/src/widgets/styles/qcommonstyle.cpp index afcb50c866..ad3ba88756 100644 --- a/src/widgets/styles/qcommonstyle.cpp +++ b/src/widgets/styles/qcommonstyle.cpp @@ -74,7 +74,9 @@ #include #include #include +#if QT_CONFIG(wizard) #include +#endif #include #include #include @@ -5187,7 +5189,7 @@ int QCommonStyle::styleHint(StyleHint sh, const QStyleOption *opt, const QWidget vret->variant = fmt; } break; -#ifndef QT_NO_WIZARD +#if QT_CONFIG(wizard) case SH_WizardStyle: ret = QWizard::ClassicStyle; break; diff --git a/src/widgets/styles/qfusionstyle.cpp b/src/widgets/styles/qfusionstyle.cpp index dc703e3e8d..983413d149 100644 --- a/src/widgets/styles/qfusionstyle.cpp +++ b/src/widgets/styles/qfusionstyle.cpp @@ -65,7 +65,9 @@ #include #include #include +#if QT_CONFIG(wizard) #include +#endif #include #include #include @@ -3727,7 +3729,7 @@ int QFusionStyle::styleHint(StyleHint hint, const QStyleOption *option, const QW case SH_MessageBox_TextInteractionFlags: return Qt::TextSelectableByMouse | Qt::LinksAccessibleByMouse; -#ifndef QT_NO_WIZARD +#if QT_CONFIG(wizard) case SH_WizardStyle: return QWizard::ClassicStyle; #endif diff --git a/src/widgets/styles/qmacstyle_mac.mm b/src/widgets/styles/qmacstyle_mac.mm index cf2929db7e..147b2027bf 100644 --- a/src/widgets/styles/qmacstyle_mac.mm +++ b/src/widgets/styles/qmacstyle_mac.mm @@ -89,7 +89,9 @@ #include #include #include +#if QT_CONFIG(wizard) #include +#endif #include #include #include @@ -2990,7 +2992,7 @@ int QMacStyle::styleHint(StyleHint sh, const QStyleOption *opt, const QWidget *w case SH_FocusFrame_AboveWidget: ret = true; break; -#ifndef QT_NO_WIZARD +#if QT_CONFIG(wizard) case SH_WizardStyle: ret = QWizard::MacStyle; break; diff --git a/src/widgets/styles/qmacstyle_mac_p_p.h b/src/widgets/styles/qmacstyle_mac_p_p.h index e5d2ffdc9d..e16f17c67f 100644 --- a/src/widgets/styles/qmacstyle_mac_p_p.h +++ b/src/widgets/styles/qmacstyle_mac_p_p.h @@ -93,7 +93,6 @@ #include #include #include -#include #include #include #include diff --git a/src/widgets/styles/qwindowsstyle.cpp b/src/widgets/styles/qwindowsstyle.cpp index b537931f49..efbb972a06 100644 --- a/src/widgets/styles/qwindowsstyle.cpp +++ b/src/widgets/styles/qwindowsstyle.cpp @@ -60,7 +60,9 @@ #include "qfile.h" #include "qtextstream.h" #include "qpixmapcache.h" +#if QT_CONFIG(wizard) #include "qwizard.h" +#endif #include "qlistview.h" #include #include @@ -621,7 +623,7 @@ int QWindowsStyle::styleHint(StyleHint hint, const QStyleOption *opt, const QWid } break; #endif // QT_NO_RUBBERBAND -#ifndef QT_NO_WIZARD +#if QT_CONFIG(wizard) case SH_WizardStyle: ret = QWizard::ModernStyle; break; -- cgit v1.2.3 From 379179df9d172fd350f869c9f87391c05090187d Mon Sep 17 00:00:00 2001 From: Stephan Binner Date: Wed, 31 May 2017 22:08:27 +0200 Subject: Convert features.errormessage to QT_[REQUIRE_]CONFIG Change-Id: I9cc4f5190108c4bb96ddbd782ef1a031c9889f7e Reviewed-by: Oswald Buddenhagen --- src/widgets/dialogs/dialogs.pri | 7 +++++-- src/widgets/dialogs/qdialog.cpp | 4 +++- src/widgets/dialogs/qerrormessage.cpp | 4 ---- src/widgets/dialogs/qerrormessage.h | 7 ++----- 4 files changed, 10 insertions(+), 12 deletions(-) (limited to 'src/widgets') diff --git a/src/widgets/dialogs/dialogs.pri b/src/widgets/dialogs/dialogs.pri index 718db3bb5d..a9da465884 100644 --- a/src/widgets/dialogs/dialogs.pri +++ b/src/widgets/dialogs/dialogs.pri @@ -2,7 +2,6 @@ HEADERS += \ dialogs/qfscompleter_p.h \ - dialogs/qerrormessage.h \ dialogs/qfontdialog.h \ dialogs/qfontdialog_p.h \ dialogs/qfilesystemmodel.h \ @@ -11,7 +10,6 @@ HEADERS += \ INCLUDEPATH += $$PWD SOURCES += \ - dialogs/qerrormessage.cpp \ dialogs/qfontdialog.cpp \ dialogs/qfilesystemmodel.cpp \ dialogs/qfileinfogatherer.cpp @@ -30,6 +28,11 @@ qtConfig(dialog) { dialogs/qdialog.cpp } +qtConfig(errormessage) { + HEADERS += dialogs/qerrormessage.h + SOURCES += dialogs/qerrormessage.cpp +} + qtConfig(filedialog) { HEADERS += \ dialogs/qfiledialog.h \ diff --git a/src/widgets/dialogs/qdialog.cpp b/src/widgets/dialogs/qdialog.cpp index 851f195633..7cb24d65fc 100644 --- a/src/widgets/dialogs/qdialog.cpp +++ b/src/widgets/dialogs/qdialog.cpp @@ -59,7 +59,9 @@ #if QT_CONFIG(messagebox) #include "qmessagebox.h" #endif +#if QT_CONFIG(errormessage) #include "qerrormessage.h" +#endif #include #include "private/qdialog_p.h" #include "private/qguiapplication_p.h" @@ -87,7 +89,7 @@ static inline int themeDialogType(const QDialog *dialog) if (qobject_cast(dialog)) return QPlatformTheme::MessageDialog; #endif -#ifndef QT_NO_ERRORMESSAGE +#if QT_CONFIG(errormessage) if (qobject_cast(dialog)) return QPlatformTheme::MessageDialog; #endif diff --git a/src/widgets/dialogs/qerrormessage.cpp b/src/widgets/dialogs/qerrormessage.cpp index 38f0954b1c..39035b743d 100644 --- a/src/widgets/dialogs/qerrormessage.cpp +++ b/src/widgets/dialogs/qerrormessage.cpp @@ -39,8 +39,6 @@ #include "qerrormessage.h" -#ifndef QT_NO_ERRORMESSAGE - #include "qapplication.h" #include "qcheckbox.h" #include "qlabel.h" @@ -392,5 +390,3 @@ void QErrorMessagePrivate::retranslateStrings() QT_END_NAMESPACE #include "moc_qerrormessage.cpp" - -#endif // QT_NO_ERRORMESSAGE diff --git a/src/widgets/dialogs/qerrormessage.h b/src/widgets/dialogs/qerrormessage.h index 976ba9abd5..4cb1fad845 100644 --- a/src/widgets/dialogs/qerrormessage.h +++ b/src/widgets/dialogs/qerrormessage.h @@ -42,12 +42,11 @@ #include -#ifndef QT_NO_ERRORMESSAGE - #include -QT_BEGIN_NAMESPACE +QT_REQUIRE_CONFIG(errormessage); +QT_BEGIN_NAMESPACE class QErrorMessagePrivate; @@ -75,6 +74,4 @@ private: QT_END_NAMESPACE -#endif // QT_NO_ERRORMESSAGE - #endif // QERRORMESSAGE_H -- cgit v1.2.3 From 341554e34393199d8f6ba401df1fab0bfbb10188 Mon Sep 17 00:00:00 2001 From: Stephan Binner Date: Wed, 31 May 2017 22:34:24 +0200 Subject: Convert features.fscompleter to QT_[REQUIRE_]CONFIG Fix one #include as only QCompleter is used and not QFSCompleter. Change-Id: Ia1e722122f7e322c678d2db6962c6086c684ddd9 Reviewed-by: Oswald Buddenhagen --- src/widgets/dialogs/dialogs.pri | 5 ++++- src/widgets/dialogs/qfiledialog.cpp | 16 ++++++++-------- src/widgets/dialogs/qfiledialog_p.h | 6 ++++-- src/widgets/dialogs/qfscompleter_p.h | 6 ++---- 4 files changed, 18 insertions(+), 15 deletions(-) (limited to 'src/widgets') diff --git a/src/widgets/dialogs/dialogs.pri b/src/widgets/dialogs/dialogs.pri index a9da465884..f072576acc 100644 --- a/src/widgets/dialogs/dialogs.pri +++ b/src/widgets/dialogs/dialogs.pri @@ -1,7 +1,6 @@ # Qt dialogs module HEADERS += \ - dialogs/qfscompleter_p.h \ dialogs/qfontdialog.h \ dialogs/qfontdialog_p.h \ dialogs/qfilesystemmodel.h \ @@ -46,6 +45,10 @@ qtConfig(filedialog) { FORMS += dialogs/qfiledialog.ui } +qtConfig(fscompleter) { + HEADERS += dialogs/qfscompleter_p.h +} + qtConfig(inputdialog) { HEADERS += dialogs/qinputdialog.h SOURCES += dialogs/qinputdialog.cpp diff --git a/src/widgets/dialogs/qfiledialog.cpp b/src/widgets/dialogs/qfiledialog.cpp index 0c609dc5f7..b638adeaec 100644 --- a/src/widgets/dialogs/qfiledialog.cpp +++ b/src/widgets/dialogs/qfiledialog.cpp @@ -841,7 +841,7 @@ void QFileDialog::setVisible(bool visible) // Set WA_DontShowOnScreen so that QDialog::setVisible(visible) below // updates the state correctly, but skips showing the non-native version: setAttribute(Qt::WA_DontShowOnScreen); -#ifndef QT_NO_FSCOMPLETER +#if QT_CONFIG(fscompleter) // So the completer doesn't try to complete and therefore show a popup if (!d->nativeDialogInUse) d->completer->setModel(0); @@ -849,7 +849,7 @@ void QFileDialog::setVisible(bool visible) } else { d->createWidgets(); setAttribute(Qt::WA_DontShowOnScreen, false); -#ifndef QT_NO_FSCOMPLETER +#if QT_CONFIG(fscompleter) if (!d->nativeDialogInUse) { if (d->proxyModel != 0) d->completer->setModel(d->proxyModel); @@ -922,7 +922,7 @@ void QFileDialog::setDirectory(const QString &directory) if (!d->nativeDialogInUse) { d->qFileDialogUi->newFolderButton->setEnabled(d->model->flags(root) & Qt::ItemIsDropEnabled); if (root != d->rootIndex()) { -#ifndef QT_NO_FSCOMPLETER +#if QT_CONFIG(fscompleter) if (directory.endsWith(QLatin1Char('/'))) d->completer->setCompletionPrefix(newDirectory); else @@ -2909,10 +2909,10 @@ void QFileDialogPrivate::createWidgets() #ifndef QT_NO_SHORTCUT qFileDialogUi->fileNameLabel->setBuddy(qFileDialogUi->fileNameEdit); #endif -#ifndef QT_NO_FSCOMPLETER +#if QT_CONFIG(fscompleter) completer = new QFSCompleter(model, q); qFileDialogUi->fileNameEdit->setCompleter(completer); -#endif // QT_NO_FSCOMPLETER +#endif // QT_CONFIG(fscompleter) qFileDialogUi->fileNameEdit->setInputMethodHints(Qt::ImhNoPredictiveText); @@ -3078,7 +3078,7 @@ void QFileDialog::setProxyModel(QAbstractProxyModel *proxyModel) proxyModel->setSourceModel(d->model); d->qFileDialogUi->listView->setModel(d->proxyModel); d->qFileDialogUi->treeView->setModel(d->proxyModel); -#ifndef QT_NO_FSCOMPLETER +#if QT_CONFIG(fscompleter) d->completer->setModel(d->proxyModel); d->completer->proxyModel = d->proxyModel; #endif @@ -3088,7 +3088,7 @@ void QFileDialog::setProxyModel(QAbstractProxyModel *proxyModel) d->proxyModel = 0; d->qFileDialogUi->listView->setModel(d->model); d->qFileDialogUi->treeView->setModel(d->model); -#ifndef QT_NO_FSCOMPLETER +#if QT_CONFIG(fscompleter) d->completer->setModel(d->model); d->completer->sourceModel = d->model; d->completer->proxyModel = 0; @@ -4028,7 +4028,7 @@ void QFileDialogLineEdit::keyPressEvent(QKeyEvent *e) e->accept(); } -#ifndef QT_NO_FSCOMPLETER +#if QT_CONFIG(fscompleter) QString QFSCompleter::pathFromIndex(const QModelIndex &index) const { diff --git a/src/widgets/dialogs/qfiledialog_p.h b/src/widgets/dialogs/qfiledialog_p.h index d06a089e42..f7a3c6b091 100644 --- a/src/widgets/dialogs/qfiledialog_p.h +++ b/src/widgets/dialogs/qfiledialog_p.h @@ -73,7 +73,9 @@ #include #include #include "qsidebar_p.h" +#if QT_CONFIG(fscompleter) #include "qfscompleter_p.h" +#endif #if defined (Q_OS_UNIX) #include @@ -231,9 +233,9 @@ public: QStringList watching; QFileSystemModel *model; -#ifndef QT_NO_FSCOMPLETER +#if QT_CONFIG(fscompleter) QFSCompleter *completer; -#endif //QT_NO_FSCOMPLETER +#endif //QT_CONFIG(fscompleter) QString setWindowTitle; diff --git a/src/widgets/dialogs/qfscompleter_p.h b/src/widgets/dialogs/qfscompleter_p.h index c073fa1521..ce0612f293 100644 --- a/src/widgets/dialogs/qfscompleter_p.h +++ b/src/widgets/dialogs/qfscompleter_p.h @@ -55,9 +55,9 @@ #include "qcompleter.h" #include -QT_BEGIN_NAMESPACE +QT_REQUIRE_CONFIG(fscompleter); -#ifndef QT_NO_FSCOMPLETER +QT_BEGIN_NAMESPACE /*! QCompleter that can deal with QFileSystemModel @@ -78,8 +78,6 @@ public: QFileSystemModel *sourceModel; }; -#endif // QT_NO_FSCOMPLETER - QT_END_NAMESPACE #endif // QFSCOMPLETOR_P_H -- cgit v1.2.3 From 2fb9705521bc2879dc89b54c1488d6a20a310d85 Mon Sep 17 00:00:00 2001 From: Stephan Binner Date: Wed, 31 May 2017 23:08:35 +0200 Subject: Convert features.filesystemmodel to QT_[REQUIRE_]CONFIG Change-Id: I862510387e79d04221ec075f3e79896908ee9d8f Reviewed-by: Oswald Buddenhagen --- src/widgets/dialogs/dialogs.pri | 20 +++++++++++++------- src/widgets/dialogs/qfileinfogatherer.cpp | 4 ---- src/widgets/dialogs/qfileinfogatherer_p.h | 7 ++----- src/widgets/dialogs/qfilesystemmodel.cpp | 4 ---- src/widgets/dialogs/qfilesystemmodel.h | 8 ++------ src/widgets/dialogs/qfilesystemmodel_p.h | 6 ++---- src/widgets/util/qcompleter.cpp | 18 ++++++++++-------- 7 files changed, 29 insertions(+), 38 deletions(-) (limited to 'src/widgets') diff --git a/src/widgets/dialogs/dialogs.pri b/src/widgets/dialogs/dialogs.pri index f072576acc..c2625ec1f4 100644 --- a/src/widgets/dialogs/dialogs.pri +++ b/src/widgets/dialogs/dialogs.pri @@ -2,16 +2,11 @@ HEADERS += \ dialogs/qfontdialog.h \ - dialogs/qfontdialog_p.h \ - dialogs/qfilesystemmodel.h \ - dialogs/qfilesystemmodel_p.h \ - dialogs/qfileinfogatherer_p.h + dialogs/qfontdialog_p.h INCLUDEPATH += $$PWD SOURCES += \ - dialogs/qfontdialog.cpp \ - dialogs/qfilesystemmodel.cpp \ - dialogs/qfileinfogatherer.cpp + dialogs/qfontdialog.cpp qtConfig(colordialog) { HEADERS += dialogs/qcolordialog.h @@ -45,6 +40,17 @@ qtConfig(filedialog) { FORMS += dialogs/qfiledialog.ui } +qtConfig(filesystemmodel) { + HEADERS += \ + dialogs/qfilesystemmodel.h \ + dialogs/qfilesystemmodel_p.h \ + dialogs/qfileinfogatherer_p.h + + SOURCES += \ + dialogs/qfilesystemmodel.cpp \ + dialogs/qfileinfogatherer.cpp +} + qtConfig(fscompleter) { HEADERS += dialogs/qfscompleter_p.h } diff --git a/src/widgets/dialogs/qfileinfogatherer.cpp b/src/widgets/dialogs/qfileinfogatherer.cpp index 08c5a40c7c..9f2d15d31b 100644 --- a/src/widgets/dialogs/qfileinfogatherer.cpp +++ b/src/widgets/dialogs/qfileinfogatherer.cpp @@ -50,8 +50,6 @@ QT_BEGIN_NAMESPACE -#ifndef QT_NO_FILESYSTEMMODEL - #ifdef QT_BUILD_INTERNAL static QBasicAtomicInt fetchedRoot = Q_BASIC_ATOMIC_INITIALIZER(false); Q_AUTOTEST_EXPORT void qt_test_resetFetchedRoot() @@ -366,8 +364,6 @@ void QFileInfoGatherer::fetch(const QFileInfo &fileInfo, QElapsedTimer &base, bo } } -#endif // QT_NO_FILESYSTEMMODEL - QT_END_NAMESPACE #include "moc_qfileinfogatherer_p.cpp" diff --git a/src/widgets/dialogs/qfileinfogatherer_p.h b/src/widgets/dialogs/qfileinfogatherer_p.h index 0018b6c387..52578126de 100644 --- a/src/widgets/dialogs/qfileinfogatherer_p.h +++ b/src/widgets/dialogs/qfileinfogatherer_p.h @@ -66,6 +66,8 @@ #include +QT_REQUIRE_CONFIG(filesystemmodel); + QT_BEGIN_NAMESPACE class QExtendedInformation { @@ -150,8 +152,6 @@ private : class QFileIconProvider; -#ifndef QT_NO_FILESYSTEMMODEL - class Q_AUTOTEST_EXPORT QFileInfoGatherer : public QThread { Q_OBJECT @@ -208,9 +208,6 @@ private: QFileIconProvider *m_iconProvider; // not accessed by run() QFileIconProvider defaultProvider; }; -#endif // QT_NO_FILESYSTEMMODEL - QT_END_NAMESPACE #endif // QFILEINFOGATHERER_H - diff --git a/src/widgets/dialogs/qfilesystemmodel.cpp b/src/widgets/dialogs/qfilesystemmodel.cpp index 0ada9c6c58..63b5cf7aaf 100644 --- a/src/widgets/dialogs/qfilesystemmodel.cpp +++ b/src/widgets/dialogs/qfilesystemmodel.cpp @@ -58,8 +58,6 @@ QT_BEGIN_NAMESPACE -#ifndef QT_NO_FILESYSTEMMODEL - /*! \enum QFileSystemModel::Roles \value FileIconRole @@ -1995,5 +1993,3 @@ bool QFileSystemModelPrivate::passNameFilters(const QFileSystemNode *node) const QT_END_NAMESPACE #include "moc_qfilesystemmodel.cpp" - -#endif // QT_NO_FILESYSTEMMODEL diff --git a/src/widgets/dialogs/qfilesystemmodel.h b/src/widgets/dialogs/qfilesystemmodel.h index 7d790124c8..a5f23c9220 100644 --- a/src/widgets/dialogs/qfilesystemmodel.h +++ b/src/widgets/dialogs/qfilesystemmodel.h @@ -47,10 +47,9 @@ #include #include -QT_BEGIN_NAMESPACE - +QT_REQUIRE_CONFIG(filesystemmodel); -#ifndef QT_NO_FILESYSTEMMODEL +QT_BEGIN_NAMESPACE class ExtendedInformation; class QFileSystemModelPrivate; @@ -166,9 +165,6 @@ inline QString QFileSystemModel::fileName(const QModelIndex &aindex) const inline QIcon QFileSystemModel::fileIcon(const QModelIndex &aindex) const { return qvariant_cast(aindex.data(Qt::DecorationRole)); } -#endif // QT_NO_FILESYSTEMMODEL - QT_END_NAMESPACE #endif // QFILESYSTEMMODEL_H - diff --git a/src/widgets/dialogs/qfilesystemmodel_p.h b/src/widgets/dialogs/qfilesystemmodel_p.h index e7149a3097..640225529b 100644 --- a/src/widgets/dialogs/qfilesystemmodel_p.h +++ b/src/widgets/dialogs/qfilesystemmodel_p.h @@ -54,8 +54,6 @@ #include #include "qfilesystemmodel.h" -#ifndef QT_NO_FILESYSTEMMODEL - #include #include #include "qfileinfogatherer_p.h" @@ -66,6 +64,8 @@ #include #include +QT_REQUIRE_CONFIG(filesystemmodel); + QT_BEGIN_NAMESPACE class ExtendedInformation; @@ -313,9 +313,7 @@ public: }; Q_DECLARE_TYPEINFO(QFileSystemModelPrivate::Fetching, Q_MOVABLE_TYPE); -#endif // QT_NO_FILESYSTEMMODEL QT_END_NAMESPACE #endif - diff --git a/src/widgets/util/qcompleter.cpp b/src/widgets/util/qcompleter.cpp index 5a31eb4e52..c412c4cbd5 100644 --- a/src/widgets/util/qcompleter.cpp +++ b/src/widgets/util/qcompleter.cpp @@ -148,7 +148,9 @@ #include "QtWidgets/qscrollbar.h" #include "QtCore/qstringlistmodel.h" #include "QtWidgets/qdirmodel.h" +#if QT_CONFIG(filesystemmodel) #include "QtWidgets/qfilesystemmodel.h" +#endif #include "QtWidgets/qheaderview.h" #include "QtWidgets/qlistview.h" #include "QtWidgets/qapplication.h" @@ -467,7 +469,7 @@ QMatchData QCompletionEngine::filterHistory() const bool isDirModel = false; #endif Q_UNUSED(isDirModel) -#ifndef QT_NO_FILESYSTEMMODEL +#if QT_CONFIG(filesystemmodel) const bool isFsModel = (qobject_cast(source) != 0); #else const bool isFsModel = false; @@ -872,7 +874,7 @@ void QCompleterPrivate::_q_complete(QModelIndex index, bool highlighted) completion += QDir::separator(); } #endif -#ifndef QT_NO_FILESYSTEMMODEL +#if QT_CONFIG(filesystemmodel) // add a trailing separator in inline if (mode == QCompleter::InlineCompletion) { if (qobject_cast(proxy->sourceModel()) && QFileInfo(completion).isDir()) @@ -1044,7 +1046,7 @@ void QCompleter::setModel(QAbstractItemModel *model) { Q_D(QCompleter); QAbstractItemModel *oldModel = d->proxy->sourceModel(); -#ifndef QT_NO_FILESYSTEMMODEL +#if QT_CONFIG(filesystemmodel) if (qobject_cast(oldModel)) setCompletionRole(Qt::EditRole); // QTBUG-54642, clear FileNameRole set by QFileSystemModel #endif @@ -1062,7 +1064,7 @@ void QCompleter::setModel(QAbstractItemModel *model) #endif } #endif // QT_NO_DIRMODEL -#ifndef QT_NO_FILESYSTEMMODEL +#if QT_CONFIG(filesystemmodel) QFileSystemModel *fsModel = qobject_cast(model); if (fsModel) { #if defined(Q_OS_WIN) @@ -1073,7 +1075,7 @@ void QCompleter::setModel(QAbstractItemModel *model) setCompletionRole(QFileSystemModel::FileNameRole); connect(fsModel, SIGNAL(directoryLoaded(QString)), this, SLOT(_q_fileSystemModelDirectoryLoaded(QString))); } -#endif // QT_NO_FILESYSTEMMODEL +#endif // QT_CONFIG(filesystemmodel) } /*! @@ -1770,7 +1772,7 @@ QString QCompleter::pathFromIndex(const QModelIndex& index) const #ifndef QT_NO_DIRMODEL isDirModel = qobject_cast(d->proxy->sourceModel()) != 0; #endif -#ifndef QT_NO_FILESYSTEMMODEL +#if QT_CONFIG(filesystemmodel) isFsModel = qobject_cast(d->proxy->sourceModel()) != 0; #endif if (!isDirModel && !isFsModel) @@ -1782,7 +1784,7 @@ QString QCompleter::pathFromIndex(const QModelIndex& index) const QString t; if (isDirModel) t = sourceModel->data(idx, Qt::EditRole).toString(); -#ifndef QT_NO_FILESYSTEMMODEL +#if QT_CONFIG(filesystemmodel) else t = sourceModel->data(idx, QFileSystemModel::FileNameRole).toString(); #endif @@ -1820,7 +1822,7 @@ QStringList QCompleter::splitPath(const QString& path) const Q_D(const QCompleter); isDirModel = qobject_cast(d->proxy->sourceModel()) != 0; #endif -#ifndef QT_NO_FILESYSTEMMODEL +#if QT_CONFIG(filesystemmodel) #ifdef QT_NO_DIRMODEL Q_D(const QCompleter); #endif -- cgit v1.2.3