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. Qt Creator WYSIWYG isn't giving a true representation
Forum Updated to NodeBB v4.3 + New Features

Qt Creator WYSIWYG isn't giving a true representation

Scheduled Pinned Locked Moved Unsolved General and Desktop
39 Posts 7 Posters 5.6k Views 4 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.
  • P Pl45m4
    14 Jun 2021, 10:24

    @SPlatten said in Qt Creator WYSIWYG isn't giving a true representation:

    are not in the layout they children of the centralWidget.

    So your "Select Trainee" label is floating around? :)
    Then you don't have to wonder why other widgets cover it.

    S Offline
    S Offline
    SPlatten
    wrote on 14 Jun 2021, 10:28 last edited by SPlatten
    #19

    @Pl45m4 , On this form there are four buttons to the left of the label, these are all of a specific size and position, when viewing in designer everything looks great and nothing is wrong.

    When I launch the application I am not resizing or moving anything, it initial state looks very different from how it did in designer.

    No other widgets are covering it, the font size and size of the label is different.

    Kind Regards,
    Sy

    P 1 Reply Last reply 14 Jun 2021, 10:36
    0
    • S SPlatten
      14 Jun 2021, 10:28

      @Pl45m4 , On this form there are four buttons to the left of the label, these are all of a specific size and position, when viewing in designer everything looks great and nothing is wrong.

      When I launch the application I am not resizing or moving anything, it initial state looks very different from how it did in designer.

      No other widgets are covering it, the font size and size of the label is different.

      P Offline
      P Offline
      Pl45m4
      wrote on 14 Jun 2021, 10:36 last edited by
      #20

      @SPlatten said in Qt Creator WYSIWYG isn't giving a true representation:

      No other widgets are covering it

      I thought the button on the left is covering your text...

      the font size and size of the label is different.

      Because the size of your label is not expanding with its content, because no layout will stretch your label :)
      You could try to set a minimum size in QtDesigner that fits your content.


      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 14 Jun 2021, 10:42
      0
      • P Pl45m4
        14 Jun 2021, 10:36

        @SPlatten said in Qt Creator WYSIWYG isn't giving a true representation:

        No other widgets are covering it

        I thought the button on the left is covering your text...

        the font size and size of the label is different.

        Because the size of your label is not expanding with its content, because no layout will stretch your label :)
        You could try to set a minimum size in QtDesigner that fits your content.

        S Offline
        S Offline
        SPlatten
        wrote on 14 Jun 2021, 10:42 last edited by
        #21

        @Pl45m4 , thank you, I've dropped in a Horizontal Layout and added the top row of controls to that, the application is better, although the presentation in designer is still not the same and whilst it's perfect in designer, the application still has a label that isn't displaying all characters.

        Kind Regards,
        Sy

        P 1 Reply Last reply 14 Jun 2021, 11:45
        0
        • S SPlatten
          14 Jun 2021, 10:42

          @Pl45m4 , thank you, I've dropped in a Horizontal Layout and added the top row of controls to that, the application is better, although the presentation in designer is still not the same and whilst it's perfect in designer, the application still has a label that isn't displaying all characters.

          P Offline
          P Offline
          Pl45m4
          wrote on 14 Jun 2021, 11:45 last edited by
          #22

          @SPlatten said in Qt Creator WYSIWYG isn't giving a true representation:

          the application still has a label that isn't displaying all characters.

          Weird. Shouldn't be the case, if done right.


          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 14 Jun 2021, 11:54
          0
          • P Pl45m4
            14 Jun 2021, 11:45

            @SPlatten said in Qt Creator WYSIWYG isn't giving a true representation:

            the application still has a label that isn't displaying all characters.

            Weird. Shouldn't be the case, if done right.

            S Offline
            S Offline
            SPlatten
            wrote on 14 Jun 2021, 11:54 last edited by
            #23

            @Pl45m4 , in fact every thing I've tried still results in the label showing everything except the first letter "S".

            Kind Regards,
            Sy

            P 1 Reply Last reply 14 Jun 2021, 12:55
            0
            • S SPlatten
              14 Jun 2021, 11:54

              @Pl45m4 , in fact every thing I've tried still results in the label showing everything except the first letter "S".

              P Offline
              P Offline
              Pl45m4
              wrote on 14 Jun 2021, 12:55 last edited by
              #24

              @SPlatten

              I believe there's still something wrong. Show your layout please (the layout / widget setup and the result you get)


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

              ~E. W. Dijkstra

              1 Reply Last reply
              1
              • S SPlatten
                14 Jun 2021, 09:17

                This is part of the form whilst editing in Qt Creator:
                creator.png

                This is the same form when running as application on desktop:
                IMG_0355.jpg

                In both cases I've screen printed and cropped the area. Why is the final presentation in the compiled application when running on the desktop so different from the view in Qt Creator?

                Also notice the controls used in Qt Creator are not quite the same as those when running in the application, note that the rectangles for the buttons and combo are sharp when running in the application and very slightly rounded when running in Qt Creator.

                I'm using Qt 4.4.1, Based on Qt 5.9.2 (MSVC 2015, 32 bit).

                T Offline
                T Offline
                Thank You
                wrote on 14 Jun 2021, 15:55 last edited by Thank You
                #25

                @SPlatten
                I think it is layout issue.
                In QT Creator You see it
                But while compiling it may show some or none of things

                Try applying horizontal layout label and QComboBox as discussed by @Pl45m4
                Then I am sure It will work
                It may not work if the window size is small Try resizing it

                Why you can't expect the output from QT Creator
                The height and width in QT Creator just for there unless layout is applied to it?
                If the design in QT Creator fills the screen properly Then would you expect it fill to all screens in the same behaviour "NO"
                So It's specific to that size only So I guess layouts are
                EASY
                RESPONSIVE
                ATTRACTIVE

                I hope it helps

                Let's make QT free or It will go forever

                TRUE AND FALSE <3

                S 1 Reply Last reply 15 Jun 2021, 06:24
                0
                • T Thank You
                  14 Jun 2021, 15:55

                  @SPlatten
                  I think it is layout issue.
                  In QT Creator You see it
                  But while compiling it may show some or none of things

                  Try applying horizontal layout label and QComboBox as discussed by @Pl45m4
                  Then I am sure It will work
                  It may not work if the window size is small Try resizing it

                  Why you can't expect the output from QT Creator
                  The height and width in QT Creator just for there unless layout is applied to it?
                  If the design in QT Creator fills the screen properly Then would you expect it fill to all screens in the same behaviour "NO"
                  So It's specific to that size only So I guess layouts are
                  EASY
                  RESPONSIVE
                  ATTRACTIVE

                  I hope it helps

                  S Offline
                  S Offline
                  SPlatten
                  wrote on 15 Jun 2021, 06:24 last edited by
                  #26

                  This is now resolved, I redid the main window ui, the top line buttons and widgets are now in a horizontal layout with the main window content in a grid layout. As a WYSIWYG editor Qt Creator is rubbish because the presentation of what you see is not what you get.

                  Kind Regards,
                  Sy

                  J 1 Reply Last reply 15 Jun 2021, 06:36
                  0
                  • C Offline
                    C Offline
                    Christian Ehrlicher
                    Lifetime Qt Champion
                    wrote on 15 Jun 2021, 06:30 last edited by
                    #27

                    @SPlatten said in Qt Creator WYSIWYG isn't giving a true representation:

                    As a WYSIWYG editor Qt Creator is rubbish because the presentation of what you see is not what you get.

                    I don't see how this should work - first you've styles which slightly modifies the items and then you can set the sizes and others by code - so what do you expect that this should work out?
                    That's why you have to use layouts - they arrange the widgets the way you want without killing the layout when another style is used or similar.

                    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
                    2
                    • S SPlatten
                      15 Jun 2021, 06:24

                      This is now resolved, I redid the main window ui, the top line buttons and widgets are now in a horizontal layout with the main window content in a grid layout. As a WYSIWYG editor Qt Creator is rubbish because the presentation of what you see is not what you get.

                      J Offline
                      J Offline
                      jsulm
                      Lifetime Qt Champion
                      wrote on 15 Jun 2021, 06:36 last edited by jsulm
                      #28

                      @SPlatten said in Qt Creator WYSIWYG isn't giving a true representation:

                      As a WYSIWYG editor Qt Creator is rubbish

                      I think the mistake you were doing was that you were designing your UI manually (positions and sizes of the widgets) for a specific theme. This is a very bad idea in my opinion because your UI is going to break as soon as the theme changes.
                      Lets assume QtDesigner would use the system theme, you are on Windows 10 and design your UI manually, everything is fine. One day Microsoft changes the theme (this will for sure happen one day) - your UI breaks, you have to adjust the UI and rebuild your app for the new Windows version. And there is one more thing to consider: if you're working on a cross platform app then your UI will only behave properly on the platform were you created it...

                      I use QtDesigner a lot and don't see how it is rubbish as long as you use layouts. So, instead of blaming the tool use it properly.

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

                      1 Reply Last reply
                      3
                      • S Offline
                        S Offline
                        SPlatten
                        wrote on 15 Jun 2021, 06:42 last edited by
                        #29

                        Perhaps rubbish is too harsh, but I've used various GUI tools and IDE's and generally when designing a GUI in a front end, what you end up with in your application is exactly how you left it in the designer. This isn't always the case in Qt Creator.

                        I'm not sure what you mean by themes, I drag and drop widgets from the palette onto the form and edit properties if required, in code I didn't modify anything, however now its fixed.

                        Kind Regards,
                        Sy

                        J 1 Reply Last reply 15 Jun 2021, 06:44
                        0
                        • S SPlatten
                          15 Jun 2021, 06:42

                          Perhaps rubbish is too harsh, but I've used various GUI tools and IDE's and generally when designing a GUI in a front end, what you end up with in your application is exactly how you left it in the designer. This isn't always the case in Qt Creator.

                          I'm not sure what you mean by themes, I drag and drop widgets from the palette onto the form and edit properties if required, in code I didn't modify anything, however now its fixed.

                          J Offline
                          J Offline
                          jsulm
                          Lifetime Qt Champion
                          wrote on 15 Jun 2021, 06:44 last edited by jsulm
                          #30

                          @SPlatten said in Qt Creator WYSIWYG isn't giving a true representation:

                          I'm not sure what you mean by themes

                          This thread started with you saying that QtDesigner does not use system theme (which is correct observation).

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

                          S 1 Reply Last reply 15 Jun 2021, 06:52
                          1
                          • J jsulm
                            15 Jun 2021, 06:44

                            @SPlatten said in Qt Creator WYSIWYG isn't giving a true representation:

                            I'm not sure what you mean by themes

                            This thread started with you saying that QtDesigner does not use system theme (which is correct observation).

                            S Offline
                            S Offline
                            SPlatten
                            wrote on 15 Jun 2021, 06:52 last edited by
                            #31

                            @jsulm , I don't follow at all.

                            Kind Regards,
                            Sy

                            J 1 Reply Last reply 15 Jun 2021, 07:06
                            0
                            • S SPlatten
                              15 Jun 2021, 06:52

                              @jsulm , I don't follow at all.

                              J Offline
                              J Offline
                              jsulm
                              Lifetime Qt Champion
                              wrote on 15 Jun 2021, 07:06 last edited by
                              #32

                              @SPlatten "Also notice the controls used in Qt Creator are not quite the same as those when running in the application, note that the rectangles for the buttons and combo are sharp when running in the application and very slightly rounded when running in Qt Creator." - you wrote this, right?
                              Also: "Qt Creator should present the forms in the way they will look when running on the host, which currently is very different"

                              So, what I mean is: QtDesigner does not use the system theme (the one used in the OS it is running on).

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

                              S 1 Reply Last reply 15 Jun 2021, 07:09
                              0
                              • J jsulm
                                15 Jun 2021, 07:06

                                @SPlatten "Also notice the controls used in Qt Creator are not quite the same as those when running in the application, note that the rectangles for the buttons and combo are sharp when running in the application and very slightly rounded when running in Qt Creator." - you wrote this, right?
                                Also: "Qt Creator should present the forms in the way they will look when running on the host, which currently is very different"

                                So, what I mean is: QtDesigner does not use the system theme (the one used in the OS it is running on).

                                S Offline
                                S Offline
                                SPlatten
                                wrote on 15 Jun 2021, 07:09 last edited by
                                #33

                                @jsulm , ok, thank you, and why is that? Surely thats either a design fault?

                                Is it a setting I can change?

                                Kind Regards,
                                Sy

                                J 1 Reply Last reply 15 Jun 2021, 07:12
                                0
                                • C Offline
                                  C Offline
                                  Christian Ehrlicher
                                  Lifetime Qt Champion
                                  wrote on 15 Jun 2021, 07:11 last edited by
                                  #34

                                  @SPlatten said in Qt Creator WYSIWYG isn't giving a true representation:

                                  ok, thank you, and why is that? Surely thats either a design fault?

                                  No design fault - it's a design feature that your app uses the style of the OS so it looks native.

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

                                  S 1 Reply Last reply 15 Jun 2021, 07:12
                                  0
                                  • S SPlatten
                                    15 Jun 2021, 07:09

                                    @jsulm , ok, thank you, and why is that? Surely thats either a design fault?

                                    Is it a setting I can change?

                                    J Offline
                                    J Offline
                                    jsulm
                                    Lifetime Qt Champion
                                    wrote on 15 Jun 2021, 07:12 last edited by
                                    #35

                                    @SPlatten I don't know why QtDesigner does not use the system theme and I'm not aware of any settings for that. Qt developers on Qt Mailing List could provide more information about this issue.

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

                                    1 Reply Last reply
                                    0
                                    • C Christian Ehrlicher
                                      15 Jun 2021, 07:11

                                      @SPlatten said in Qt Creator WYSIWYG isn't giving a true representation:

                                      ok, thank you, and why is that? Surely thats either a design fault?

                                      No design fault - it's a design feature that your app uses the style of the OS so it looks native.

                                      S Offline
                                      S Offline
                                      SPlatten
                                      wrote on 15 Jun 2021, 07:12 last edited by
                                      #36

                                      @Christian-Ehrlicher , thats exactly what I want as the default behaviour, but thats not what I'm seeing. What I'm getting is a slightly different look in the designer to the end product.

                                      Kind Regards,
                                      Sy

                                      C 1 Reply Last reply 15 Jun 2021, 08:11
                                      0
                                      • S Offline
                                        S Offline
                                        SimonSchroeder
                                        wrote on 15 Jun 2021, 07:22 last edited by
                                        #37

                                        I agree that the Qt Designer is not very good. I had a harder time learning the designer instead of writing C++ code. Especially handling layouts is quite cumbersome in the designer. Most of the time I would be much faster writing things down in C++. But our project uses ui-files.

                                        You can have a look how things would look like in the native style by using the menu: Tools -> Form Editor -> Preview. It is not entirely WYSIWYG, but you don't have to compile and run your application first to see how it looks. It will not know about your stylesheets, though (maybe there is a way to let it know about them). Also, showing a dialog in your application might actually resize the widget (especially when it contains layouts) whereas the preview shows you the same size as the designer.

                                        The designer was done for designers who don't know how to code. If you know how to code, I personally prefer to write things down in C++. This gives me much better control over everything and even shifting around things inside the layout is much faster. Sometimes to add something to a complex grid layout you have to break the layout first, then reposition everything in the designer so that when you reapply the grid layout it will pick up on everything correctly. That is way faster in C++ code.

                                        I don't expect any improvements for the Qt Designer. Designers (the people) are now targeted with QML instead (and also Qt Studio and the like with the commercial licenses).

                                        1 Reply Last reply
                                        2
                                        • S SPlatten
                                          15 Jun 2021, 07:12

                                          @Christian-Ehrlicher , thats exactly what I want as the default behaviour, but thats not what I'm seeing. What I'm getting is a slightly different look in the designer to the end product.

                                          C Offline
                                          C Offline
                                          Christian Ehrlicher
                                          Lifetime Qt Champion
                                          wrote on 15 Jun 2021, 08:11 last edited by
                                          #38

                                          @SPlatten I don't see what's wrong that there is another style used in designer - your layout should look good with all styles.
                                          You can select the style for the preview in QtCreator -> extra -> layout editor -> preview in -> <your desired style>

                                          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
                                          2

                                          28/39

                                          15 Jun 2021, 06:36

                                          • Login

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