Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
qtws26_logo

The Qt Event of the Year: Qt World Summit 2026

Save Your Spot >
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. QML Code modularization (re-use)
Qt 6.12 LTS is out! See what's new in the release blog

QML Code modularization (re-use)

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

    Hi
    It looks like Qt is making some really nice strides under Digia. I thought I would start playing with QML. I'm wondering how to go about modularizing qml files. For instance, what if I have two screens that have very different functionality and I want to separate them into different QML files or I have some code that I want to re-use often? How do I pull it all together?

    thnx

    Brian

    1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      Put separate components into separate QML files. It's all written in the documentation. As long as the file name follows the convention (starts with upper case), QML will allow you to import that file and use it in your code straigt away.

      There are also more advanced options available, like creating custom component sets.

      (Z(:^

      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
      • Unsolved