|
| template<typename EventType > |
| QPoint | eventGlobalPos (EventType *event) |
| | 获取事件的位置(QPoint)
|
| |
| template<typename EventType > |
| QPoint | eventPos (EventType *event) |
| | 获取事件的位置(QPoint)
|
| |
| template<typename EventType > |
| int | eventPosX (EventType *event) |
| | 获取事件的x坐标
|
| |
| template<typename EventType > |
| int | eventPosY (EventType *event) |
| | 获取事件的y坐标
|
| |
| int | horizontalAdvance (const QFontMetrics &fm, const QString &str) |
| | 计算字符串的水平宽度(整数版本)
|
| |
| qreal | horizontalAdvanceF (const QFontMetricsF &fm, const QString &str) |
| | 计算字符串的水平宽度(浮点数版本)
|
| |
| int | wheelEventDelta (QWheelEvent *e) |
| | Get vertical wheel delta value compatible with Qt5 and Qt6
|
| |
|
void | setNamedColor (QColor &c, const char *colorName) |
| |
|
void | setNamedColor (QColor &c, const QString &colorName) |
| |
| int DA::compat::wheelEventDelta |
( |
QWheelEvent * |
e | ) |
|
|
inline |
Get vertical wheel delta value compatible with Qt5 and Qt6
This function provides a unified interface to retrieve the vertical scroll delta from a QWheelEvent, supporting both Qt5 (using delta()) and Qt6 (using angleDelta().y()) without changing the calling code.
The return value represents the vertical scroll amount:
- Positive value: Wheel scrolled up
- Negative value: Wheel scrolled down
- The magnitude follows the standard wheel step (typically ±120 per notch)
- 参数
-
| e | Pointer to the QWheelEvent object (must not be nullptr) |
- 返回
- Integer delta value of vertical wheel movement
- 注解
- The function only returns vertical wheel delta (ignores horizontal scroll via angleDelta().x())
- 警告
- Ensure the input QWheelEvent pointer is valid to avoid null pointer dereference