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());
|
currentKey_ = keys_.at(ui_.table->currentRow());
|
||||||
|
|
||||||
//TODO: Read setting and set correct radio button
|
//TODO: Read setting and set correct radio button
|
||||||
|
// Disable ALL hotkey functionality built-in to Qt for this widget
|
||||||
/*
|
|
||||||
Where should this go?
|
|
||||||
If uncommented, and a cell is clicked, segfault
|
|
||||||
QKeyEvent* event;
|
|
||||||
GetShortcut(event);
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ShortcutsDialog::DefaultRadioClickedEvent() {
|
void ShortcutsDialog::DefaultRadioClickedEvent() {
|
||||||
settings_.setValue(currentKey_, currentDefault_);
|
settings_.setValue(currentKey_, currentDefault_);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ShortcutsDialog::GetShortcut(QKeyEvent* event) {
|
bool ShortcutsDialog::event(QEvent* event) {
|
||||||
qDebug() << event->text();
|
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 ResetShortcuts();
|
||||||
void SaveShortcuts();
|
void SaveShortcuts();
|
||||||
void CancelEvent();
|
void CancelEvent();
|
||||||
void GetShortcut(QKeyEvent* event);
|
/*void GetShortcut(QKeyEvent* event);*/
|
||||||
void CellClickedEvent();
|
void CellClickedEvent();
|
||||||
void DefaultText(QString str);
|
void DefaultText(QString str);
|
||||||
void DefaultRadioClickedEvent();
|
void DefaultRadioClickedEvent();
|
||||||
|
bool event(QEvent* event);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::ShortcutsDialog ui_;
|
Ui::ShortcutsDialog ui_;
|
||||||
|
Loading…
Reference in New Issue
Block a user