Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Games
KMines
Commits
ffa1f442
Commit
ffa1f442
authored
Aug 31, 2020
by
Laurent Montel
😁
Browse files
Port away from deprecated Qt::MidButton
parent
672eca60
Changes
1
Hide whitespace changes
Inline
Side-by-side
minefielditem.cpp
View file @
ffa1f442
...
...
@@ -353,7 +353,7 @@ void MineFieldItem::mousePressEvent( QGraphicsSceneMouseEvent *ev )
bool
useFastExplore
=
Settings
::
exploreWithLeftClickOnNumberCells
();
m_emulatingMidButton
=
(
useFastExplore
?
(
(
ev
->
buttons
()
&
Qt
::
LeftButton
)
&&
(
itemUnderMouse
->
isRevealed
()
)
)
:
(
(
ev
->
buttons
()
&
Qt
::
LeftButton
)
&&
(
ev
->
buttons
()
&
Qt
::
RightButton
)
)
);
bool
midButtonPressed
=
(
ev
->
button
()
==
Qt
::
MidButton
||
m_emulatingMidButton
);
bool
midButtonPressed
=
(
ev
->
button
()
==
Qt
::
Mid
dle
Button
||
m_emulatingMidButton
);
if
(
midButtonPressed
)
{
...
...
@@ -411,7 +411,7 @@ void MineFieldItem::mouseReleaseEvent( QGraphicsSceneMouseEvent * ev)
CellItem
*
itemUnderMouse
=
itemAt
(
row
,
col
);
bool
midButtonReleased
=
(
ev
->
button
()
==
Qt
::
MidButton
||
m_emulatingMidButton
);
bool
midButtonReleased
=
(
ev
->
button
()
==
Qt
::
Mid
dle
Button
||
m_emulatingMidButton
);
if
(
midButtonReleased
)
{
...
...
@@ -515,7 +515,7 @@ void MineFieldItem::mouseMoveEvent( QGraphicsSceneMouseEvent *ev )
if
(
row
<
0
||
row
>=
m_numRows
||
col
<
0
||
col
>=
m_numCols
)
return
;
bool
midButtonPressed
=
((
ev
->
buttons
()
&
Qt
::
MidButton
)
||
bool
midButtonPressed
=
((
ev
->
buttons
()
&
Qt
::
Mid
dle
Button
)
||
(
(
ev
->
buttons
()
&
Qt
::
LeftButton
)
&&
(
ev
->
buttons
()
&
Qt
::
RightButton
)
)
);
if
(
midButtonPressed
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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