MCPcopy Create free account
hub / github.com/comaps/comaps / BindHotkeys

Method BindHotkeys

qt/qt_common/map_widget.cpp:67–97  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

65}
66
67void MapWidget::BindHotkeys(QWidget & parent)
68{
69 Hotkey const hotkeys[] = {
70 {Qt::Key_Equal, SLOT(ScalePlus())},
71 {Qt::Key_Plus, SLOT(ScalePlus())},
72 {Qt::Key_Minus, SLOT(ScaleMinus())},
73 {Qt::Key_Right, SLOT(MoveRight())},
74 {Qt::Key_Left, SLOT(MoveLeft())},
75 {Qt::Key_Up, SLOT(MoveUp())},
76 {Qt::Key_Down, SLOT(MoveDown())},
77 {Qt::ALT | Qt::Key_Equal, SLOT(ScalePlusLight())},
78 {Qt::ALT | Qt::Key_Plus, SLOT(ScalePlusLight())},
79 {Qt::ALT | Qt::Key_Minus, SLOT(ScaleMinusLight())},
80 {Qt::ALT | Qt::Key_Right, SLOT(MoveRightSmooth())},
81 {Qt::ALT | Qt::Key_Left, SLOT(MoveLeftSmooth())},
82 {Qt::ALT | Qt::Key_Up, SLOT(MoveUpSmooth())},
83 {Qt::ALT | Qt::Key_Down, SLOT(MoveDownSmooth())},
84#ifdef ENABLE_AA_SWITCH
85 {Qt::ALT | Qt::Key_A, SLOT(AntialiasingOn())},
86 {Qt::ALT | Qt::Key_S, SLOT(AntialiasingOff())},
87#endif
88 };
89
90 for (auto const & hotkey : hotkeys)
91 {
92 auto action = std::make_unique<QAction>(&parent);
93 action->setShortcut(QKeySequence(hotkey.m_key));
94 connect(action.get(), SIGNAL(triggered()), this, hotkey.m_slot);
95 parent.addAction(action.release());
96 }
97}
98
99void MapWidget::BindSlider(ScaleSlider & slider)
100{

Callers 1

CreateNavigationBarMethod · 0.80

Calls 3

addActionMethod · 0.80
getMethod · 0.65
releaseMethod · 0.45

Tested by

no test coverage detected