This repository contains a minimal example to demonstrate two Qt bugs:
- Hover event does not trigger in a ~10px area at the bottom edge of a
RectItem setCursor()stops working after interacting with a messagebox using the keyboard
- Qt Version: 6.8.2
- OS: macOS Sequoia 15.3.2
- Compiler: Apple Clang 16.0.0 (clang-1600.0.26.6)
git clone https://github.com/eKevinHoang/QGraphicsBug.git
cd QGraphicsBug
mkdir build
cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug
cmake --build build --config Debug
./build/QGraphicsBug- Run the app. (See Build Instructions above.)
- Move the mouse to the edges of the pre-drawn
RectItemobjects and observe the cursor.- ✅ Expected: The cursor changes correctly based on
ResizeDirection.
- ✅ Expected: The cursor changes correctly based on
- Zoom in and out freely using the mouse wheel. (Do not move or resize the application window.)
- Move the mouse again to the edges of the
RectItemobjects.- ❌ Issue: The bottom ~10px region does not trigger hover events. Even debug messages inside
hoverMoveEvent()do not appear.
- ❌ Issue: The bottom ~10px region does not trigger hover events. Even debug messages inside
- Start from step 1 of Bug 1, or launch the app normally.
- Pan the image by holding
Commandand dragging the mouse.- ✅ Expected: The cursor should change to a hand cursor (
Qt::OpenHandCursor) while panning.
- ✅ Expected: The cursor should change to a hand cursor (
- Right click to trigger a messagebox.
- Interact with the messagebox using the keyboard (e.g., press
SpaceorTabto navigate buttons). - Try panning the image again.
- ❌ Issue: The cursor remains stuck as an arrow (
Qt::ArrowCursor), even after clicking on the scene 🔹 Note: This issue does not always occur, but it is fairly easy to reproduce.
🔹 Hypothesis: This may be due to a Qt UI thread synchronization issue when handling cursor updates after modal dialogs.
- ❌ Issue: The cursor remains stuck as an arrow (