PDA

View Full Version : Mouse events or position issues with Qt 5.6



regular
15th June 2016, 15:39
Hi,

I have had a very weird UI issue on our Qt application for Windows. Ever since upgrading from Qt 5.3.1 to 5.6.0, some widgets have become unclickable until I resize their parent (QDialog, QWizard or simply QSplitter). This includes QPushButtons, QRadioButtons, QCheckBoxes, etc. What's weird is that this only happens on mine and one other developer's machines - all other developers do not get this problem. I was thinking that it may have something to do with having more than one version of Qt installed (I have 4.8., 5.3.1 and 5.6.0) - but that seems unlikely (plus all other developers have multiple versions as well). We use VisualStudio 2015 on Windows 7.

I've attached some small code that reproduces the problem for me 100% but may or may not on other machines. What happens for me, is when I click the "click" button and the QWizard pops up, I cannot click the "Cancel" button (nor the "Finish" button once it gets enabled) - the mouse event does not seem to register at all. I can click the X on the top-right, though. If I resize the QWizard in any direction, then I can click the "Cancel" button.

A possible clue is that on QDialogs that have this problem, QComboBoxes behave weirdly as well - the popup view is displayed in a weird positon (screenshot below). Again, if I resize the parent, the popup view shows in the expected location. This may indicate some problem with either positions or parent objects not being set correctly somewhere (relative positions) but I'm not sure where to start.

11980

Any help is appreciated.


EDIT:
It does seem to be related to setting the parent somehow, because using the attached example, if I add the wizard page with either:

wizard->addPage(new GeneralPropertiesPage(QSet<QString>() << "test", this));
or:

wizard->addPage(new GeneralPropertiesPage(QSet<QString>() << "test", NULL));
makes the popup view of the combobox look like this:
11982
While using:

wizard->addPage(new GeneralPropertiesPage(QSet<QString>() << "test", wizard));
makes it look like this:
11983
Still not sure what the root cause is, though.