Bug 425899 - ItemViewHeader not working inside KCMs not in an application window
Summary: ItemViewHeader not working inside KCMs not in an application window
Status: CONFIRMED
Alias: None
Product: frameworks-kirigami
Classification: Frameworks and Libraries
Component: general (other bugs)
Version First Reported In: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: Not decided
Assignee: Marco Martin
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-08-28 13:10 UTC by Harald Sitter
Modified: 2020-09-08 14:36 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
main.qml (minimal example) (581 bytes, text/x-qml)
2020-08-28 13:10 UTC, Harald Sitter
Details
shot of the screen (58.38 KB, image/png)
2020-08-28 13:11 UTC, Harald Sitter
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Harald Sitter 2020-08-28 13:10:45 UTC
Created attachment 131240 [details]
main.qml (minimal example)

inside a qml KCM put a Kirigami.ItemViewHeader and it gets grumpy:

> kinfocenter(273011)/(default) unknown: file:///usr/lib/x86_64-linux-gnu/qt5/qml/org/kde/kirigami.2/AbstractItemViewHeader.qml:33: ReferenceError: applicationWindow is not defined
> kinfocenter(273011)/(default) unknown: file:///usr/lib/x86_64-linux-gnu/qt5/qml/org/kde/kirigami.2/ItemViewHeader.qml:28: ReferenceError: applicationWindow is not defined
> kinfocenter(273011)/(default) unknown: file:///usr/lib/x86_64-linux-gnu/qt5/qml/org/kde/kirigami.2/AbstractApplicationItem.qml:311:9: QML Binding: Not restoring previous value because restoreMode has not been set.
> This behavior is deprecated.
> You have to import QtQml 2.14 after any QtQuick imports and set
> the restoreMode of the binding to fix this warning.
> In Qt < 6.0 the default is Binding.RestoreBinding.
> In Qt >= 6.0 the default is Binding.RestoreBindingOrValue.
> 
> kinfocenter(273011)/(default) unknown: file:///usr/lib/x86_64-linux-gnu/qt5/qml/org/kde/kirigami.2/AbstractItemViewHeader.qml:33: ReferenceError: applicationWindow is not defined
> kinfocenter(273011)/(default) unknown: file:///usr/lib/x86_64-linux-gnu/qt5/qml/org/kde/kirigami.2/ItemViewHeader.qml:28: ReferenceError: applicationWindow is not defined


I'm attaching a sample file, easiest to drop it in an existing KCM to see the problem.
Comment 1 Harald Sitter 2020-08-28 13:11:11 UTC
Created attachment 131241 [details]
shot of the screen
Comment 2 Nicolas Fella 2020-08-29 10:23:20 UTC
I suppose the problem is that it assumes the presence of applicationWindow()
Comment 3 Harald Sitter 2020-08-31 10:46:07 UTC
Yep. Probably needs some if-elseing.