try using saveGeometry() and restoreGeometry().
try using saveGeometry() and restoreGeometry().
==========================signature=============== ==================
S.O.L.I.D principles (use them!):
https://en.wikipedia.org/wiki/SOLID_...iented_design)
Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.
No, its also not working.
Always Believe in Urself![]()
Merry
show your code with what you tried.
==========================signature=============== ==================
S.O.L.I.D principles (use them!):
https://en.wikipedia.org/wiki/SOLID_...iented_design)
Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.
I saved the original geometry that appears when the MainWindow appears.
Qt Code:
Void MainWindow::init() { settings.setValue("geometry", saveGeometry()); }To copy to clipboard, switch view to plain text mode
And on Next Dialog, On Resize Event, I restored that saved geometry.
Qt Code:
{ this->restoreGeometry(settings.value("geometry").toByteArray()); }To copy to clipboard, switch view to plain text mode
Actually My Dialog is in the layout So, when I restore its orginal geometry then it restores the widget and On Maximize Button it expands without expanding the widgets inside the dialog.
Always Believe in Urself![]()
Merry
Your code makes no sense.
You are storing the geometry of your main window, and give that geometry to the dialog??
You should restored the geometry for your main window!
How can that be? Dialog is a top level widget.Actually My Dialog is in the layout
==========================signature=============== ==================
S.O.L.I.D principles (use them!):
https://en.wikipedia.org/wiki/SOLID_...iented_design)
Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.
Attached is the sample code for reference
Unzip the code and run , There is one case in which i am getting problem:
The case is:
I had also, try to use saveGeometry() and restoreGeometry(). It is commented in the code, Uncomment it and try to run again, and see the result,On Application Run, First click on the maximize Button on the top, after that On the "OK Button" -> On Click on OkButton -> it will show the next dialog, then click on the maximize Button on the top of this next dialog, It will not come in the centre of the screen.
Pls help me, what i am doing wrong?
Always Believe in Urself![]()
Merry
I can't run your code where I am at.
Maybe some one else can.
I'll try looking at it in the evening if I have time.
==========================signature=============== ==================
S.O.L.I.D principles (use them!):
https://en.wikipedia.org/wiki/SOLID_...iented_design)
Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.
Nobody is there to solve my problem.
Its very urgent, Pls help.
Always Believe in Urself![]()
Merry
Qt Code:
{ setupUi(this); OnInit(); }To copy to clipboard, switch view to plain text mode
you are saving the geometry in OnInit() but you call OnInit() during construction time, during that time the geometry is not defined.
You have to save the geometry after the dialog is visible, best as a reaction to resizing or moving.
==========================signature=============== ==================
S.O.L.I.D principles (use them!):
https://en.wikipedia.org/wiki/SOLID_...iented_design)
Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.
merry (26th August 2011)
Thanks a ton high_flyer, its working.
Always Believe in Urself![]()
Merry
Bookmarks