qt - When using Editable ComboBox,I can NOT import QtQuick.Controls 2.2 -
in qml doc, there following:
import statement:
import qtquick.controls 2.2
since: qt 5.7
"combobox can made editable." ...
i have latest qt opensource 5.9 installed. can not import qtquick.controls 2.2
, simplest qt quick project created project wizard. following error print:
qrc:/main.qml:2 module "qtquick.controls" version 2.2 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 generated qt creator 4.3
i work on windows 7.
if have qtquick 2.7
installed, need import qtquick.controls 2.0
. import statement in documentation set newest version.
might happen, e.g. when new property introduced in newer version (see acceptableinput
)
the combobox
per se available since qt5.7
, corresponding qtquick.controls 2.0
, properties have been added in qtquick.controls 2.2
comes qt5.9
.
Comments
Post a Comment