Importing QtQuick and QtQuick.Controls gives 'Invalid propery name in TableView'
-
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 addingimport QtQuick.Controls 2.12at 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?
-
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 addingimport QtQuick.Controls 2.12at 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?
-
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 ? -
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 addingimport QtQuick.Controls 2.12at 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?
@vix Sorry, ignore my previous reply. Now that I have been able to remind myself, the issue was that I needed to import
QtQml.ModelsbeforeQtQuick. (However, it was indeed an "Invalid property name" error that I otherwise saw, in the properties ofListElements in aListModel). -
@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 -
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 ?@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.