Results 1 to 4 of 4

Thread: positioning a window at a specific screen position

  1. #1
    Join Date
    Mar 2006
    Posts
    172
    Thanks
    30
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Question positioning a window at a specific screen position

    Hey is it possible to always position the window at a predefined location on the screen viz.
    left, right, top and bottom, in Qt4?

    Also could any one also help me understand the alignment flags in Qt viz
    Qt::Alignleft, Qt::AlignBottom etc....where does one use them???



    thanks

    Nupul

  2. #2
    Join Date
    Jan 2006
    Posts
    39
    Thanks
    2
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: positioning a window at a specific screen position

    The setGeometry function in QWidget might be what you're after. It allows you to set the x, y coordinates for the top left corner of your window as well as the size of the window.

  3. #3
    Join Date
    Jan 2006
    Location
    Ukraine,Lviv
    Posts
    454
    Thanks
    9
    Thanked 27 Times in 27 Posts
    Qt products
    Qt3
    Platforms
    Unix/X11 Windows

    Default Re: positioning a window at a specific screen position

    Quote Originally Posted by nupul
    Also could any one also help me understand the alignment flags in Qt viz
    Qt::Alignleft, Qt::AlignBottom etc....where does one use them???


    l
    For example aligning text in some widgets
    a life without programming is like an empty bottle

  4. #4
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: positioning a window at a specific screen position

    See QDesktopWidget and Window Geometry.

    The former provides you access to screen information (amount, size..) and the latter gives you hints in positioning widgets.
    You can't use aligment flags for this purpose..

Similar Threads

  1. Mouse position on screen
    By Nippler in forum Qt Programming
    Replies: 3
    Last Post: 7th August 2008, 14:22
  2. Setting manually cursor position on multi screen systems
    By irreriwan in forum Qt Programming
    Replies: 0
    Last Post: 4th March 2008, 09:47
  3. Replies: 3
    Last Post: 23rd November 2007, 11:40
  4. Fixing default Window position with move.
    By VireX in forum Qt Programming
    Replies: 4
    Last Post: 3rd April 2007, 21:13

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.