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 resize QWidgets with QMainWindow
QtWS25 Last Chance

How to resize QWidgets with QMainWindow

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 3 Posters 278 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.
  • H Offline
    H Offline
    hernancrespo89
    wrote on 31 Jan 2020, 14:20 last edited by
    #1

    Hi everyone I am new with PyQt,
    I've been trying to resize all widgets when i click Maximize
    1.png
    And when i click it, size of the widgets don't change.
    2.png

    I read this post. But when set a Layout, i see still the same problem.

    1 Reply Last reply
    0
    • C Offline
      C Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on 31 Jan 2020, 15:56 last edited by Christian Ehrlicher
      #2

      @hernancrespo89 said in How to resize QWidgets with QMainWindow:

      i see still the same problem.

      Then you don't set a layout on the main window.

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

      H 1 Reply Last reply 31 Jan 2020, 16:02
      0
      • C Christian Ehrlicher
        31 Jan 2020, 15:56

        @hernancrespo89 said in How to resize QWidgets with QMainWindow:

        i see still the same problem.

        Then you don't set a layout on the main window.

        H Offline
        H Offline
        hernancrespo89
        wrote on 31 Jan 2020, 16:02 last edited by
        #3

        @Christian-Ehrlicher
        Thanks for reply, i won't set a layout. What should i do?

        1 Reply Last reply
        0
        • C Offline
          C Offline
          Christian Ehrlicher
          Lifetime Qt Champion
          wrote on 31 Jan 2020, 17:24 last edited by
          #4

          @hernancrespo89 said in How to resize QWidgets with QMainWindow:

          What should i do?

          Set a layout on the mainwindow.

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

          1 Reply Last reply
          1
          • S Offline
            S Offline
            SGaist
            Lifetime Qt Champion
            wrote on 31 Jan 2020, 21:59 last edited by
            #5

            Hi,

            Just one thing, since it's a QMainWindow, put these widgets in a layout. Set that layout on a "container" widget that you will set as central widget of your QMainWindow.

            You can't set a layout on a QMainWindow because it already has one. The one that does all the dock widget, tool bar, menu bar, etc. handling.

            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
            0

            1/5

            31 Jan 2020, 14:20

            • Login

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