KDDockWidgets icon indicating copy to clipboard operation
KDDockWidgets copied to clipboard

What is the preferred way to control the minimum and maximum sizes of a dock widget?

Open oleyniko5 opened this issue 2 years ago • 3 comments

Hello,

We display a QQuickItem in a dock widget for our application, and we'd like to make sure that dock widgets would never go below or above a certain size. Doing something like

dock_widget->setMinimumSize(QSize{30, 500});

for a DockWidgetQuick does not seem to achieve that. However, having gone through the source code, I was able to control the minimum size by setting the property kddockwidgets_min_size for the QQuickItem either on C++ side, or on the QML side.

Doing the same for maximum size does update the value, as evidenced by calling maximumSize(). However, it does not seem to have an effect from the user perspective, as the dock widget windows can still be made larger than that.

Are there other ways to set those constraints? Is it possible to set those constraints by controlling the sizing of only the dock widget, rather than the QQuickItem? And what would be the preferred way to achieve this functionality?

oleyniko5 avatar Dec 17 '21 18:12 oleyniko5