Use QT_CONFIG(proxymodel) instead of QT_NO_PROXYMODEL

Change-Id: Ie01a118b2aa11fcbeaf073ee2d28ceaeffc8a6ad
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
bb10
Ulf Hermann 2016-12-02 12:06:40 +01:00
parent 30306d8c93
commit 89a19935d4
3 changed files with 14 additions and 14 deletions

View File

@ -517,7 +517,7 @@ void QFileDialog::changeEvent(QEvent *e)
QFileDialogPrivate::QFileDialogPrivate()
:
#ifndef QT_NO_PROXYMODEL
#if QT_CONFIG(proxymodel)
proxyModel(0),
#endif
model(0),
@ -663,7 +663,7 @@ void QFileDialogPrivate::retranslateStrings()
QList<QAction*> actions = qFileDialogUi->treeView->header()->actions();
QAbstractItemModel *abstractModel = model;
#ifndef QT_NO_PROXYMODEL
#if QT_CONFIG(proxymodel)
if (proxyModel)
abstractModel = proxyModel;
#endif
@ -2796,7 +2796,7 @@ bool QFileDialogPrivate::restoreWidgetState(QStringList &history, int splitterPo
QList<QAction*> actions = headerView->actions();
QAbstractItemModel *abstractModel = model;
#ifndef QT_NO_PROXYMODEL
#if QT_CONFIG(proxymodel)
if (proxyModel)
abstractModel = proxyModel;
#endif
@ -2965,7 +2965,7 @@ void QFileDialogPrivate::createWidgets()
q, SLOT(_q_showHeader(QAction*)));;
QAbstractItemModel *abstractModel = model;
#ifndef QT_NO_PROXYMODEL
#if QT_CONFIG(proxymodel)
if (proxyModel)
abstractModel = proxyModel;
#endif
@ -3046,7 +3046,7 @@ void QFileDialogPrivate::_q_showHeader(QAction *action)
qFileDialogUi->treeView->header()->setSectionHidden(actionGroup->actions().indexOf(action) + 1, !action->isChecked());
}
#ifndef QT_NO_PROXYMODEL
#if QT_CONFIG(proxymodel)
/*!
\since 4.3
@ -3124,7 +3124,7 @@ QAbstractProxyModel *QFileDialog::proxyModel() const
Q_D(const QFileDialog);
return d->proxyModel;
}
#endif // QT_NO_PROXYMODEL
#endif // QT_CONFIG(proxymodel)
/*!
\internal

View File

@ -178,7 +178,7 @@ public:
void setSupportedSchemes(const QStringList &schemes);
QStringList supportedSchemes() const;
#ifndef QT_NO_PROXYMODEL
#if QT_CONFIG(proxymodel)
void setProxyModel(QAbstractProxyModel *model);
QAbstractProxyModel *proxyModel() const;
#endif

View File

@ -227,7 +227,7 @@ public:
void _q_fileRenamed(const QString &path, const QString &oldName, const QString &newName);
// layout
#ifndef QT_NO_PROXYMODEL
#if QT_CONFIG(proxymodel)
QAbstractProxyModel *proxyModel;
#endif
@ -346,17 +346,17 @@ private:
};
QModelIndex QFileDialogPrivate::mapToSource(const QModelIndex &index) const {
#ifdef QT_NO_PROXYMODEL
return index;
#else
#if QT_CONFIG(proxymodel)
return proxyModel ? proxyModel->mapToSource(index) : index;
#else
return index;
#endif
}
QModelIndex QFileDialogPrivate::mapFromSource(const QModelIndex &index) const {
#ifdef QT_NO_PROXYMODEL
return index;
#else
#if QT_CONFIG(proxymodel)
return proxyModel ? proxyModel->mapFromSource(index) : index;
#else
return index;
#endif
}