Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to set Auto resize GUI in Qt depending on the screen size
Forum Updated to NodeBB v4.3 + New Features

How to set Auto resize GUI in Qt depending on the screen size

Scheduled Pinned Locked Moved Unsolved General and Desktop
qtcreatorqwidget
5 Posts 3 Posters 18.2k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • I Offline
    I Offline
    im_vidhya
    wrote on last edited by
    #1

    I am new to QT. actually,i developed a application. the problem is my application should run in different desktop.so,for that i want to set auto resize the GUI based on Desktop screen size. Is there any function in QT to auto resize the GUI? Thanks in Advance!!!

    R 1 Reply Last reply
    0
    • Christian EhrlicherC Offline
      Christian EhrlicherC Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Just use proper layouting and Qt will do the rest for you: http://doc.qt.io/qt-5/layout.html

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      I 1 Reply Last reply
      5
      • I im_vidhya

        I am new to QT. actually,i developed a application. the problem is my application should run in different desktop.so,for that i want to set auto resize the GUI based on Desktop screen size. Is there any function in QT to auto resize the GUI? Thanks in Advance!!!

        R Offline
        R Offline
        Robert Hairgrove
        wrote on last edited by
        #3

        @im_vidhya - Look at the QScreen class. There are functions to give you the available screen size, for example.

        But if you do the layout correctly, as Christian pointed out, then the user can resize the windows just about any way they want without problems. Qt layouts take care of the rest. I only use the information from QScreen to show my main windows in a reasonable initial default size, centered on the screen.

        I 1 Reply Last reply
        4
        • R Robert Hairgrove

          @im_vidhya - Look at the QScreen class. There are functions to give you the available screen size, for example.

          But if you do the layout correctly, as Christian pointed out, then the user can resize the windows just about any way they want without problems. Qt layouts take care of the rest. I only use the information from QScreen to show my main windows in a reasonable initial default size, centered on the screen.

          I Offline
          I Offline
          im_vidhya
          wrote on last edited by
          #4

          @Robert-Hairgrove Thankyou It's Working.

          1 Reply Last reply
          0
          • Christian EhrlicherC Christian Ehrlicher

            Just use proper layouting and Qt will do the rest for you: http://doc.qt.io/qt-5/layout.html

            I Offline
            I Offline
            im_vidhya
            wrote on last edited by
            #5

            @Christian-Ehrlicher Thankyou It's Working

            1 Reply Last reply
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved