PDA

View Full Version : size of Mainwindow Shrinks when i call it from a Dialog



ranjit.kadam
27th April 2011, 06:06
Hello Friends ,I have written the code to call a mainwindow from a dialog on pushbutton click as below


void Dialog1::on_pushButton_2_clicked()
{
MainWindow *b=new MainWindow;
b->showMaximized();
}

and i can go to the mainwindow but the size (layout) is changing,I dont know how to solve this,so please help me out


regards
ranjit

helloworld
27th April 2011, 06:54
Not sure what you want to achieve but if you want to show the widget in full-screen mode, you can instead use:



b->showFullScreen();

ChrisW67
27th April 2011, 08:05
so please help me out
Sure. It is self-evident that if you resize a window that its size and layout will change, so a literal reading of what you wrote is clearly not a description of a problem. Try to provide sufficient information so that someone who cannot see your screen, and has no idea what your layouts contain, has more than a vague idea what you mean by "i can go to the mainwindow but the size (layout) is changing".

ranjit.kadam
27th April 2011, 12:48
the maindialog which i am calling contains a text box and button,and when i call it through a dialog,it gets open but layout changes,if the same thing if i did with dialog the layout wont change..

ChrisW67
28th April 2011, 01:31
What do you mean by the layout changes?

ranjit.kadam
28th April 2011, 05:58
it becomes small,i.e the textbox and pushbutton become small

ChrisW67
28th April 2011, 06:19
Post the actual code that constructs your main window. Clearly that is broken badly

ranjit.kadam
28th April 2011, 07:17
that i have just designed in qt designer,i have not coded for that