Results 1 to 3 of 3

Thread: Detect screen rotation or resize

  1. #1
    Join Date
    Apr 2010
    Location
    Porto Alegre, RS, Brazil
    Posts
    37
    Thanks
    9
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Question Detect screen rotation or resize

    Hi folks...

    I'm just starting to develop using qt and c++, and I'm having a problem that seems to be kind of easy to solve.
    Basically I want to detect when the screen is rotated or resized, so I can play an animation when that happens. Today I am able to get screen size and orientation easily, but I don't know how to "hear the event" thrown by the system when the screen gets rotated (or resized) to know when to play my animation.
    I've already tryed the code in this link, but unfortunatelly the function is not called when the screen gets rotated or resized.
    http://msdn.microsoft.com/en-us/libr...norient_topic3

    Can you help me on this?
    I'm using Windows XP, but I'd like the code to work in any platform, if possible (including phones, tablets, etc...).


    thanks in advance

  2. #2
    Join Date
    Apr 2010
    Location
    Porto Alegre, RS, Brazil
    Posts
    37
    Thanks
    9
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Thumbs up Re: Detect screen rotation or resize

    Well, I could not detect the screen rotation/resize yet, but with a maximized widget, I use the widget's resizeEvent to get when the resolution changes or the screen is rotated... For now, it works for me

  3. #3
    Join Date
    Nov 2009
    Location
    Internet
    Posts
    11
    Thanks
    9
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Detect screen rotation or resize

    Test resized signal in QDesktopWidget class to detect screen resize.

    Qt Code:
    1. connect(QApplication::desktop(), SIGNAL(resized(int)), this, SLOT(YouSlot(int));
    To copy to clipboard, switch view to plain text mode 

Similar Threads

  1. How to detect multi screen in QT?
    By Kevin Hoang in forum Qt Programming
    Replies: 9
    Last Post: 27th March 2010, 00:02
  2. detect which layer of the screen an application is on
    By solartic in forum Qt Programming
    Replies: 2
    Last Post: 22nd July 2009, 18:05
  3. Screen Rotation - qt embedded 4.5
    By Beppe in forum Qt Programming
    Replies: 2
    Last Post: 17th April 2009, 12:32
  4. QVFB: Screen rotation
    By alexandr in forum Qt for Embedded and Mobile
    Replies: 1
    Last Post: 2nd February 2007, 16:41
  5. Qtopia, Zaurus (SL-C1000) & Screen Rotation
    By alexandr in forum Qt for Embedded and Mobile
    Replies: 0
    Last Post: 22nd January 2007, 13:13

Tags for this Thread

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.