Details
-
Bug
-
Resolution: Done
-
Not Evaluated
-
Qt Creator 5.0.2, Qt Creator 6.0.0
-
fd5bcea5f6 (qt-creator/qt-creator/8.0) fd5bcea5f6 (qt-creator/qt-creator/master) fd5bcea5f6 (qt-creator/tqtc-qt-creator/8.0)
Description
In a simple test project like this:
import Qt.labs.platform 1.1 as QtLabs import QtQuick 2.15 import QtQuick.Window 2.15 import QtQuick.Controls 2.15 Window { width: 640 height: 480 visible: true title: qsTr("Hello World") Dialog { width: 340 height: 340 } }
Qt Creator seems to assume the Dialog to be from the labs module even though the import has been given a qualifier which is not used with "Dialog". So technically the Dialog should be from QQC2 but Qt Creator disagrees. This results in Qt Creator giving warnings about "invalid property name" while in reality the code would run fine.
Steps to reproduce the errors:
- Open the attached project in Qt Creator
- Open main.qml in editor
The workaround:
Add a qualifier for QQC2 as well. Example:
import Qt.labs.platform 1.1 as QtLabs import QtQuick 2.15 import QtQuick.Window 2.15 import QtQuick.Controls 2.15 as QQC2 Window { width: 640 height: 480 visible: true title: qsTr("Hello World") QQC2.Dialog { width: 340 height: 340 } }
In this case the errors disappear and autocompletion for code works well.
Attachments
For Gerrit Dashboard: QTCREATORBUG-26714 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
416497,4 | QmlJS: Enhance member lookup | 8.0 | qt-creator/qt-creator | Status: MERGED | -1 | 0 |