dismiss on focus out if a View was clicked
BUG:334810
This commit is contained in:
parent
80be35661c
commit
5600cb0fea
@ -22,6 +22,7 @@
|
|||||||
#include "dialog.h"
|
#include "dialog.h"
|
||||||
#include "../declarativeimports/core/framesvgitem.h"
|
#include "../declarativeimports/core/framesvgitem.h"
|
||||||
#include "dialogshadows_p.h"
|
#include "dialogshadows_p.h"
|
||||||
|
#include "view.h"
|
||||||
|
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
#include <QQuickItem>
|
#include <QQuickItem>
|
||||||
@ -793,7 +794,7 @@ void Dialog::focusOutEvent(QFocusEvent *ev)
|
|||||||
const QWindow *focusWindow = QGuiApplication::focusWindow();
|
const QWindow *focusWindow = QGuiApplication::focusWindow();
|
||||||
bool childHasFocus = (focusWindow && focusWindow->isActive() && isAncestorOf(focusWindow));
|
bool childHasFocus = (focusWindow && focusWindow->isActive() && isAncestorOf(focusWindow));
|
||||||
|
|
||||||
if (!parentHasFocus && !childHasFocus) {
|
if (qobject_cast<const View *>(focusWindow) || (!parentHasFocus && !childHasFocus)) {
|
||||||
qDebug() << "DIALOG: hiding dialog.";
|
qDebug() << "DIALOG: hiding dialog.";
|
||||||
setVisible(false);
|
setVisible(false);
|
||||||
emit windowDeactivated();
|
emit windowDeactivated();
|
||||||
|
Loading…
Reference in New Issue
Block a user