Dear visitor, welcome to QtForum.org. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.
Quoted
Originally posted by RoyceyBaby
Newbie question:
How does one position a dialog to the center of the screen or indeed to any position on the screen regardless of its parent?
If QApplication is the parent then the dialog opens in the center on the screen, however if another QDialog is the parent, then dialog opens centered to the QDialog that called it.
I also cannot workout how to position a dialog before it is shown. I can move the dialog once show() is called but this movement can be seen by the user.
Thanks,
Royce
|
|
Source code |
1 2 3 4 5 6 |
FormTest *formTest; formTest = new FormTest(); // (1) formTest->show(); // (2) |
|
|
Source code |
1 |
formTest->setGeometry( 10, 10, 100, 100 ); |
Quoted
Originally posted by huynux
Please take a look at this:
http://www.qtforum.org/thread.php?thread…dialog+position
