Replace QWheelEvent::delta with QWheelEvent::angleDelta
This commit is contained in:
parent
cf9a7e6ed3
commit
481d2d699e
|
@ -112,7 +112,7 @@ void AnalyzerContainer::ShowPopupMenu() {
|
|||
}
|
||||
|
||||
void AnalyzerContainer::wheelEvent(QWheelEvent *e) {
|
||||
emit WheelEvent(e->delta());
|
||||
emit WheelEvent(e->angleDelta().y());
|
||||
}
|
||||
|
||||
void AnalyzerContainer::SetEngine(EngineBase *engine) {
|
||||
|
|
|
@ -93,7 +93,7 @@ bool QtSystemTrayIcon::eventFilter(QObject *object, QEvent *event) {
|
|||
if (event->type() == QEvent::Wheel) {
|
||||
QWheelEvent *e = static_cast<QWheelEvent*>(event);
|
||||
if (e->modifiers() == Qt::ShiftModifier) {
|
||||
if (e->delta() > 0) {
|
||||
if (e->angleDelta().y() > 0) {
|
||||
emit SeekForward();
|
||||
}
|
||||
else {
|
||||
|
@ -101,7 +101,7 @@ bool QtSystemTrayIcon::eventFilter(QObject *object, QEvent *event) {
|
|||
}
|
||||
}
|
||||
else if (e->modifiers() == Qt::ControlModifier) {
|
||||
if (e->delta() < 0) {
|
||||
if (e->angleDelta().y() < 0) {
|
||||
emit NextTrack();
|
||||
}
|
||||
else {
|
||||
|
@ -114,7 +114,7 @@ bool QtSystemTrayIcon::eventFilter(QObject *object, QEvent *event) {
|
|||
bool prev_next_track = s.value("scrolltrayicon").toBool();
|
||||
s.endGroup();
|
||||
if (prev_next_track) {
|
||||
if (e->delta() < 0) {
|
||||
if (e->angleDelta().y() < 0) {
|
||||
emit NextTrack();
|
||||
}
|
||||
else {
|
||||
|
@ -122,7 +122,7 @@ bool QtSystemTrayIcon::eventFilter(QObject *object, QEvent *event) {
|
|||
}
|
||||
}
|
||||
else {
|
||||
emit ChangeVolume(e->delta());
|
||||
emit ChangeVolume(e->angleDelta().y());
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
|
|
@ -109,13 +109,15 @@ void TrackSliderSlider::mouseMoveEvent(QMouseEvent* e) {
|
|||
}
|
||||
|
||||
void TrackSliderSlider::wheelEvent(QWheelEvent *e) {
|
||||
if (e->delta() < 0) {
|
||||
|
||||
if (e->angleDelta().y() < 0) {
|
||||
emit SeekBackward();
|
||||
}
|
||||
else {
|
||||
emit SeekForward();
|
||||
}
|
||||
e->accept();
|
||||
|
||||
}
|
||||
|
||||
void TrackSliderSlider::enterEvent(QEvent* e) {
|
||||
|
|
|
@ -65,7 +65,7 @@ void SliderSlider::wheelEvent(QWheelEvent* e) {
|
|||
}
|
||||
|
||||
// Position Slider (horizontal)
|
||||
int step = e->delta() * 1500 / 18;
|
||||
int step = e->angleDelta().y() * 1500 / 18;
|
||||
int nval = qBound(minimum(), QSlider::value() + step, maximum());
|
||||
|
||||
QSlider::setValue(nval);
|
||||
|
@ -303,7 +303,7 @@ void VolumeSlider::slideEvent(QMouseEvent* e) {
|
|||
|
||||
void VolumeSlider::wheelEvent(QWheelEvent* e) {
|
||||
|
||||
const uint step = e->delta() / (e->orientation() == Qt::Vertical ? 30 : -30);
|
||||
const uint step = e->angleDelta().y() / (e->angleDelta().x() == 0 ? 30 : -30);
|
||||
QSlider::setValue(QSlider::value() + step);
|
||||
emit sliderReleased(value());
|
||||
|
||||
|
|
Loading…
Reference in New Issue