Add qml import for KItemModels
ClosedPublic

Authored by davidedmundson on May 21 2019, 11:43 PM.

Details

Summary

QML dependency is optional and all original classes are kept away from
any new dependency.

The plugin extends KConcatenateRowsProxyModel via extended types to
expose sources as QQmlListProperty in a declarative way.

Intention is to expose some of the models we have here, but also the
QSortFilterProxy wrappers we have currently incorrectly in
plasma-framework and some common models used across plasma workspace.

Diff Detail

Repository
R275 KItemModels
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
Restricted Application added a project: Frameworks. · View Herald TranscriptMay 21 2019, 11:43 PM
Restricted Application added a subscriber: kde-frameworks-devel. · View Herald Transcript
davidedmundson requested review of this revision.May 21 2019, 11:43 PM
davidedmundson retitled this revision from Move everything in src to a subdirectory to Add qml import for KItemModels.May 21 2019, 11:50 PM
davidedmundson edited the summary of this revision. (Show Details)

Sync copyright headers to existing style

apol added a subscriber: apol.May 22 2019, 12:12 AM

I wonder if it was necessary to do the whole move into core :P.

+1 overall

tests/qml/concatenaterows.qml
6

can we turn this into an autotest?

+1 too, having the QML bindings as part of the corresponding framework is IMHO the way to go, compared to the KDeclarative approach.

kossebau added inline comments.
src/qml/CMakeLists.txt
13

With the macros of ECMAddQmlModule proposed in D20984, the explicit qmldir file could be removed and the install lines replaced by

ecm_add_qmlmodule(itemmodelsqml
    IDENTIFIER org.kde.kitemmodels
    DESTINATION ${KDE_INSTALL_QMLDIR}
    PLUGIN itemmodelsplugin
    TYPEINFO plugins.qmltypes
    VERSION 1.0
)

getting rid of all the duplicated identifiers and having the build-system instead know about them and propagate as needed from this single source.
It would also add support for a plugins.qmltypes file, thus providing metadata about the module for tools e.g. in cross-compilation scenarios.

Port manual test to unit test

I wonder if it was necessary to do the whole move into core :P.

It wasn't necessary, but I was trying to follow the framework convention.
If it helps get this, I can remove it.

Add KDescendentsProxyModel

apol added a comment.Aug 28 2019, 10:06 PM

Can you look into kossebau's coment? Let's get this in once that's ironed out.

autotests/CMakeLists.txt
30 ↗(On Diff #64882)

I like if (TARGET Qt5::Qml) better.

Can you look into kossebau's coment? Let's get this in once that's ironed out.

Kossebau's new API is not yet merged. It looks nice though.

Can you look into kossebau's coment? Let's get this in once that's ironed out.

Kossebau's new API is not yet merged. It looks nice though.

Yes, sorry, I dropped the ball there for a bit as I was a unsure still about usefulness an completeness of those macros, and also since then had not worked on own QML modules, while I had hoped I could test-drive the macros some more myself before making them public ECM API.
Shall pick up again in the next weeks, and then also ask for more feedback of QML module by all you Plasma QML workers. Feel invited to already be triggered to give some more comments (thanks @apol for your review there so far)

apol accepted this revision.Aug 28 2019, 11:26 PM

Alright then, let's get this in and kossebau can port it eventually.

This revision is now accepted and ready to land.Aug 28 2019, 11:26 PM
This revision was automatically updated to reflect the committed changes.