Reputation: 4499
How could I make a QDockWidget such that the user is not able to drag the boundary of the QDockWidget to resize it?
Upvotes: 5
Views: 909
Reputation: 26
Actually, can set the size policy of the widget in dock widget to fixed.
inner_widget=QWidget()
inner_widget.setSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed)
dock=QDockWidget("")
dock.setWidget(inner_widget)
I'm using PyQt with Qt 5.15.
Upvotes: 0
Reputation: 12445
You can try setSizePolicy
. Something like
dock->setSizePolicy(QsizePolicy::Fixed);
Upvotes: 1