1
0
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:
Andrew Udvare 2010-03-11 09:56:02 +00:00
parent f9711d414f
commit 116204d58e
2 changed files with 12 additions and 11 deletions

View File

@ -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);
}

View File

@ -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_;
@ -62,4 +63,4 @@ class ShortcutsDialog : public QDialog {
QStringList keys_;
};
#endif // SHORTCUTSDIALOG_H
#endif // SHORTCUTSDIALOG_H