In QML Doc, there are the following:
Import Statement:
import QtQuick.Controls 2.2
Since: Qt 5.7
"ComboBox can be made editable." ...
I have latest Qt OpenSource 5.9 installed. But I can not import the QtQuick.Controls 2.2
, even with the simplest qt quick project created by the project wizard. The following error is print:
qrc:/main.qml:2 module "QtQuick.Controls" version 2.2 is not installed
My code:
import QtQuick 2.7
import QtQuick.Controls 2.2
import QtQuick.Layouts 1.3
ApplicationWindow {
...
main.cpp
#include <QGuiApplication>
#include <QQmlApplicationEngine>
int main(int argc, char *argv[])
{
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
QGuiApplication app(argc, argv);
QQmlApplicationEngine engine;
engine.load(QUrl(QLatin1String("qrc:/main.qml")));
if (engine.rootObjects().isEmpty())
return -1;
return app.exec();
}
All codes are generated by Qt Creator 4.3
I work on windows 7.
Qt5.9.0\5.9\mingw53_32\qml\QtQuick\Controls.2
is the folder whereQtQuick.Controls 2.2
components likeComboBox
are present – Praveen Kumar