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. Another question on same QML...
Forum Updated to NodeBB v4.3 + New Features

Another question on same QML...

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

    There are references in the QML file:

    Item {
      id: root
      property var theme : isDarkTheme ? Dark : Light
    
      property double heading : vehicle.data.heading ? vehicle.data.heading : 0
    

    I cannot see any mention of vehicle in the file except to read its content, how can I find out where it comes from?

    Kind Regards,
    Sy

    J.HilkJ 1 Reply Last reply
    0
    • SPlattenS SPlatten

      There are references in the QML file:

      Item {
        id: root
        property var theme : isDarkTheme ? Dark : Light
      
        property double heading : vehicle.data.heading ? vehicle.data.heading : 0
      

      I cannot see any mention of vehicle in the file except to read its content, how can I find out where it comes from?

      J.HilkJ Offline
      J.HilkJ Offline
      J.Hilk
      Moderators
      wrote on last edited by
      #2

      @SPlatten ah, welcome to qml :D

      Two options:

      1. (Let's hope for this one) vehicle is a c++ object registered ContextProperty. If thats the case, you'll have somewhere a in your c++ files a setContextProperty call. Usually where your QmlEngine is instantiated. main.cpp)

      2. It is a custom property, defined anywhere in the parent/child hierarchy of any of the parents. Good luck finding it.


      Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


      Q: What's that?
      A: It's blue light.
      Q: What does it do?
      A: It turns blue.

      SPlattenS 1 Reply Last reply
      2
      • J.HilkJ J.Hilk

        @SPlatten ah, welcome to qml :D

        Two options:

        1. (Let's hope for this one) vehicle is a c++ object registered ContextProperty. If thats the case, you'll have somewhere a in your c++ files a setContextProperty call. Usually where your QmlEngine is instantiated. main.cpp)

        2. It is a custom property, defined anywhere in the parent/child hierarchy of any of the parents. Good luck finding it.

        SPlattenS Offline
        SPlattenS Offline
        SPlatten
        wrote on last edited by SPlatten
        #3

        @J-Hilk , thank you, I searched the entire source for setContextProperty and found lots of other references but sadly not for "vehicle".

        Found it I think, there is a helper function that calls setContextProperty where one of the parameters passed into it is "vehicle".

        Kind Regards,
        Sy

        1 Reply Last reply
        1

        • Login

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