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 Designer adds excess 1 pixel spacing
Forum Update on Monday, May 27th 2025

Qt Designer adds excess 1 pixel spacing

Scheduled Pinned Locked Moved General and Desktop
qtdesignerspacing
19 Posts 5 Posters 7.7k 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.
  • D Offline
    D Offline
    David King
    wrote on last edited by
    #10

    Ah, and within the vendor tool, to launch the .js, select PlugIns > CAN/CANopen Scripting, then Load, and nav to the .js

    1 Reply Last reply
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by
      #11

      Hi
      What is "application-level widget" ?
      the centralWidget in mainwindow ?

      1 Reply Last reply
      0
      • D Offline
        D Offline
        David King
        wrote on last edited by
        #12

        Hi mrjj,

        I am probably using the wrong terminology completely - do correct me !

        But by 'application-level widget', I mean the QWidget at the root of the hierarchy, within which all other widgets reside.
        Namely, as defined starting on line 4, within the OnePixel.ui source, within my previous post.

        We're not using C++, just Qt Script, with just a .js file, and a .ui file, source per previous post. Our vendor tool, which is a Windows .exe, has a dialogue as mentioned, for opening the .js file.

        The vendor provides a number of custom script functions, one of which is called util.loadUIFile( ), for loading the .ui file. That function call be seen in OnePixel.js, in my previous post.

        I guess behind the scenes, within the vendor Windows .exe source code, concepts of centralWidget and mainwindow, could well exist. But those are hidden from view for us, within their undisclosed source.

        Are centralWidget and mainwindow, standard names and concepts, with regular full C++ Qt development ?

        I really need to set aside some time, to study Qt properly. But rushing against a looming project deadline, too much still to do, not enough time, usual story ..

        Best regards,

        David

        1 Reply Last reply
        0
        • D Offline
          D Offline
          David King
          wrote on last edited by
          #13

          Oh, btw, if you were to download the demo version of the vendor tool, from the mentioned weblink, as below, then after installing, the PDF manual for the vendor-special functions, can be found in
          C:\Program Files\emtas\CANopenDeviceExplorer\doc, filename cde_script_api.pdf.

          https://www.emtas.de/en/download/canopen-deviceexplorer-demo/

          1 Reply Last reply
          0
          • mrjjM Offline
            mrjjM Offline
            mrjj
            Lifetime Qt Champion
            wrote on last edited by
            #14

            Hi
            Makes perfect sense now :)

            -Are centralWidget and mainwindow, standard names and concepts, with regular full C++ Qt -
            development ?

            Well yes as a Default project has a default QWindow type that is a widget with docking
            abilities. Supporting that it comes with a inner plain widget called centralWidget that is
            the main client area of it and its often a gotch when starting up. ( you think u insert directly to the window)

            Other than that, its just as normal to use any widget as window as its just a flag.

            I read you post a few times and still not 100% sure what the issue is. :)
            I read it like
            I put in some layouts. I set min/max and when i run it i can make it 2 pixels more that
            it should be allowed to ?
            (even with fixed Policy)
            Something like that ?

            1 Reply Last reply
            0
            • D Offline
              D Offline
              David King
              wrote on last edited by
              #15

              Hi,

              Things are actually a little bit weirder than I thought: Rather than Vertical Layout having a 1 pixel inner box, it's actually a more like a closing square bracket ] surrounding the content, 1 pixel top and bottom, 2 pixels on the right, and no pixels on the left.

              I found that, by placing in the styleSheet property for the first label, background-color:blue;

              And in the styleSheet property for the second label, background-color:green;

              Everything else, left exactly per the OnePixel.ui source in my post.

              Checkout the following runtime screengrabs. First is as-is. Second is with window dragged out, from 200 by 200, to 202 by 202. You can see the little white sliver of the ] enclosing the blue and green.

              0_1515703967515_1.png

              0_1515703973055_2.png

              In both labels, in the QFrame section, I then tried changing lineWidth, from the default 1, to 0. No change to behaviour.

              And then for both labels, in QLabel section, under alignment, I tried changing Horizontal from the default AlignLeft, to AlignHCenter. No change to behaviour, except for centering the TextLabel text, within the blue and green panel.

              Lastly, for each label, in the QWidget section, I tried changing layoutDirection, from the default LeftToRight, to instead, RightToLeft. I've never had need to look at that property before. Lo-and-behold, the ] changes to a [, if you're with me.
              So as follows, when dragged out from 200 by 200, to 202 by 202:

              0_1515704388020_3.png

              LayoutDirectionAuto is the same as LeftToRight.

              Best regards,

              David

              1 Reply Last reply
              0
              • D Offline
                D Offline
                David King
                wrote on last edited by
                #16

                Ah, my recent posts, crossed with your reply

                Yes, your summary pretty much sums it up

                Although in our actual application, it's 12 pixels more height than it should be, not 2 as in the example

                And that's because of

                ]
                ]
                ]
                ]
                ]
                ]

                1 Reply Last reply
                0
                • D Offline
                  D Offline
                  David King
                  wrote on last edited by
                  #17

                  Btw mrjj, does that Champion flash mean you're a Qt staffer ? Can we tell on this forum if someone is an Qt support person, who might have the ear of the Qt devs ?

                  1 Reply Last reply
                  0
                  • mrjjM Offline
                    mrjjM Offline
                    mrjj
                    Lifetime Qt Champion
                    wrote on last edited by
                    #18

                    Hi
                    Ok its actually 12 pixels that is a lot.
                    Nope, im just a private person. This is a user forum and paid support is
                    available via other channels. (as in , not so much staff here but they host/pay the server)

                    However, its possible to speak to the devs at
                    http://lists.qt-project.org/mailman/listinfo

                    1 Reply Last reply
                    0
                    • G Offline
                      G Offline
                      g0ierli
                      wrote on last edited by
                      #19

                      tl;dr

                      It's QFrame adding this extra pixel.
                      set frameShape to NoFrame

                      1 Reply Last reply
                      1

                      • Login

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