summaryrefslogtreecommitdiffstats
path: root/src/widgets
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2018-09-27 18:34:12 +0000
committerThe Qt Project <gerrit-noreply@qt-project.org>2018-09-27 18:34:12 +0000
commit353a58ceb96508f0cd6d44b4050bfb69ae2a1c8a (patch)
tree0652749519e6268fa97106d36ae31c72392b0c24 /src/widgets
parent586650f81dc93c0b819df24d5bfd58f2f926b4ad (diff)
parentd0fcaa7eaaae85ddbf0a78efa59b341380c101a4 (diff)
Merge "Merge remote-tracking branch 'origin/5.11' into 5.12" into refs/staging/5.12
Diffstat (limited to 'src/widgets')
-rw-r--r--src/widgets/dialogs/qfilesystemmodel.cpp2
-rw-r--r--src/widgets/itemviews/qdirmodel.cpp2
-rw-r--r--src/widgets/itemviews/qheaderview.cpp3
-rw-r--r--src/widgets/util/qcompleter.cpp9
4 files changed, 10 insertions, 6 deletions
diff --git a/src/widgets/dialogs/qfilesystemmodel.cpp b/src/widgets/dialogs/qfilesystemmodel.cpp
index e4edd2f6ef..e54fdc97d4 100644
--- a/src/widgets/dialogs/qfilesystemmodel.cpp
+++ b/src/widgets/dialogs/qfilesystemmodel.cpp
@@ -797,7 +797,7 @@ QString QFileSystemModelPrivate::time(const QModelIndex &index) const
{
if (!index.isValid())
return QString();
-#ifndef QT_NO_DATESTRING
+#if QT_CONFIG(datestring)
return node(index)->lastModified().toString(Qt::SystemLocaleDate);
#else
Q_UNUSED(index);
diff --git a/src/widgets/itemviews/qdirmodel.cpp b/src/widgets/itemviews/qdirmodel.cpp
index 449850c42e..78fc623fb5 100644
--- a/src/widgets/itemviews/qdirmodel.cpp
+++ b/src/widgets/itemviews/qdirmodel.cpp
@@ -1319,7 +1319,7 @@ QString QDirModelPrivate::type(const QModelIndex &index) const
QString QDirModelPrivate::time(const QModelIndex &index) const
{
-#ifndef QT_NO_DATESTRING
+#if QT_CONFIG(datestring)
return node(index)->info.lastModified().toString(Qt::LocalDate);
#else
Q_UNUSED(index);
diff --git a/src/widgets/itemviews/qheaderview.cpp b/src/widgets/itemviews/qheaderview.cpp
index 3396a91dc5..7bfa51337d 100644
--- a/src/widgets/itemviews/qheaderview.cpp
+++ b/src/widgets/itemviews/qheaderview.cpp
@@ -2213,9 +2213,6 @@ void QHeaderViewPrivate::_q_sectionsAboutToBeChanged(const QList<QPersistentMode
? model->index(0, logical, root)
: model->index(logical, 0, root),
s});
-
- if (layoutChangePersistentSections.size() > 1000)
- break;
}
}
diff --git a/src/widgets/util/qcompleter.cpp b/src/widgets/util/qcompleter.cpp
index df280119cb..0daa4a4b41 100644
--- a/src/widgets/util/qcompleter.cpp
+++ b/src/widgets/util/qcompleter.cpp
@@ -1243,7 +1243,14 @@ void QCompleter::setPopup(QAbstractItemView *popup)
Qt::FocusPolicy origPolicy = Qt::NoFocus;
if (d->widget)
origPolicy = d->widget->focusPolicy();
- popup->setParent(nullptr, Qt::Popup);
+
+ // Mark the widget window as a popup, so that if the last non-popup window is closed by the
+ // user, the application should not be prevented from exiting. It needs to be set explicitly via
+ // setWindowFlag(), because passing the flag via setParent(parent, windowFlags) does not call
+ // QWidgetPrivate::adjustQuitOnCloseAttribute(), and causes an application not to exit if the
+ // popup ends up being the last window.
+ popup->setParent(nullptr);
+ popup->setWindowFlag(Qt::Popup);
popup->setFocusPolicy(Qt::NoFocus);
if (d->widget)
d->widget->setFocusPolicy(origPolicy);