Make QTextEdit resizeable
-
You have to set the splitter between your left layout (which you not yet have) and the textedit - select both -> right click - it's properly documented: https://doc.qt.io/qt-6/designer-layouts.html#splitter-layouts
-
@Charon117 said in Make QTextEdit resizeable:
Definitely cant resize it as it stands.
Save your ui, compile your program, start it and your can move the splitter.
-
LOL. I can move the space inbetween the splitter, eg. between two widgets. WTF is that. I cant (1) move the splitter, or (2) resize the splitter. The space in the splitter is always getting used up 100% by whatever widgets are in. We are back to step zero again. We have the QTextEdit in a container, great. Now we have to built in the functionality to resize the splitter ?
Not sure if we are on track with this, this definitely doesnt fullfill the software specification. Which is a freely resizeable QTextEdit.
-
Even if we follow Alice into this wonderland, i only see a vertical and horizontal splitter. If we combine them into the weirdest 4 dimensional 2 layer monster, which would give us "almost" an acceptable outcome it doesnt change the fact that the splitter itself is not moveable, or resizeable. Now we could dock the splitter itself to the main window, which would resize it, ... and we end up with a very weird construct, and several weird bugs.
Can i just get a hint on how to address the frame of QTextEdit and how to build in the resize functionality itself ?
-
I mean i am pretty sure i can implement the resize functionality with resize(), i just dont get if user input on the frame is generated, how to create the appropriate cursor, and how to connect the user input on the frame, if any is generated, to the resize functionality.
-
@Charon117 said in Make QTextEdit resizeable:
nd how to build in the resize functionality itself ?
Reimplement mousePress/mouseMove/mouseRelease event if you don't like to use a QSplitter.
Although I don't understand why this textedit should be resizable in your case - why should the textedit not use all the place it can in the first place? the empty space looks pretty awkward -
Question is still very much open to the people actually reading the question, and understanding it as such. Thank you <3.
Thanks to @Christian-Ehrlicher for pointing out that QTextEdit doesnt have a natural resize functionality, as specified in the question.
-
Message to myself:
Resources gathered so far:
https://forum.qt.io/topic/67019/best-practice-resize-widgets-with-mouse
https://stackoverflow.com/questions/26281192/qt-resizing-a-ui-element-with-the-mouse
https://forum.qt.io/topic/66586/make-a-frameless-qwidget-resizable-with-qrubberband
https://wiki.qt.io/Widget-moveable-and-resizeableReflections:
Using QSizeGrip is an easy and dirty solution, but in this case it seems to do the job. Not a good solution if the resizing icon is not desireable to be ontop of the widget.
Widget-moveable-and-resizeable seems to have done some work to make a sort of container for that already, but no time to look into the functionality. It looks promising, depending on the functionality. The QLabels seem to be a bit distracting and maybe unecessary
The most desireable solution would be an invisible container, that allows resizing in 8 directions, and is able to move itself and its content.
QSplitter is not a solution because QSplitter in and of itself is not resizeable, nor moveable. You are basically starting all over again. QSplitter can be a solution if it is embedded in an overall layout, that manages the resizing operation and moving operations. But the underlying form for the desired functionality is freeform, eg. the user defines how the layout looks like. Therefore QSplitter is not a solution.