Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. How to use enums from a C++ singleton in another QML plugin (Qt 6, qt_add_qml_module)
Forum Updated to NodeBB v4.3 + New Features

How to use enums from a C++ singleton in another QML plugin (Qt 6, qt_add_qml_module)

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
2 Posts 2 Posters 60 Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    SuhasKrishanamurthy
    wrote last edited by
    #1

    I have a Qt 6 project with two QML plugins created using qt_add_qml_module.

    Plugin A contains QML files.
    Plugin B contains a C++ singleton class that defines several enums.

    I want to use the enums from the singleton in Plugin B inside the QML files of Plugin A.

    What is the correct way to expose the singleton enums to QML across plugins, and how should the plugins be linked/imported?

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote last edited by
      #2

      Hi,

      AFAIK, if you want to share stuff between different plugins, use a shared library that contains that stuff and link it to both plugins.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved