mirror of
https://github.com/YACReader/yacreader
synced 2025-06-04 01:28:55 -04:00
Use a constant reference for passing QKeySequence to moveAction
This commit is contained in:
parent
08ce8c3c65
commit
dee557c518
@ -629,7 +629,7 @@ void Viewer::keyPressEvent(QKeyEvent *event)
|
||||
key == ShortcutsManager::getShortcutsManager().getShortcut(MOVE_UP_ACTION_Y) ||
|
||||
key == ShortcutsManager::getShortcutsManager().getShortcut(MOVE_LEFT_ACTION_Y) ||
|
||||
key == ShortcutsManager::getShortcutsManager().getShortcut(MOVE_RIGHT_ACTION_Y)) {
|
||||
moveAction(&key);
|
||||
moveAction(key);
|
||||
emit backgroundChanges();
|
||||
}
|
||||
|
||||
@ -652,20 +652,20 @@ void Viewer::keyPressEvent(QKeyEvent *event)
|
||||
QAbstractScrollArea::keyPressEvent(event);
|
||||
}
|
||||
|
||||
void Viewer::moveAction(QKeySequence *key)
|
||||
void Viewer::moveAction(const QKeySequence &key)
|
||||
{
|
||||
int _key = 0;
|
||||
|
||||
if (*key == ShortcutsManager::getShortcutsManager().getShortcut(MOVE_DOWN_ACTION_Y))
|
||||
if (key == ShortcutsManager::getShortcutsManager().getShortcut(MOVE_DOWN_ACTION_Y))
|
||||
_key = Qt::Key_Down;
|
||||
|
||||
else if (*key == ShortcutsManager::getShortcutsManager().getShortcut(MOVE_UP_ACTION_Y))
|
||||
else if (key == ShortcutsManager::getShortcutsManager().getShortcut(MOVE_UP_ACTION_Y))
|
||||
_key = Qt::Key_Up;
|
||||
|
||||
else if (*key == ShortcutsManager::getShortcutsManager().getShortcut(MOVE_LEFT_ACTION_Y))
|
||||
else if (key == ShortcutsManager::getShortcutsManager().getShortcut(MOVE_LEFT_ACTION_Y))
|
||||
_key = Qt::Key_Left;
|
||||
|
||||
else if (*key == ShortcutsManager::getShortcutsManager().getShortcut(MOVE_RIGHT_ACTION_Y))
|
||||
else if (key == ShortcutsManager::getShortcutsManager().getShortcut(MOVE_RIGHT_ACTION_Y))
|
||||
_key = Qt::Key_Right;
|
||||
|
||||
QKeyEvent _event = QKeyEvent(QEvent::KeyPress, _key, Qt::NoModifier);
|
||||
|
@ -164,7 +164,7 @@ private:
|
||||
void wheelEvent(QWheelEvent *event) override;
|
||||
void mouseMoveEvent(QMouseEvent *event) override;
|
||||
|
||||
void moveAction(QKeySequence *key);
|
||||
void moveAction(const QKeySequence &key);
|
||||
|
||||
//!ZigzagScroll
|
||||
enum scrollDirection { UP,
|
||||
|
Loading…
x
Reference in New Issue
Block a user