Hello,
I want my QDialog class to react to the resizeevent (portrait/landscape for andriod).
But QWidget::setLayout for the dialog only works correctly when called from the constructor it seems.
So how is this done?

This does not work correctly, it shows widget2 on top of widget1:
Qt Code:
  1. Dialog::Dialog()
  2. {
  3. createstuff();
  4. }
  5.  
  6. Dialog::createstuff()
  7. {
  8. QVBoxLayout *layout = new QVBoxLayout;
  9. layout->addWidget(widget1);
  10. layout->addWidget(widget2);
  11. ..etc
  12. setLayout(layout);
  13. }
To copy to clipboard, switch view to plain text mode 

createstuff is going to have a parameter 'bool landscape' and will be called from resizeEvent() and I hope I will be able to use either a QVBoxLayout or a QHBoxLayout according to the event.
This is what I came up with, so if there are better ways please let me know..