Possible missed Enter event in Qt 6.9.3 causing QPushButton hover state to get stuck
-
Hi and welcome to devnet,
Can you test with a more recent version of Qt ? 6.12 just got released and would be a better target for a fix if you can still reproduce this issue.
-
Also please provide a minimal, compilable example to reproduce the problem.
-
Also please provide a minimal, compilable example to reproduce the problem.
@Christian-Ehrlicher
Hi
I've created a minimal example with eight QPushButtons in a QVBoxLayout. I've attached the code screenshot.

-
Also please provide a minimal, compilable example to reproduce the problem.
-
Please post it as text, not images
-
Please post it as text, not images
-
Please post it as text, not images
@Christian-Ehrlicher
Thanks for taking a look. I’ve attached a minimal, compilable Qt Widgets example. I reproduced the issue with Qt 6.9.3 on Windows at 150% display scaling.The debugger confirmed that Qt selected the QPushButton as the mouse event receiver, but the mapped local Y coordinate was approximately -7.82e-14 at the button’s top edge. This made widgetUnderMouse false, so sendMouseEvent() skipped the Enter event. It still updated lastMouseReceiver to that button, so moving farther into the button did not trigger another Enter.
I checked the upstream qtbase dev source and found the same coordinate mapping and event dispatch logic. This suggests the issue is still present upstream, though I’ve only confirmed it at runtime on Qt 6.9.3.
-
Please post it as text, not images
#include <QtWidgets> int main(int argc, char **argv) { QApplication app(argc, argv); QWidget window; window.setWindowTitle(QStringLiteral("MarkerHoverTest")); window.resize(320, 520); auto *layout = new QVBoxLayout(&window); layout->setContentsMargins(8, 20, 8, 28); layout->setSpacing(20); for (int i = 1; i <= 8; ++i) { auto *button = new QPushButton(QString::number(i), &window); button->setFixedSize(260, 40); layout->addWidget(button, 0, Qt::AlignHCenter); } layout->addStretch(); window.show(); return app.exec(); } -
#include <QtWidgets> int main(int argc, char **argv) { QApplication app(argc, argv); QWidget window; window.setWindowTitle(QStringLiteral("MarkerHoverTest")); window.resize(320, 520); auto *layout = new QVBoxLayout(&window); layout->setContentsMargins(8, 20, 8, 28); layout->setSpacing(20); for (int i = 1; i <= 8; ++i) { auto *button = new QPushButton(QString::number(i), &window); button->setFixedSize(260, 40); layout->addWidget(button, 0, Qt::AlignHCenter); } layout->addStretch(); window.show(); return app.exec(); } -
It's already fixed - please use a recent Qt version
QTBUG-128391


