Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to load a component
Forum Updated to NodeBB v4.3 + New Features

How to load a component

Scheduled Pinned Locked Moved Solved General and Desktop
4 Posts 2 Posters 263 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.
  • FortigaF Offline
    FortigaF Offline
    Fortiga
    wrote on last edited by
    #1

    Good evening I am using Qt 9.0.1 and QtQuick 6.4, and I have a problem with the execution of my program:
    QQmlApplicationEngine failed to load component
    qrc:/Note-Black/main.qml:25:5: MyMenu is not a type

    I want to use the "MyMenu" component (defined in "MyMenu.qml") imported the file

    But it doesn't work.

    Any ideas?

    Thank you

    Juste pour aller de l'avant et apprendre des choses, lorsque vous voulez devenir une légende, cela ne se fait pas du jour au lendemain.

    Pl45m4P 1 Reply Last reply
    0
    • Pl45m4P Pl45m4

      @Fortiga said in How to load a component:

      MyMenu.qml

      Is MyMenu.qml in the same directory as main.qml? Have you added this file to your qml resources?

      FortigaF Offline
      FortigaF Offline
      Fortiga
      wrote on last edited by Fortiga
      #3

      @Pl45m4
      in fact yes they have in the same directory
      I use a resource file it contains nothing

      pre.png

      Juste pour aller de l'avant et apprendre des choses, lorsque vous voulez devenir une légende, cela ne se fait pas du jour au lendemain.

      Pl45m4P 1 Reply Last reply
      0
      • FortigaF Fortiga

        Good evening I am using Qt 9.0.1 and QtQuick 6.4, and I have a problem with the execution of my program:
        QQmlApplicationEngine failed to load component
        qrc:/Note-Black/main.qml:25:5: MyMenu is not a type

        I want to use the "MyMenu" component (defined in "MyMenu.qml") imported the file

        But it doesn't work.

        Any ideas?

        Thank you

        Pl45m4P Offline
        Pl45m4P Offline
        Pl45m4
        wrote on last edited by
        #2

        @Fortiga said in How to load a component:

        MyMenu.qml

        Is MyMenu.qml in the same directory as main.qml? Have you added this file to your qml resources?


        If debugging is the process of removing software bugs, then programming must be the process of putting them in.

        ~E. W. Dijkstra

        FortigaF 1 Reply Last reply
        0
        • Pl45m4P Pl45m4

          @Fortiga said in How to load a component:

          MyMenu.qml

          Is MyMenu.qml in the same directory as main.qml? Have you added this file to your qml resources?

          FortigaF Offline
          FortigaF Offline
          Fortiga
          wrote on last edited by Fortiga
          #3

          @Pl45m4
          in fact yes they have in the same directory
          I use a resource file it contains nothing

          pre.png

          Juste pour aller de l'avant et apprendre des choses, lorsque vous voulez devenir une légende, cela ne se fait pas du jour au lendemain.

          Pl45m4P 1 Reply Last reply
          0
          • FortigaF Fortiga

            @Pl45m4
            in fact yes they have in the same directory
            I use a resource file it contains nothing

            pre.png

            Pl45m4P Offline
            Pl45m4P Offline
            Pl45m4
            wrote on last edited by
            #4

            @Fortiga

            How does your resource.qrc look like?
            Btw, there are couple of posts dealing with this issue
            e.g. here or this on StackOverflow.


            If debugging is the process of removing software bugs, then programming must be the process of putting them in.

            ~E. W. Dijkstra

            1 Reply Last reply
            0
            • FortigaF Fortiga 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 Extensions
            • Unsolved