[Qt-interest] How To Positioning a Dialog At X,Y

Arnold Krille arnold at arnoldarts.de
Sat Apr 4 21:05:50 CEST 2009


On Saturday 04 April 2009 17:28:26 Raja Sekharan wrote:
> How can I place a dialog in a particular section of the screen such as
> x,y or directly in the centre of the screen?

By not trying at all.

Seriously, if you as an app developer want to be smarter then the window-
manager, you get yourself into lots of trouble.
Why do you think the coordinates you figure for the window are correct?
Might be that the user is using different font-sizes.
Might be that while you choose "middle of the screen" is actually in the 
middle of screen 2 of 3 and the user has screens 1 and 3 in front of him and 
screen 2 is the beamer. (The user did tell his window-manager to place all new 
windows on screen 1 and the developer of the window manager gets a bug-report 
because of your (broken) app...)
Might be that what you see as one big screen without xinerama is actually two 
screens merged and your window pops up right in the middle and gets devided by 
the gap between the screen. And the user is annoyed because he _always_ has to 
move your window while all the other apps pop up correctly on the 
left/right...

Please concentrate your work on your app and be glad that you don't have to 
deal with window-placement, absolute font-sizes, color-schemes and these 
things.

Have fun,

Arnold
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part.
Url : http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090404/e04c9acb/attachment.bin 


More information about the Qt-interest-old mailing list