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. MainWindow: how to resize automatically?
QtWS25 Last Chance

MainWindow: how to resize automatically?

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 3 Posters 413 Views
  • 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.
  • sitesvS Offline
    sitesvS Offline
    sitesv
    wrote on last edited by
    #1

    Hi!
    On Main Window I have a QFrame with a horizontal layout.
    QFrame fills with dynamically created widgets.
    How to make MainWindow resized automatically?

    jsulmJ 1 Reply Last reply
    0
    • sitesvS sitesv

      Hi!
      On Main Window I have a QFrame with a horizontal layout.
      QFrame fills with dynamically created widgets.
      How to make MainWindow resized automatically?

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

      @sitesv said in MainWindow: how to resize automatically?:

      How to make MainWindow resized automatically?

      Do you mean you want your main window to resize if you add more widgets?

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

      sitesvS 1 Reply Last reply
      0
      • jsulmJ jsulm

        @sitesv said in MainWindow: how to resize automatically?:

        How to make MainWindow resized automatically?

        Do you mean you want your main window to resize if you add more widgets?

        sitesvS Offline
        sitesvS Offline
        sitesv
        wrote on last edited by sitesv
        #3

        @jsulm Yes. Main Window has a default size. While a startup, some widgets adding to QFrame...
        When I work with Embarcadero RAD Studio, TForm has an AutoSize parameter...

        1 Reply Last reply
        0
        • Christian EhrlicherC Online
          Christian EhrlicherC Online
          Christian Ehrlicher
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Call resize(sizeHint())

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

          sitesvS 1 Reply Last reply
          1
          • Christian EhrlicherC Christian Ehrlicher

            Call resize(sizeHint())

            sitesvS Offline
            sitesvS Offline
            sitesv
            wrote on last edited by
            #5

            @Christian-Ehrlicher Thanks!

            One more q.
            This trick is suitable to resize main window to qtablewidget size? Or I should calculate width and height manually?

            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