http://bugs.winehq.org/show_bug.cgi?id=10850
--- Comment #4 from Markus Gritsch m.gritsch@gmail.com 2007-12-23 04:38:16 --- I added a third application to the .zip file (QLineEditSelectionChanged.exe) which shows a bug which is probably caused by the same WINE bug. The test application has a QLineEdit and a QCheckBox. Every time the text in the lineedit is changed, the checkbox gets toggled. The source code is displayed at the end of this comment.
-> Except for the first time, every time one clicks with the mouse into the lineedit, the textChanged() signal gets emitted (and thus the checkbox gets toggled). This is only observed under WINE, not on native Windows.
-> When switching to another window when the lineedit has the focus, an additional textChanged signal is emitted. This is also not the case on native Windows.
#include <qapplication.h>
#include <qwidget.h>
#include <qlineedit.h>
#include <qcheckbox.h>
#include <qlayout.h>
#include <qobject.h>
int main(int argc, char ** argv)
{
QApplication app = QApplication(argc, argv);
QWidget * widget = new QWidget();
QLineEdit * lineEdit = new QLineEdit(widget);
QCheckBox * checkBox = new QCheckBox(widget);
checkBox->setEnabled(false);
QHBoxLayout * layout = new QHBoxLayout(widget, 1, 0, "layout");
layout->addWidget(lineEdit);
layout->addWidget(checkBox);
QObject::connect(lineEdit, SIGNAL(textChanged(const QString &)), checkBox, SLOT(toggle()));
app.setMainWidget(widget);
widget->show();
return app.exec();
}