Solved Mouse click events in Arm build
-
Hello all,
I have a piece of my Qt code that has worked without issues on x86 architecture for many years.
But, when the code was recently ported to Arm, an issue appeared.I have pasted a sample code below :
// Parent QuickWidget for all the other widgets...
m_DeskLayout = new QQuickWidget();
m_DeskLayout->setObjectName("RootQW");
m_DeskLayout->setGeometry( 0, 0, instWidth, instHeight );
m_DeskLayout->setFixedSize(instWidth, instHeight);// mouse events work in mainQmlWidget when created here...
m_mainQmlWidget = new QQuickWidget(m_DeskLayout);
m_mainQmlWidget->setObjectName("MainQW");
m_mainQmlWidget->setSource(QUrl("qrc:/main.qml" ));
m_mainQmlWidget->setEnabled(true);
m_mainQmlWidget->setResizeMode(QQuickWidget::SizeRootObjectToView);
m_mainQmlWidget->setGeometry(0, 35, 1024, 665);// Show using the top level QQuickWidget...
m_DeskLayout->show();// ------ Mouse does not work in mainQmlWidget when created after show() ------
// m_mainQmlWidget = new QQuickWidget(m_DeskLayout);
// m_mainQmlWidget->setObjectName("MainQW");
// m_mainQmlWidget->setSource(QUrl("qrc:/main.qml" ));
// m_mainQmlWidget->setEnabled(true);
// m_mainQmlWidget->setResizeMode(QQuickWidget::SizeRootObjectToView);
// m_mainQmlWidget->setGeometry(0, 35, 1024, 665);
// ------ Mouse does not work in mainQmlWidget when created after show() ------In the above code, if "mainQmlWidget" is created after its parent's show() has been called, mouse events do not work as expected. Any click on the widgets that are hosted in main qml does not receive mouse events. It acts as though mainQmlWidget is transparent to mouse clicks.
On the other hand, if "mainQmlWidget" is created before its parent's show() is called, mouse events work ok.The existing code base largely relies on being able to create the "mainQmlWidget" at anytime when needed.
So, trying to work around this behavior only for Arm build is proving hard.Any help please, if there is any additional change needed to get this working on Arm
when "mainQmlWidget" is created even after its parent's show() has been called ?I am testing the Arm build on a Xilinx Zynq UltraScale+ MPSoC ZCU102 Evaluation Kit that has Qt 5.9.6 installed in it.
Thank you for your time.
Cheers,
Balaji Ram
-
Any directions or thoughts please ?
-
- do you use the exact same Qt version on x86?
- can you update Qt to 5.12.x or 5.13 (at least for tests)?
-
Thanks for your reply.
Yes, It is the same Qt version in x86 and it works.
Sure, I will try upgrading the Qt version to the latest and give it a try on Arm.
This could take me some time to try out as Petalinux tools 18.3 which is the latest available today from Xilinx comes with Qt 5.9.6.
Changing that will require me to rebuild Petalinux with a different Qt version, but I think it is doable and will try it.Thank you.
-
I just thought about this issue again. I don't think ARM vs. x86 makes the difference.
But probably the Qt platform plugin backend used for input/output handling and graphics are different to your desktop build. Not sure if this brings any new information or help, just a thought.
In case you have a Qt licences, you should contact the support, they might have more detail knowledge and pinpoint the problem.
Regards
-
One of my colleague upgraded to different Qt versions and upgrading to the latest Qt version helped.
These were the versions tried and its result
Qt 5.9.4 : failed
Qt 5.12.4 : ok
Qt 5.13.0 : okThank you.
Balaji Ram