Give more layouts reasonable names

This time for the mainwindow.

This includes an adjustment in the C++ code where we actually referenced
one of those weird generic names.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2015-01-02 17:14:02 -08:00
parent 57b49a7833
commit 36ba5d3382
2 changed files with 13 additions and 12 deletions

View file

@ -132,15 +132,16 @@ MainWindow::MainWindow() : QMainWindow(),
// has no concept of "toolbar" for a non-mainwindow widget (...) // has no concept of "toolbar" for a non-mainwindow widget (...)
// I need to take the current item that's in the toolbar Position // I need to take the current item that's in the toolbar Position
// and reposition it alongside the grid layout. // and reposition it alongside the grid layout.
QLayoutItem *p = ui.gridLayout->takeAt(0); QLayoutItem *p = ui.profileInnerLayout->takeAt(0);
ui.gridLayout->addWidget(toolBar, 0, 0); ui.profileInnerLayout->addWidget(toolBar, 0, 0);
ui.gridLayout->addItem(p, 0, 1); ui.profileInnerLayout->addItem(p, 0, 1);
// and now for some layout hackery // and now for some layout hackery
// this gets us consistent margins everywhere and a much more balanced look // this gets us consistent margins everywhere and a much more balanced look
QMargins margins(5, 5, 5, 5); QMargins margins(5, 5, 5, 5);
QList<QString> dontChange; QList<QString> dontChange;
dontChange << "notesAndSocialNetworksLayout" << ui.gridLayout->objectName(); dontChange << "notesAndSocialNetworksLayout" <<
"profileInnerLayout";
Q_FOREACH (QLayout *layout, findChildren<QLayout *>()) { Q_FOREACH (QLayout *layout, findChildren<QLayout *>()) {
// lots of internally used layouts by Qt have no names // lots of internally used layouts by Qt have no names
// don't mess with those (or scroll bars look terrible, among other things // don't mess with those (or scroll bars look terrible, among other things
@ -153,7 +154,7 @@ MainWindow::MainWindow() : QMainWindow(),
layout->setContentsMargins(margins); layout->setContentsMargins(margins);
} }
margins = QMargins(0, 5, 5, 5); margins = QMargins(0, 5, 5, 5);
ui.gridLayout->setContentsMargins(margins); ui.profileInnerLayout->setContentsMargins(margins);
updateManager = new UpdateManager(this); updateManager = new UpdateManager(this);
} }

View file

@ -11,7 +11,7 @@
</rect> </rect>
</property> </property>
<widget class="QWidget" name="centralwidget"> <widget class="QWidget" name="centralwidget">
<layout class="QVBoxLayout" name="verticalLayout_2"> <layout class="QVBoxLayout" name="fullWindowLayout">
<property name="spacing"> <property name="spacing">
<number>0</number> <number>0</number>
</property> </property>
@ -44,7 +44,7 @@
<number>0</number> <number>0</number>
</property> </property>
<widget class="QWidget" name="page"> <widget class="QWidget" name="page">
<layout class="QHBoxLayout" name="horizontalLayout_3"> <layout class="QHBoxLayout" name="mainTabOuterLayout">
<property name="spacing"> <property name="spacing">
<number>0</number> <number>0</number>
</property> </property>
@ -69,7 +69,7 @@
<property name="enabled"> <property name="enabled">
<bool>true</bool> <bool>true</bool>
</property> </property>
<layout class="QHBoxLayout" name="horizontalLayout_4"> <layout class="QHBoxLayout" name="profileOuterLayout">
<property name="spacing"> <property name="spacing">
<number>0</number> <number>0</number>
</property> </property>
@ -96,7 +96,7 @@
</widget> </widget>
</widget> </widget>
<widget class="QWidget" name="ProfileWidget"> <widget class="QWidget" name="ProfileWidget">
<layout class="QGridLayout" name="gridLayout"> <layout class="QGridLayout" name="profileInnerLayout">
<property name="leftMargin"> <property name="leftMargin">
<number>0</number> <number>0</number>
</property> </property>
@ -127,7 +127,7 @@
<number>0</number> <number>0</number>
</property> </property>
<widget class="QWidget" name="page_3"> <widget class="QWidget" name="page_3">
<layout class="QVBoxLayout" name="verticalLayout_4"> <layout class="QVBoxLayout" name="diveListLayout">
<item> <item>
<widget class="DiveListView" name="ListWidget"> <widget class="DiveListView" name="ListWidget">
<property name="selectionMode"> <property name="selectionMode">
@ -150,7 +150,7 @@
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout"> <layout class="QVBoxLayout" name="globeLayout">
<item> <item>
<widget class="GlobeGPS" name="globe" native="true"/> <widget class="GlobeGPS" name="globe" native="true"/>
</item> </item>
@ -165,7 +165,7 @@
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_3"> <layout class="QVBoxLayout" name="verticalLayout_3">
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout"> <layout class="QHBoxLayout" name="divePlanLayout">
<item> <item>
<widget class="QLabel" name="divePlanOutputLabel"> <widget class="QLabel" name="divePlanOutputLabel">
<property name="maximumSize"> <property name="maximumSize">