Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Education
KmPlot
Commits
88dd56a2
Commit
88dd56a2
authored
Oct 17, 2022
by
Nicolas Fella
Browse files
Port away from deprecated QWheelEvent::pos
parent
b62d82d2
Changes
2
Hide whitespace changes
Inline
Side-by-side
kmplot/view.cpp
View file @
88dd56a2
...
...
@@ -3051,10 +3051,10 @@ void View::wheelEvent(QWheelEvent *e)
if
(
e
->
modifiers
()
&
Qt
::
ControlModifier
)
{
if
(
m_AccumulatedDelta
>=
QWheelEvent
::
DefaultDeltasPerStep
)
{
zoomIn
(
e
->
pos
(),
double
(
Settings
::
zoomInStep
())
/
100.0
);
zoomIn
(
e
->
pos
ition
(),
double
(
Settings
::
zoomInStep
())
/
100.0
);
m_AccumulatedDelta
=
0
;
}
else
if
(
m_AccumulatedDelta
<=
-
QWheelEvent
::
DefaultDeltasPerStep
)
{
zoomIn
(
e
->
pos
(),
(
double
(
Settings
::
zoomOutStep
())
/
100.0
)
+
1.0
);
zoomIn
(
e
->
pos
ition
(),
(
double
(
Settings
::
zoomOutStep
())
/
100.0
)
+
1.0
);
m_AccumulatedDelta
=
0
;
}
e
->
accept
();
...
...
@@ -3209,7 +3209,7 @@ void View::mouseReleaseEvent(QMouseEvent *e)
updateCursor
();
}
void
View
::
zoomIn
(
const
QPoint
&
mousePos
,
double
zoomFactor
)
void
View
::
zoomIn
(
const
QPoint
F
&
mousePos
,
double
zoomFactor
)
{
QPointF
real
=
toReal
(
mousePos
);
...
...
kmplot/view.h
View file @
88dd56a2
...
...
@@ -415,7 +415,7 @@ private:
* Zooms in by amount \p zoomFactor (which will zooming out if less than 1)
* from clicking at \p mousePos (in widget coordinates).
*/
void
zoomIn
(
const
QPoint
&
mousePos
,
double
zoomFactor
);
void
zoomIn
(
const
QPoint
F
&
mousePos
,
double
zoomFactor
);
/**
* Zooms in from having drawn \p zoomRect (which is in widget coordinates).
*/
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment