Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

[SOLVED] problem with textEdit layout



  • i have a docked widget with a textEdit and a pushButton on it. I would like to set the textEdit width to the max width of the dock widget. the problem is when i set layout vertically or layout in a grid, the pushButton changes size and i don't want that. how to set the textEdit width to the dock widget width without resizing the pushButton? i am using the form designer



  • You could use a spacer on the left or right of the pushbutton.



  • Set a horizontal spacer next to the button in your layout.



  • how to maximize the textEdit to the dock widget current width?



  • Again: put it in a layout.



  • In Qt Designer you can put spacer in the layouts, so layout elements wouldn't get resized (the spacer will "resize"). Even if your button resizes at first within the new layout, you can always set it's max width and height, so it will be as long and tall as you want, within the layout you need him to be in.



  • thank you Eus. thank you everybody. i never knew that i could resize the buttons after the layout was made. this topic is solved.


Log in to reply