diff options
author | Samuel Ghinet <samuel.ghinet@qt.io> | 2022-06-01 14:56:12 +0300 |
---|---|---|
committer | Samuel Ghinet <samuel.ghinet@qt.io> | 2022-06-01 11:59:16 +0000 |
commit | e5ce1f98f70bc8838a73ae854def5cb198d250b0 (patch) | |
tree | b865eb2851138f37ce830384637ef6b03b710651 | |
parent | c3b90c0ce5e7c97fdac0d09619ab16ce71dafb14 (diff) |
Fix build error: Allow changing the 3D Editor's background color
Task-number: QDS-6585
Change-Id: Id87e5403a3c6d398aa9ebf85cc97cc4c9bf7a2a2
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
-rw-r--r-- | src/plugins/qmldesigner/components/edit3d/backgroundcolorselection.cpp | 6 | ||||
-rw-r--r-- | src/plugins/qmldesigner/components/edit3d/backgroundcolorselection.h | 4 |
2 files changed, 7 insertions, 3 deletions
diff --git a/src/plugins/qmldesigner/components/edit3d/backgroundcolorselection.cpp b/src/plugins/qmldesigner/components/edit3d/backgroundcolorselection.cpp index c947d8e155..76db41a177 100644 --- a/src/plugins/qmldesigner/components/edit3d/backgroundcolorselection.cpp +++ b/src/plugins/qmldesigner/components/edit3d/backgroundcolorselection.cpp @@ -65,7 +65,7 @@ void saveBackgroundColorConfiguration(const QList<QColor> &colorConfig) } // namespace -QPointer<QColorDialog> BackgroundColorSelection::createDialog(QWidget *parent) +QColorDialog *BackgroundColorSelection::createDialog(QWidget *parent) { auto dialog = new QColorDialog(parent); @@ -100,4 +100,8 @@ void BackgroundColorSelection::showBackgroundColorSelectionWidget(QWidget *paren m_dialog = BackgroundColorSelection::createDialog(parent); QTC_ASSERT(m_dialog, return); + + QObject::connect(m_dialog, &QWidget::destroyed, m_dialog, [&]() { + m_dialog = nullptr; + }); } diff --git a/src/plugins/qmldesigner/components/edit3d/backgroundcolorselection.h b/src/plugins/qmldesigner/components/edit3d/backgroundcolorselection.h index d90693f03c..d8832f40fd 100644 --- a/src/plugins/qmldesigner/components/edit3d/backgroundcolorselection.h +++ b/src/plugins/qmldesigner/components/edit3d/backgroundcolorselection.h @@ -40,8 +40,8 @@ public: static void showBackgroundColorSelectionWidget(QWidget *parent); private: - static QPointer<QColorDialog> createDialog(QWidget *parent); - inline static QPointer<QColorDialog> m_dialog; + static QColorDialog *createDialog(QWidget *parent); + inline static QColorDialog *m_dialog = nullptr; }; } // namespace QmlDesigner |