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. Use of sub modules in Qt/QML
Forum Updated to NodeBB v4.3 + New Features

Use of sub modules in Qt/QML

Scheduled Pinned Locked Moved Solved QML and Qt Quick
4 Posts 3 Posters 476 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.
  • Egn1n3E Offline
    Egn1n3E Offline
    Egn1n3
    wrote on last edited by
    #1

    Hi,
    I am trying to understand why in QML (and maybe in Qt too) you have sub modules.
    For example, if you look at main.qml:

    import QtQuick 2.9
    import QtQuick.Window 2.2
    

    Why do you explicitly need to define QtQuick.Windows as well as you already defined QtQuick ealier? Does QtQuick on itself only loads parts of the QtQuick library?
    What's the use?

    Thanks.

    1 Reply Last reply
    0
    • dheerendraD Offline
      dheerendraD Offline
      dheerendra
      Qt Champions 2022
      wrote on last edited by
      #2

      Please note that it is software architecture. Qt is well designed with plug-and-play concept. So different functionalities in QtQuick are provided in different modules. So it our interest to include module we require. If you don't want QtQuick.Window module don't include. It is flexibility given to us. Hence the different modules.

      Dheerendra
      @Community Service
      Certified Qt Specialist
      http://www.pthinks.com

      1 Reply Last reply
      0
      • S Offline
        S Offline
        shaan7
        wrote on last edited by
        #3

        As though it might seem like that, the module QtQuick is not a superset containing things like QtQuick.Window. The same goes for QtQuick.Controls etc. Think of them as "extensions" to QtQuick rather than sub-modules.

        1 Reply Last reply
        0
        • Egn1n3E Offline
          Egn1n3E Offline
          Egn1n3
          wrote on last edited by
          #4

          That's exactly what I thought: a superset. If you look at them like extensions it make sense indeed. Thanks!

          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