hello, KDE community!
I have couple of questions regarding KPageWidgetModel / KPageWidget classes from KF6::KWidgetsAddons module.
Backstory: currently I’m developing an application to create and edit education robot move “scenarios”. These scenarios or protocols consist of some meta-information, device information and “steps” that robot should execute. Steps differ from each other with their own set of parameters, for example “sit” (position, speed), “sleep” (duration), etc. Pretty usual stuff.
I want to display this project in tree-view, kind of like projects are represented in CAD systems. So top-level tree elements would be “Project” and “Steps”, and they have to be persistent, regardless of protocol file user would load. Then, as second level tree elements, “Meta info” would be attached to “Project” and all steps would be attached to “Steps”. For each tree entry i would like to display relevant widget alongside to see/manipulate data inside model.
So i opted to use KPageWidgetModel first just to see how things work. I subclassed it with intent to store pointer to data model inside and add methods to manipulate data (add steps). In my model’s constructor i create and store couple of KPageWidgetItems for persistent entries.
Now, for trouble: i create KPageWidget, set model, open widget. When i enter something in search bar – everything crashes with SIGSEGV in qt_qFindChildren_helper function.
(note: got same issues with subclassing KPageModel, but i thought that i might have got overriden methods wrong or something, so temporarily swithed to KPageWidgetModel as simpler solution)
Here’s MWE that reproduces this error: https://gist.github.com/murych/20affb25438d48b27336a2fb9688235e (stacktrace included in first comment)
building environment:
- Fedora 42,
- gcc version 15.2.1 20260123,
- qt 6.10.2,
- kde frameworks 6.24.0
Am i doing something wrong? Is there any way to disable/hide search bar? Maybe using KPageWidgetModel (or, subsequently, KPageModel) is not good option for tree model that changes frequently?