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.0k 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.
  • SPlattenS SPlatten

    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.

    jsulmJ Offline
    jsulmJ Offline
    jsulm
    Lifetime Qt Champion
    wrote on 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

    SPlattenS 1 Reply Last reply
    1
    • jsulmJ jsulm

      @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).

      SPlattenS Offline
      SPlattenS Offline
      SPlatten
      wrote on last edited by
      #31

      @jsulm , I don't follow at all.

      Kind Regards,
      Sy

      jsulmJ 1 Reply Last reply
      0
      • SPlattenS SPlatten

        @jsulm , I don't follow at all.

        jsulmJ Offline
        jsulmJ Offline
        jsulm
        Lifetime Qt Champion
        wrote on 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

        SPlattenS 1 Reply Last reply
        0
        • jsulmJ jsulm

          @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).

          SPlattenS Offline
          SPlattenS Offline
          SPlatten
          wrote on 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

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

            SPlattenS 1 Reply Last reply
            0
            • SPlattenS SPlatten

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

              Is it a setting I can change?

              jsulmJ Offline
              jsulmJ Offline
              jsulm
              Lifetime Qt Champion
              wrote on 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
              • Christian EhrlicherC Christian Ehrlicher

                @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.

                SPlattenS Offline
                SPlattenS Offline
                SPlatten
                wrote on 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

                Christian EhrlicherC 1 Reply Last reply
                0
                • S Offline
                  S Offline
                  SimonSchroeder
                  wrote on 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
                  • SPlattenS SPlatten

                    @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.

                    Christian EhrlicherC Offline
                    Christian EhrlicherC Offline
                    Christian Ehrlicher
                    Lifetime Qt Champion
                    wrote on 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
                    • C Offline
                      C Offline
                      ChrisW67
                      wrote on last edited by ChrisW67
                      #39

                      As previously noted, Qt GUI programs generally default to a style that matches the runtime environment to a reasonable degree. Designer on my Linux box defaults to the Fusion style. The program can force the style but a quick look at the Designer source does not immediately suggest it does.

                      Designer, like any idiomatic Qt GUI program, accepts the command line option "-style stylename". As far as I can tell the common option (depending on platform) are: Windows, WindowsXP, WindowsVista, Android, Fusion, Macintosh. On my Linux box I also have a Breeze and Oxygen style. If, on the platform you are running, it is possible to display in that style it will, or it will report to the console the allowable options and fall back to something that can work. I think Fusion is available and consistent for all platforms.

                      Within Designer you can preview your UI in any of the styles that can be rendered in your development environment. It's on one of the menus.

                      QtCreator also accepts the flag, but the main UI is so heavily customized the only difference seems to be in the menu look-and-feel.

                      Your program can force a style (QApplication::setStyle()) and accept that your program looks different to the other native apps. The Windows style emulation on Linux is Windows95-ish and truly awful ;)

                      You can develop your own style to plug in, but that's a lot of work.

                      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