Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
oleyniko5 opened this issue Dec 17, 2021 · 3 comments
Assignees

Comments

@oleyniko5
Copy link

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?

@petrmanek
Copy link

I had this problem too and would be interested in a solution.

One thing that I noticed is that kddockwidgets_max_size actually translates to maximumSizeHint() instead maximumSize(). This appears to be in effect only when you double-click the splitter (the widget expands as far as it can).

In addition to this, I would also like to ask there is any way in Quick to set widgets' preferred size behavior (e.g. expanding, minimum)?

@itsmattkc
Copy link

I would also like to know. We're having an issue in olive-editor/olive#2188 where we can't figure out how to make a dock widget narrower. Is there really no way to do this?

@Quinntyx
Copy link

I'd also like to know what's the correct course of action to change the size of KDDockWidgets.

@iamsergio iamsergio self-assigned this Jan 23, 2024
iamsergio added a commit that referenced this issue Jan 23, 2024
Started documenting it.
There's seems to be lots of improvements to do.

For issue #262
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants