diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2023-12-19 13:52:11 +0100 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2024-01-05 18:36:01 +0000 |
commit | 60e5b99d067bcb28f7ae2a6ac371f300bf03e24e (patch) | |
tree | ecff199b7db8eaa7171d983109b2367e660b9ae9 | |
parent | 29a4460ba942f18609bb6464c1b1470942f1c60b (diff) |
Qt Designer: Replace QDesignerWorkbench::marginHint() by a constant
Task-number: QTBUG-120236
Pick-to: 6.6
Change-Id: I0039e1454f1783a974410637a400f1a5f25a1697
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
(cherry picked from commit cc812731fa2ae7f2757cd64867c3b90dc0decfdb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r-- | src/designer/src/designer/qdesigner_toolwindow.cpp | 8 | ||||
-rw-r--r-- | src/designer/src/designer/qdesigner_workbench.cpp | 4 | ||||
-rw-r--r-- | src/designer/src/designer/qdesigner_workbench.h | 2 |
3 files changed, 2 insertions, 12 deletions
diff --git a/src/designer/src/designer/qdesigner_toolwindow.cpp b/src/designer/src/designer/qdesigner_toolwindow.cpp index 9b63423aa..4c5e5e27a 100644 --- a/src/designer/src/designer/qdesigner_toolwindow.cpp +++ b/src/designer/src/designer/qdesigner_toolwindow.cpp @@ -24,6 +24,8 @@ QT_BEGIN_NAMESPACE using namespace Qt::StringLiterals; +static constexpr int margin = 20; + // ---------------- QDesignerToolWindow QDesignerToolWindow::QDesignerToolWindow(QDesignerWorkbench *workbench, QWidget *w, @@ -148,7 +150,6 @@ PropertyEditorToolWindow::PropertyEditorToolWindow(QDesignerWorkbench *workbench QRect PropertyEditorToolWindow::geometryHint() const { const QRect g = availableToolWindowGeometry(); - const int margin = workbench()->marginHint(); const int spacing = 40; const QSize sz(g.width() * 1/4, g.height() * 4/6); @@ -200,7 +201,6 @@ ActionEditorToolWindow::ActionEditorToolWindow(QDesignerWorkbench *workbench) : QRect ActionEditorToolWindow::geometryHint() const { const QRect g = availableToolWindowGeometry(); - const int margin = workbench()->marginHint(); const QSize sz(g.width() * 1/4, g.height() * 1/6); @@ -242,7 +242,6 @@ ObjectInspectorToolWindow::ObjectInspectorToolWindow(QDesignerWorkbench *workben QRect ObjectInspectorToolWindow::geometryHint() const { const QRect g = availableToolWindowGeometry(); - const int margin = workbench()->marginHint(); const QSize sz(g.width() * 1/4, g.height() * 1/6); @@ -277,7 +276,6 @@ ResourceEditorToolWindow::ResourceEditorToolWindow(QDesignerWorkbench *workbench QRect ResourceEditorToolWindow::geometryHint() const { const QRect g = availableToolWindowGeometry(); - const int margin = workbench()->marginHint(); const QSize sz(g.width() * 1/3, g.height() * 1/6); QRect r(QPoint(0, 0), sz); @@ -311,7 +309,6 @@ SignalSlotEditorToolWindow::SignalSlotEditorToolWindow(QDesignerWorkbench *workb QRect SignalSlotEditorToolWindow::geometryHint() const { const QRect g = availableToolWindowGeometry(); - const int margin = workbench()->marginHint(); const QSize sz(g.width() * 1/3, g.height() * 1/6); QRect r(QPoint(0, 0), sz); @@ -352,7 +349,6 @@ WidgetBoxToolWindow::WidgetBoxToolWindow(QDesignerWorkbench *workbench) : QRect WidgetBoxToolWindow::geometryHint() const { const QRect g = availableToolWindowGeometry(); - const int margin = workbench()->marginHint(); const QRect rc = QRect(g.left() + margin, g.top() + margin, g.width() * 1/4, g.height() * 5/6); diff --git a/src/designer/src/designer/qdesigner_workbench.cpp b/src/designer/src/designer/qdesigner_workbench.cpp index ccb63b38c..c6c4f6444 100644 --- a/src/designer/src/designer/qdesigner_workbench.cpp +++ b/src/designer/src/designer/qdesigner_workbench.cpp @@ -571,10 +571,6 @@ QRect QDesignerWorkbench::availableGeometry() const return screen ? screen->availableGeometry() : QGuiApplication::primaryScreen()->availableGeometry() ; } -int QDesignerWorkbench::marginHint() const -{ return 20; -} - void QDesignerWorkbench::slotFormWindowActivated(QDesignerFormWindow* fw) { core()->formWindowManager()->setActiveFormWindow(fw->editor()); diff --git a/src/designer/src/designer/qdesigner_workbench.h b/src/designer/src/designer/qdesigner_workbench.h index ed4d6ed46..6eb723509 100644 --- a/src/designer/src/designer/qdesigner_workbench.h +++ b/src/designer/src/designer/qdesigner_workbench.h @@ -67,8 +67,6 @@ public: QRect availableGeometry() const; QRect desktopGeometry() const; - int marginHint() const; - bool readInForm(const QString &fileName) const; bool writeOutForm(QDesignerFormWindowInterface *formWindow, const QString &fileName) const; bool saveForm(QDesignerFormWindowInterface *fw); |