April 20, 2011

vishwajeet vishwajeet
Lab Rat
83 posts

How to check in QML if plugin is available

 

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 :)

 Signature 

Born To Code !!!

3 replies

April 20, 2011

Denis Kormalev Denis Kormalev
Lab Rat
1654 posts

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

April 20, 2011

minimoog77 minimoog77
Lab Rat
128 posts

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.

April 21, 2011

mbrasser mbrasser
Ant Farmer
452 posts

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.

 
  ‹‹ Changing QML property from C++ : how to change width of QML property?      Image.PreserveAspectCrop how to set anchors? ››

You must log in to post a reply. Not a member yet? Register here!