mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-28 13:10:19 +00:00
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>
This commit is contained in:
parent
4f4d40925b
commit
7f9fbd2295
1 changed files with 8 additions and 0 deletions
|
@ -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()
|
||||
|
|
Loading…
Reference in a new issue