diff options
Diffstat (limited to 'src/widgets/itemviews/qabstractitemdelegate.cpp')
-rw-r--r-- | src/widgets/itemviews/qabstractitemdelegate.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/widgets/itemviews/qabstractitemdelegate.cpp b/src/widgets/itemviews/qabstractitemdelegate.cpp index fd4699409c..d532221092 100644 --- a/src/widgets/itemviews/qabstractitemdelegate.cpp +++ b/src/widgets/itemviews/qabstractitemdelegate.cpp @@ -49,10 +49,15 @@ #include <qevent.h> #include <qstring.h> #include <qdebug.h> +#if QT_CONFIG(lineedit) #include <qlineedit.h> +#endif +#if QT_CONFIG(textedit) #include <qtextedit.h> #include <qplaintextedit.h> +#endif #include <qapplication.h> +#include <qvalidator.h> #include <private/qtextengine_p.h> #include <private/qabstractitemdelegate_p.h> @@ -432,7 +437,7 @@ QAbstractItemDelegatePrivate::QAbstractItemDelegatePrivate() static bool editorHandlesKeyEvent(QWidget *editor, const QKeyEvent *event) { -#ifndef QT_NO_TEXTEDIT +#if QT_CONFIG(textedit) // do not filter enter / return / tab / backtab for QTextEdit or QPlainTextEdit if (qobject_cast<QTextEdit *>(editor) || qobject_cast<QPlainTextEdit *>(editor)) { switch (event->key()) { @@ -446,7 +451,7 @@ static bool editorHandlesKeyEvent(QWidget *editor, const QKeyEvent *event) break; } } -#endif // QT_NO_TEXTEDIT +#endif // QT_CONFIG(textedit) Q_UNUSED(editor); Q_UNUSED(event); @@ -535,7 +540,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) @@ -550,7 +555,7 @@ bool QAbstractItemDelegatePrivate::tryFixup(QWidget *editor) } #else Q_UNUSED(editor) -#endif // QT_NO_LINEEDIT +#endif // QT_CONFIG(lineedit) return true; } |