Results 1 to 5 of 5

Thread: Can we restrict the movement of a Qt Window?

  1. #1
    Join Date
    Sep 2008
    Posts
    9
    Thanks
    9
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Can we restrict the movement of a Qt Window?

    Under X11, is it possible to restrict the movement of a Qt window? Is it possible to completely prevent a window from being moved?

  2. #2
    Join Date
    Mar 2007
    Location
    Germany
    Posts
    229
    Thanks
    2
    Thanked 29 Times in 28 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Can we restrict the movement of a Qt Window?

    What about moving the window back to its previous position?
    Read this: http://doc.trolltech.com/4.4/qwidget.html#pos-prop (and read the Warning carefully).

  3. The following user says thank you to Boron for this useful post:

    Frank J. Lhota (21st October 2008)

  4. #3
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Can we restrict the movement of a Qt Window?

    If your case is simple, you can also try different types of windows which dont move - tooltip / splash screen.

  5. The following user says thank you to aamer4yu for this useful post:

    Frank J. Lhota (21st October 2008)

  6. #4
    Join Date
    Sep 2008
    Posts
    9
    Thanks
    9
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Smile Re: Can we restrict the movement of a Qt Window?

    Quote Originally Posted by Boron View Post
    What about moving the window back to its previous position?
    Read this: http://doc.trolltech.com/4.4/qwidget.html#pos-prop (and read the Warning carefully).
    I found a way to do this using a Qt event filter. This event filter does not actually filter any events. It does, however, looks at the move events and moves any window back to its initial location. Thanks.

  7. #5
    Join Date
    May 2007
    Location
    Lublin, Poland
    Posts
    345
    Thanks
    40
    Thanked 8 Times in 4 Posts
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Can we restrict the movement of a Qt Window?

    Hi,

    1.Ignore move/change pos events ?
    2. Create a tooltip style widget which can't be move; like, creatin a dialog and setting a flag to look as tooltip>

    SOme ideas.
    Qt allows you to use everything you want
    wysota
    --------------------------------------------------------------------------------
    #if defined(Q_OS_UNIX) && defined(QT_DEBUG)
    abort(); // trap; generates core dump
    #else
    exit(1); // goodbye cruel world
    #endif

Similar Threads

  1. Error: BadMatch --> what's it?
    By mattia in forum Newbie
    Replies: 4
    Last Post: 9th June 2008, 12:20
  2. QMain Window Problem
    By maveric in forum Qt Programming
    Replies: 1
    Last Post: 24th May 2008, 15:51
  3. Set a window as child at runtime
    By sabeesh in forum Qt Programming
    Replies: 1
    Last Post: 26th November 2007, 09:30
  4. Change shape of window / animate window
    By sabeesh in forum Qt Programming
    Replies: 3
    Last Post: 31st October 2007, 08:16
  5. Limit Window Movement
    By abbapatris in forum Qt Programming
    Replies: 20
    Last Post: 19th July 2007, 13:54

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.