Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
5.13.0
-
None
-
Win64, VS2017
Description
consider the following piece of QML code:
import QtQuick 2.13 import QtQuick.Window 2.13 import QtQuick.Scene3D 2.0 import Qt3D.Render 2.0 Window { visible: true width: 640 height: 480 title: qsTr("Hello World") }
Running this piece of code results in a runtime error:
qrc:/main.qml:9 Only for assigning window surface property
The reason is that Qt3DQuick3DRenderPlugin registers an uncreatable type also named window, although it is just an internal wrapper of QWindow.
(See https://code.woboq.org/qt5/qt3d/src/quick3d/imports/render/qt3dquick3drenderplugin.cpp.html Line 164.)
While it is possible to import QtQuick.Windows using an alias, e.g.
import QtQuick.Window 2.13 as W and then use W.Window { ....
this should not be neccessary for a number of reasons:
- Only standard Qt modules are used. There should be no nameclashes within a single product.
- There is no apparent reason why the internal type uses the same name as the publicly documented class Window
- The error message is not helpfull without looking into the sourcecode
This is a follow up to https://forum.qt.io/topic/105826/nameclash-between-qtquick-window-and-qt3d-window/5