c++ - How to maintain position of a QDialog on hide/show -
i have qdialog have checkable button witch opens/close (hide/show) window (the window qdialog).
my problem wish maintain position of second qdialog when hide , after open (example: move qdialog in corner of screen , when hide , show qdialog needs in same corner).
at moment seems restored @ initial position. found similar article @ similar in case have 2 separate windows , can move second qdialog on screen. did meet problem?
afaik works without code: position isn't changed when showing/hiding widget.
anyway, can store position of qdialog
through geometry:
// save geometry qrect geometry = my_dialog->geometry(); my_dialog->hide(); // restore geometry my_dialog->show(); my_dialog->setgeometry(geometry);
note geometry relative parent: assume here qdialog
modeless.
Comments
Post a Comment