Qt5: fix deprecation warnings of QWheelEvent in Qt 5.15
This commit is contained in:
@@ -277,7 +277,11 @@ void WebView::mousePressEvent(QMouseEvent *event)
|
||||
void WebView::wheelEvent(QWheelEvent *event)
|
||||
{
|
||||
if (QApplication::keyboardModifiers() & Qt::ControlModifier) {
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
|
||||
qreal factor = zoomFactor() + (-event->angleDelta().y() / 800.0);
|
||||
#else
|
||||
qreal factor = zoomFactor() + (-event->delta() / 800.0);
|
||||
#endif
|
||||
setZoomFactor(factor);
|
||||
event->accept();
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user