/*! * \see navigatorWidget */ void ContentWidget::setNavigatorWidget(NavigatorWidget * nav) { if (navigator == nav) return; bool updatesBlocked = false; if (navigator != 0 && navigator->isVisible() && updatesEnabled()) { updatesBlocked = true; setUpdatesEnabled(false); } nav->setParent(this); if (navigator != 0) { nav->setGeometry(navigator->geometry()); nav->setVisible(navigator->isVisible()); navigator->setVisible(false); navigator->deleteLater(); } navigator = nav; connect(navigator, SIGNAL(closeRequested()), this, SLOT(hideNavigator())); connect(navigator, SIGNAL(nextImageRequested()), this, SLOT(navigatorNext())); connect(navigator, SIGNAL(previousImageRequested()), this, SLOT(navigatorPrev())); if (updatesBlocked) setUpdatesEnabled(true); }
bool MessageViewAdapter::eventFilter(QObject*, QEvent* ev) { if (ev->type() == QEvent::KeyPress) { QKeyEvent* event = static_cast<QKeyEvent*>(ev); if (event->modifiers() != Qt::NoModifier) { return false; } switch (event->key()) { case Qt::Key_Left: case Qt::Key_Up: previousImageRequested(); break; case Qt::Key_Right: case Qt::Key_Down: nextImageRequested(); break; default: break; } } return false; }