Second window overlaps maximum screen size on actual device.
-
Hi,
when i try to launch another main window or any other widget container for that matter, it overlaps from the maximum screen height and width on the actual device.
on the emulator however it works fine. any ideas?
-
Example code and Screen Shot will be helpful.
-
just a typical launching of another window?
@void MainWindow::on_toolButton_clicked()
{
MainWindow2 *mw2;mw2 = new MainWindow2; this->hide(); mw2->show();
}
@
once the tool button is pressed, it will show this with normal size boundaries and no overlapping
!http://img713.imageshack.us/img713/8622/27516056.png(n95 simulator)!
but on actual device, the button "hide" is way over below and you can't see it anymore and the text area almost occupies the whole screen.
is this common? i'm using qt 4.6 on s60 third edition FP1.
-
How are you placing the text field and the button in the mainwindow2? Are you placing them in a layout? Are you setting any geometry for the window?
From my experience the UI on the Qt Simulator is NOT the exact look you get on the device.
-
yeah, i'm placing it on a vertical layout, and is set to 800 x 480 same as the first window, should I dynamically set the geometry? rather relying on the designer setting?
-
If i am not wrong the resolution of a 3rd edition phone is 320 x 240 pixels. Try not to hardcode the values. You can get the screen size by using this: @QDesktopWidget *desktop = QApplication::desktop();
QRect screenSize = desktop->screenGeometry();@You can set the geometry of your main widget to fit the device screen size then you should not be facing the stretched widgets problem.
Try setting the max width and height of the text filed if required.
PS: QApplication::desktop()->availableGeometry() gives wrong geometry "Available Geometry Bug on Symbian":http://bugreports.qt.nokia.com/browse/QTBUG-14058
-
Well i think that setting the geometry is needed for displaying the second window Ui properly, mostly i have observed that ui where geometry is set for a layout does not view properly so better to take this layout which you are using on a widget and then set geometry for that widget.
May be you wont be able to reproduce it on simulator but on device it should work. -
just an update, it seems that it's a Qt 4.6 symbian bug? and that to go around with it, is to use mainwindow.showMaximized() rather than just mainwindow.show()
still, getting the screen size and then setting the geometry should have it's uses should i run into resizing problems in the future. thanks!