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. General and Desktop
  4. loadFromModule: What exactly is the typename?
Qt 6.12 LTS is out! See what's new in the release blog

loadFromModule: What exactly is the typename?

Scheduled Pinned Locked Moved Solved General and Desktop
2 Posts 1 Posters 986 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
    Asperamanca
    wrote on last edited by
    #1

    I don't find any good description of the typename in functions such as QQmlComponent::loadFromModule

    In examples where the QML file is in the same folder as everything else, it seems to be simply the name of the QML file without extension.
    So "Main.qml" which is part of QML module "People" is loaded via

    QQmlComponent component(&engine);
    component.loadFromModule("People", "Main");
    

    However, in real life, it's rare that all files are in the same folder. So does the typename have to take subfolders into account? Or the resource path? Or something else?

    A 1 Reply Last reply
    0
    • A Asperamanca

      I don't find any good description of the typename in functions such as QQmlComponent::loadFromModule

      In examples where the QML file is in the same folder as everything else, it seems to be simply the name of the QML file without extension.
      So "Main.qml" which is part of QML module "People" is loaded via

      QQmlComponent component(&engine);
      component.loadFromModule("People", "Main");
      

      However, in real life, it's rare that all files are in the same folder. So does the typename have to take subfolders into account? Or the resource path? Or something else?

      A Offline
      A Offline
      Asperamanca
      wrote on last edited by
      #2

      @Asperamanca
      Looks like typically, the Typename should be the QML filename without extension, regardless of folder structure.

      1 Reply Last reply
      0
      • A Asperamanca has marked this topic as solved on

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt
      • Unsolved