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. QtCreator does not provide code hints for objects registered using setContextProperty in C++. Please refer to the image.
Forum Updated to NodeBB v4.3 + New Features

QtCreator does not provide code hints for objects registered using setContextProperty in C++. Please refer to the image.

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
1 Posts 1 Posters 144 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.
  • X Offline
    X Offline
    xu__d
    wrote on 26 Apr 2023, 02:21 last edited by
    #1

    868d45ad-a63a-41a2-9bb6-73b7233d5e1d-image.png
    8465d88f-570f-4d9d-b6aa-8d3eb6f628f9-image.png
    As shown in the figure above, I have a QQmlApplicationEngine type variable "m_engine" in HMIApplication. I registered a C++ instance with setContextProperty in QML. This way, the registered type will have code prompts in QtCreator.
    However, if I pass the "m_engine" variable in HMIApplication to a member variable "Transfer" in HMIApplication through a pointer, and then register a C++ instance with setContextProperty in QML in the "Transfer" class, there will be no code prompts in QtCreator as shown in the figure. Can you explain why this is happening? Or can you tell me how to have code prompts for instances registered with setContextProperty in QtCreator?
    a627c083-cde7-42f5-8c56-7a3f5a09d3a3-image.png
    01f61f0b-d163-4ad5-9651-95b9bc30c646-image.png

    1 Reply Last reply
    0

    1/1

    26 Apr 2023, 02:21

    • Login

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