#include <config.h>
#include "GuiSelectionManager.h"
+#include "qt_helpers.h"
#include "support/debug.h"
if (addPB->isEnabled()) {
if (!keyModifiers) {
addPB_clicked();
- } else if (keyModifiers == Qt::ControlModifier ||
+ } else if (keyModifiers == Qt::ControlModifier ||
keyModifiers == Qt::KeypadModifier ||
keyModifiers == (Qt::ControlModifier | Qt::KeypadModifier)) {
addPB_clicked();
return true;
}
else if (keyPressed == Qt::Key_Right) {
- selectedLV->setFocus();
- selectedLV->setCurrentIndex(selectedLV->currentIndex());
+ focusAndHighlight(selectedLV);
event->accept();
return true;
}
selectedHasFocus_ = false;
updateHook();
}
- event->accept();
- return true;
- }
+ return false;
+ }
} else if (obj == selectedLV) {
if (etype == QEvent::KeyPress) {
QKeyEvent * keyEvent = static_cast<QKeyEvent *>(event);
updateHook();
} else
return QObject::eventFilter(obj, event);
- }
+ }
// Ctrl-Up activates upPB
else if (keyPressed == Qt::Key_Up) {
if (keyModifiers == Qt::ControlModifier) {
event->accept();
return true;
}
- }
+ }
// Ctrl-Down activates downPB
else if (keyPressed == Qt::Key_Down) {
if (keyModifiers == Qt::ControlModifier) {
}
}
else if (keyPressed == Qt::Key_Left) {
- availableLV->setFocus();
- availableLV->setCurrentIndex(availableLV->currentIndex());
+ focusAndHighlight(availableLV);
event->accept();
return true;
}
selectedHasFocus_ = true;
updateHook();
}
- event->accept();
- return true;
+ return false;
}
}
return QObject::eventFilter(obj, event);