summaryrefslogtreecommitdiffstats
path: root/examples/sql/sqlbrowser/connectionwidget.cpp
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@qt.io>2024-12-31 10:03:41 +0100
committerMarc Mutz <marc.mutz@qt.io>2025-01-02 07:51:11 +0100
commit15524d1623a1400e4de15e57408e37020d394986 (patch)
tree1643ff8c66662197675360d491bbf18450bb9ab7 /examples/sql/sqlbrowser/connectionwidget.cpp
parente0e9a5627376e04aba1b2ca2591554851d7de240 (diff)
sqlbrowser example: fix ugly margin around ConnectionWidget
When a layout is used to arrange the children of a non-top-level custom widget, the layout's contentsMargins need to be manually set to zero to avoid extra empty space around the widgets, misaligning it w.r.t. its siblings. Add the necessary call. Amends 2690822428deec4f0c08f4d118d69a7c6036369e, which, however, inherited the missing margin adjustment from older code. Pick-to: 6.9 6.8 Change-Id: Icd1945a4f2b1635f031e50758ec2f1ec9313ae27 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'examples/sql/sqlbrowser/connectionwidget.cpp')
-rw-r--r--examples/sql/sqlbrowser/connectionwidget.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/examples/sql/sqlbrowser/connectionwidget.cpp b/examples/sql/sqlbrowser/connectionwidget.cpp
index da6796d7e55..6dd5060ef22 100644
--- a/examples/sql/sqlbrowser/connectionwidget.cpp
+++ b/examples/sql/sqlbrowser/connectionwidget.cpp
@@ -14,6 +14,7 @@ ConnectionWidget::ConnectionWidget(QWidget *parent)
, tree(new QTreeWidget(this))
{
QVBoxLayout *layout = new QVBoxLayout(this);
+ layout->setContentsMargins({});
tree->setHeaderLabels(QStringList(tr("Database")));
tree->header()->setStretchLastSection(true);
QAction *refreshAction = new QAction(tr("Refresh"), tree);