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. What is the "cost" of using unnecessary imports on QML ?
Forum Updated to NodeBB v4.3 + New Features

What is the "cost" of using unnecessary imports on QML ?

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

    What is the "cost" of using unnecessary imports on QML ?

    1 Reply Last reply
    0
    • C Offline
      C Offline
      chriadam
      wrote on last edited by
      #2

      Generally it depends on which type of import it is (installed module vs located module vs components directory vs JavaScript resource).

      If it is an installed or located module, the cost can be quite high in some circumstances (plugin loading and calling into the type registration function). If it is a components directory with a qmldir listing file, or module without a plugin, the cost is somewhat lower (the import system will parse the qmldir file and enumerate the available typenames but shouldn't parse the QML documents or load the type until/unless they're used). If it is a components directory without a qmldir listing file, the cost should be nil unless you use one of the types specified. If the import is a JavaScript resource, the cost will be substantial, since the file is parsed and loaded, and then evaluated, at import time.

      Cheers,
      Chris.

      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