Convert features.fscompleter to QT_[REQUIRE_]CONFIG
Fix one #include as only QCompleter is used and not QFSCompleter. Change-Id: Ia1e722122f7e322c678d2db6962c6086c684ddd9 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
This commit is contained in:
parent
379179df9d
commit
341554e343
@ -61,7 +61,7 @@
|
|||||||
|
|
||||||
#include <QtWidgets/qdialogbuttonbox.h>
|
#include <QtWidgets/qdialogbuttonbox.h>
|
||||||
|
|
||||||
#include "private/qfscompleter_p.h"
|
#include <private/qcompleter_p.h>
|
||||||
#include "ui_qprintpropertieswidget.h"
|
#include "ui_qprintpropertieswidget.h"
|
||||||
#include "ui_qprintsettingsoutput.h"
|
#include "ui_qprintsettingsoutput.h"
|
||||||
#include "ui_qprintwidget.h"
|
#include "ui_qprintwidget.h"
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
# Qt dialogs module
|
# Qt dialogs module
|
||||||
|
|
||||||
HEADERS += \
|
HEADERS += \
|
||||||
dialogs/qfscompleter_p.h \
|
|
||||||
dialogs/qfontdialog.h \
|
dialogs/qfontdialog.h \
|
||||||
dialogs/qfontdialog_p.h \
|
dialogs/qfontdialog_p.h \
|
||||||
dialogs/qfilesystemmodel.h \
|
dialogs/qfilesystemmodel.h \
|
||||||
@ -46,6 +45,10 @@ qtConfig(filedialog) {
|
|||||||
FORMS += dialogs/qfiledialog.ui
|
FORMS += dialogs/qfiledialog.ui
|
||||||
}
|
}
|
||||||
|
|
||||||
|
qtConfig(fscompleter) {
|
||||||
|
HEADERS += dialogs/qfscompleter_p.h
|
||||||
|
}
|
||||||
|
|
||||||
qtConfig(inputdialog) {
|
qtConfig(inputdialog) {
|
||||||
HEADERS += dialogs/qinputdialog.h
|
HEADERS += dialogs/qinputdialog.h
|
||||||
SOURCES += dialogs/qinputdialog.cpp
|
SOURCES += dialogs/qinputdialog.cpp
|
||||||
|
@ -841,7 +841,7 @@ void QFileDialog::setVisible(bool visible)
|
|||||||
// Set WA_DontShowOnScreen so that QDialog::setVisible(visible) below
|
// Set WA_DontShowOnScreen so that QDialog::setVisible(visible) below
|
||||||
// updates the state correctly, but skips showing the non-native version:
|
// updates the state correctly, but skips showing the non-native version:
|
||||||
setAttribute(Qt::WA_DontShowOnScreen);
|
setAttribute(Qt::WA_DontShowOnScreen);
|
||||||
#ifndef QT_NO_FSCOMPLETER
|
#if QT_CONFIG(fscompleter)
|
||||||
// So the completer doesn't try to complete and therefore show a popup
|
// So the completer doesn't try to complete and therefore show a popup
|
||||||
if (!d->nativeDialogInUse)
|
if (!d->nativeDialogInUse)
|
||||||
d->completer->setModel(0);
|
d->completer->setModel(0);
|
||||||
@ -849,7 +849,7 @@ void QFileDialog::setVisible(bool visible)
|
|||||||
} else {
|
} else {
|
||||||
d->createWidgets();
|
d->createWidgets();
|
||||||
setAttribute(Qt::WA_DontShowOnScreen, false);
|
setAttribute(Qt::WA_DontShowOnScreen, false);
|
||||||
#ifndef QT_NO_FSCOMPLETER
|
#if QT_CONFIG(fscompleter)
|
||||||
if (!d->nativeDialogInUse) {
|
if (!d->nativeDialogInUse) {
|
||||||
if (d->proxyModel != 0)
|
if (d->proxyModel != 0)
|
||||||
d->completer->setModel(d->proxyModel);
|
d->completer->setModel(d->proxyModel);
|
||||||
@ -922,7 +922,7 @@ void QFileDialog::setDirectory(const QString &directory)
|
|||||||
if (!d->nativeDialogInUse) {
|
if (!d->nativeDialogInUse) {
|
||||||
d->qFileDialogUi->newFolderButton->setEnabled(d->model->flags(root) & Qt::ItemIsDropEnabled);
|
d->qFileDialogUi->newFolderButton->setEnabled(d->model->flags(root) & Qt::ItemIsDropEnabled);
|
||||||
if (root != d->rootIndex()) {
|
if (root != d->rootIndex()) {
|
||||||
#ifndef QT_NO_FSCOMPLETER
|
#if QT_CONFIG(fscompleter)
|
||||||
if (directory.endsWith(QLatin1Char('/')))
|
if (directory.endsWith(QLatin1Char('/')))
|
||||||
d->completer->setCompletionPrefix(newDirectory);
|
d->completer->setCompletionPrefix(newDirectory);
|
||||||
else
|
else
|
||||||
@ -2909,10 +2909,10 @@ void QFileDialogPrivate::createWidgets()
|
|||||||
#ifndef QT_NO_SHORTCUT
|
#ifndef QT_NO_SHORTCUT
|
||||||
qFileDialogUi->fileNameLabel->setBuddy(qFileDialogUi->fileNameEdit);
|
qFileDialogUi->fileNameLabel->setBuddy(qFileDialogUi->fileNameEdit);
|
||||||
#endif
|
#endif
|
||||||
#ifndef QT_NO_FSCOMPLETER
|
#if QT_CONFIG(fscompleter)
|
||||||
completer = new QFSCompleter(model, q);
|
completer = new QFSCompleter(model, q);
|
||||||
qFileDialogUi->fileNameEdit->setCompleter(completer);
|
qFileDialogUi->fileNameEdit->setCompleter(completer);
|
||||||
#endif // QT_NO_FSCOMPLETER
|
#endif // QT_CONFIG(fscompleter)
|
||||||
|
|
||||||
qFileDialogUi->fileNameEdit->setInputMethodHints(Qt::ImhNoPredictiveText);
|
qFileDialogUi->fileNameEdit->setInputMethodHints(Qt::ImhNoPredictiveText);
|
||||||
|
|
||||||
@ -3078,7 +3078,7 @@ void QFileDialog::setProxyModel(QAbstractProxyModel *proxyModel)
|
|||||||
proxyModel->setSourceModel(d->model);
|
proxyModel->setSourceModel(d->model);
|
||||||
d->qFileDialogUi->listView->setModel(d->proxyModel);
|
d->qFileDialogUi->listView->setModel(d->proxyModel);
|
||||||
d->qFileDialogUi->treeView->setModel(d->proxyModel);
|
d->qFileDialogUi->treeView->setModel(d->proxyModel);
|
||||||
#ifndef QT_NO_FSCOMPLETER
|
#if QT_CONFIG(fscompleter)
|
||||||
d->completer->setModel(d->proxyModel);
|
d->completer->setModel(d->proxyModel);
|
||||||
d->completer->proxyModel = d->proxyModel;
|
d->completer->proxyModel = d->proxyModel;
|
||||||
#endif
|
#endif
|
||||||
@ -3088,7 +3088,7 @@ void QFileDialog::setProxyModel(QAbstractProxyModel *proxyModel)
|
|||||||
d->proxyModel = 0;
|
d->proxyModel = 0;
|
||||||
d->qFileDialogUi->listView->setModel(d->model);
|
d->qFileDialogUi->listView->setModel(d->model);
|
||||||
d->qFileDialogUi->treeView->setModel(d->model);
|
d->qFileDialogUi->treeView->setModel(d->model);
|
||||||
#ifndef QT_NO_FSCOMPLETER
|
#if QT_CONFIG(fscompleter)
|
||||||
d->completer->setModel(d->model);
|
d->completer->setModel(d->model);
|
||||||
d->completer->sourceModel = d->model;
|
d->completer->sourceModel = d->model;
|
||||||
d->completer->proxyModel = 0;
|
d->completer->proxyModel = 0;
|
||||||
@ -4028,7 +4028,7 @@ void QFileDialogLineEdit::keyPressEvent(QKeyEvent *e)
|
|||||||
e->accept();
|
e->accept();
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef QT_NO_FSCOMPLETER
|
#if QT_CONFIG(fscompleter)
|
||||||
|
|
||||||
QString QFSCompleter::pathFromIndex(const QModelIndex &index) const
|
QString QFSCompleter::pathFromIndex(const QModelIndex &index) const
|
||||||
{
|
{
|
||||||
|
@ -73,7 +73,9 @@
|
|||||||
#include <qpointer.h>
|
#include <qpointer.h>
|
||||||
#include <qdebug.h>
|
#include <qdebug.h>
|
||||||
#include "qsidebar_p.h"
|
#include "qsidebar_p.h"
|
||||||
|
#if QT_CONFIG(fscompleter)
|
||||||
#include "qfscompleter_p.h"
|
#include "qfscompleter_p.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined (Q_OS_UNIX)
|
#if defined (Q_OS_UNIX)
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
@ -231,9 +233,9 @@ public:
|
|||||||
QStringList watching;
|
QStringList watching;
|
||||||
QFileSystemModel *model;
|
QFileSystemModel *model;
|
||||||
|
|
||||||
#ifndef QT_NO_FSCOMPLETER
|
#if QT_CONFIG(fscompleter)
|
||||||
QFSCompleter *completer;
|
QFSCompleter *completer;
|
||||||
#endif //QT_NO_FSCOMPLETER
|
#endif //QT_CONFIG(fscompleter)
|
||||||
|
|
||||||
QString setWindowTitle;
|
QString setWindowTitle;
|
||||||
|
|
||||||
|
@ -55,9 +55,9 @@
|
|||||||
#include "qcompleter.h"
|
#include "qcompleter.h"
|
||||||
#include <QtWidgets/qfilesystemmodel.h>
|
#include <QtWidgets/qfilesystemmodel.h>
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_REQUIRE_CONFIG(fscompleter);
|
||||||
|
|
||||||
#ifndef QT_NO_FSCOMPLETER
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
QCompleter that can deal with QFileSystemModel
|
QCompleter that can deal with QFileSystemModel
|
||||||
@ -78,8 +78,6 @@ public:
|
|||||||
QFileSystemModel *sourceModel;
|
QFileSystemModel *sourceModel;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // QT_NO_FSCOMPLETER
|
|
||||||
|
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
#endif // QFSCOMPLETOR_P_H
|
#endif // QFSCOMPLETOR_P_H
|
||||||
|
Loading…
x
Reference in New Issue
Block a user