|
2011-03-16
, 10:03
|
Posts: 172 |
Thanked: 193 times |
Joined on Nov 2009
@ Germany
|
#2
|
centralWidget->setLayout(layoutLandscape );
|
2011-03-16
, 10:19
|
Guest |
Posts: n/a |
Thanked: 0 times |
Joined on
|
#3
|
void MainWindow::selfAssignLayout() {centralWidget = new QWidget(); //centralWidget->setLayout(autoLayout); QHBoxLayout *htest = new QHBoxLayout(); centralWidget->setLayout(htest); htest->addWidget(new QPushButton("test")); htest->addWidget(new QPushButton("test")); this->setCentralWidget(centralWidget);}
|
2011-03-16
, 10:42
|
Posts: 172 |
Thanked: 193 times |
Joined on Nov 2009
@ Germany
|
#4
|
Edit: It seems problematic for me that the hbox layout is used in layoutLandscape and layoutPortrait. So there are 2 layout working on hbox.
Note: The ownership of item is transferred to the layout, and it's the layout's responsibility to delete it.
|
2011-03-16
, 10:58
|
Guest |
Posts: n/a |
Thanked: 0 times |
Joined on
|
#5
|
|
2011-03-16
, 12:16
|
Posts: 172 |
Thanked: 193 times |
Joined on Nov 2009
@ Germany
|
#6
|
|
2011-03-17
, 11:20
|
Guest |
Posts: n/a |
Thanked: 0 times |
Joined on
|
#7
|
The source code can be viewed here: http://xengi.ath.cx/trac/autag/browser/tags/testing
A screenshot of the behaviour:
I made a QHBoxLayout and added 2 QPushButtons ("FolderUp" and "Home"). The buttons alignment is justified by default so they should fill the hole width, each button 50%.
But they don't each button is 25% of the screen and I have no idea why.
On the Screenshot I have aligned the buttons left and right.
Any suggestions?
Last edited by XenGi; 2011-03-16 at 10:04.