Details
-
Suggestion
-
Resolution: Done
-
P3: Somewhat important
-
5.12.2, 5.15.0, 6.2
Description
There are times when you would like to use a module (service) that may or may not be available. For examples sensors. In a game sensors may provide additional control methods that are optional, and on a desktop or platform without sensors it would nice if it failed silently. Right now it's possible using a loader, but it's awkward and makes for poor example applications.
[13:26] <asj> in QML can you have a conditional import? basically like "if import QtMobility.sensors fails, well don't worry be happy"
[13:33] <blam> asj: I don't think so.. although it would be really good to have. One (awkward) way to check is to load the code that uses it using a Loader and then check Loader::status
[13:33] <blam> asj: could you file a suggestion for that please?
Attachments
Issue Links
- is duplicated by
-
QTBUG-22021 API to query if a module is present
-
- Closed
-
- resulted in
-
QTBUG-128746 Optional code in QML
-
- Reported
-