aboutsummaryrefslogtreecommitdiffstats
path: root/src/quickdialogs/quickdialogsquickimpl/qquickfontdialogimpl.cpp
diff options
context:
space:
mode:
authorOliver Eftevaag <oliver.eftevaag@qt.io>2024-05-28 13:21:24 +0200
committerOliver Eftevaag <oliver.eftevaag@qt.io>2024-07-23 10:07:41 +0200
commit18c4bf827dabea735435887f84ad1bea4136b1ea (patch)
tree7c6ec66cb204229c21d126ae4c8add816c2ef795 /src/quickdialogs/quickdialogsquickimpl/qquickfontdialogimpl.cpp
parent0933e62b24855dfbdad061d814a668bfe7ac4f2d (diff)
Enable popup windows for QtQuick.Dialogs
The dialogs in QtQuick.Dialogs look so much better on desktop systems, when they appear inside real top level windows. This change enables the feature for all QtQuick.Dialogs types, and makes manual changes to each dialog, to make sure that they look good. This includes changes that hides the title from the header, since the title can now appear inside the window decoration instead. Lots of tests had to be changed, as a result, to properly generate and deliver events to the correct items. In addition, I've added some helper functions to dialogHelper, to handle cases we're we need to wait for a popup window to appear. Showing popups with dedicated windows, takes longer than simply creating a new item in an existing window. [ChangeLog] All dialogs in QtQuick.Dialogs will now use popup windows, if able. Fixes: QTBUG-126006 Pick-to: 6.8 Change-Id: Ieca6ae643d4f97b1bed648e448bbcd236a50e7e7 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'src/quickdialogs/quickdialogsquickimpl/qquickfontdialogimpl.cpp')
-rw-r--r--src/quickdialogs/quickdialogsquickimpl/qquickfontdialogimpl.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/quickdialogs/quickdialogsquickimpl/qquickfontdialogimpl.cpp b/src/quickdialogs/quickdialogsquickimpl/qquickfontdialogimpl.cpp
index e83913a738..2c2c7e57eb 100644
--- a/src/quickdialogs/quickdialogsquickimpl/qquickfontdialogimpl.cpp
+++ b/src/quickdialogs/quickdialogsquickimpl/qquickfontdialogimpl.cpp
@@ -43,6 +43,7 @@ void QQuickFontDialogImplPrivate::handleClick(QQuickAbstractButton *button)
QQuickFontDialogImpl::QQuickFontDialogImpl(QObject *parent)
: QQuickDialog(*(new QQuickFontDialogImplPrivate), parent)
{
+ setPopupType(QQuickPopup::Window);
}
QQuickFontDialogImplAttached *QQuickFontDialogImpl::qmlAttachedProperties(QObject *object)
@@ -127,9 +128,9 @@ void QQuickFontDialogImpl::keyReleaseEvent(QKeyEvent *event)
// The family and style text edits are read-only so that they
// can show the current selection but also allow key input to "search".
// This is why we handle just the release event, and don't accept it.
- if (window()->activeFocusItem() == attached->familyEdit())
+ if (attached->familyEdit()->hasFocus())
attached->searchFamily(event->text());
- else if (window()->activeFocusItem() == attached->styleEdit())
+ else if (attached->styleEdit()->hasFocus())
attached->searchStyle(event->text());
}