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. Layouts in Qt Creator
QtWS25 Last Chance

Layouts in Qt Creator

Scheduled Pinned Locked Moved Unsolved General and Desktop
14 Posts 4 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.
  • S Offline
    S Offline
    SPlatten
    wrote on 19 May 2021, 07:28 last edited by SPlatten
    #1

    I'm trying to layout what should be quite simple but is taking way to much time and effort. I have a form with a QGridLayout using Qt Creator I'm trying to create a layout showing:

    ##### of #####
    

    I have the QGridLayout on the form, I've dragged the three labels onto the grid layout and they appear as children of the layout, but on the WYSIWYG display they are all in vertical rows in a single column.

    I cannot see any properties or options to specify the rows and columns.

    If I use the context menu and change select layout horizontally it changes the QGridLayout to a QHBoxLayout, still can't specify column order and now the ** of ** appears at the front of the layout, so frustrating, how do I set it up the way I want it which is as shown above.

    In the end I ended up using the XML editor to do exactly what I want, but seems like a bit of a hack because the WYSIWYG editor is so bad.

    Kind Regards,
    Sy

    O P 2 Replies Last reply 19 May 2021, 07:43
    0
    • S SPlatten
      19 May 2021, 07:28

      I'm trying to layout what should be quite simple but is taking way to much time and effort. I have a form with a QGridLayout using Qt Creator I'm trying to create a layout showing:

      ##### of #####
      

      I have the QGridLayout on the form, I've dragged the three labels onto the grid layout and they appear as children of the layout, but on the WYSIWYG display they are all in vertical rows in a single column.

      I cannot see any properties or options to specify the rows and columns.

      If I use the context menu and change select layout horizontally it changes the QGridLayout to a QHBoxLayout, still can't specify column order and now the ** of ** appears at the front of the layout, so frustrating, how do I set it up the way I want it which is as shown above.

      In the end I ended up using the XML editor to do exactly what I want, but seems like a bit of a hack because the WYSIWYG editor is so bad.

      O Offline
      O Offline
      ollarch
      wrote on 19 May 2021, 07:43 last edited by
      #2

      Remove the Grid layout. Add the 3 labels inside the main widget. Click the main widget and click the grid layout icon.

      1 Reply Last reply
      3
      • S SPlatten
        19 May 2021, 07:28

        I'm trying to layout what should be quite simple but is taking way to much time and effort. I have a form with a QGridLayout using Qt Creator I'm trying to create a layout showing:

        ##### of #####
        

        I have the QGridLayout on the form, I've dragged the three labels onto the grid layout and they appear as children of the layout, but on the WYSIWYG display they are all in vertical rows in a single column.

        I cannot see any properties or options to specify the rows and columns.

        If I use the context menu and change select layout horizontally it changes the QGridLayout to a QHBoxLayout, still can't specify column order and now the ** of ** appears at the front of the layout, so frustrating, how do I set it up the way I want it which is as shown above.

        In the end I ended up using the XML editor to do exactly what I want, but seems like a bit of a hack because the WYSIWYG editor is so bad.

        P Offline
        P Offline
        Pl45m4
        wrote on 19 May 2021, 09:33 last edited by
        #3

        @SPlatten said in Layouts in Qt Creator:

        because the WYSIWYG editor is so bad

        It's actually not that bad. It requires a steady hand and some patience to move the widgets where they should go.
        You can fill every row / column of your gridLayout by using the design mode.


        If debugging is the process of removing software bugs, then programming must be the process of putting them in.

        ~E. W. Dijkstra

        S 1 Reply Last reply 19 May 2021, 09:38
        0
        • P Pl45m4
          19 May 2021, 09:33

          @SPlatten said in Layouts in Qt Creator:

          because the WYSIWYG editor is so bad

          It's actually not that bad. It requires a steady hand and some patience to move the widgets where they should go.
          You can fill every row / column of your gridLayout by using the design mode.

          S Offline
          S Offline
          SPlatten
          wrote on 19 May 2021, 09:38 last edited by
          #4

          @Pl45m4 , its no-where near as good as it could be, I'm no fan of Microsoft but Microsofts Visual Studio was considerably easier to use and get better results from than Qt Creator and that's going back to the 1980s.

          Kind Regards,
          Sy

          O 1 Reply Last reply 19 May 2021, 09:41
          0
          • S SPlatten
            19 May 2021, 09:38

            @Pl45m4 , its no-where near as good as it could be, I'm no fan of Microsoft but Microsofts Visual Studio was considerably easier to use and get better results from than Qt Creator and that's going back to the 1980s.

            O Offline
            O Offline
            ollarch
            wrote on 19 May 2021, 09:41 last edited by
            #5

            @SPlatten said in Layouts in Qt Creator:

            @Pl45m4 , its no-where near as good as it could be, I'm no fan of Microsoft but Microsofts Visual Studio was considerably easier to use and get better results from than Qt Creator and that's going back to the 1980s.

            I think that you are confusing Qt Creator with Qt Designer. Qt Creator also uses Designer embedded.
            Qt Designer only let's you design Ui files. Qt Creator is an IDE.
            Of course you can use Visual Studio for developing and Qt Designer to design Ui files (as I do).

            S 2 Replies Last reply 19 May 2021, 09:42
            2
            • O ollarch
              19 May 2021, 09:41

              @SPlatten said in Layouts in Qt Creator:

              @Pl45m4 , its no-where near as good as it could be, I'm no fan of Microsoft but Microsofts Visual Studio was considerably easier to use and get better results from than Qt Creator and that's going back to the 1980s.

              I think that you are confusing Qt Creator with Qt Designer. Qt Creator also uses Designer embedded.
              Qt Designer only let's you design Ui files. Qt Creator is an IDE.
              Of course you can use Visual Studio for developing and Qt Designer to design Ui files (as I do).

              S Offline
              S Offline
              SPlatten
              wrote on 19 May 2021, 09:42 last edited by SPlatten
              #6

              @ollarch , yes, you are correct. How do you use Visual Studio with the Qt palette of tools ?

              I have Visual Studio 2019.

              Kind Regards,
              Sy

              O 1 Reply Last reply 19 May 2021, 10:58
              0
              • O ollarch
                19 May 2021, 09:41

                @SPlatten said in Layouts in Qt Creator:

                @Pl45m4 , its no-where near as good as it could be, I'm no fan of Microsoft but Microsofts Visual Studio was considerably easier to use and get better results from than Qt Creator and that's going back to the 1980s.

                I think that you are confusing Qt Creator with Qt Designer. Qt Creator also uses Designer embedded.
                Qt Designer only let's you design Ui files. Qt Creator is an IDE.
                Of course you can use Visual Studio for developing and Qt Designer to design Ui files (as I do).

                S Offline
                S Offline
                SPlatten
                wrote on 19 May 2021, 10:03 last edited by SPlatten
                #7

                @ollarch , here is the form I'm trying to get right in designer:
                Untitled.png
                What I would like to do is get all the labels on the left formatted to the same width and right aligned.

                Then have the figures that in the screenshot read:

                1832 of 46783
                

                Formatted so they are all left aligned to the Blocks label without all the whitespace.

                I would also like the Abort pushbutton resized and aligned to the bottom right of the form.

                Finally I would like the form height to have the same padding from the bottom of the Abort button as the border padding to the left and right.

                I've spent a long time trying and failing to resolve this.

                Kind Regards,
                Sy

                J 1 Reply Last reply 19 May 2021, 10:06
                0
                • S SPlatten
                  19 May 2021, 10:03

                  @ollarch , here is the form I'm trying to get right in designer:
                  Untitled.png
                  What I would like to do is get all the labels on the left formatted to the same width and right aligned.

                  Then have the figures that in the screenshot read:

                  1832 of 46783
                  

                  Formatted so they are all left aligned to the Blocks label without all the whitespace.

                  I would also like the Abort pushbutton resized and aligned to the bottom right of the form.

                  Finally I would like the form height to have the same padding from the bottom of the Abort button as the border padding to the left and right.

                  I've spent a long time trying and failing to resolve this.

                  J Offline
                  J Offline
                  jsulm
                  Lifetime Qt Champion
                  wrote on 19 May 2021, 10:06 last edited by
                  #8

                  @SPlatten said in Layouts in Qt Creator:

                  Formatted so they are all left aligned to the Blocks label without all the whitespace

                  Then add a Horizontal Spacer at the right side of that line...

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

                  S 1 Reply Last reply 19 May 2021, 10:09
                  4
                  • J jsulm
                    19 May 2021, 10:06

                    @SPlatten said in Layouts in Qt Creator:

                    Formatted so they are all left aligned to the Blocks label without all the whitespace

                    Then add a Horizontal Spacer at the right side of that line...

                    S Offline
                    S Offline
                    SPlatten
                    wrote on 19 May 2021, 10:09 last edited by SPlatten
                    #9

                    @jsulm , easier said than done, how? I've dragged it onto the form an it appears below the row I want.

                    [Edit] Done it, dragged and dropped directly onto the data where I want it.

                    Kind Regards,
                    Sy

                    O 1 Reply Last reply 19 May 2021, 10:59
                    0
                    • S SPlatten
                      19 May 2021, 09:42

                      @ollarch , yes, you are correct. How do you use Visual Studio with the Qt palette of tools ?

                      I have Visual Studio 2019.

                      O Offline
                      O Offline
                      ollarch
                      wrote on 19 May 2021, 10:58 last edited by
                      #10

                      @SPlatten Using Qt Visual Studio Tools on Visual Studio 2015.

                      1 Reply Last reply
                      0
                      • S SPlatten
                        19 May 2021, 10:09

                        @jsulm , easier said than done, how? I've dragged it onto the form an it appears below the row I want.

                        [Edit] Done it, dragged and dropped directly onto the data where I want it.

                        O Offline
                        O Offline
                        ollarch
                        wrote on 19 May 2021, 10:59 last edited by
                        #11

                        @SPlatten Just take some time playing with Designer and see how it works.

                        S 1 Reply Last reply 19 May 2021, 11:04
                        0
                        • O ollarch
                          19 May 2021, 10:59

                          @SPlatten Just take some time playing with Designer and see how it works.

                          S Offline
                          S Offline
                          SPlatten
                          wrote on 19 May 2021, 11:04 last edited by
                          #12

                          @ollarch , I'm getting so frustrated with it, its not WYSIWYG at all, I've just formatted it and was happy with the design, built project and the end result is nothing like it appears in the WYSIWYG editor.

                          Kind Regards,
                          Sy

                          P 1 Reply Last reply 19 May 2021, 11:12
                          0
                          • S SPlatten
                            19 May 2021, 11:04

                            @ollarch , I'm getting so frustrated with it, its not WYSIWYG at all, I've just formatted it and was happy with the design, built project and the end result is nothing like it appears in the WYSIWYG editor.

                            P Offline
                            P Offline
                            Pl45m4
                            wrote on 19 May 2021, 11:12 last edited by Pl45m4
                            #13

                            @SPlatten

                            Because the layouts apply after building (and displaying) your widget. So there might be some rearrangement.
                            The WYSIWYG editor shows how it could look like.


                            If debugging is the process of removing software bugs, then programming must be the process of putting them in.

                            ~E. W. Dijkstra

                            S 1 Reply Last reply 19 May 2021, 11:34
                            0
                            • P Pl45m4
                              19 May 2021, 11:12

                              @SPlatten

                              Because the layouts apply after building (and displaying) your widget. So there might be some rearrangement.
                              The WYSIWYG editor shows how it could look like.

                              S Offline
                              S Offline
                              SPlatten
                              wrote on 19 May 2021, 11:34 last edited by
                              #14

                              @Pl45m4 , then perhaps it could be WYSCBWYG :)

                              Kind Regards,
                              Sy

                              1 Reply Last reply
                              0

                              3/14

                              19 May 2021, 09:33

                              topic:navigator.unread, 11
                              • Login

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