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. Importing QtQuick and QtQuick.Controls gives 'Invalid propery name in TableView'
Qt 6.11 is out! See what's new in the release blog

Importing QtQuick and QtQuick.Controls gives 'Invalid propery name in TableView'

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
6 Posts 3 Posters 797 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.
  • -vix-- Offline
    -vix-- Offline
    -vix-
    wrote on last edited by
    #1

    I've just notice a strange thing: if I import both QtQuick 5.12 and QtQuick.Controls 2.12, the QML syntax check gives some 'Invalid propery name' errors for some properies in TableView.
    You can easily verify this, opening the "pixelator" example and adding

    import QtQuick.Controls 2.12
    

    at line 52.
    If you run QML/JS Checks (CTRL+SHIFT+C) you can see the error for propery delegate of the TableView (line 114).
    If you don't import QtQuick.Controls, the error is not shown.

    Is there something wrong from my side?

    B 2 Replies Last reply
    0
    • -vix-- -vix-

      I've just notice a strange thing: if I import both QtQuick 5.12 and QtQuick.Controls 2.12, the QML syntax check gives some 'Invalid propery name' errors for some properies in TableView.
      You can easily verify this, opening the "pixelator" example and adding

      import QtQuick.Controls 2.12
      

      at line 52.
      If you run QML/JS Checks (CTRL+SHIFT+C) you can see the error for propery delegate of the TableView (line 114).
      If you don't import QtQuick.Controls, the error is not shown.

      Is there something wrong from my side?

      B Offline
      B Offline
      Bob64
      wrote on last edited by
      #2

      @vix This rings a bell, but I am not able to access my code at the moment to check the details. I am sure I have seen something like this which was resolved by reordering the imports. It was a bug in Qt from what I remember.

      1 Reply Last reply
      0
      • MarkkyboyM Offline
        MarkkyboyM Offline
        Markkyboy
        wrote on last edited by Markkyboy
        #3

        No errors given here when adding the import statement, the example runs as expected.

        I'm using QtCreator 4.10.2 (based on Qt 5.13.2(MSVC 2017, 32bit)

        Quote
        "I've just notice a strange thing: if I import both QtQuick 5.12 and QtQuick.Controls 2.12," . . . . hold on, QtQuick 5.12 not 2.12 ?

        Don't just sit there standing around, pick up a shovel and sweep up!

        I live by the sea, not in it.

        -vix-- 1 Reply Last reply
        0
        • -vix-- -vix-

          I've just notice a strange thing: if I import both QtQuick 5.12 and QtQuick.Controls 2.12, the QML syntax check gives some 'Invalid propery name' errors for some properies in TableView.
          You can easily verify this, opening the "pixelator" example and adding

          import QtQuick.Controls 2.12
          

          at line 52.
          If you run QML/JS Checks (CTRL+SHIFT+C) you can see the error for propery delegate of the TableView (line 114).
          If you don't import QtQuick.Controls, the error is not shown.

          Is there something wrong from my side?

          B Offline
          B Offline
          Bob64
          wrote on last edited by
          #4

          @vix Sorry, ignore my previous reply. Now that I have been able to remind myself, the issue was that I needed to import QtQml.Models before QtQuick. (However, it was indeed an "Invalid property name" error that I otherwise saw, in the properties of ListElements in a ListModel).

          1 Reply Last reply
          0
          • -vix-- Offline
            -vix-- Offline
            -vix-
            wrote on last edited by
            #5

            @Bob64 I confirm that importing QtQuick.Controls 2.12 before QtQuick 2.12 doesn't show the issue.
            It seems that the order matters.
            TableView is implemented in QtQuick module, and an old "QtQuick Controls 1" TableView is implemented in QtQuick.Controls module.
            If importing QtQuick.Control 2.12 includes somehow QtQuick.Control 1, it can be that it overwrites the TableView imported from QtQuick.
            But I don't know if QtQuick.Control 2.12 includes QtQuick.Control 1

            1 Reply Last reply
            0
            • MarkkyboyM Markkyboy

              No errors given here when adding the import statement, the example runs as expected.

              I'm using QtCreator 4.10.2 (based on Qt 5.13.2(MSVC 2017, 32bit)

              Quote
              "I've just notice a strange thing: if I import both QtQuick 5.12 and QtQuick.Controls 2.12," . . . . hold on, QtQuick 5.12 not 2.12 ?

              -vix-- Offline
              -vix-- Offline
              -vix-
              wrote on last edited by
              #6

              @Markkyboy I confirm that I see the bug both with QtCreator 4.10.2 and 4.11, with Qt 5.12.6, 5.13.2 and 5.14 (all of them with MigGW compiler 32 and 64 bit on Windows).
              As I wrote above, the order of import statements matters.
              You have to run the syntax check (CTRL+SHIFT+C) after you add the import.

              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