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. Test available module
Qt 6.11 is out! See what's new in the release blog

Test available module

Scheduled Pinned Locked Moved QML and Qt Quick
testavailablemodule
2 Posts 2 Posters 1.4k 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.
  • CharlieGC Offline
    CharlieGC Offline
    CharlieG
    wrote on last edited by
    #1

    Hello,

    Is it possible to try import in QML document ?
    By example :

    try {
       import QtQuick 2.5
    }
    catch {
       import QtQuick 2.0
    }
    

    or use another instruction to test if a module is available

    Thank you in advance

    p3c0P 1 Reply Last reply
    0
    • CharlieGC CharlieG

      Hello,

      Is it possible to try import in QML document ?
      By example :

      try {
         import QtQuick 2.5
      }
      catch {
         import QtQuick 2.0
      }
      

      or use another instruction to test if a module is available

      Thank you in advance

      p3c0P Offline
      p3c0P Offline
      p3c0
      Moderators
      wrote on last edited by
      #2

      Hi @CharlieG
      AFAIK that is not possible from QML. But you can try checking for errors by loading the QML from C++ side. For eg. if you use QQmlComponent you can check for errors using errors.

      157

      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