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
Forum Updated to NodeBB v4.3 + New Features

How to resize QWidgets with QMainWindow

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 3 Posters 290 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.
  • H Offline
    H Offline
    hernancrespo89
    wrote on 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
    • Christian EhrlicherC Offline
      Christian EhrlicherC Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on 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
      0
      • Christian EhrlicherC Christian Ehrlicher

        @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 last edited by
        #3

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

        1 Reply Last reply
        0
        • Christian EhrlicherC Offline
          Christian EhrlicherC Offline
          Christian Ehrlicher
          Lifetime Qt Champion
          wrote on 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
          • SGaistS Offline
            SGaistS Offline
            SGaist
            Lifetime Qt Champion
            wrote on 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

            • Login

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