Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt for Python
  4. Qt Designer - unable to replicate qtdesigner-manual form
Forum Updated to NodeBB v4.3 + New Features

Qt Designer - unable to replicate qtdesigner-manual form

Scheduled Pinned Locked Moved Unsolved Qt for Python
12 Posts 2 Posters 705 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.
  • R Offline
    R Offline
    ReyCBXZRX
    wrote last edited by
    #3

    Neglect to say I'm using Qt Designer 6.4.3 and Python 3.11.

    1 Reply Last reply
    0
    • R Offline
      R Offline
      ReyCBXZRX
      wrote last edited by
      #4

      Howdy JonB.
      Found search when I had browser (Vivaldi) fully open 8-)
      Will try/experiment more as the lineEdits do not show the up and down icons on right side like the example and while form does resize on changing form width the lineEdit objs do not allow height chng. Thanks for reply and suggestions, Rey
      image.png

      1 Reply Last reply
      0
      • JonBJ Offline
        JonBJ Offline
        JonB
        wrote last edited by
        #5

        If you don't show or give a link to whatever example people don't know what you are looking at. For a QTextEdit I think by default you will only see scrollbars if needed by the current content, see enum Qt::ScrollBarPolicy.

        1 Reply Last reply
        0
        • R Offline
          R Offline
          ReyCBXZRX
          wrote last edited by
          #6

          Howdy JonB. The form I'm looking at is at https://doc.qt.io/qt-6/designer-widget-mode.html. Took a break and now will get back at it...Thanks, Rey

          JonBJ 1 Reply Last reply
          0
          • R ReyCBXZRX

            Howdy JonB. The form I'm looking at is at https://doc.qt.io/qt-6/designer-widget-mode.html. Took a break and now will get back at it...Thanks, Rey

            JonBJ Offline
            JonBJ Offline
            JonB
            wrote last edited by JonB
            #7

            @ReyCBXZRX
            Well nowhere on that page is there a QTextEdit, let alone one with scrollbars. QLineEdits do not allow height change. And they have QGridLayout and QHBoxLayout where you have no explicit layouts (you may have set Form layout on the widget I cannot tell). If you are not using layouts you will get nowhere with e.g. resizing. So all in all your situation is pretty different....

            1 Reply Last reply
            0
            • R Offline
              R Offline
              ReyCBXZRX
              wrote last edited by
              #8

              Howdy again. The Qt Designer ver I'm using has no QTextEdit but has a plainLineEdit obj that when height resized shows scrollbar.
              Went through tutorial (https://www.youtube.com/watch?v=EmZZvBEKBxc) that uses frames where layout added after widget objs inserted.
              Thru trial and err - pain - finally understood why I was having problems with label and lineEdits not aligning but lineEdit above label...and that was that I had the label TOO close to line edit where label size was touching or extending into the lineEdit field. Once I adjusted the label or lineEdit so they were not touching/overlapping, then they lined up horizontally. In many of my attempts, I would put the label and lineEdit into a horizontal layout and then add to vertical layout screwing things up AGAIN.
              Will try using label and lineEdit in horizontal layout and adding to frame to see what happens.
              As is said, trial and err is best learning experience BUT bad for keyboards 8-)
              Thanks for assistance, will update and my results. Rey

              JonBJ 1 Reply Last reply
              0
              • R ReyCBXZRX

                Howdy again. The Qt Designer ver I'm using has no QTextEdit but has a plainLineEdit obj that when height resized shows scrollbar.
                Went through tutorial (https://www.youtube.com/watch?v=EmZZvBEKBxc) that uses frames where layout added after widget objs inserted.
                Thru trial and err - pain - finally understood why I was having problems with label and lineEdits not aligning but lineEdit above label...and that was that I had the label TOO close to line edit where label size was touching or extending into the lineEdit field. Once I adjusted the label or lineEdit so they were not touching/overlapping, then they lined up horizontally. In many of my attempts, I would put the label and lineEdit into a horizontal layout and then add to vertical layout screwing things up AGAIN.
                Will try using label and lineEdit in horizontal layout and adding to frame to see what happens.
                As is said, trial and err is best learning experience BUT bad for keyboards 8-)
                Thanks for assistance, will update and my results. Rey

                JonBJ Offline
                JonBJ Offline
                JonB
                wrote last edited by
                #9

                @ReyCBXZRX said in Qt Designer - unable to replicate qtdesigner-manual form:

                The Qt Designer ver I'm using has no QTextEdit

                All versions of Designer offer a QTextEdit widget along with all the other widgets.

                but has a plainLineEdit obj that when height resized shows scrollbar

                I do not know what "plainLineEdit obj" is. Qt has QTextEdit and QPlainTextEdit, both of which are multiline, can be resized vertically, and can show scrollbars (both vertically or horizontally). OTOH there is also a QLineEdit widget which is single-line, does not show scrollbars and cannot be resized vertically.

                line edit where label size was touching or extending into the lineEdit field

                I do not know what you are saying or doing here. It sounds a bit like you are using "absolute positioning" of widgets by dragging them around, not sure. If so you should not be using that: you want to use layouts, that will position your widgets so that e.g. they do not "touch or overlap" and will move them around for resizing.

                1 Reply Last reply
                1
                • R Offline
                  R Offline
                  ReyCBXZRX
                  wrote last edited by
                  #10

                  OK. Seems I'm getting hang of this...simple layout as I'd be bald if not 8-)
                  But one issue was that I was using plainTextEdit instead of spinbox obj which has up/down btns and thus field size stayed constant whereas the plainTextEdit obj started as square which I resized but when running form would change/increase size. Played on separate form and realized my error. Regarding the widget overlap, I place widgets inside frame, space then so there is no overlap and THEN apply layout inside frame. When "done", I set layout for the form in this case vertical.
                  Will try your overlap suggestion and continue "learning." Thanks

                  JonBJ 1 Reply Last reply
                  0
                  • R Offline
                    R Offline
                    ReyCBXZRX
                    wrote last edited by
                    #11

                    Here's form at this time: image.png

                    1 Reply Last reply
                    0
                    • R ReyCBXZRX

                      OK. Seems I'm getting hang of this...simple layout as I'd be bald if not 8-)
                      But one issue was that I was using plainTextEdit instead of spinbox obj which has up/down btns and thus field size stayed constant whereas the plainTextEdit obj started as square which I resized but when running form would change/increase size. Played on separate form and realized my error. Regarding the widget overlap, I place widgets inside frame, space then so there is no overlap and THEN apply layout inside frame. When "done", I set layout for the form in this case vertical.
                      Will try your overlap suggestion and continue "learning." Thanks

                      JonBJ Offline
                      JonBJ Offline
                      JonB
                      wrote last edited by
                      #12

                      @ReyCBXZRX
                      I don't always follow the logic or English of what you write, but never mind :)

                      A QSpinBox has a pair of "scroll arrows" at the right but it is not a "scrollbar". These are for inc/decrementing the number value and have nothing to do with scrolling or sizing. A QLineEdit is for entering text (rather than number), is single line and has no scrollbars. A QTextEdit or QPlainTextEdit is for multiline text, can be resized vertically and can have scrollbars.

                      There are two ways of adding a layout to a widget in Designer. Each widget can have a layout set by right-clicking on it and selecting Layout > menu item. However for unknown/inexplicable reason this is only enabled when the parent widget has had at least one child widget placed on it, you cannot do it before you add any child widget, which is rather odd. Alternatively there are explicit layout items available at the top of the all the items you can drag from the left-hand side toolbar, these can be dragged and placed anytime. I have never understood/investigated whether there is any difference in result between these two methods.

                      With layouts there should be no "overlapping", it is their job to prevent this.

                      One tip: If you look at the Object Explorer --- the pane at the right which shows all your placed widgets in their hierarchy --- you will see a "red no entry" symbol on any widgets you have created which do not have a layout but should have. If you see that you know you should be adding a layout there.

                      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