diff options
author | Stephan Binner <stephan.binner@basyskom.com> | 2017-09-02 20:54:40 +0200 |
---|---|---|
committer | Stephan Binner <stephan.binner@basyskom.com> | 2017-09-12 18:13:14 +0000 |
commit | 710a9180c19994028fe35c4a2624ca643ca4ec8b (patch) | |
tree | 8575ebd3b776f8bccd4cac9796a477ef27a42c94 /src/widgets/styles | |
parent | df99fbdbedec36aecf5ca67d368966b9dfd9e2e9 (diff) |
Convert features.lineedit to QT_[REQUIRE_]CONFIG
Change-Id: I509977994b11a7fc0c109bfcc83aadeee6c9b0b8
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Diffstat (limited to 'src/widgets/styles')
-rw-r--r-- | src/widgets/styles/qcommonstyle.cpp | 4 | ||||
-rw-r--r-- | src/widgets/styles/qmacstyle_mac.mm | 6 | ||||
-rw-r--r-- | src/widgets/styles/qmacstyle_mac_p_p.h | 2 | ||||
-rw-r--r-- | src/widgets/styles/qstylesheetstyle.cpp | 10 | ||||
-rw-r--r-- | src/widgets/styles/qwindowsvistastyle.cpp | 8 | ||||
-rw-r--r-- | src/widgets/styles/qwindowsvistastyle_p_p.h | 2 |
6 files changed, 20 insertions, 12 deletions
diff --git a/src/widgets/styles/qcommonstyle.cpp b/src/widgets/styles/qcommonstyle.cpp index 4389598c26..378439b994 100644 --- a/src/widgets/styles/qcommonstyle.cpp +++ b/src/widgets/styles/qcommonstyle.cpp @@ -611,7 +611,7 @@ void QCommonStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, Q } break; #endif // QT_CONFIG(tabbar) -#ifndef QT_NO_LINEEDIT +#if QT_CONFIG(lineedit) case PE_PanelLineEdit: if (const QStyleOptionFrame *panel = qstyleoption_cast<const QStyleOptionFrame *>(opt)) { p->fillRect(panel->rect.adjusted(panel->lineWidth, panel->lineWidth, -panel->lineWidth, -panel->lineWidth), @@ -621,7 +621,7 @@ void QCommonStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, Q proxy()->drawPrimitive(PE_FrameLineEdit, panel, p, widget); } break; -#endif // QT_NO_LINEEDIT +#endif // QT_CONFIG(lineedit) #if QT_CONFIG(columnview) case PE_IndicatorColumnViewArrow: { if (const QStyleOptionViewItem *viewOpt = qstyleoption_cast<const QStyleOptionViewItem *>(opt)) { diff --git a/src/widgets/styles/qmacstyle_mac.mm b/src/widgets/styles/qmacstyle_mac.mm index 28fe39c347..cb80a49422 100644 --- a/src/widgets/styles/qmacstyle_mac.mm +++ b/src/widgets/styles/qmacstyle_mac.mm @@ -73,7 +73,9 @@ #include <qgroupbox.h> #include <qhash.h> #include <qheaderview.h> +#if QT_CONFIG(lineedit) #include <qlineedit.h> +#endif #if QT_CONFIG(mainwindow) #include <qmainwindow.h> #endif @@ -679,7 +681,7 @@ static QSize qt_aqua_get_known_size(QStyle::ContentsType ct, const QWidget *widg else if (qobject_cast<const QProgressBar *>(widg)) ct = QStyle::CT_ProgressBar; #endif -#ifndef QT_NO_LINEEDIT +#if QT_CONFIG(lineedit) else if (qobject_cast<const QLineEdit *>(widg)) ct = QStyle::CT_LineEdit; #endif @@ -3573,7 +3575,7 @@ void QMacStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QPai // Draw the focus frame for widgets other than QLineEdit (e.g. for line edits in Webkit). // Focus frame is drawn outside the rectangle passed in the option-rect. if (const QStyleOptionFrame *panel = qstyleoption_cast<const QStyleOptionFrame *>(opt)) { -#ifndef QT_NO_LINEEDIT +#if QT_CONFIG(lineedit) if ((opt->state & State_HasFocus) && !qobject_cast<const QLineEdit*>(w)) { int vmargin = pixelMetric(QStyle::PM_FocusFrameVMargin); int hmargin = pixelMetric(QStyle::PM_FocusFrameHMargin); diff --git a/src/widgets/styles/qmacstyle_mac_p_p.h b/src/widgets/styles/qmacstyle_mac_p_p.h index 330816a996..228abf950a 100644 --- a/src/widgets/styles/qmacstyle_mac_p_p.h +++ b/src/widgets/styles/qmacstyle_mac_p_p.h @@ -74,7 +74,9 @@ #include <qhash.h> #include <qheaderview.h> #include <qlayout.h> +#if QT_CONFIG(lineedit) #include <qlineedit.h> +#endif #if QT_CONFIG(listview) #include <qlistview.h> #endif diff --git a/src/widgets/styles/qstylesheetstyle.cpp b/src/widgets/styles/qstylesheetstyle.cpp index 57e695c114..686cb8209a 100644 --- a/src/widgets/styles/qstylesheetstyle.cpp +++ b/src/widgets/styles/qstylesheetstyle.cpp @@ -51,7 +51,9 @@ #endif #include <qpainter.h> #include <qstyleoption.h> +#if QT_CONFIG(lineedit) #include <qlineedit.h> +#endif #include <private/qwindowsstyle_p.h> #if QT_CONFIG(combobox) #include <qcombobox.h> @@ -2040,7 +2042,7 @@ QRenderRule QStyleSheetStyle::renderRule(const QObject *obj, const QStyleOption } #endif -#ifndef QT_NO_LINEEDIT +#if QT_CONFIG(lineedit) // LineEdit sets Sunken flag to indicate Sunken frame (argh) if (const QLineEdit *lineEdit = qobject_cast<const QLineEdit *>(obj)) { state &= ~QStyle::State_Sunken; @@ -2388,7 +2390,7 @@ static QWidget *embeddedWidget(QWidget *w) */ static QWidget *containerWidget(const QWidget *w) { -#ifndef QT_NO_LINEEDIT +#if QT_CONFIG(lineedit) if (qobject_cast<const QLineEdit *>(w)) { //if the QLineEdit is an embeddedWidget, we need the rule of the real widget #if QT_CONFIG(combobox) @@ -2400,7 +2402,7 @@ static QWidget *containerWidget(const QWidget *w) return w->parentWidget(); #endif } -#endif // QT_NO_LINEEDIT +#endif // QT_CONFIG(lineedit) #if QT_CONFIG(scrollarea) if (const QAbstractScrollArea *sa = qobject_cast<const QAbstractScrollArea *>(w->parentWidget())) { @@ -2461,7 +2463,7 @@ static quint64 extendedPseudoClass(const QWidget *w) pc |= (combo->isEditable() ? PseudoClass_Editable : PseudoClass_ReadOnly); } else #endif -#ifndef QT_NO_LINEEDIT +#if QT_CONFIG(lineedit) if (const QLineEdit *edit = qobject_cast<const QLineEdit *>(w)) { pc |= (edit->isReadOnly() ? PseudoClass_ReadOnly : PseudoClass_Editable); } else diff --git a/src/widgets/styles/qwindowsvistastyle.cpp b/src/widgets/styles/qwindowsvistastyle.cpp index 9c38cc4f6b..4179566f6b 100644 --- a/src/widgets/styles/qwindowsvistastyle.cpp +++ b/src/widgets/styles/qwindowsvistastyle.cpp @@ -2292,11 +2292,11 @@ void QWindowsVistaStyle::polish(QApplication *app) void QWindowsVistaStyle::polish(QWidget *widget) { QWindowsXPStyle::polish(widget); -#ifndef QT_NO_LINEEDIT +#if QT_CONFIG(lineedit) if (qobject_cast<QLineEdit*>(widget)) widget->setAttribute(Qt::WA_Hover); else -#endif // QT_NO_LINEEDIT +#endif // QT_CONFIG(lineedit) if (qobject_cast<QGroupBox*>(widget)) widget->setAttribute(Qt::WA_Hover); else if (qobject_cast<QCommandLinkButton*>(widget)) { @@ -2353,11 +2353,11 @@ void QWindowsVistaStyle::unpolish(QWidget *widget) d->stopAnimation(widget); -#ifndef QT_NO_LINEEDIT +#if QT_CONFIG(lineedit) if (qobject_cast<QLineEdit*>(widget)) widget->setAttribute(Qt::WA_Hover, false); else -#endif // QT_NO_LINEEDIT +#endif // QT_CONFIG(lineedit) if (qobject_cast<QGroupBox*>(widget)) widget->setAttribute(Qt::WA_Hover, false); else if (qobject_cast<QMessageBox *> (widget)) { diff --git a/src/widgets/styles/qwindowsvistastyle_p_p.h b/src/widgets/styles/qwindowsvistastyle_p_p.h index 278a4e53c2..6e22f97cf4 100644 --- a/src/widgets/styles/qwindowsvistastyle_p_p.h +++ b/src/widgets/styles/qwindowsvistastyle_p_p.h @@ -67,7 +67,9 @@ #include <qpushbutton.h> #endif #include <qradiobutton.h> +#if QT_CONFIG(lineedit) #include <qlineedit.h> +#endif #include <qgroupbox.h> #if QT_CONFIG(toolbutton) #include <qtoolbutton.h> |