Grab gesture with QCompleter, incorrect focus
-
Hi,
[Qt5.3.1]
When I use a QCompleter on a QLineEdit with a grab gesture on the LeftMouseButtonGesture, there is a problem of focus. In the QLineEdit, when the completer needs a QScroller to display the values, if I want to put the focus out of the QLineEdit, the completer does not closed. If there is no QScroller, it works.
If I remove the definition of grab gesture, it works in any case.
Here a code sample. Write "o" in the first QLineEdit and put the focus in the second one.
Do you have any idea ?
Thanks a lot.@ QStringList wordList;
wordList << "alpha" << "omega" << "omicron" << "omicran" << "omicrin" << "omicron" << "omirron" << "omifran" << "olicrin" << "ozicron" << "zeta";QLineEdit *lineEdit1 = new QLineEdit(this);
lineEdit1->setGeometry(50, 50, 100, 25);
QCompleter *completer1 = new QCompleter(wordList, this);
lineEdit1->setCompleter(completer1);
QScroller::grabGesture(completer1->popup(), QScroller::LeftMouseButtonGesture);
completer1->popup()->setVerticalScrollMode(QAbstractItemView::ScrollPerPixel);
completer1->setMaxVisibleItems(5);QLineEdit *lineEdit2 = new QLineEdit(this);
lineEdit2->setGeometry(200, 50, 100, 25);
QCompleter *completer2 = new QCompleter(wordList, this);
lineEdit2->setCompleter(completer2);
QScroller::grabGesture(completer2->popup(), QScroller::LeftMouseButtonGesture);
completer2->popup()->setVerticalScrollMode(QAbstractItemView::ScrollPerPixel);
completer2->setMaxVisibleItems(5); @