[qt] Deprecation warnings and Qt compatibility fixes (#118)
* [qt] Fix compilation of the sqlite wrapper * [qt] Fix QImage-related warnings * Update Qt redirection handling Since 5.9 RedirectPolicyAttribute is preferred, and from 6.0 the behavior of NoLessSafeRedirectPolicy is the default. * [qt] Fix more deprecation warnings Co-authored-by: Mårten Nordheim <morten242@gmail.com>
This commit is contained in:
@@ -448,16 +448,20 @@ void MapWindow::mouseMoveEvent(QMouseEvent *ev)
|
||||
|
||||
void MapWindow::wheelEvent(QWheelEvent *ev)
|
||||
{
|
||||
if (ev->orientation() == Qt::Horizontal) {
|
||||
if (ev->angleDelta().y() == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
float factor = ev->delta() / 1200.;
|
||||
if (ev->delta() < 0) {
|
||||
float factor = ev->angleDelta().y() / 1200.;
|
||||
if (ev->angleDelta().y() < 0) {
|
||||
factor = factor > -1 ? factor : 1 / factor;
|
||||
}
|
||||
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
|
||||
m_map->scaleBy(1 + factor, ev->position());
|
||||
#else
|
||||
m_map->scaleBy(1 + factor, ev->pos());
|
||||
#endif
|
||||
ev->accept();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user