qmlscene issues
-
How to fix below?
j@j:~$ qmlscene main.qml
file:///home/j/main.qml:2 module "QtQuick.Window" is not installed
file:///home/j/main.qml:1 module "QtQuick" is not installed
file:///home/j/main.qml:2 module "QtQuick.Window" is not installed
file:///home/j/main.qml:1 module "QtQuick" is not installedimport QtQuick 6.2 import QtQuick.Window 6.2 Window { visible: true width: 200 height: 100 Text { anchors.centerIn: parent text: "QtQuick version: " + Qt.application.qtVersion } } -
C Christian Ehrlicher moved this topic from General and Desktop
-
you are using Qt6. I guess qmlscene is for Qt5. Try
qml main.qml
and remove 6.2 from QML code because version number is not needed anymore in Qt6.I tested your code with qml and did not see any problem.
import QtQuick import QtQuick.Window Window { visible: true width: 200 height: 100 Text { anchors.centerIn: parent text: "QtQuick version: " + Qt.application.qtVersion } } -
Change
Qt.application.qtVersiontoQt.application.version, and it works for me with Qt 6.9.2 from a qt.io installer.

There is a warning on stderr:
qt.tools.qmlscene.deprecated: Warning: qmlscene is deprecated and will be removed in a future version of Qt. Please use qml instead.