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. Looking for a specific QML Type
Forum Updated to NodeBB v4.3 + New Features

Looking for a specific QML Type

Scheduled Pinned Locked Moved Solved QML and Qt Quick
3 Posts 3 Posters 367 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.
  • R Offline
    R Offline
    RobM
    wrote on last edited by
    #1

    Are there any premade QML Types that have a label and content functionality? For instance:

    label: "This label"
    content: --some QM object or Type
    

    does that make sense? For instance, lets say my "content" for this Type was a simple Text{text: "hello world"} then it would something like this overall:

    This Label
    hello world

    and if it were a Repeater{model:3; Text{text: "hello world:}} then it would look something like this:

    This Label
    hello world
    hello world
    hello world

    ODБOïO 1 Reply Last reply
    0
    • R RobM

      Are there any premade QML Types that have a label and content functionality? For instance:

      label: "This label"
      content: --some QM object or Type
      

      does that make sense? For instance, lets say my "content" for this Type was a simple Text{text: "hello world"} then it would something like this overall:

      This Label
      hello world

      and if it were a Repeater{model:3; Text{text: "hello world:}} then it would look something like this:

      This Label
      hello world
      hello world
      hello world

      ODБOïO Offline
      ODБOïO Offline
      ODБOï
      wrote on last edited by
      #2

      hi @RobM
      you can create a reusable component like this

      Item {
          property alias childItem : loader.sourceComponent
          Text { id:title;text: "This label" }
          Loader { id: loader;anchors.top: title.bottom }
      }
      
      MyComponent{
             childItem: Column{
                 Repeater{
                     model : 3
                     Text {
                         id: name
                         text: "hello world"
                     }
                 }
             }
         }
      
      1 Reply Last reply
      1
      • fcarneyF Offline
        fcarneyF Offline
        fcarney
        wrote on last edited by
        #3

        @LeLev said in Looking for a specific QML Type:

        Item {
        property alias childItem : loader.sourceComponent
        Text { id:title;text: "This label" }
        Loader { id: loader;anchors.top: title.bottom }
        }

        Probably want this too:

        property alias title: title.text
        

        C++ is a perfectly valid school of magic.

        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