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

Arnold Krille arnold at arnoldarts.de
Sat Apr 4 22:00:14 CEST 2009


Hi,

On Saturday 04 April 2009 21:28:19 you wrote:
> I was asking because the dialogs in my Qt applications were getting placed
> in the top left corner of the screen in my ubuntu Linux. I am working on an
> academic project and through the would be evaluating professors colored
> glasses thats a blaring BUG!

Ah, professors. They _are_ a special species, I know that mine is.
But it helps to defend the right solution. :-)

> The problem doesn't occur in windows but only in Linux with Qt
> applications. Even in my guiding professors computer, this *problem*
> occured when I ran my application in it. Now that you have pointed out a
> larger problem that could come out of it I will look for a different
> solution.
> Would you be able to tell me why some dialogs show up on the top left
> corner? Even in linux I feel that is a unusual. Am I doing something wrong?

If the dialogs parent object is not zero but your main widget (or the widget 
inside whichs code you create the dialog), it will appear centered on top of 
that widget, which means centered on top of your app. Which is the right way 
because thats where the current focus is.

BTW: I doubt that your dialogs would appear in the top-right corner on my 
laptop. Simply because I told my window-manager to center all new windows 
(except for dialogs that Qt centers on the calling app)...

Have fun,

Arnold

PS: Why reply in private? Your message wasn't personal or anything...
-------------- 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/f5b07e4a/attachment.bin 


More information about the Qt-interest-old mailing list