Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
How to change the width of QDialogbox with the click of a button
Mr-Workalot last edited by Mr-Workalot
This is my QDialog
as of now the width of the QDialog is 1000, on right side the QListwidget covers 500 width, when i click the button "Show/Hide" , i should be able to change the width of QDialog frm 1000 to 500 (such that i am able to hide the QListwidget) and vice versa,
i guess i would have to use setFixedWidth(int w) function, but kinda confused how would i do it to change the QDialog size
Pl45m4 last edited by Pl45m4
First of all, it seems that you don't use any layouts.
Secondly, don't hide your widget by just resizing your dialog (if you are trying to do that). Better hide the widget itself.
To set a width anyway, you can use
QWidget::resize(int w, int h)