Results 1 to 4 of 4

Thread: How can i make widget automatically adjust screen size

  1. #1
    Join Date
    Oct 2009
    Posts
    66
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Unhappy How can i make widget automatically adjust screen size

    Hi,
    I want to make the widget automatically adjust to the size of the screen. I am using setGeometry() but that is causing the problem when in auto adjusting on the screen if the resolution is changed. Please can some body help me on this issue please.

  2. #2
    Join Date
    Oct 2009
    Posts
    9
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: How can i make widget automatically adjust screen size

    use QDesktopWidget and then detect screensize changes by polling every few seconds using a separate QThread and appropriately resize your widget.

    This is 1 method which I could think immediately. Not sure if it is good enough as it wud waste CPU cycles.

  3. #3
    Join Date
    Oct 2009
    Posts
    66
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: How can i make widget automatically adjust screen size

    i tried to resize the parent widget but the child widget inside are not getting resized, so in this case how can i scale the parent and the child widget both to adjust the screen??

  4. #4
    Join Date
    Jan 2006
    Location
    Sta. Eugènia de Berga (Vic - Barcelona - Spain)
    Posts
    869
    Thanks
    70
    Thanked 59 Times in 57 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: How can i make widget automatically adjust screen size

    Hi,

    Insert the children into parent layout and it will autoresize.
    Òscar Llarch i Galán

Similar Threads

  1. QDockWidget inside another widget in the center?
    By Antebios in forum Qt Programming
    Replies: 1
    Last Post: 16th February 2010, 08:06
  2. Fix size widget + Splitter
    By weepdoo in forum Qt Tools
    Replies: 0
    Last Post: 20th November 2008, 09:47
  3. Replies: 1
    Last Post: 27th March 2008, 16:10
  4. QLayout and the size of the widget
    By jimfan in forum Qt Programming
    Replies: 2
    Last Post: 20th December 2007, 18:04
  5. Compiling with Qmake/Make
    By VireX in forum Newbie
    Replies: 25
    Last Post: 22nd February 2007, 06:57

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.