1 #include "jumpwidget.h"
6 JumpWidget::JumpWidget(QWidget *parent )
11 connect(m_ui.jumpButton, SIGNAL(clicked()),
13 connect(m_ui.spinBox, SIGNAL(editingFinished()),
15 connect(m_ui.cancelButton, SIGNAL(clicked()),
18 installEventFilter(this);
21 void JumpWidget::slotJump()
24 emit jumpTo(m_ui.spinBox->value());
29 void JumpWidget::slotCancel()
34 void JumpWidget::showEvent(QShowEvent *event)
36 m_ui.spinBox->setFocus(Qt::ShortcutFocusReason);
37 return QWidget::showEvent(event);
40 bool JumpWidget::eventFilter(QObject *object, QEvent* event)
42 if (event->type() == QEvent::KeyPress) {
43 if ((static_cast<QKeyEvent*>(event))->key() == Qt::Key_Escape) {
47 return QWidget::eventFilter(object, event);
50 #include "jumpwidget.moc"