From b1f54536ba882c75251a3f8f5844b4338fbb4fc8 Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Thu, 29 Aug 2019 14:16:40 +0200 Subject: QmlDesigner: Make AnimationCurveDialog a normal modal dialog QDialog::open() opens the dialog as a modal dialog. Since no dialog parent was set the dialog did not block any parent windows. In this patch we set Core::ICore::dialogParent as the parent and use show() instead of open(). The dialog is not modal anymore and Qt Creator is the proper parent window. Therefore Qt::WindowStaysOnTopHint is not required anymore. Change-Id: Iea48a73e67de5e9d2568e71145d57d0ffd0df78b Reviewed-by: Tim Jenssen --- .../qmldesigner/components/timelineeditor/animationcurvedialog.cpp | 2 -- .../qmldesigner/components/timelineeditor/timelinetoolbar.cpp | 5 +++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/plugins/qmldesigner/components/timelineeditor/animationcurvedialog.cpp b/src/plugins/qmldesigner/components/timelineeditor/animationcurvedialog.cpp index abc7778125..08269f0a92 100644 --- a/src/plugins/qmldesigner/components/timelineeditor/animationcurvedialog.cpp +++ b/src/plugins/qmldesigner/components/timelineeditor/animationcurvedialog.cpp @@ -33,7 +33,6 @@ AnimationCurveDialog::AnimationCurveDialog(QWidget *parent) : QDialog(parent) , m_editor(nullptr) { - setWindowFlag(Qt::WindowStaysOnTopHint, true); setWindowFlag(Qt::WindowContextHelpButtonHint, false); } @@ -41,7 +40,6 @@ AnimationCurveDialog::AnimationCurveDialog(DesignTools::CurveEditorModel *model, : QDialog(parent) , m_editor(nullptr) { - setWindowFlag(Qt::WindowStaysOnTopHint, true); setWindowFlag(Qt::WindowContextHelpButtonHint, false); setModel(model); } diff --git a/src/plugins/qmldesigner/components/timelineeditor/timelinetoolbar.cpp b/src/plugins/qmldesigner/components/timelineeditor/timelinetoolbar.cpp index 33c6dafa34..6e6ae34e43 100644 --- a/src/plugins/qmldesigner/components/timelineeditor/timelinetoolbar.cpp +++ b/src/plugins/qmldesigner/components/timelineeditor/timelinetoolbar.cpp @@ -40,6 +40,7 @@ #include #include +#include #include @@ -101,7 +102,7 @@ QAction *createAction(const Core::Id &id, TimelineToolBar::TimelineToolBar(QWidget *parent) : QToolBar(parent) , m_grp() - , m_dialog() + , m_dialog(Core::ICore::dialogParent()) , m_curveModel(new AnimationCurveEditorModel(0., 500.)) { m_dialog.setModel(m_curveModel); @@ -221,7 +222,7 @@ void TimelineToolBar::removeTimeline(const QmlTimeline &timeline) void TimelineToolBar::openAnimationCurveEditor() { - m_dialog.open(); + m_dialog.show(); } void TimelineToolBar::updateCurve(DesignTools::PropertyTreeItem *item) -- cgit v1.2.3