Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt for Python
  4. PYQT5 Stacked Widgets not resizing
Forum Updated to NodeBB v4.3 + New Features

PYQT5 Stacked Widgets not resizing

Scheduled Pinned Locked Moved Unsolved Qt for Python
qt for python
6 Posts 2 Posters 1.3k 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.
  • A Offline
    A Offline
    ametefe
    wrote on last edited by
    #1

    I'm trying to switch windows with Stacked Widget and it works, however, when I use a window that is a different size from the rest, every other window now has to follow the sizing of the biggest window.
    Is there any way of changing this?

    JonBJ 1 Reply Last reply
    0
    • A ametefe

      I'm trying to switch windows with Stacked Widget and it works, however, when I use a window that is a different size from the rest, every other window now has to follow the sizing of the biggest window.
      Is there any way of changing this?

      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by
      #2

      @ametefe
      I found this behaviour when I used QStackedWidget. It resizes to the largest page (which after a while seems preferable anyway). So if don't want that I can only imagine you would have to resize manually/on up-front in code.

      1 Reply Last reply
      0
      • A Offline
        A Offline
        ametefe
        wrote on last edited by ametefe
        #3

        @JonB
        I have tried resizing manually but it never resizes. Can you give me an example, please?

        JonBJ 1 Reply Last reply
        0
        • A ametefe

          @JonB
          I have tried resizing manually but it never resizes. Can you give me an example, please?

          JonBJ Offline
          JonBJ Offline
          JonB
          wrote on last edited by
          #4

          @ametefe
          No, because I said I never did resize, I came to like the common-size-for-all behaviour.

          1 Reply Last reply
          0
          • A Offline
            A Offline
            ametefe
            wrote on last edited by
            #5

            @JonB
            Do you have any other way to call another widget, because the other methods I have seen, involve turning the pyqt UI into python code.

            JonBJ 1 Reply Last reply
            0
            • A ametefe

              @JonB
              Do you have any other way to call another widget, because the other methods I have seen, involve turning the pyqt UI into python code.

              JonBJ Offline
              JonBJ Offline
              JonB
              wrote on last edited by JonB
              #6

              @ametefe said in PYQT5 Stacked Widgets not resizing:

              Do you have any other way to call another widget

              I do not know what this means.

              If you use Designer to produce .ui files, you can either run the Python uic to generate Python .py file code from it or you can use UiLoader thingie to load the file dynamically at runtime instead of generating code for it. Exacts depend on whether you are PyQt or PySide, the alternatives are documented somewhere in introductory topics for the two Python bindings.

              I don't see that either of these approaches will have any effect on the runtime behaviour of your widgets/QStackedWidget, if that is what you are expecting.

              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