![]() |
strange behaviour - qt hbox width only half the screen
Hi I'm developing an apllication in Qt.
The source code can be viewed here: http://xengi.ath.cx/trac/autag/browser/tags/testing A screenshot of the behaviour: http://img148.imageshack.us/i/screen...031609571.png/http://i56.tinypic.com/2nhon4y.png 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? |
Re: strange behaviour - qt hbox width only half the screen
Does it work if you skip the PLLayout and use the 'layoutLandscape ' directly via
Code:
centralWidget->setLayout(layoutLandscape ); Edit: It seems problematic for me that the hbox layout is used in layoutLandscape and layoutPortrait. So there are 2 layout working on hbox. |
Re: strange behaviour - qt hbox width only half the screen
I edited mainwindow.ccp like that:
Code:
void MainWindow::selfAssignLayout() The hole PLLayout class has no sizing stuff in it, so I really on't know whats the reasing for this. |
Re: strange behaviour - qt hbox width only half the screen
Quote:
Quote:
That's at least how I do in in my projects. :) I would assume that the PLLayout class is working as desired but you are using it the wrong way or your own layout stuff has a bug. |
Re: strange behaviour - qt hbox width only half the screen
I have the PLLayout stuff from here: http://wiki.forum.nokia.com/index.ph...n_layout_in_Qt
There is only one textbox but it is used in landscape and in portrait layout. So i thought I should use my hboxes and pushbuttons in both layouts too. The problem if I make every button 2 times, one for each layout is that if the layout changes the button you clicked is not the same. Or in other words... you enter some text in a textbox rotate the device and your text is away. sure I could transfer the user input to the other layout on rotate but I think this PLLayout stuff is not intended to be used in that way. |
Re: strange behaviour - qt hbox width only half the screen
Hmm, in the example they use eventFilter(QObject *obj, QEvent *event) and you are using resizeEvent(QResizeEvent* event).
Do you get the resize event? And have you checked that their simple example with 4 buttons is working? |
Re: strange behaviour - qt hbox width only half the screen
I don't know, never tested it.
But I've abbonded the idea of auto orientation in my program because it's unhandy to use it in portrait mode. So I deleted all the PLLayout stuff. but thanks for your help. I will continue working on that problem when I do my next program. Maybe I write my own solution for nice auto orientation. I have some ideas already in this direction. If you are interested you can checkout the current state of AuTag. Any help or suggestions would be cool. Feedback is always good. ;) |
All times are GMT. The time now is 16:30. |
vBulletin® Version 3.8.8