diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2023-12-19 13:52:11 +0100 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2024-01-06 13:19:20 +0100 |
commit | a68531d11e916f0147181b858bb26acb413da606 (patch) | |
tree | 520b8fdad09882e27d7186e89c8499a6a3b23d2e | |
parent | 67b706ee219d7ae59f5b1116ef12efd8db7e953f (diff) |
Qt Designer: Replace QDesignerWorkbench::marginHint() by a constant
Task-number: QTBUG-120236
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>
(cherry picked from commit 60e5b99d067bcb28f7ae2a6ac371f300bf03e24e)
-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 dc65a8f46..9919b1a86 100644 --- a/src/designer/src/designer/qdesigner_toolwindow.cpp +++ b/src/designer/src/designer/qdesigner_toolwindow.cpp @@ -32,6 +32,8 @@ bool ToolWindowFontSettings::equals(const ToolWindowFontSettings &rhs) const m_font == rhs.m_font; } +static constexpr int margin = 20; + // ---------------- QDesignerToolWindow QDesignerToolWindow::QDesignerToolWindow(QDesignerWorkbench *workbench, QWidget *w, @@ -156,7 +158,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); @@ -208,7 +209,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); @@ -250,7 +250,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); @@ -285,7 +284,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); @@ -319,7 +317,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); @@ -360,7 +357,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 e6970b418..97d97f96d 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 faf735e88..7c10ed227 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); |