Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Qmainwindow resize to screen size
Forum Updated to NodeBB v4.3 + New Features

Qmainwindow resize to screen size

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
6 Posts 4 Posters 4.4k Views 3 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.
  • D Offline
    D Offline
    DivyaMuthyala
    wrote on last edited by
    #1

    Hi,

    Hi I am using qmainwindow class, I have added some labels, frames and buttons to my centralwidget. Now I want to resize my gui and its contents(lables,frames,buttons) to screen size.

    Can anyone please help me? Thanks in advance.

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Use layouts to handle your widgets. All explained in the Layout Management chapter of Qt's documentation.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      1
      • D Offline
        D Offline
        DivyaMuthyala
        wrote on last edited by
        #3

        Hi SGaist,

        thankyou.

        1 Reply Last reply
        0
        • D Offline
          D Offline
          DivyaMuthyala
          wrote on last edited by
          #4

          Hi,
          When I am selecting frames and trying to set layout it's not happening.

          jsulmJ 1 Reply Last reply
          0
          • D DivyaMuthyala

            Hi,
            When I am selecting frames and trying to set layout it's not happening.

            jsulmJ Offline
            jsulmJ Offline
            jsulm
            Lifetime Qt Champion
            wrote on last edited by
            #5

            @DivyaMuthyala Please show your code else it is just impossible to say what is wrong!

            https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply
            0
            • yuvaramY Offline
              yuvaramY Offline
              yuvaram
              wrote on last edited by
              #6

              Hi @DivyaMuthyala
              Its better not to hard code any of your widget sizes within mainwindow.
              setMinimumSize, setMaximumSize can be used.

              Based on different screen size :
              QRect rec = QApplication::desktop()->screenGeometry();
              int height = rec.height();
              int width = rec.width();

              Hope this should help you.

              Yuvaram Aligeti
              Embedded Qt Developer
              : )

              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