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. Splitting Up a UI From
Forum Updated to NodeBB v4.3 + New Features

Splitting Up a UI From

Scheduled Pinned Locked Moved Solved General and Desktop
7 Posts 3 Posters 1.0k 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
    AlexanderAlexander
    wrote on last edited by AlexanderAlexander
    #1

    Situation:

    • I have one very bloated UI Form that centers around a QStackedWidget
    • Within the QStackedWidget are large QWidgets
    • I am using QT Designer for the UI Form

    What I Want to Achieve:

    • Split the bloated UI Form into separate Forms, one main Form for my QStackedWidget and then other Forms for the smaller internal QWidgets
    • Once I have my seperate forms, I can easily just set the parent of each form's top parent to my QStackedWidget when I run my applications setup (c++)

    Problems:

    • Within QT Desinger, the highest Parent is always of type QMainWindow, I would like it to be of type QWidget for my internal QWidget Forms
    • I cannot select and cut out a Widget

    Notes:

    • I am aware I could do this in code, but my widgets are very complex and precisely set up with layouts
    • QT Desinger 5.13
    1 Reply Last reply
    0
    • Christian EhrlicherC Offline
      Christian EhrlicherC Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Use 'Widget' as template when creating a new form in designer.

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

      A 1 Reply Last reply
      3
      • Christian EhrlicherC Christian Ehrlicher

        Use 'Widget' as template when creating a new form in designer.

        A Offline
        A Offline
        AlexanderAlexander
        wrote on last edited by
        #3

        @Christian-Ehrlicher
        Thank you, I was completely unaware that you could do that.

        What about the other 1/2 of my problem, the ability to cut out an internal QWidget (so that I can copy into this new template)?

        J.HilkJ 1 Reply Last reply
        0
        • Christian EhrlicherC Offline
          Christian EhrlicherC Offline
          Christian Ehrlicher
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @AlexanderAlexander said in Splitting Up a UI From:

          the ability to cut out an internal QWidget (so that I can copy into this new template)?

          I don't understand this - simply instantiate the widget and put it where you want.

          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
          0
          • A AlexanderAlexander

            @Christian-Ehrlicher
            Thank you, I was completely unaware that you could do that.

            What about the other 1/2 of my problem, the ability to cut out an internal QWidget (so that I can copy into this new template)?

            J.HilkJ Offline
            J.HilkJ Offline
            J.Hilk
            Moderators
            wrote on last edited by
            #5

            @AlexanderAlexander you can literally select the content of on of your QStackwidget pages, copy it (ctrl + c) and on the new form, paste (ctrl + v) it.

            The only restriction is, that you copy target does not yet have a layout


            Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


            Q: What's that?
            A: It's blue light.
            Q: What does it do?
            A: It turns blue.

            A 1 Reply Last reply
            1
            • J.HilkJ J.Hilk

              @AlexanderAlexander you can literally select the content of on of your QStackwidget pages, copy it (ctrl + c) and on the new form, paste (ctrl + v) it.

              The only restriction is, that you copy target does not yet have a layout

              A Offline
              A Offline
              AlexanderAlexander
              wrote on last edited by
              #6

              @J-Hilk
              Thats the issue then, I did not know you couldn't copy if they already have a layout... That's unfortunate since my inner widgets are also complex :(

              Anyway, thanks for the help guys

              J.HilkJ 1 Reply Last reply
              0
              • A AlexanderAlexander

                @J-Hilk
                Thats the issue then, I did not know you couldn't copy if they already have a layout... That's unfortunate since my inner widgets are also complex :(

                Anyway, thanks for the help guys

                J.HilkJ Offline
                J.HilkJ Offline
                J.Hilk
                Moderators
                wrote on last edited by
                #7

                @AlexanderAlexander well only the top most layout you can not transfer over, all others (nested ones), you can select and copy just fine


                Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


                Q: What's that?
                A: It's blue light.
                Q: What does it do?
                A: It turns blue.

                1 Reply Last reply
                2

                • Login

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