Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. [Moved] QML and grouped properties
Forum Updated to NodeBB v4.3 + New Features

[Moved] QML and grouped properties

Scheduled Pinned Locked Moved Qt Creator and other tools
10 Posts 5 Posters 5.6k 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.
  • D Offline
    D Offline
    DenisKormalev
    wrote on last edited by
    #1

    I have next code to imitate grouped properties in Style.qml:
    @
    QtObject {
    property QtObject color: QtObject {
    property QtObject background: QtObject {
    property string main: "black"
    }
    }
    @
    In another qml I have:
    @
    //...
    Style {
    id: style
    }
    //...
    @

    Things like
    @
    Rectangle { color = style.color.background.main }
    @
    works ok, but there is no completion for them in QtCreator.
    Maybe someone knows another way to imitate grouped property? Or it is the only way and I should move it to Tools forum with question about autocompletion in QtCreator :)

    1 Reply Last reply
    0
    • Q Offline
      Q Offline
      qtrahul
      wrote on last edited by
      #2

      one question ?
      Does the QML code to be run in qmlviewer or in Qt creator ?

      1 Reply Last reply
      0
      • D Offline
        D Offline
        DenisKormalev
        wrote on last edited by
        #3

        qtrahul, how your question is related to this topic? And also what do you mean by "run in QtCreator"?

        1 Reply Last reply
        0
        • Q Offline
          Q Offline
          qtrahul
          wrote on last edited by
          #4

          Where do we run(compile) QML code.
          qmlviewer or in Qt creator ?

          1 Reply Last reply
          0
          • D Offline
            D Offline
            DenisKormalev
            wrote on last edited by
            #5

            I didn't understand how it is related to post.
            QML code can be run either in qmlviewer or inside your C++ app (wrapper made by QtCreator is actually generated C++ app).

            1 Reply Last reply
            0
            • K Offline
              K Offline
              kamalakshantv
              wrote on last edited by
              #6

              [quote author="qtrahul" date="1293212187"]Where do we run(compile) QML code.
              qmlviewer or in Qt creator ?[/quote]

              Just to add that QML code is never compiled.

              bq. A QML component is a template that is interpreted by the QML runtime.

              1 Reply Last reply
              0
              • D Offline
                D Offline
                DenisKormalev
                wrote on last edited by
                #7

                Christmas holidays are over, so moving this thread up :)

                1 Reply Last reply
                0
                • M Offline
                  M Offline
                  mbrasser
                  wrote on last edited by
                  #8

                  [quote author="Denis Kormalev" date="1292937212"]
                  Maybe someone knows another way to imitate grouped property? Or it is the only way and I should move it to Tools forum with question about autocompletion in QtCreator :)[/quote]

                  Your approach seems fine to me -- I'd suggest asking in the Tools forum (or lodging a suggestion on http://bugreports.qt.nokia.com if there isn't one already).

                  Michael

                  1 Reply Last reply
                  0
                  • F Offline
                    F Offline
                    fcrochik
                    wrote on last edited by
                    #9

                    Denis:
                    Would you mind expanding your example so we all can learn from it?

                    Certified Specialist & Qt Ambassador <a href="http://www.crochik.com">Maemo, Meego, Symbian, Playbook, RaspberryPi, Desktop... Qt everywhere!</a>

                    1 Reply Last reply
                    0
                    • D Offline
                      D Offline
                      DenisKormalev
                      wrote on last edited by
                      #10

                      mbrasser, thanks for answer, topic is moved :)

                      fcrochik, I'll do it later.

                      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