Skip to content

This test was created to see how QAction (C++) and Action (QML) work together. Summary: barely.

Notifications You must be signed in to change notification settings

kaa-ching/test-mix-action-qaction

Repository files navigation

This example code was written to see how to get a QAction in C++ and an Action in QML to work together. Especially in the context of a QActionGroup (C++) or ExclusiveGroup (QML).

The short of it: barely. You cannot use a QAction from QML nor an Action from C++, but you can get them to communicate a bit using signals and slots.

Too bad that there is state duplication: both ends maintain state about who's checked. (and C++ updates QML for state changes, but not reverse). This is likely fixable by creating dedicated derived classes on both ends: that will make synchronisation better and usage more transparant. Exercise left to the reader, I now know enough.

About

This test was created to see how QAction (C++) and Action (QML) work together. Summary: barely.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published