mirror of
https://github.com/clementine-player/Clementine
synced 2024-12-15 10:48:33 +01:00
Start of event handling to capture keys with virtual function event()
This commit is contained in:
parent
f9711d414f
commit
116204d58e
@ -151,19 +151,19 @@ void ShortcutsDialog::CellClickedEvent() {
|
||||
currentKey_ = keys_.at(ui_.table->currentRow());
|
||||
|
||||
//TODO: Read setting and set correct radio button
|
||||
|
||||
/*
|
||||
Where should this go?
|
||||
If uncommented, and a cell is clicked, segfault
|
||||
QKeyEvent* event;
|
||||
GetShortcut(event);
|
||||
*/
|
||||
// Disable ALL hotkey functionality built-in to Qt for this widget
|
||||
}
|
||||
|
||||
void ShortcutsDialog::DefaultRadioClickedEvent() {
|
||||
settings_.setValue(currentKey_, currentDefault_);
|
||||
}
|
||||
|
||||
void ShortcutsDialog::GetShortcut(QKeyEvent* event) {
|
||||
qDebug() << event->text();
|
||||
bool ShortcutsDialog::event(QEvent* event) {
|
||||
if (event->type() == QEvent::ShortcutOverride) {
|
||||
QKeyEvent *ke = static_cast<QKeyEvent *>(event);
|
||||
qDebug() << ke->text();
|
||||
qDebug() << ke->key();
|
||||
return true;
|
||||
}
|
||||
return QWidget::event(event);
|
||||
}
|
||||
|
@ -47,10 +47,11 @@ class ShortcutsDialog : public QDialog {
|
||||
void ResetShortcuts();
|
||||
void SaveShortcuts();
|
||||
void CancelEvent();
|
||||
void GetShortcut(QKeyEvent* event);
|
||||
/*void GetShortcut(QKeyEvent* event);*/
|
||||
void CellClickedEvent();
|
||||
void DefaultText(QString str);
|
||||
void DefaultRadioClickedEvent();
|
||||
bool event(QEvent* event);
|
||||
|
||||
private:
|
||||
Ui::ShortcutsDialog ui_;
|
||||
|
Loading…
Reference in New Issue
Block a user