Fix some use of deprecated functions.
[GB.QT5] * BUG: Fix some use of deprecated functions.
This commit is contained in:
parent
d996843f55
commit
c378523342
2 changed files with 12 additions and 3 deletions
|
@ -3118,18 +3118,20 @@ bool CWidget::eventFilter(QObject *widget, QEvent *event)
|
|||
{
|
||||
MOUSE_info.orientation = Qt::Horizontal;
|
||||
MOUSE_info.delta = delta.x();
|
||||
cancel = GB.Raise(control, EVENT_MouseWheel, 0);
|
||||
}
|
||||
else
|
||||
if (delta.y())
|
||||
{
|
||||
MOUSE_info.orientation = Qt::Vertical;
|
||||
MOUSE_info.delta = delta.y();
|
||||
cancel = GB.Raise(control, EVENT_MouseWheel, 0);
|
||||
}
|
||||
#else
|
||||
MOUSE_info.orientation = ev->orientation();
|
||||
MOUSE_info.delta = ev->delta();
|
||||
cancel = GB.Raise(control, EVENT_MouseWheel, 0);
|
||||
#endif
|
||||
|
||||
cancel = GB.Raise(control, EVENT_MouseWheel, 0);
|
||||
|
||||
CMOUSE_clear(false);
|
||||
|
||||
|
|
|
@ -389,10 +389,17 @@ bool TrayIconManager::eventFilter(QObject *o, QEvent *e)
|
|||
CTRAYICON *_object = find_trayicon(o);
|
||||
if (THIS)
|
||||
{
|
||||
bool cancel;
|
||||
bool cancel = true;
|
||||
QWheelEvent *ev = (QWheelEvent *)e;
|
||||
|
||||
#ifdef QT5
|
||||
if (ev->angleDelta().x())
|
||||
cancel = GB.Raise(THIS, EVENT_Scroll, 2, GB_T_FLOAT, ev->angleDelta().x() / 120.0, GB_T_INTEGER, false);
|
||||
if (ev->angleDelta().y())
|
||||
cancel = GB.Raise(THIS, EVENT_Scroll, 2, GB_T_FLOAT, ev->angleDelta().y() / 120.0, GB_T_INTEGER, true);
|
||||
#else
|
||||
cancel = GB.Raise(THIS, EVENT_Scroll, 2, GB_T_FLOAT, ev->delta() / 120.0, GB_T_INTEGER, ev->orientation() == Qt::Vertical);
|
||||
#endif
|
||||
|
||||
if (cancel)
|
||||
return true;
|
||||
|
|
Loading…
Reference in a new issue