Convert features.completer to QT_[REQUIRE_]CONFIG
Change-Id: If45a46c08b37d245229a39f3d6ffbb34154934f2 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
This commit is contained in:
parent
66d9a2b997
commit
093064fdeb
@ -63,7 +63,9 @@
|
|||||||
|
|
||||||
#include <QtWidgets/qdialogbuttonbox.h>
|
#include <QtWidgets/qdialogbuttonbox.h>
|
||||||
|
|
||||||
|
#if QT_CONFIG(completer)
|
||||||
#include <private/qcompleter_p.h>
|
#include <private/qcompleter_p.h>
|
||||||
|
#endif
|
||||||
#include "ui_qprintpropertieswidget.h"
|
#include "ui_qprintpropertieswidget.h"
|
||||||
#include "ui_qprintsettingsoutput.h"
|
#include "ui_qprintsettingsoutput.h"
|
||||||
#include "ui_qprintwidget.h"
|
#include "ui_qprintwidget.h"
|
||||||
@ -679,7 +681,7 @@ QUnixPrintWidgetPrivate::QUnixPrintWidgetPrivate(QUnixPrintWidget *p, QPrinter *
|
|||||||
}
|
}
|
||||||
widget.properties->setEnabled(true);
|
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);
|
QFileSystemModel *fsm = new QFileSystemModel(widget.filename);
|
||||||
fsm->setRootPath(QDir::homePath());
|
fsm->setRootPath(QDir::homePath());
|
||||||
widget.filename->setCompleter(new QCompleter(fsm, widget.filename));
|
widget.filename->setCompleter(new QCompleter(fsm, widget.filename));
|
||||||
|
@ -4130,7 +4130,7 @@ QStringList QFSCompleter::splitPath(const QString &path) const
|
|||||||
return parts;
|
return parts;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // QT_NO_COMPLETER
|
#endif // QT_CONFIG(completer)
|
||||||
|
|
||||||
|
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
@ -69,7 +69,9 @@
|
|||||||
#include <qstackedwidget.h>
|
#include <qstackedwidget.h>
|
||||||
#include <qdialogbuttonbox.h>
|
#include <qdialogbuttonbox.h>
|
||||||
#include <qabstractproxymodel.h>
|
#include <qabstractproxymodel.h>
|
||||||
|
#if QT_CONFIG(completer)
|
||||||
#include <qcompleter.h>
|
#include <qcompleter.h>
|
||||||
|
#endif
|
||||||
#include <qpointer.h>
|
#include <qpointer.h>
|
||||||
#include <qdebug.h>
|
#include <qdebug.h>
|
||||||
#include "qsidebar_p.h"
|
#include "qsidebar_p.h"
|
||||||
|
@ -143,8 +143,6 @@
|
|||||||
|
|
||||||
#include "qcompleter_p.h"
|
#include "qcompleter_p.h"
|
||||||
|
|
||||||
#ifndef QT_NO_COMPLETER
|
|
||||||
|
|
||||||
#include "QtWidgets/qscrollbar.h"
|
#include "QtWidgets/qscrollbar.h"
|
||||||
#include "QtCore/qstringlistmodel.h"
|
#include "QtCore/qstringlistmodel.h"
|
||||||
#if QT_CONFIG(dirmodel)
|
#if QT_CONFIG(dirmodel)
|
||||||
@ -1902,5 +1900,3 @@ QT_END_NAMESPACE
|
|||||||
#include "moc_qcompleter.cpp"
|
#include "moc_qcompleter.cpp"
|
||||||
|
|
||||||
#include "moc_qcompleter_p.cpp"
|
#include "moc_qcompleter_p.cpp"
|
||||||
|
|
||||||
#endif // QT_NO_COMPLETER
|
|
||||||
|
@ -47,11 +47,10 @@
|
|||||||
#include <QtCore/qabstractitemmodel.h>
|
#include <QtCore/qabstractitemmodel.h>
|
||||||
#include <QtCore/qrect.h>
|
#include <QtCore/qrect.h>
|
||||||
|
|
||||||
|
QT_REQUIRE_CONFIG(completer);
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
|
|
||||||
#ifndef QT_NO_COMPLETER
|
|
||||||
|
|
||||||
class QCompleterPrivate;
|
class QCompleterPrivate;
|
||||||
class QAbstractItemView;
|
class QAbstractItemView;
|
||||||
class QAbstractProxyModel;
|
class QAbstractProxyModel;
|
||||||
@ -162,8 +161,6 @@ private:
|
|||||||
Q_PRIVATE_SLOT(d_func(), void _q_fileSystemModelDirectoryLoaded(const QString&))
|
Q_PRIVATE_SLOT(d_func(), void _q_fileSystemModelDirectoryLoaded(const QString&))
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // QT_NO_COMPLETER
|
|
||||||
|
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
#endif // QCOMPLETER_H
|
#endif // QCOMPLETER_H
|
||||||
|
@ -55,8 +55,6 @@
|
|||||||
#include <QtWidgets/private/qtwidgetsglobal_p.h>
|
#include <QtWidgets/private/qtwidgetsglobal_p.h>
|
||||||
#include "private/qobject_p.h"
|
#include "private/qobject_p.h"
|
||||||
|
|
||||||
#ifndef QT_NO_COMPLETER
|
|
||||||
|
|
||||||
#include "QtWidgets/qabstractitemview.h"
|
#include "QtWidgets/qabstractitemview.h"
|
||||||
#include "QtCore/qabstractproxymodel.h"
|
#include "QtCore/qabstractproxymodel.h"
|
||||||
#include "qcompleter.h"
|
#include "qcompleter.h"
|
||||||
@ -64,6 +62,8 @@
|
|||||||
#include "QtGui/qpainter.h"
|
#include "QtGui/qpainter.h"
|
||||||
#include "private/qabstractproxymodel_p.h"
|
#include "private/qabstractproxymodel_p.h"
|
||||||
|
|
||||||
|
QT_REQUIRE_CONFIG(completer);
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
class QCompletionModel;
|
class QCompletionModel;
|
||||||
@ -258,6 +258,4 @@ class QCompletionModelPrivate : public QAbstractProxyModelPrivate
|
|||||||
|
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
#endif // QT_NO_COMPLETER
|
|
||||||
|
|
||||||
#endif // QCOMPLETER_P_H
|
#endif // QCOMPLETER_P_H
|
||||||
|
@ -3,14 +3,19 @@
|
|||||||
HEADERS += \
|
HEADERS += \
|
||||||
util/qsystemtrayicon.h \
|
util/qsystemtrayicon.h \
|
||||||
util/qcolormap.h \
|
util/qcolormap.h \
|
||||||
util/qcompleter.h \
|
|
||||||
util/qcompleter_p.h \
|
|
||||||
util/qsystemtrayicon_p.h
|
util/qsystemtrayicon_p.h
|
||||||
|
|
||||||
SOURCES += \
|
SOURCES += \
|
||||||
util/qsystemtrayicon.cpp \
|
util/qsystemtrayicon.cpp \
|
||||||
util/qcolormap.cpp \
|
util/qcolormap.cpp
|
||||||
util/qcompleter.cpp
|
|
||||||
|
qtConfig(completer) {
|
||||||
|
HEADERS += \
|
||||||
|
util/qcompleter.h \
|
||||||
|
util/qcompleter_p.h
|
||||||
|
|
||||||
|
SOURCES += util/qcompleter.cpp
|
||||||
|
}
|
||||||
|
|
||||||
qtConfig(scroller) {
|
qtConfig(scroller) {
|
||||||
HEADERS += \
|
HEADERS += \
|
||||||
|
@ -107,7 +107,7 @@ QComboBoxPrivate::QComboBoxPrivate()
|
|||||||
#ifdef Q_OS_MAC
|
#ifdef Q_OS_MAC
|
||||||
, m_platformMenu(0)
|
, m_platformMenu(0)
|
||||||
#endif
|
#endif
|
||||||
#ifndef QT_NO_COMPLETER
|
#if QT_CONFIG(completer)
|
||||||
, completer(0)
|
, completer(0)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
@ -193,7 +193,7 @@ QStyleOptionMenuItem QComboMenuDelegate::getStyleOption(const QStyleOptionViewIt
|
|||||||
return menuOption;
|
return menuOption;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef QT_NO_COMPLETER
|
#if QT_CONFIG(completer)
|
||||||
void QComboBoxPrivate::_q_completerActivated(const QModelIndex &index)
|
void QComboBoxPrivate::_q_completerActivated(const QModelIndex &index)
|
||||||
{
|
{
|
||||||
Q_Q(QComboBox);
|
Q_Q(QComboBox);
|
||||||
@ -214,7 +214,7 @@ void QComboBoxPrivate::_q_completerActivated(const QModelIndex &index)
|
|||||||
}
|
}
|
||||||
# endif // QT_KEYPAD_NAVIGATION
|
# endif // QT_KEYPAD_NAVIGATION
|
||||||
}
|
}
|
||||||
#endif // !QT_NO_COMPLETER
|
#endif // QT_CONFIG(completer)
|
||||||
|
|
||||||
void QComboBoxPrivate::updateArrow(QStyle::StateFlag state)
|
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
|
// Base how duplicates are determined on the autocompletion case sensitivity
|
||||||
Qt::MatchFlags flags = Qt::MatchFixedString;
|
Qt::MatchFlags flags = Qt::MatchFixedString;
|
||||||
#ifndef QT_NO_COMPLETER
|
#if QT_CONFIG(completer)
|
||||||
if (!lineEdit->completer() || lineEdit->completer()->caseSensitivity() == Qt::CaseSensitive)
|
if (!lineEdit->completer() || lineEdit->completer()->caseSensitivity() == Qt::CaseSensitive)
|
||||||
#endif
|
#endif
|
||||||
flags |= Qt::MatchCaseSensitive;
|
flags |= Qt::MatchCaseSensitive;
|
||||||
@ -1425,7 +1425,7 @@ int QComboBox::maxCount() const
|
|||||||
return d->maxCount;
|
return d->maxCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef QT_NO_COMPLETER
|
#if QT_CONFIG(completer)
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\property QComboBox::autoCompletion
|
\property QComboBox::autoCompletion
|
||||||
@ -1520,7 +1520,7 @@ void QComboBox::setAutoCompletionCaseSensitivity(Qt::CaseSensitivity sensitivity
|
|||||||
d->lineEdit->completer()->setCaseSensitivity(sensitivity);
|
d->lineEdit->completer()->setCaseSensitivity(sensitivity);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // QT_NO_COMPLETER
|
#endif // QT_CONFIG(completer)
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\property QComboBox::duplicatesEnabled
|
\property QComboBox::duplicatesEnabled
|
||||||
@ -1802,12 +1802,12 @@ void QComboBox::setLineEdit(QLineEdit *edit)
|
|||||||
d->updateFocusPolicy();
|
d->updateFocusPolicy();
|
||||||
d->lineEdit->setFocusProxy(this);
|
d->lineEdit->setFocusProxy(this);
|
||||||
d->lineEdit->setAttribute(Qt::WA_MacShowFocusRect, false);
|
d->lineEdit->setAttribute(Qt::WA_MacShowFocusRect, false);
|
||||||
#ifndef QT_NO_COMPLETER
|
#if QT_CONFIG(completer)
|
||||||
setAutoCompletion(d->autoCompletion);
|
setAutoCompletion(d->autoCompletion);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef QT_KEYPAD_NAVIGATION
|
#ifdef QT_KEYPAD_NAVIGATION
|
||||||
#ifndef QT_NO_COMPLETER
|
#if QT_CONFIG(completer)
|
||||||
if (QApplication::keypadNavigationEnabled()) {
|
if (QApplication::keypadNavigationEnabled()) {
|
||||||
// Editable combo boxes will have a completer that is set to UnfilteredPopupCompletion.
|
// 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
|
// 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
|
#endif // QT_NO_VALIDATOR
|
||||||
|
|
||||||
#ifndef QT_NO_COMPLETER
|
#if QT_CONFIG(completer)
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn void QComboBox::setCompleter(QCompleter *completer)
|
\fn void QComboBox::setCompleter(QCompleter *completer)
|
||||||
@ -1911,7 +1911,7 @@ QCompleter *QComboBox::completer() const
|
|||||||
return d->lineEdit ? d->lineEdit->completer() : 0;
|
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.
|
Returns the item delegate used by the popup list view.
|
||||||
@ -1977,7 +1977,7 @@ void QComboBox::setModel(QAbstractItemModel *model)
|
|||||||
if (model == d->model)
|
if (model == d->model)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
#ifndef QT_NO_COMPLETER
|
#if QT_CONFIG(completer)
|
||||||
if (d->lineEdit && d->lineEdit->completer()
|
if (d->lineEdit && d->lineEdit->completer()
|
||||||
&& d->lineEdit->completer() == d->completer)
|
&& d->lineEdit->completer() == d->completer)
|
||||||
d->lineEdit->completer()->setModel(model);
|
d->lineEdit->completer()->setModel(model);
|
||||||
@ -2123,7 +2123,7 @@ void QComboBoxPrivate::setCurrentIndex(const QModelIndex &mi)
|
|||||||
const QString newText = itemText(normalized);
|
const QString newText = itemText(normalized);
|
||||||
if (lineEdit->text() != newText) {
|
if (lineEdit->text() != newText) {
|
||||||
lineEdit->setText(newText); // may cause lineEdit -> nullptr (QTBUG-54191)
|
lineEdit->setText(newText); // may cause lineEdit -> nullptr (QTBUG-54191)
|
||||||
#ifndef QT_NO_COMPLETER
|
#if QT_CONFIG(completer)
|
||||||
if (lineEdit && lineEdit->completer())
|
if (lineEdit && lineEdit->completer())
|
||||||
lineEdit->completer()->setCompletionPrefix(newText);
|
lineEdit->completer()->setCompletionPrefix(newText);
|
||||||
#endif
|
#endif
|
||||||
@ -2574,7 +2574,7 @@ void QComboBox::showPopup()
|
|||||||
#endif // Q_OS_MAC
|
#endif // Q_OS_MAC
|
||||||
|
|
||||||
#ifdef QT_KEYPAD_NAVIGATION
|
#ifdef QT_KEYPAD_NAVIGATION
|
||||||
#ifndef QT_NO_COMPLETER
|
#if QT_CONFIG(completer)
|
||||||
if (QApplication::keypadNavigationEnabled() && d->completer) {
|
if (QApplication::keypadNavigationEnabled() && d->completer) {
|
||||||
// editable combo box is line edit plus completer
|
// editable combo box is line edit plus completer
|
||||||
setEditFocus(true);
|
setEditFocus(true);
|
||||||
@ -2911,7 +2911,7 @@ void QComboBox::focusInEvent(QFocusEvent *e)
|
|||||||
update();
|
update();
|
||||||
if (d->lineEdit) {
|
if (d->lineEdit) {
|
||||||
d->lineEdit->event(e);
|
d->lineEdit->event(e);
|
||||||
#ifndef QT_NO_COMPLETER
|
#if QT_CONFIG(completer)
|
||||||
if (d->lineEdit->completer())
|
if (d->lineEdit->completer())
|
||||||
d->lineEdit->completer()->setWidget(this);
|
d->lineEdit->completer()->setWidget(this);
|
||||||
#endif
|
#endif
|
||||||
@ -3137,7 +3137,7 @@ void QComboBox::keyPressEvent(QKeyEvent *e)
|
|||||||
{
|
{
|
||||||
Q_D(QComboBox);
|
Q_D(QComboBox);
|
||||||
|
|
||||||
#ifndef QT_NO_COMPLETER
|
#if QT_CONFIG(completer)
|
||||||
if (d->lineEdit
|
if (d->lineEdit
|
||||||
&& d->lineEdit->completer()
|
&& d->lineEdit->completer()
|
||||||
&& d->lineEdit->completer()->popup()
|
&& d->lineEdit->completer()->popup()
|
||||||
@ -3473,7 +3473,7 @@ void QComboBox::setModelColumn(int visibleColumn)
|
|||||||
QListView *lv = qobject_cast<QListView *>(d->viewContainer()->itemView());
|
QListView *lv = qobject_cast<QListView *>(d->viewContainer()->itemView());
|
||||||
if (lv)
|
if (lv)
|
||||||
lv->setModelColumn(visibleColumn);
|
lv->setModelColumn(visibleColumn);
|
||||||
#ifndef QT_NO_COMPLETER
|
#if QT_CONFIG(completer)
|
||||||
if (d->lineEdit && d->lineEdit->completer()
|
if (d->lineEdit && d->lineEdit->completer()
|
||||||
&& d->lineEdit->completer() == d->completer)
|
&& d->lineEdit->completer() == d->completer)
|
||||||
d->lineEdit->completer()->setCompletionColumn(visibleColumn);
|
d->lineEdit->completer()->setCompletionColumn(visibleColumn);
|
||||||
|
@ -71,10 +71,10 @@ class Q_WIDGETS_EXPORT QComboBox : public QWidget
|
|||||||
Q_PROPERTY(int minimumContentsLength READ minimumContentsLength WRITE setMinimumContentsLength)
|
Q_PROPERTY(int minimumContentsLength READ minimumContentsLength WRITE setMinimumContentsLength)
|
||||||
Q_PROPERTY(QSize iconSize READ iconSize WRITE setIconSize)
|
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(bool autoCompletion READ autoCompletion WRITE setAutoCompletion DESIGNABLE false)
|
||||||
Q_PROPERTY(Qt::CaseSensitivity autoCompletionCaseSensitivity READ autoCompletionCaseSensitivity WRITE setAutoCompletionCaseSensitivity 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 duplicatesEnabled READ duplicatesEnabled WRITE setDuplicatesEnabled)
|
||||||
Q_PROPERTY(bool frame READ hasFrame WRITE setFrame)
|
Q_PROPERTY(bool frame READ hasFrame WRITE setFrame)
|
||||||
@ -91,7 +91,7 @@ public:
|
|||||||
void setMaxCount(int max);
|
void setMaxCount(int max);
|
||||||
int maxCount() const;
|
int maxCount() const;
|
||||||
|
|
||||||
#ifndef QT_NO_COMPLETER
|
#if QT_CONFIG(completer)
|
||||||
bool autoCompletion() const;
|
bool autoCompletion() const;
|
||||||
void setAutoCompletion(bool enable);
|
void setAutoCompletion(bool enable);
|
||||||
|
|
||||||
@ -149,7 +149,7 @@ public:
|
|||||||
const QValidator *validator() const;
|
const QValidator *validator() const;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef QT_NO_COMPLETER
|
#if QT_CONFIG(completer)
|
||||||
void setCompleter(QCompleter *c);
|
void setCompleter(QCompleter *c);
|
||||||
QCompleter *completer() const;
|
QCompleter *completer() const;
|
||||||
#endif
|
#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_rowsRemoved(const QModelIndex & parent, int start, int end))
|
||||||
Q_PRIVATE_SLOT(d_func(), void _q_modelDestroyed())
|
Q_PRIVATE_SLOT(d_func(), void _q_modelDestroyed())
|
||||||
Q_PRIVATE_SLOT(d_func(), void _q_modelReset())
|
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))
|
Q_PRIVATE_SLOT(d_func(), void _q_completerActivated(const QModelIndex &index))
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
@ -67,7 +67,9 @@
|
|||||||
#include "QtCore/qtimer.h"
|
#include "QtCore/qtimer.h"
|
||||||
#include "private/qwidget_p.h"
|
#include "private/qwidget_p.h"
|
||||||
#include "QtCore/qpointer.h"
|
#include "QtCore/qpointer.h"
|
||||||
|
#if QT_CONFIG(completer)
|
||||||
#include "QtWidgets/qcompleter.h"
|
#include "QtWidgets/qcompleter.h"
|
||||||
|
#endif
|
||||||
#include "QtGui/qevent.h"
|
#include "QtGui/qevent.h"
|
||||||
#include "QtCore/qdebug.h"
|
#include "QtCore/qdebug.h"
|
||||||
|
|
||||||
@ -355,7 +357,7 @@ public:
|
|||||||
void _q_emitCurrentIndexChanged(const QModelIndex &index);
|
void _q_emitCurrentIndexChanged(const QModelIndex &index);
|
||||||
void _q_modelDestroyed();
|
void _q_modelDestroyed();
|
||||||
void _q_modelReset();
|
void _q_modelReset();
|
||||||
#ifndef QT_NO_COMPLETER
|
#if QT_CONFIG(completer)
|
||||||
void _q_completerActivated(const QModelIndex &index);
|
void _q_completerActivated(const QModelIndex &index);
|
||||||
#endif
|
#endif
|
||||||
void _q_resetButton();
|
void _q_resetButton();
|
||||||
@ -415,7 +417,7 @@ public:
|
|||||||
#ifdef Q_OS_MAC
|
#ifdef Q_OS_MAC
|
||||||
QPlatformMenu *m_platformMenu;
|
QPlatformMenu *m_platformMenu;
|
||||||
#endif
|
#endif
|
||||||
#ifndef QT_NO_COMPLETER
|
#if QT_CONFIG(completer)
|
||||||
QPointer<QCompleter> completer;
|
QPointer<QCompleter> completer;
|
||||||
#endif
|
#endif
|
||||||
static QPalette viewContainerPalette(QComboBox *cmb)
|
static QPalette viewContainerPalette(QComboBox *cmb)
|
||||||
|
@ -615,7 +615,7 @@ void QLineEdit::setValidator(const QValidator *v)
|
|||||||
}
|
}
|
||||||
#endif // QT_NO_VALIDATOR
|
#endif // QT_NO_VALIDATOR
|
||||||
|
|
||||||
#ifndef QT_NO_COMPLETER
|
#if QT_CONFIG(completer)
|
||||||
/*!
|
/*!
|
||||||
\since 4.2
|
\since 4.2
|
||||||
|
|
||||||
@ -667,7 +667,7 @@ QCompleter *QLineEdit::completer() const
|
|||||||
return d->control->completer();
|
return d->control->completer();
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // QT_NO_COMPLETER
|
#endif // QT_CONFIG(completer)
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
Returns a recommended size for the widget.
|
Returns a recommended size for the widget.
|
||||||
@ -1742,7 +1742,7 @@ void QLineEdit::inputMethodEvent(QInputMethodEvent *e)
|
|||||||
|
|
||||||
d->control->processInputMethodEvent(e);
|
d->control->processInputMethodEvent(e);
|
||||||
|
|
||||||
#ifndef QT_NO_COMPLETER
|
#if QT_CONFIG(completer)
|
||||||
if (!e->commitString().isEmpty())
|
if (!e->commitString().isEmpty())
|
||||||
d->control->complete(Qt::Key_unknown);
|
d->control->complete(Qt::Key_unknown);
|
||||||
#endif
|
#endif
|
||||||
@ -1823,7 +1823,7 @@ void QLineEdit::focusInEvent(QFocusEvent *e)
|
|||||||
d->control->setCancelText(d->control->text());
|
d->control->setCancelText(d->control->text());
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#ifndef QT_NO_COMPLETER
|
#if QT_CONFIG(completer)
|
||||||
if (d->control->completer()) {
|
if (d->control->completer()) {
|
||||||
d->control->completer()->setWidget(this);
|
d->control->completer()->setWidget(this);
|
||||||
QObject::connect(d->control->completer(), SIGNAL(activated(QString)),
|
QObject::connect(d->control->completer(), SIGNAL(activated(QString)),
|
||||||
@ -1870,7 +1870,7 @@ void QLineEdit::focusOutEvent(QFocusEvent *e)
|
|||||||
#ifdef QT_KEYPAD_NAVIGATION
|
#ifdef QT_KEYPAD_NAVIGATION
|
||||||
d->control->setCancelText(QString());
|
d->control->setCancelText(QString());
|
||||||
#endif
|
#endif
|
||||||
#ifndef QT_NO_COMPLETER
|
#if QT_CONFIG(completer)
|
||||||
if (d->control->completer()) {
|
if (d->control->completer()) {
|
||||||
QObject::disconnect(d->control->completer(), 0, this, 0);
|
QObject::disconnect(d->control->completer(), 0, this, 0);
|
||||||
}
|
}
|
||||||
|
@ -124,7 +124,7 @@ public:
|
|||||||
const QValidator * validator() const;
|
const QValidator * validator() const;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef QT_NO_COMPLETER
|
#if QT_CONFIG(completer)
|
||||||
void setCompleter(QCompleter *completer);
|
void setCompleter(QCompleter *completer);
|
||||||
QCompleter *completer() const;
|
QCompleter *completer() const;
|
||||||
#endif
|
#endif
|
||||||
@ -250,7 +250,7 @@ private:
|
|||||||
Q_PRIVATE_SLOT(d_func(), void _q_handleWindowActivate())
|
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_textEdited(const QString &))
|
||||||
Q_PRIVATE_SLOT(d_func(), void _q_cursorPositionChanged(int, int))
|
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 &))
|
Q_PRIVATE_SLOT(d_func(), void _q_completionHighlighted(const QString &))
|
||||||
#endif
|
#endif
|
||||||
#ifdef QT_KEYPAD_NAVIGATION
|
#ifdef QT_KEYPAD_NAVIGATION
|
||||||
|
@ -90,7 +90,7 @@ QRect QLineEditPrivate::cursorRect() const
|
|||||||
return adjustedControlRect(control->cursorRect());
|
return adjustedControlRect(control->cursorRect());
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef QT_NO_COMPLETER
|
#if QT_CONFIG(completer)
|
||||||
|
|
||||||
void QLineEditPrivate::_q_completionHighlighted(const QString &newText)
|
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()
|
void QLineEditPrivate::_q_handleWindowActivate()
|
||||||
{
|
{
|
||||||
@ -124,7 +124,7 @@ void QLineEditPrivate::_q_textEdited(const QString &text)
|
|||||||
{
|
{
|
||||||
Q_Q(QLineEdit);
|
Q_Q(QLineEdit);
|
||||||
emit q->textEdited(text);
|
emit q->textEdited(text);
|
||||||
#ifndef QT_NO_COMPLETER
|
#if QT_CONFIG(completer)
|
||||||
if (control->completer()
|
if (control->completer()
|
||||||
&& control->completer()->completionMode() != QCompleter::InlineCompletion)
|
&& control->completer()->completionMode() != QCompleter::InlineCompletion)
|
||||||
control->complete(-1); // update the popup on cut/paste/del
|
control->complete(-1); // update the popup on cut/paste/del
|
||||||
|
@ -63,7 +63,9 @@
|
|||||||
#include "QtGui/qicon.h"
|
#include "QtGui/qicon.h"
|
||||||
#include "QtWidgets/qstyleoption.h"
|
#include "QtWidgets/qstyleoption.h"
|
||||||
#include "QtCore/qbasictimer.h"
|
#include "QtCore/qbasictimer.h"
|
||||||
|
#if QT_CONFIG(completer)
|
||||||
#include "QtWidgets/qcompleter.h"
|
#include "QtWidgets/qcompleter.h"
|
||||||
|
#endif
|
||||||
#include "QtCore/qpointer.h"
|
#include "QtCore/qpointer.h"
|
||||||
#include "QtCore/qmimedata.h"
|
#include "QtCore/qmimedata.h"
|
||||||
|
|
||||||
@ -203,7 +205,7 @@ public:
|
|||||||
#endif
|
#endif
|
||||||
void _q_selectionChanged();
|
void _q_selectionChanged();
|
||||||
void _q_updateNeeded(const QRect &);
|
void _q_updateNeeded(const QRect &);
|
||||||
#ifndef QT_NO_COMPLETER
|
#if QT_CONFIG(completer)
|
||||||
void _q_completionHighlighted(const QString &);
|
void _q_completionHighlighted(const QString &);
|
||||||
#endif
|
#endif
|
||||||
QPoint mousePressPos;
|
QPoint mousePressPos;
|
||||||
|
@ -1428,7 +1428,7 @@ void QWidgetLineControl::emitCursorPositionChanged()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef QT_NO_COMPLETER
|
#if QT_CONFIG(completer)
|
||||||
// iterating forward(dir=1)/backward(dir=-1) from the
|
// iterating forward(dir=1)/backward(dir=-1) from the
|
||||||
// current row based. dir=0 indicates a new completion prefix was set.
|
// current row based. dir=0 indicates a new completion prefix was set.
|
||||||
bool QWidgetLineControl::advanceToEnabledItem(int dir)
|
bool QWidgetLineControl::advanceToEnabledItem(int dir)
|
||||||
@ -1627,7 +1627,7 @@ void QWidgetLineControl::processKeyEvent(QKeyEvent* event)
|
|||||||
{
|
{
|
||||||
bool inlineCompletionAccepted = false;
|
bool inlineCompletionAccepted = false;
|
||||||
|
|
||||||
#ifndef QT_NO_COMPLETER
|
#if QT_CONFIG(completer)
|
||||||
if (m_completer) {
|
if (m_completer) {
|
||||||
QCompleter::CompletionMode completionMode = m_completer->completionMode();
|
QCompleter::CompletionMode completionMode = m_completer->completionMode();
|
||||||
if ((completionMode == QCompleter::PopupCompletion
|
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 (event->key() == Qt::Key_Enter || event->key() == Qt::Key_Return) {
|
||||||
if (hasAcceptableInput() || fixup()) {
|
if (hasAcceptableInput() || fixup()) {
|
||||||
@ -1774,7 +1774,7 @@ void QWidgetLineControl::processKeyEvent(QKeyEvent* event)
|
|||||||
end(1);
|
end(1);
|
||||||
}
|
}
|
||||||
else if (event == QKeySequence::MoveToNextChar) {
|
else if (event == QKeySequence::MoveToNextChar) {
|
||||||
#if defined(QT_NO_COMPLETER)
|
#if !QT_CONFIG(completer)
|
||||||
const bool inlineCompletion = false;
|
const bool inlineCompletion = false;
|
||||||
#else
|
#else
|
||||||
const bool inlineCompletion = m_completer && m_completer->completionMode() == QCompleter::InlineCompletion;
|
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));
|
cursorForward(1, visual ? 1 : (layoutDirection() == Qt::LeftToRight ? 1 : -1));
|
||||||
}
|
}
|
||||||
else if (event == QKeySequence::MoveToPreviousChar) {
|
else if (event == QKeySequence::MoveToPreviousChar) {
|
||||||
#if defined(QT_NO_COMPLETER)
|
#if !QT_CONFIG(completer)
|
||||||
const bool inlineCompletion = false;
|
const bool inlineCompletion = false;
|
||||||
#else
|
#else
|
||||||
const bool inlineCompletion = m_completer && m_completer->completionMode() == QCompleter::InlineCompletion;
|
const bool inlineCompletion = m_completer && m_completer->completionMode() == QCompleter::InlineCompletion;
|
||||||
@ -1886,7 +1886,7 @@ void QWidgetLineControl::processKeyEvent(QKeyEvent* event)
|
|||||||
del();
|
del();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
#ifndef QT_NO_COMPLETER
|
#if QT_CONFIG(completer)
|
||||||
case Qt::Key_Up:
|
case Qt::Key_Up:
|
||||||
case Qt::Key_Down:
|
case Qt::Key_Down:
|
||||||
complete(event->key());
|
complete(event->key());
|
||||||
@ -1901,7 +1901,7 @@ void QWidgetLineControl::processKeyEvent(QKeyEvent* event)
|
|||||||
case Qt::Key_Backspace:
|
case Qt::Key_Backspace:
|
||||||
if (!isReadOnly()) {
|
if (!isReadOnly()) {
|
||||||
backspace();
|
backspace();
|
||||||
#ifndef QT_NO_COMPLETER
|
#if QT_CONFIG(completer)
|
||||||
complete(Qt::Key_Backspace);
|
complete(Qt::Key_Backspace);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@ -1941,7 +1941,7 @@ void QWidgetLineControl::processKeyEvent(QKeyEvent* event)
|
|||||||
&& !isReadOnly()
|
&& !isReadOnly()
|
||||||
&& isAcceptableInput(event)) {
|
&& isAcceptableInput(event)) {
|
||||||
insert(event->text());
|
insert(event->text());
|
||||||
#ifndef QT_NO_COMPLETER
|
#if QT_CONFIG(completer)
|
||||||
complete(event->key());
|
complete(event->key());
|
||||||
#endif
|
#endif
|
||||||
event->accept();
|
event->accept();
|
||||||
|
@ -62,7 +62,9 @@
|
|||||||
#include "QtGui/qclipboard.h"
|
#include "QtGui/qclipboard.h"
|
||||||
#include "QtGui/qinputmethod.h"
|
#include "QtGui/qinputmethod.h"
|
||||||
#include "QtCore/qpoint.h"
|
#include "QtCore/qpoint.h"
|
||||||
|
#if QT_CONFIG(completer)
|
||||||
#include "QtWidgets/qcompleter.h"
|
#include "QtWidgets/qcompleter.h"
|
||||||
|
#endif
|
||||||
#include "QtCore/qthread.h"
|
#include "QtCore/qthread.h"
|
||||||
#include "QtGui/private/qinputcontrol_p.h"
|
#include "QtGui/private/qinputcontrol_p.h"
|
||||||
|
|
||||||
@ -289,7 +291,7 @@ public:
|
|||||||
void setValidator(const QValidator *v) { m_validator = const_cast<QValidator*>(v); }
|
void setValidator(const QValidator *v) { m_validator = const_cast<QValidator*>(v); }
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef QT_NO_COMPLETER
|
#if QT_CONFIG(completer)
|
||||||
QCompleter *completer() const { return m_completer; }
|
QCompleter *completer() const { return m_completer; }
|
||||||
/* Note that you must set the widget for the completer separately */
|
/* Note that you must set the widget for the completer separately */
|
||||||
void setCompleter(const QCompleter *c) { m_completer = const_cast<QCompleter*>(c); }
|
void setCompleter(const QCompleter *c) { m_completer = const_cast<QCompleter*>(c); }
|
||||||
@ -461,7 +463,7 @@ private:
|
|||||||
QPointer<QValidator> m_validator;
|
QPointer<QValidator> m_validator;
|
||||||
#endif
|
#endif
|
||||||
QPointer<QCompleter> m_completer;
|
QPointer<QCompleter> m_completer;
|
||||||
#ifndef QT_NO_COMPLETER
|
#if QT_CONFIG(completer)
|
||||||
bool advanceToEnabledItem(int dir);
|
bool advanceToEnabledItem(int dir);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -83,7 +83,7 @@ private slots:
|
|||||||
void customPaperSizeAndMargins();
|
void customPaperSizeAndMargins();
|
||||||
void customPaperNameSettingBySize();
|
void customPaperNameSettingBySize();
|
||||||
void customPaperNameSettingByName();
|
void customPaperNameSettingByName();
|
||||||
#if !defined(QT_NO_COMPLETER) && QT_CONFIG(filedialog)
|
#if QT_CONFIG(completer) && QT_CONFIG(filedialog)
|
||||||
void printDialogCompleter();
|
void printDialogCompleter();
|
||||||
#endif
|
#endif
|
||||||
void testCurrentPage();
|
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()
|
void tst_QPrinter::printDialogCompleter()
|
||||||
{
|
{
|
||||||
QPrintDialog dialog;
|
QPrintDialog dialog;
|
||||||
|
@ -261,7 +261,7 @@ private slots:
|
|||||||
// task-specific tests:
|
// task-specific tests:
|
||||||
void task180999_focus();
|
void task180999_focus();
|
||||||
void task174640_editingFinished();
|
void task174640_editingFinished();
|
||||||
#ifndef QT_NO_COMPLETER
|
#if QT_CONFIG(completer)
|
||||||
void task198789_currentCompletion();
|
void task198789_currentCompletion();
|
||||||
void task210502_caseInsensitiveInlineCompletion();
|
void task210502_caseInsensitiveInlineCompletion();
|
||||||
#endif
|
#endif
|
||||||
@ -3630,7 +3630,7 @@ void tst_QLineEdit::task174640_editingFinished()
|
|||||||
QCOMPARE(editingFinishedSpy.count(), 1);
|
QCOMPARE(editingFinishedSpy.count(), 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef QT_NO_COMPLETER
|
#if QT_CONFIG(completer)
|
||||||
class task198789_Widget : public QWidget
|
class task198789_Widget : public QWidget
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
@ -3689,7 +3689,7 @@ void tst_QLineEdit::task210502_caseInsensitiveInlineCompletion()
|
|||||||
QCOMPARE(lineEdit.text(), completion);
|
QCOMPARE(lineEdit.text(), completion);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // QT_NO_COMPLETER
|
#endif // QT_CONFIG(completer)
|
||||||
|
|
||||||
|
|
||||||
void tst_QLineEdit::task229938_dontEmitChangedWhenTextIsNotChanged()
|
void tst_QLineEdit::task229938_dontEmitChangedWhenTextIsNotChanged()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user