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. Qt Creator only recognize type of my custom QML component but the property does not
QtWS25 Last Chance

Qt Creator only recognize type of my custom QML component but the property does not

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

    Qt Creator only recognizing the type of my custom qml component but the property inside the component does not.

    I registering the component with that option:

    qmlRegisterType(QUrl("qrc:/customcom/ViewApp.qml"), "com.mycompany.ui" , 1, 0, "ViewApp")
    

    then on main.qml

    import QtQuick 2.0
    
    import com.mycompany.ui 1.0 <-- I expect with this import option, make the code flexible and refactoring friendly
    
    ViewApp{
        id: viewApp
        anchors.fill: parent <-- Not Recognized by Qt Creator but can compile/run
    }
    

    Any advice?

    1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      So what does it not recognize? The parent (is there any)? Or anchors?

      (Z(:^

      1 Reply Last reply
      0
      • K Offline
        K Offline
        kangherr
        wrote on last edited by kangherr
        #3

        Qt Creator only can show auto-completion for Component Name (ViewApp) but cannot show completion for property inside the component (inside ViewApp.qml).

        How to make Qt Creator also can show completion of the property inside the component?

        sierdzioS 1 Reply Last reply
        0
        • K kangherr

          Qt Creator only can show auto-completion for Component Name (ViewApp) but cannot show completion for property inside the component (inside ViewApp.qml).

          How to make Qt Creator also can show completion of the property inside the component?

          sierdzioS Offline
          sierdzioS Offline
          sierdzio
          Moderators
          wrote on last edited by
          #4

          @kangherr said in Qt Creator only recognize type of my custom QML component but the property does not:

          Qt Creator only can show auto-completion for Component Name (ViewApp) but cannot show completion for property inside the component (inside ViewApp.qml).

          I see.

          How to make Qt Creator also can show completion of the property inside the component?

          Use qmldir (make a QML module) instead of qmlRegisterType. When using qmlRegisterType, place it in main.cpp, if it is in another class, Qt Creator gets lost easily.

          (Z(:^

          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