diff options
author | Liang Qi <liang.qi@qt.io> | 2018-09-27 11:08:55 +0200 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2018-09-27 11:08:55 +0200 |
commit | d0fcaa7eaaae85ddbf0a78efa59b341380c101a4 (patch) | |
tree | 9b3422ae33ef9dfcda0af228c56c3d2eeed7b0c3 /src/widgets/util | |
parent | f6ce2d42b3cbe049ebcf1a2349a5cd4dde2c6d24 (diff) | |
parent | 5e64957ee4162ecf4456306a530a68761c2b127f (diff) |
Merge remote-tracking branch 'origin/5.11' into 5.12
Conflicts:
src/corelib/global/qconfig-bootstrapped.h
src/widgets/util/qcompleter.cpp
Change-Id: I4f44f0f074982530f2f2e750ce696230b2754cf3
Diffstat (limited to 'src/widgets/util')
-rw-r--r-- | src/widgets/util/qcompleter.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
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); |