Details
-
Bug
-
Resolution: Done
-
P2: Important
-
Qt Creator 3.0.0
-
None
-
Windows 7
Qt 5.2.0 - MSVC 2010 (x86) - Angle
Qt Creator 3.0.0
Description
Qt Quick Designer does not show a QML component if you import an unknown module. This would be an understandable behavior if the module actually didn't exist, but it's not passable if the module does exist but comes from a C++ class.
Example:
- main.qml
import QtQuick 2.0 MyComponent { x: 0 y: 0 height: 200 width: 200 }
- MyComponent.qml
import QtQuick 2.0 import Testing 1.0 Image { x: 0 y: 0 source: "myimage.png" }
- main.cpp
class TestClass; ... QGuiApplication app(argc, argv); QtQuick2ApplicationViewer viewer; qmlRegisterType<TestClass>("Testing", 1, 0, "Test"); viewer.setMainQmlFile(QStringLiteral("main.qml"));
end of example
If you try to edit main.qml on Qt Quick Designer, it simply doesn't show the component MyModule that should be inside it. However, if I comment the line "import Testing 1.0" on MyComponent.qml, it shows the component once again.
Attachments
Issue Links
- relates to
-
QTCREATORBUG-13211 Design view of parent qml file no longer shows content of child qml file that uses import of c++ registered type
- Closed