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/itemviews | |
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/itemviews')
-rw-r--r-- | src/widgets/itemviews/qabstractitemdelegate.cpp | 6 | ||||
-rw-r--r-- | src/widgets/itemviews/qabstractitemview.cpp | 4 | ||||
-rw-r--r-- | src/widgets/itemviews/qitemeditorfactory.cpp | 10 | ||||
-rw-r--r-- | src/widgets/itemviews/qitemeditorfactory_p.h | 6 | ||||
-rw-r--r-- | src/widgets/itemviews/qstyleditemdelegate.cpp | 4 |
5 files changed, 19 insertions, 11 deletions
diff --git a/src/widgets/itemviews/qabstractitemdelegate.cpp b/src/widgets/itemviews/qabstractitemdelegate.cpp index 265cf6b47c..e98b82e049 100644 --- a/src/widgets/itemviews/qabstractitemdelegate.cpp +++ b/src/widgets/itemviews/qabstractitemdelegate.cpp @@ -49,7 +49,9 @@ #include <qevent.h> #include <qstring.h> #include <qdebug.h> +#if QT_CONFIG(lineedit) #include <qlineedit.h> +#endif #include <qtextedit.h> #include <qplaintextedit.h> #include <qapplication.h> @@ -536,7 +538,7 @@ bool QAbstractItemDelegatePrivate::editorEventFilter(QObject *object, QEvent *ev bool QAbstractItemDelegatePrivate::tryFixup(QWidget *editor) { -#ifndef QT_NO_LINEEDIT +#if QT_CONFIG(lineedit) if (QLineEdit *e = qobject_cast<QLineEdit*>(editor)) { if (!e->hasAcceptableInput()) { #if QT_CONFIG(validator) @@ -551,7 +553,7 @@ bool QAbstractItemDelegatePrivate::tryFixup(QWidget *editor) } #else Q_UNUSED(editor) -#endif // QT_NO_LINEEDIT +#endif // QT_CONFIG(lineedit) return true; } diff --git a/src/widgets/itemviews/qabstractitemview.cpp b/src/widgets/itemviews/qabstractitemview.cpp index 039b37baa7..88b6a30409 100644 --- a/src/widgets/itemviews/qabstractitemview.cpp +++ b/src/widgets/itemviews/qabstractitemview.cpp @@ -49,7 +49,9 @@ #include <qscrollbar.h> #include <qtooltip.h> #include <qdatetime.h> +#if QT_CONFIG(lineedit) #include <qlineedit.h> +#endif #if QT_CONFIG(spinbox) #include <qspinbox.h> #endif @@ -4217,7 +4219,7 @@ QWidget *QAbstractItemViewPrivate::editor(const QModelIndex &index, QWidget *focusWidget = w; while (QWidget *fp = focusWidget->focusProxy()) focusWidget = fp; -#ifndef QT_NO_LINEEDIT +#if QT_CONFIG(lineedit) if (QLineEdit *le = qobject_cast<QLineEdit*>(focusWidget)) le->selectAll(); #endif diff --git a/src/widgets/itemviews/qitemeditorfactory.cpp b/src/widgets/itemviews/qitemeditorfactory.cpp index 4d0175dc6c..b580f0e840 100644 --- a/src/widgets/itemviews/qitemeditorfactory.cpp +++ b/src/widgets/itemviews/qitemeditorfactory.cpp @@ -50,7 +50,9 @@ #if QT_CONFIG(label) #include <qlabel.h> #endif +#if QT_CONFIG(lineedit) #include <qlineedit.h> +#endif #if QT_CONFIG(spinbox) #include <qspinbox.h> #endif @@ -284,7 +286,7 @@ QWidget *QDefaultItemEditorFactory::createEditor(int userType, QWidget *parent) sb->setMaximum(DBL_MAX); return sb; } #endif -#ifndef QT_NO_LINEEDIT +#if QT_CONFIG(lineedit) case QVariant::String: default: { // the default editor is a lineedit @@ -537,7 +539,7 @@ QItemEditorCreatorBase::~QItemEditorCreatorBase() \reimp */ -#ifndef QT_NO_LINEEDIT +#if QT_CONFIG(lineedit) QExpandingLineEdit::QExpandingLineEdit(QWidget *parent) : QLineEdit(parent), originalWidth(-1), widgetOwnsGeometry(false) @@ -597,7 +599,7 @@ void QExpandingLineEdit::resizeToContents() } } -#endif // QT_NO_LINEEDIT +#endif // QT_CONFIG(lineedit) #if QT_CONFIG(combobox) @@ -622,7 +624,7 @@ bool QBooleanComboBox::value() const QT_END_NAMESPACE -#if !defined(QT_NO_LINEEDIT) || QT_CONFIG(combobox) +#if QT_CONFIG(lineedit) || QT_CONFIG(combobox) #include "qitemeditorfactory.moc" #endif diff --git a/src/widgets/itemviews/qitemeditorfactory_p.h b/src/widgets/itemviews/qitemeditorfactory_p.h index 409ecc684f..46a8da1d8f 100644 --- a/src/widgets/itemviews/qitemeditorfactory_p.h +++ b/src/widgets/itemviews/qitemeditorfactory_p.h @@ -53,9 +53,9 @@ #include <QtWidgets/private/qtwidgetsglobal_p.h> -#include <qlineedit.h> -#ifndef QT_NO_LINEEDIT +#if QT_CONFIG(lineedit) +#include <qlineedit.h> QT_REQUIRE_CONFIG(itemviews); @@ -89,6 +89,6 @@ private: QT_END_NAMESPACE -#endif // QT_NO_LINEEDIT +#endif // QT_CONFIG(lineedit) #endif //QITEMEDITORFACTORY_P_H diff --git a/src/widgets/itemviews/qstyleditemdelegate.cpp b/src/widgets/itemviews/qstyleditemdelegate.cpp index bda3325adb..561ccec5e6 100644 --- a/src/widgets/itemviews/qstyleditemdelegate.cpp +++ b/src/widgets/itemviews/qstyleditemdelegate.cpp @@ -42,7 +42,9 @@ #include <qabstractitemmodel.h> #include <qapplication.h> #include <qbrush.h> +#if QT_CONFIG(lineedit) #include <qlineedit.h> +#endif #include <qtextedit.h> #include <qplaintextedit.h> #include <qpainter.h> @@ -501,7 +503,7 @@ void QStyledItemDelegate::updateEditorGeometry(QWidget *editor, // let the editor take up all available space //if the editor is not a QLineEdit //or it is in a QTableView -#if QT_CONFIG(tableview) && !defined(QT_NO_LINEEDIT) +#if QT_CONFIG(tableview) && QT_CONFIG(lineedit) if (qobject_cast<QExpandingLineEdit*>(editor) && !qobject_cast<const QTableView*>(widget)) opt.showDecorationSelected = editor->style()->styleHint(QStyle::SH_ItemView_ShowDecorationSelected, 0, editor); else |