Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
5.14.0
-
None
-
Windows, VS2019, 32bit
Description
I probably found a bug in QDataWidgetMapper but I want to make sure this is not intentional or some side-effect.
I have two QLineEdits, one is attached to QDataWidgetMapper and the second not.
auto model = new QStringListModel(QStringList({"1","2"})); auto pWidgetMapper = new QDataWidgetMapper(this); pWidgetMapper->setModel(model); pWidgetMapper->setCurrentIndex(0); pWidgetMapper->addMapping(ui->lineEditMapped, 0);
Now, when I have a focus on QLineEdit without widget mapper and I do ALT+TAB to switch to another app and then back to my tab, the focus is correctly restored to this QLineEdit.
But, when the focus is on QLineEdit WITH widget mapper, the focus isn't restored at all.
My configuration: Qt 5.14, VS2019, Win10
Edit:
It seems that it's sufficient to add these two lines to broke focus handling:
auto pWidgetMapper = new QDataWidgetMapper(this); auto pWidgetMapper = new QDataWidgetMapper(this); pWidgetMapper->addMapping(ui->lineEditMapped, 0);