Closed petrmanek closed 5 months ago
I suspect this is a low-hanging fruit / undocumented feature. I tried to search through examples and other issues, but could not find anything material. Could I please get any of the developers/maintainers to chime in? @iamsergio
I'll get to this soon, currently traveling
yeah, API needs to be exposed
@iamsergio Note that I am happy to help with a PR, if that is desirable. I would like to use affinities to load/save only a subset of windows and widgets.
MainWindowInstantiator, DockWidgetInstantiator and LayoutSaverInstantiator have an affinities
property now, it takes a list. See tests/main465.qml
Thanks for implementing this so fast! :tada:
One last question: I have noticed that the referenced commit appears in the mdi_fixed_size_example
branch. I am currently running KDDW from the 2.0
branch. What is the difference between those branches, and are there any plans to merge them in the future?
It's in main now. mdi_fixed_size_example
is something else, to be deleted
It's in main now.
mdi_fixed_size_example
is something else, to be deleted
Are you sure about this? I have just switch back from mdi_fixed_size_example
to 725d146796b1382c52180b61ac5f3652a3d688f3, which is the latest commit in 2.0
as of writing, and this does not seem to be included.
Please disregard my last comment. I have only noticed now that there is a main
branch. (I was assuming that you were referring to 2.0
when you wrote "main")
Hi, I am trying to use affinities with the QtQuick platform and the latest revision of KDDW 2.0 and have a quick question. How and at what point in object lifecycle do you set them? All QML wrappers have
affinities
declared only as a readonly property, which proxies to the wrapped object (usually aDockWidget
or aMainWindow
) or an empty list if it is not defined.I was able to subclass
KDDockWidgets::QtQuick::ViewFactory
and setDockWidget
affinity insidecreateDockWidget()
, however this seems super hacky and it does not give me an easy way to do the same for main windows. An obvious place to do this setup cleanly would be somewhere inMainWindowInstantiator
or aDockWidgetInstantiator
.Can you please advise? Am I missing something here?