I try programmatically set alignment of title of QGroupBox. According to the documentation I try to do it in the following way:
MainWidget::MainWidget (QWidget * parent)
: QWidget (parent)
setWindowTitle (tr ("QGropBox Title Alignment issue") );
QGroupBox * group = new QGroupBox ("Group Title", this);
QVBoxLayout * layoutTop = new QVBoxLayout ();
But I have got unexpected result and title aligned with the left-hand side of the group box.
Such behaviour I have got with the environment:
- Debian 9.0 (sid);
- Qt 5.5.1 (installed from repository);
- XMonad DE.
The same behaviour I have got with the next environment:
- Ubuntu 15.10;
- Qt 5.4 (installed manually using offline-installer);
But! If I use Qt installed from repository (Qt 5.4.2) the title will aligned with the centre by default. But if I change align to the left it will not changed.
I try find some solution with Google, but I haven't found similar questions and this is bad sign and usually this is means that I do some thing wrong.
So my question is: Why I can't manage by alignment of the group box title.