aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Amit Chaudhuri <amit.k.chaudhuri@gmail.com>2013-05-09 08:32:27 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-05-09 12:10:34 -0700
commit7f9fbd229568a85109860c18dd18e1e9928e351f (patch)
tree0a1e7ec69355e6e1a631751207f8805990485397
parent4f4d40925b668f015fead231de9f16319083f78b (diff)
downloadsubsurface-7f9fbd229568a85109860c18dd18e1e9928e351f.tar.gz
Horizontally align labels on info widget page.
Left aligning text values looked wrong. Use Qobject cast to filter labels from any other qobjects around and set alignment. Doing this via Qt Designer would be tedious. Signed-off-by: Amit Chaudhuri <amit.k.chaudhuri@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r--qt-ui/maintab.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/qt-ui/maintab.cpp b/qt-ui/maintab.cpp
index 4e7f6b3a1..e1ac7c275 100644
--- a/qt-ui/maintab.cpp
+++ b/qt-ui/maintab.cpp
@@ -21,6 +21,14 @@ MainTab::MainTab(QWidget *parent) : QTabWidget(parent),
ui->setupUi(this);
ui->cylinders->setModel(cylindersModel);
ui->weights->setModel(weightModel);
+
+ /* example of where code is more concise than Qt designer */
+ QList<QObject *> infoTabWidgets = ui->infoTab->children();
+ Q_FOREACH( QObject* obj, infoTabWidgets ){
+ QLabel* label = qobject_cast<QLabel *>(obj);
+ if (label)
+ label->setAlignment(Qt::AlignHCenter);
+ }
}
void MainTab::clearEquipment()