Unsolved QML instantiation QWidget problem
-
QML instantiation one QWidget class which have registered to qml, but keyPressEvent can't working,
BTW,constructor was invoked -
Hi,
How are you instanciating that widget ?
-
qmlRegisterType<UpdateWindow>("UpdateWindow.module",1,0,"UpdateWindow"); in the main function
and then import UpdateWindow.module 1.0 in the qml,
in QMl instanciating this widget class,
UpdateWindow{
id:name_up
}BTW , I have thereafter way to instanciating widget class to qml was ok
in the main
{
UpdateWindow up_wind;
engine.rootContext()->setContextProperty("up_wind, &up_wind);
QObject *root = engine.rootObjects()[0];
root->installEventFilter(&up_wind);
}
in qml
{
Connections{
target:up_wind
}
} -
Things are not exactly clear. You are instantiating one object of that class in qml and you pass one in the context. What exactly are you trying to do ?