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. Qmllint Warnings for rootcontextproperty
Qt 6.11 is out! See what's new in the release blog

Qmllint Warnings for rootcontextproperty

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
2 Posts 2 Posters 344 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.
  • IamSumitI Offline
    IamSumitI Offline
    IamSumit
    wrote on last edited by
    #1

    Hello there,
    I am porting my qml application from qt 6.7 to 6.8 LTS and found lot of warnings because of qmllint. I need to resolve these warnings-
    First I am seeing for all the contextProperty that i have implemented for example the in the following code I have used "my_model" for mymodel object.
    Engine->rootContext()->setContextProperty("my_model", &mymodel);
    When I am using "my_model" in qml it is showing warning as "Unqualified Access".
    Text{
    text:my_model.name
    }

    How Can I remove this warning ? Pls suggest

    Be Cute

    1 Reply Last reply
    0
    • jeremy_kJ Offline
      jeremy_kJ Offline
      jeremy_k
      wrote on last edited by
      #2

      Hi,

      Please use the code (</>) tags.

      The general advice is to avoid context properties. Embedding C++ Objects into QML with Context Properties spells out a few reasons, including the one noted here.

      My preferred fix is to declare a property within the item, and then set it using an API such as QQmlComponent::createWithInitialProperties()

      Asking a question about code? http://eel.is/iso-c++/testcase/

      1 Reply Last reply
      3

      • Login

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