Details
-
Bug
-
Resolution: Done
-
P3: Somewhat important
-
5.3.0
-
135e9d5a8286e5abd35e04213c232d73c2df15b5 (dev, 3.7.2014, 5.4)
Description
#include <QApplication> #include <QCursor> #include <QDebug> #include <QPushButton> class Widget : public QPushButton { Q_OBJECT public: Widget() { m_on = false; connect(this, SIGNAL(clicked()), this, SLOT(onClicked())); } bool event(QEvent *ev) { qDebug() << ev->type(); return QPushButton::event(ev); } Q_SLOT void onClicked() { m_on = !m_on; if (m_on) grabMouse(Qt::CrossCursor); else releaseMouse(); } bool m_on; }; int main(int argc, char *argv[]) { QApplication a(argc, argv); Widget w; w.show(); return a.exec(); } #include "main.moc"
With Qt 4 I see a cross-hair cursor, with Qt 5 not.
The sequence of events is also quite different (in both case click on widget, move mouse to some place outside, click, move back to widget, click):
Qt 4:
203 75 13 14 17 26 74 77 13 12 10 24 99 8 77 12 2 77 12 77 3 77 12 77 2 3 2 77 12 77 3 77 12 77 11 25 99 9 77 12
Qt 5:
203 34 75 13 14 17 183 26 74 78 77 14 13 12 24 99 8 207 77 12 10 127 129 77 12 129 129 129 129 129 129 2 77 12 77 3 77 12 77 129 129 129 129 11 128 129 77 12 129 129 129 129 129 129 129 129 129 129 129 129 129 129 129 129 129 129 129 129 129 129 129 129 129 129 129 129 129 129 129 129 129 129 2 3 77 12 129 129 129 129 129 129 129 129 129 129 129 129 129 129 129 129 129 129 129 129 129 129 129 129 129 129 129 129 129 129 129 129 10 127 129 77 12 129 129 129 129 129 129 129 129 129 129 129 129 129 2 77 12 77 3 77 12 77 129 129 129 129 129 11 128 77 12 23 23 25 99 9 77 12
Attachments
For Gerrit Dashboard: QTBUG-39311 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
87836,5 | Implement QWidget::grabCursor(const QCursor&). | dev | qt/qtbase | Status: MERGED | +2 | 0 |