Created
January 3, 2026 23:37
-
-
Save anytizer/1975f84fce26955fa882c02ddc7685bc to your computer and use it in GitHub Desktop.
Update cursor while resizing...
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Determine the horizontal position | |
| bool left = x <= MARGIN; | |
| bool right = x >= w - MARGIN; | |
| // Determine the vertical position | |
| bool top = y <= MARGIN; | |
| bool bottom = y >= h - MARGIN; | |
| if (left && top) { | |
| setCursor(Qt::SizeFDiagCursor); // Top-Left corner ( \ ) | |
| } else if (right && bottom) { | |
| setCursor(Qt::SizeFDiagCursor); // Bottom-Right corner ( \ ) | |
| } else if (right && top) { | |
| setCursor(Qt::SizeBDiagCursor); // Top-Right corner ( / ) | |
| } else if (left && bottom) { | |
| setCursor(Qt::SizeBDiagCursor); // Bottom-Left corner ( / ) | |
| } else if (left || right) { | |
| setCursor(Qt::SizeHorCursor); // Horizontal edges ( <-> ) | |
| } else if (top || bottom) { | |
| setCursor(Qt::SizeVerCursor); // Vertical edges ( ^ v ) | |
| } else { | |
| setCursor(Qt::ArrowCursor); // Center of window | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment