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. Newbie question - how to show QML Components in Creator QML Design Window
QtWS25 Last Chance

Newbie question - how to show QML Components in Creator QML Design Window

Scheduled Pinned Locked Moved QML and Qt Quick
5 Posts 3 Posters 6.7k Views
  • 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.
  • J Offline
    J Offline
    jmore
    wrote on last edited by
    #1

    Running Qt Creator 2.0.91 (2.1.0 -Dpre-Beta1) Sep 29

    When I "Explore Qt Quick Examples" and open the ui-components project, then open slideswitch.qml file in slideswitch folder, then switch to Design mode, the Library Items shows the Switch (from the Contents folder in slideswitch) under "QML Components". How did it get there? I want to have a set of components to design with. I just can't find out how to add my own components to the designer Library list.

    Thanks in advance.

    1 Reply Last reply
    0
    • S Offline
      S Offline
      Schneidi
      wrote on last edited by
      #2

      Hey I don't use the qml designer that much so I never observer your problem but sometimes I take a look at the designer.

      I'm not sure but I believe that my own components were available in the designer.

      I have one sub directory with my qml sources and there I made another sub directory with my custom elements called "elements" as far as I can remember I had the option to use this elements in the designer. But it seems to be depending on which qml source you currently select.

      Lets say you have:

      untitled.qml

      Source1.qml

      source2.qml

      If you select untitled.qml and go to the designer to get the Source1.qml in the list of QML-Components.

      As far as I know the source2.qml will not appear in the list because its first letter is lower case and Components have to be starting with upper case letters.

      I hope that this is helpful.

      Try this yourself.

      1 Reply Last reply
      0
      • J Offline
        J Offline
        jmore
        wrote on last edited by
        #3

        I think the issue is that the project needs to be saved and then re-opened. Now the QML Component shows up as it should. Thanks for the explanation about upper case vs lower case - that saves a lot of head scratching.

        1 Reply Last reply
        0
        • S Offline
          S Offline
          Schneidi
          wrote on last edited by
          #4

          Hmm I my case I don't had to reopen the project.

          I just added a new qml component and thats it.

          1 Reply Last reply
          0
          • G Offline
            G Offline
            gustavo
            wrote on last edited by
            #5

            Do you have a ".qmlproject" file in your project directory? It has a QmlFiles field where it instructs Qt Creator where to find qml files. If you don't have one, it's possible that it's causing the need to reopen the project in order to load the new files, because, like Schneidi said, normally reopening is not necessary.

            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