Qt Designer - unable to replicate qtdesigner-manual form
-
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

-
If you don't show or give a link to whatever example people don't know what you are looking at. For a
QTextEditI think by default you will only see scrollbars if needed by the current content, see enum Qt::ScrollBarPolicy. -
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
-
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
@ReyCBXZRX
Well nowhere on that page is there aQTextEdit, let alone one with scrollbars.QLineEdits do not allow height change. And they haveQGridLayoutandQHBoxLayoutwhere 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.... -
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 -
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@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
QTextEditwidget 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
QTextEditandQPlainTextEdit, both of which are multiline, can be resized vertically, and can show scrollbars (both vertically or horizontally). OTOH there is also aQLineEditwidget 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.
-
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 -
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@ReyCBXZRX
I don't always follow the logic or English of what you write, but never mind :)A
QSpinBoxhas 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. AQLineEditis for entering text (rather than number), is single line and has no scrollbars. AQTextEditorQPlainTextEditis 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.
