From 093064fdeb6e777d2dc88dbb4f4adb8fddac3aa5 Mon Sep 17 00:00:00 2001 From: Stephan Binner Date: Sat, 2 Sep 2017 20:52:48 +0200 Subject: Convert features.completer to QT_[REQUIRE_]CONFIG Change-Id: If45a46c08b37d245229a39f3d6ffbb34154934f2 Reviewed-by: Oswald Buddenhagen --- src/printsupport/dialogs/qprintdialog_unix.cpp | 4 ++- src/widgets/dialogs/qfiledialog.cpp | 2 +- src/widgets/dialogs/qfiledialog_p.h | 2 ++ src/widgets/util/qcompleter.cpp | 4 --- src/widgets/util/qcompleter.h | 7 ++--- src/widgets/util/qcompleter_p.h | 6 ++-- src/widgets/util/util.pri | 13 ++++++--- src/widgets/widgets/qcombobox.cpp | 32 +++++++++++----------- src/widgets/widgets/qcombobox.h | 10 +++---- src/widgets/widgets/qcombobox_p.h | 6 ++-- src/widgets/widgets/qlineedit.cpp | 10 +++---- src/widgets/widgets/qlineedit.h | 4 +-- src/widgets/widgets/qlineedit_p.cpp | 6 ++-- src/widgets/widgets/qlineedit_p.h | 4 ++- src/widgets/widgets/qwidgetlinecontrol.cpp | 16 +++++------ src/widgets/widgets/qwidgetlinecontrol_p.h | 6 ++-- .../printsupport/kernel/qprinter/tst_qprinter.cpp | 4 +-- .../widgets/widgets/qlineedit/tst_qlineedit.cpp | 6 ++-- 18 files changed, 74 insertions(+), 68 deletions(-) diff --git a/src/printsupport/dialogs/qprintdialog_unix.cpp b/src/printsupport/dialogs/qprintdialog_unix.cpp index 51c8a593a1..71312d65f1 100644 --- a/src/printsupport/dialogs/qprintdialog_unix.cpp +++ b/src/printsupport/dialogs/qprintdialog_unix.cpp @@ -63,7 +63,9 @@ #include +#if QT_CONFIG(completer) #include +#endif #include "ui_qprintpropertieswidget.h" #include "ui_qprintsettingsoutput.h" #include "ui_qprintwidget.h" @@ -679,7 +681,7 @@ QUnixPrintWidgetPrivate::QUnixPrintWidgetPrivate(QUnixPrintWidget *p, QPrinter * } widget.properties->setEnabled(true); -#if QT_CONFIG(filesystemmodel) && !defined(QT_NO_COMPLETER) +#if QT_CONFIG(filesystemmodel) && QT_CONFIG(completer) QFileSystemModel *fsm = new QFileSystemModel(widget.filename); fsm->setRootPath(QDir::homePath()); widget.filename->setCompleter(new QCompleter(fsm, widget.filename)); diff --git a/src/widgets/dialogs/qfiledialog.cpp b/src/widgets/dialogs/qfiledialog.cpp index 97afce1734..8d0161d96b 100644 --- a/src/widgets/dialogs/qfiledialog.cpp +++ b/src/widgets/dialogs/qfiledialog.cpp @@ -4130,7 +4130,7 @@ QStringList QFSCompleter::splitPath(const QString &path) const return parts; } -#endif // QT_NO_COMPLETER +#endif // QT_CONFIG(completer) QT_END_NAMESPACE diff --git a/src/widgets/dialogs/qfiledialog_p.h b/src/widgets/dialogs/qfiledialog_p.h index f7a3c6b091..371826eccc 100644 --- a/src/widgets/dialogs/qfiledialog_p.h +++ b/src/widgets/dialogs/qfiledialog_p.h @@ -69,7 +69,9 @@ #include #include #include +#if QT_CONFIG(completer) #include +#endif #include #include #include "qsidebar_p.h" diff --git a/src/widgets/util/qcompleter.cpp b/src/widgets/util/qcompleter.cpp index a9ab0c22c8..8757956310 100644 --- a/src/widgets/util/qcompleter.cpp +++ b/src/widgets/util/qcompleter.cpp @@ -143,8 +143,6 @@ #include "qcompleter_p.h" -#ifndef QT_NO_COMPLETER - #include "QtWidgets/qscrollbar.h" #include "QtCore/qstringlistmodel.h" #if QT_CONFIG(dirmodel) @@ -1902,5 +1900,3 @@ QT_END_NAMESPACE #include "moc_qcompleter.cpp" #include "moc_qcompleter_p.cpp" - -#endif // QT_NO_COMPLETER diff --git a/src/widgets/util/qcompleter.h b/src/widgets/util/qcompleter.h index 33e6540264..1a2c2440f5 100644 --- a/src/widgets/util/qcompleter.h +++ b/src/widgets/util/qcompleter.h @@ -47,10 +47,9 @@ #include #include -QT_BEGIN_NAMESPACE - +QT_REQUIRE_CONFIG(completer); -#ifndef QT_NO_COMPLETER +QT_BEGIN_NAMESPACE class QCompleterPrivate; class QAbstractItemView; @@ -162,8 +161,6 @@ private: Q_PRIVATE_SLOT(d_func(), void _q_fileSystemModelDirectoryLoaded(const QString&)) }; -#endif // QT_NO_COMPLETER - QT_END_NAMESPACE #endif // QCOMPLETER_H diff --git a/src/widgets/util/qcompleter_p.h b/src/widgets/util/qcompleter_p.h index 6629c47e06..40b08cc20a 100644 --- a/src/widgets/util/qcompleter_p.h +++ b/src/widgets/util/qcompleter_p.h @@ -55,8 +55,6 @@ #include #include "private/qobject_p.h" -#ifndef QT_NO_COMPLETER - #include "QtWidgets/qabstractitemview.h" #include "QtCore/qabstractproxymodel.h" #include "qcompleter.h" @@ -64,6 +62,8 @@ #include "QtGui/qpainter.h" #include "private/qabstractproxymodel_p.h" +QT_REQUIRE_CONFIG(completer); + QT_BEGIN_NAMESPACE class QCompletionModel; @@ -258,6 +258,4 @@ class QCompletionModelPrivate : public QAbstractProxyModelPrivate QT_END_NAMESPACE -#endif // QT_NO_COMPLETER - #endif // QCOMPLETER_P_H diff --git a/src/widgets/util/util.pri b/src/widgets/util/util.pri index 8b28ac8bf0..0b654bbadd 100644 --- a/src/widgets/util/util.pri +++ b/src/widgets/util/util.pri @@ -3,14 +3,19 @@ HEADERS += \ util/qsystemtrayicon.h \ util/qcolormap.h \ - util/qcompleter.h \ - util/qcompleter_p.h \ util/qsystemtrayicon_p.h SOURCES += \ util/qsystemtrayicon.cpp \ - util/qcolormap.cpp \ - util/qcompleter.cpp + util/qcolormap.cpp + +qtConfig(completer) { + HEADERS += \ + util/qcompleter.h \ + util/qcompleter_p.h + + SOURCES += util/qcompleter.cpp +} qtConfig(scroller) { HEADERS += \ diff --git a/src/widgets/widgets/qcombobox.cpp b/src/widgets/widgets/qcombobox.cpp index 2b7e9653f3..3fc5e5a051 100644 --- a/src/widgets/widgets/qcombobox.cpp +++ b/src/widgets/widgets/qcombobox.cpp @@ -107,7 +107,7 @@ QComboBoxPrivate::QComboBoxPrivate() #ifdef Q_OS_MAC , m_platformMenu(0) #endif -#ifndef QT_NO_COMPLETER +#if QT_CONFIG(completer) , completer(0) #endif { @@ -193,7 +193,7 @@ QStyleOptionMenuItem QComboMenuDelegate::getStyleOption(const QStyleOptionViewIt return menuOption; } -#ifndef QT_NO_COMPLETER +#if QT_CONFIG(completer) void QComboBoxPrivate::_q_completerActivated(const QModelIndex &index) { Q_Q(QComboBox); @@ -214,7 +214,7 @@ void QComboBoxPrivate::_q_completerActivated(const QModelIndex &index) } # endif // QT_KEYPAD_NAVIGATION } -#endif // !QT_NO_COMPLETER +#endif // QT_CONFIG(completer) void QComboBoxPrivate::updateArrow(QStyle::StateFlag state) { @@ -1196,7 +1196,7 @@ Qt::MatchFlags QComboBoxPrivate::matchFlags() const { // Base how duplicates are determined on the autocompletion case sensitivity Qt::MatchFlags flags = Qt::MatchFixedString; -#ifndef QT_NO_COMPLETER +#if QT_CONFIG(completer) if (!lineEdit->completer() || lineEdit->completer()->caseSensitivity() == Qt::CaseSensitive) #endif flags |= Qt::MatchCaseSensitive; @@ -1425,7 +1425,7 @@ int QComboBox::maxCount() const return d->maxCount; } -#ifndef QT_NO_COMPLETER +#if QT_CONFIG(completer) /*! \property QComboBox::autoCompletion @@ -1520,7 +1520,7 @@ void QComboBox::setAutoCompletionCaseSensitivity(Qt::CaseSensitivity sensitivity d->lineEdit->completer()->setCaseSensitivity(sensitivity); } -#endif // QT_NO_COMPLETER +#endif // QT_CONFIG(completer) /*! \property QComboBox::duplicatesEnabled @@ -1802,12 +1802,12 @@ void QComboBox::setLineEdit(QLineEdit *edit) d->updateFocusPolicy(); d->lineEdit->setFocusProxy(this); d->lineEdit->setAttribute(Qt::WA_MacShowFocusRect, false); -#ifndef QT_NO_COMPLETER +#if QT_CONFIG(completer) setAutoCompletion(d->autoCompletion); #endif #ifdef QT_KEYPAD_NAVIGATION -#ifndef QT_NO_COMPLETER +#if QT_CONFIG(completer) if (QApplication::keypadNavigationEnabled()) { // Editable combo boxes will have a completer that is set to UnfilteredPopupCompletion. // This means that when the user enters edit mode they are immediately presented with a @@ -1871,7 +1871,7 @@ const QValidator *QComboBox::validator() const } #endif // QT_NO_VALIDATOR -#ifndef QT_NO_COMPLETER +#if QT_CONFIG(completer) /*! \fn void QComboBox::setCompleter(QCompleter *completer) @@ -1911,7 +1911,7 @@ QCompleter *QComboBox::completer() const return d->lineEdit ? d->lineEdit->completer() : 0; } -#endif // QT_NO_COMPLETER +#endif // QT_CONFIG(completer) /*! Returns the item delegate used by the popup list view. @@ -1977,7 +1977,7 @@ void QComboBox::setModel(QAbstractItemModel *model) if (model == d->model) return; -#ifndef QT_NO_COMPLETER +#if QT_CONFIG(completer) if (d->lineEdit && d->lineEdit->completer() && d->lineEdit->completer() == d->completer) d->lineEdit->completer()->setModel(model); @@ -2123,7 +2123,7 @@ void QComboBoxPrivate::setCurrentIndex(const QModelIndex &mi) const QString newText = itemText(normalized); if (lineEdit->text() != newText) { lineEdit->setText(newText); // may cause lineEdit -> nullptr (QTBUG-54191) -#ifndef QT_NO_COMPLETER +#if QT_CONFIG(completer) if (lineEdit && lineEdit->completer()) lineEdit->completer()->setCompletionPrefix(newText); #endif @@ -2574,7 +2574,7 @@ void QComboBox::showPopup() #endif // Q_OS_MAC #ifdef QT_KEYPAD_NAVIGATION -#ifndef QT_NO_COMPLETER +#if QT_CONFIG(completer) if (QApplication::keypadNavigationEnabled() && d->completer) { // editable combo box is line edit plus completer setEditFocus(true); @@ -2911,7 +2911,7 @@ void QComboBox::focusInEvent(QFocusEvent *e) update(); if (d->lineEdit) { d->lineEdit->event(e); -#ifndef QT_NO_COMPLETER +#if QT_CONFIG(completer) if (d->lineEdit->completer()) d->lineEdit->completer()->setWidget(this); #endif @@ -3137,7 +3137,7 @@ void QComboBox::keyPressEvent(QKeyEvent *e) { Q_D(QComboBox); -#ifndef QT_NO_COMPLETER +#if QT_CONFIG(completer) if (d->lineEdit && d->lineEdit->completer() && d->lineEdit->completer()->popup() @@ -3473,7 +3473,7 @@ void QComboBox::setModelColumn(int visibleColumn) QListView *lv = qobject_cast(d->viewContainer()->itemView()); if (lv) lv->setModelColumn(visibleColumn); -#ifndef QT_NO_COMPLETER +#if QT_CONFIG(completer) if (d->lineEdit && d->lineEdit->completer() && d->lineEdit->completer() == d->completer) d->lineEdit->completer()->setCompletionColumn(visibleColumn); diff --git a/src/widgets/widgets/qcombobox.h b/src/widgets/widgets/qcombobox.h index a6aac6f8aa..ff27a999d9 100644 --- a/src/widgets/widgets/qcombobox.h +++ b/src/widgets/widgets/qcombobox.h @@ -71,10 +71,10 @@ class Q_WIDGETS_EXPORT QComboBox : public QWidget Q_PROPERTY(int minimumContentsLength READ minimumContentsLength WRITE setMinimumContentsLength) Q_PROPERTY(QSize iconSize READ iconSize WRITE setIconSize) -#ifndef QT_NO_COMPLETER +#if QT_CONFIG(completer) Q_PROPERTY(bool autoCompletion READ autoCompletion WRITE setAutoCompletion DESIGNABLE false) Q_PROPERTY(Qt::CaseSensitivity autoCompletionCaseSensitivity READ autoCompletionCaseSensitivity WRITE setAutoCompletionCaseSensitivity DESIGNABLE false) -#endif // QT_NO_COMPLETER +#endif // QT_CONFIG(completer) Q_PROPERTY(bool duplicatesEnabled READ duplicatesEnabled WRITE setDuplicatesEnabled) Q_PROPERTY(bool frame READ hasFrame WRITE setFrame) @@ -91,7 +91,7 @@ public: void setMaxCount(int max); int maxCount() const; -#ifndef QT_NO_COMPLETER +#if QT_CONFIG(completer) bool autoCompletion() const; void setAutoCompletion(bool enable); @@ -149,7 +149,7 @@ public: const QValidator *validator() const; #endif -#ifndef QT_NO_COMPLETER +#if QT_CONFIG(completer) void setCompleter(QCompleter *c); QCompleter *completer() const; #endif @@ -262,7 +262,7 @@ private: Q_PRIVATE_SLOT(d_func(), void _q_rowsRemoved(const QModelIndex & parent, int start, int end)) Q_PRIVATE_SLOT(d_func(), void _q_modelDestroyed()) Q_PRIVATE_SLOT(d_func(), void _q_modelReset()) -#ifndef QT_NO_COMPLETER +#if QT_CONFIG(completer) Q_PRIVATE_SLOT(d_func(), void _q_completerActivated(const QModelIndex &index)) #endif }; diff --git a/src/widgets/widgets/qcombobox_p.h b/src/widgets/widgets/qcombobox_p.h index ab4dd0281f..249610825a 100644 --- a/src/widgets/widgets/qcombobox_p.h +++ b/src/widgets/widgets/qcombobox_p.h @@ -67,7 +67,9 @@ #include "QtCore/qtimer.h" #include "private/qwidget_p.h" #include "QtCore/qpointer.h" +#if QT_CONFIG(completer) #include "QtWidgets/qcompleter.h" +#endif #include "QtGui/qevent.h" #include "QtCore/qdebug.h" @@ -355,7 +357,7 @@ public: void _q_emitCurrentIndexChanged(const QModelIndex &index); void _q_modelDestroyed(); void _q_modelReset(); -#ifndef QT_NO_COMPLETER +#if QT_CONFIG(completer) void _q_completerActivated(const QModelIndex &index); #endif void _q_resetButton(); @@ -415,7 +417,7 @@ public: #ifdef Q_OS_MAC QPlatformMenu *m_platformMenu; #endif -#ifndef QT_NO_COMPLETER +#if QT_CONFIG(completer) QPointer completer; #endif static QPalette viewContainerPalette(QComboBox *cmb) diff --git a/src/widgets/widgets/qlineedit.cpp b/src/widgets/widgets/qlineedit.cpp index 449a9c0b33..eb4cb96c01 100644 --- a/src/widgets/widgets/qlineedit.cpp +++ b/src/widgets/widgets/qlineedit.cpp @@ -615,7 +615,7 @@ void QLineEdit::setValidator(const QValidator *v) } #endif // QT_NO_VALIDATOR -#ifndef QT_NO_COMPLETER +#if QT_CONFIG(completer) /*! \since 4.2 @@ -667,7 +667,7 @@ QCompleter *QLineEdit::completer() const return d->control->completer(); } -#endif // QT_NO_COMPLETER +#endif // QT_CONFIG(completer) /*! Returns a recommended size for the widget. @@ -1742,7 +1742,7 @@ void QLineEdit::inputMethodEvent(QInputMethodEvent *e) d->control->processInputMethodEvent(e); -#ifndef QT_NO_COMPLETER +#if QT_CONFIG(completer) if (!e->commitString().isEmpty()) d->control->complete(Qt::Key_unknown); #endif @@ -1823,7 +1823,7 @@ void QLineEdit::focusInEvent(QFocusEvent *e) d->control->setCancelText(d->control->text()); } #endif -#ifndef QT_NO_COMPLETER +#if QT_CONFIG(completer) if (d->control->completer()) { d->control->completer()->setWidget(this); QObject::connect(d->control->completer(), SIGNAL(activated(QString)), @@ -1870,7 +1870,7 @@ void QLineEdit::focusOutEvent(QFocusEvent *e) #ifdef QT_KEYPAD_NAVIGATION d->control->setCancelText(QString()); #endif -#ifndef QT_NO_COMPLETER +#if QT_CONFIG(completer) if (d->control->completer()) { QObject::disconnect(d->control->completer(), 0, this, 0); } diff --git a/src/widgets/widgets/qlineedit.h b/src/widgets/widgets/qlineedit.h index 4d32b11f06..dc0e694d07 100644 --- a/src/widgets/widgets/qlineedit.h +++ b/src/widgets/widgets/qlineedit.h @@ -124,7 +124,7 @@ public: const QValidator * validator() const; #endif -#ifndef QT_NO_COMPLETER +#if QT_CONFIG(completer) void setCompleter(QCompleter *completer); QCompleter *completer() const; #endif @@ -250,7 +250,7 @@ private: Q_PRIVATE_SLOT(d_func(), void _q_handleWindowActivate()) Q_PRIVATE_SLOT(d_func(), void _q_textEdited(const QString &)) Q_PRIVATE_SLOT(d_func(), void _q_cursorPositionChanged(int, int)) -#ifndef QT_NO_COMPLETER +#if QT_CONFIG(completer) Q_PRIVATE_SLOT(d_func(), void _q_completionHighlighted(const QString &)) #endif #ifdef QT_KEYPAD_NAVIGATION diff --git a/src/widgets/widgets/qlineedit_p.cpp b/src/widgets/widgets/qlineedit_p.cpp index 79241ef720..ae35a64663 100644 --- a/src/widgets/widgets/qlineedit_p.cpp +++ b/src/widgets/widgets/qlineedit_p.cpp @@ -90,7 +90,7 @@ QRect QLineEditPrivate::cursorRect() const return adjustedControlRect(control->cursorRect()); } -#ifndef QT_NO_COMPLETER +#if QT_CONFIG(completer) void QLineEditPrivate::_q_completionHighlighted(const QString &newText) { @@ -111,7 +111,7 @@ void QLineEditPrivate::_q_completionHighlighted(const QString &newText) } } -#endif // QT_NO_COMPLETER +#endif // QT_CONFIG(completer) void QLineEditPrivate::_q_handleWindowActivate() { @@ -124,7 +124,7 @@ void QLineEditPrivate::_q_textEdited(const QString &text) { Q_Q(QLineEdit); emit q->textEdited(text); -#ifndef QT_NO_COMPLETER +#if QT_CONFIG(completer) if (control->completer() && control->completer()->completionMode() != QCompleter::InlineCompletion) control->complete(-1); // update the popup on cut/paste/del diff --git a/src/widgets/widgets/qlineedit_p.h b/src/widgets/widgets/qlineedit_p.h index 92bdd4ad60..094425e45e 100644 --- a/src/widgets/widgets/qlineedit_p.h +++ b/src/widgets/widgets/qlineedit_p.h @@ -63,7 +63,9 @@ #include "QtGui/qicon.h" #include "QtWidgets/qstyleoption.h" #include "QtCore/qbasictimer.h" +#if QT_CONFIG(completer) #include "QtWidgets/qcompleter.h" +#endif #include "QtCore/qpointer.h" #include "QtCore/qmimedata.h" @@ -203,7 +205,7 @@ public: #endif void _q_selectionChanged(); void _q_updateNeeded(const QRect &); -#ifndef QT_NO_COMPLETER +#if QT_CONFIG(completer) void _q_completionHighlighted(const QString &); #endif QPoint mousePressPos; diff --git a/src/widgets/widgets/qwidgetlinecontrol.cpp b/src/widgets/widgets/qwidgetlinecontrol.cpp index 9281cc8ced..3abe82ce59 100644 --- a/src/widgets/widgets/qwidgetlinecontrol.cpp +++ b/src/widgets/widgets/qwidgetlinecontrol.cpp @@ -1428,7 +1428,7 @@ void QWidgetLineControl::emitCursorPositionChanged() } } -#ifndef QT_NO_COMPLETER +#if QT_CONFIG(completer) // iterating forward(dir=1)/backward(dir=-1) from the // current row based. dir=0 indicates a new completion prefix was set. bool QWidgetLineControl::advanceToEnabledItem(int dir) @@ -1627,7 +1627,7 @@ void QWidgetLineControl::processKeyEvent(QKeyEvent* event) { bool inlineCompletionAccepted = false; -#ifndef QT_NO_COMPLETER +#if QT_CONFIG(completer) if (m_completer) { QCompleter::CompletionMode completionMode = m_completer->completionMode(); if ((completionMode == QCompleter::PopupCompletion @@ -1672,7 +1672,7 @@ void QWidgetLineControl::processKeyEvent(QKeyEvent* event) } } } -#endif // QT_NO_COMPLETER +#endif // QT_CONFIG(completer) if (event->key() == Qt::Key_Enter || event->key() == Qt::Key_Return) { if (hasAcceptableInput() || fixup()) { @@ -1774,7 +1774,7 @@ void QWidgetLineControl::processKeyEvent(QKeyEvent* event) end(1); } else if (event == QKeySequence::MoveToNextChar) { -#if defined(QT_NO_COMPLETER) +#if !QT_CONFIG(completer) const bool inlineCompletion = false; #else const bool inlineCompletion = m_completer && m_completer->completionMode() == QCompleter::InlineCompletion; @@ -1791,7 +1791,7 @@ void QWidgetLineControl::processKeyEvent(QKeyEvent* event) cursorForward(1, visual ? 1 : (layoutDirection() == Qt::LeftToRight ? 1 : -1)); } else if (event == QKeySequence::MoveToPreviousChar) { -#if defined(QT_NO_COMPLETER) +#if !QT_CONFIG(completer) const bool inlineCompletion = false; #else const bool inlineCompletion = m_completer && m_completer->completionMode() == QCompleter::InlineCompletion; @@ -1886,7 +1886,7 @@ void QWidgetLineControl::processKeyEvent(QKeyEvent* event) del(); } break; -#ifndef QT_NO_COMPLETER +#if QT_CONFIG(completer) case Qt::Key_Up: case Qt::Key_Down: complete(event->key()); @@ -1901,7 +1901,7 @@ void QWidgetLineControl::processKeyEvent(QKeyEvent* event) case Qt::Key_Backspace: if (!isReadOnly()) { backspace(); -#ifndef QT_NO_COMPLETER +#if QT_CONFIG(completer) complete(Qt::Key_Backspace); #endif } @@ -1941,7 +1941,7 @@ void QWidgetLineControl::processKeyEvent(QKeyEvent* event) && !isReadOnly() && isAcceptableInput(event)) { insert(event->text()); -#ifndef QT_NO_COMPLETER +#if QT_CONFIG(completer) complete(event->key()); #endif event->accept(); diff --git a/src/widgets/widgets/qwidgetlinecontrol_p.h b/src/widgets/widgets/qwidgetlinecontrol_p.h index 257402e9dc..243a1a7723 100644 --- a/src/widgets/widgets/qwidgetlinecontrol_p.h +++ b/src/widgets/widgets/qwidgetlinecontrol_p.h @@ -62,7 +62,9 @@ #include "QtGui/qclipboard.h" #include "QtGui/qinputmethod.h" #include "QtCore/qpoint.h" +#if QT_CONFIG(completer) #include "QtWidgets/qcompleter.h" +#endif #include "QtCore/qthread.h" #include "QtGui/private/qinputcontrol_p.h" @@ -289,7 +291,7 @@ public: void setValidator(const QValidator *v) { m_validator = const_cast(v); } #endif -#ifndef QT_NO_COMPLETER +#if QT_CONFIG(completer) QCompleter *completer() const { return m_completer; } /* Note that you must set the widget for the completer separately */ void setCompleter(const QCompleter *c) { m_completer = const_cast(c); } @@ -461,7 +463,7 @@ private: QPointer m_validator; #endif QPointer m_completer; -#ifndef QT_NO_COMPLETER +#if QT_CONFIG(completer) bool advanceToEnabledItem(int dir); #endif diff --git a/tests/auto/printsupport/kernel/qprinter/tst_qprinter.cpp b/tests/auto/printsupport/kernel/qprinter/tst_qprinter.cpp index cc32e73b9c..88bae686ab 100644 --- a/tests/auto/printsupport/kernel/qprinter/tst_qprinter.cpp +++ b/tests/auto/printsupport/kernel/qprinter/tst_qprinter.cpp @@ -83,7 +83,7 @@ private slots: void customPaperSizeAndMargins(); void customPaperNameSettingBySize(); void customPaperNameSettingByName(); -#if !defined(QT_NO_COMPLETER) && QT_CONFIG(filedialog) +#if QT_CONFIG(completer) && QT_CONFIG(filedialog) void printDialogCompleter(); #endif void testCurrentPage(); @@ -587,7 +587,7 @@ void tst_QPrinter::customPaperSizeAndMargins() } } -#if !defined(QT_NO_COMPLETER) && QT_CONFIG(filedialog) +#if QT_CONFIG(completer) && QT_CONFIG(filedialog) void tst_QPrinter::printDialogCompleter() { QPrintDialog dialog; diff --git a/tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp b/tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp index 8a17a4a327..cf1e19d598 100644 --- a/tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp +++ b/tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp @@ -261,7 +261,7 @@ private slots: // task-specific tests: void task180999_focus(); void task174640_editingFinished(); -#ifndef QT_NO_COMPLETER +#if QT_CONFIG(completer) void task198789_currentCompletion(); void task210502_caseInsensitiveInlineCompletion(); #endif @@ -3630,7 +3630,7 @@ void tst_QLineEdit::task174640_editingFinished() QCOMPARE(editingFinishedSpy.count(), 1); } -#ifndef QT_NO_COMPLETER +#if QT_CONFIG(completer) class task198789_Widget : public QWidget { Q_OBJECT @@ -3689,7 +3689,7 @@ void tst_QLineEdit::task210502_caseInsensitiveInlineCompletion() QCOMPARE(lineEdit.text(), completion); } -#endif // QT_NO_COMPLETER +#endif // QT_CONFIG(completer) void tst_QLineEdit::task229938_dontEmitChangedWhenTextIsNotChanged() -- cgit v1.2.3