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 check in QML if plugin is available
Qt 6.11 is out! See what's new in the release blog

How to check in QML if plugin is available

Scheduled Pinned Locked Moved QML and Qt Quick
4 Posts 4 Posters 4.1k Views 1 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.
  • V Offline
    V Offline
    vishwajeet
    wrote on last edited by
    #1

    Hi,

    I want to check from my QML application if the required plugin is available or not. so based on that i can have some conditional steps to do.

    Does anybody know how to do that ? is it possible in QML to check ?

    Thanks a lot :)

    Born To Code !!!

    1 Reply Last reply
    0
    • D Offline
      D Offline
      DenisKormalev
      wrote on last edited by
      #2

      I'm not sure, but I don't think it is possible from QML. Maybe using C++ is a valid option for you?

      1 Reply Last reply
      0
      • M Offline
        M Offline
        minimoog77
        wrote on last edited by
        #3

        Just try to load dummy qml file who has 'import yourplugin', if it's fails then plugin is unavailable.

        Never tried myself, it's a idea.

        1 Reply Last reply
        0
        • M Offline
          M Offline
          mbrasser
          wrote on last edited by
          #4

          There isn't any official, built-in way to do this from QML in Qt Quick 1.x. It isn't especially elegant, but as minimoog77 suggested, a workaround is to use Loader or dynamic item creation to try and load a file with the needed import, and then check whether or not you've received any errors.

          Hopefully we'll have a better solution for this in a future version of QML.

          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