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. [SOLVED] how to initialize a property alias in QML
QtWS25 Last Chance

[SOLVED] how to initialize a property alias in QML

Scheduled Pinned Locked Moved QML and Qt Quick
property aliasqml
3 Posts 2 Posters 5.5k 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.
  • T Offline
    T Offline
    themts
    wrote on 15 Apr 2015, 18:54 last edited by themts
    #1

    Hey guys,

    I'm wondering if there is a way to initialize property aliases?
    e.g.

    Item {
        property alias valueDisplayVisible: valueDisplay.visible // I want this to be false by default
    
        Rectangle {
            id: valueDisplay    
        }
    }
    

    CU
    mts

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mcosta
      wrote on 15 Apr 2015, 19:07 last edited by mcosta
      #2

      Hi,

      you can fix the initial value of the variable

      Item {
          property alias valueDisplayVisible: valueDisplay.visible // I want this to be false by default
      
          Rectangle {
              id: valueDisplay    
              visible: false
          }
      }
      

      Once your problem is solved don't forget to:

      • Mark the thread as SOLVED using the Topic Tool menu
      • Vote up the answer(s) that helped you to solve the issue

      You can embed images using (http://imgur.com/) or (http://postimage.org/)

      1 Reply Last reply
      0
      • T Offline
        T Offline
        themts
        wrote on 15 Apr 2015, 19:21 last edited by
        #3

        Ahh, sure!
        Thanks :-)
        Didn't thought it was that easy ;-)

        1 Reply Last reply
        0

        1/3

        15 Apr 2015, 18:54

        • Login

        • Login or register to search.
        1 out of 3
        • First post
          1/3
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved