OutputWindow::OutputWindow(MainWindow * mainwindow) : QWidget(0), _mainWindow(mainwindow) { setupUi(this); #if QT_VERSION >= 0x040600 _tbFullScreen->setIcon(QIcon::fromTheme("view-fullscreen")); #else _tbFullScreen->setText("Fullscreen"); _tbFullScreen->setToolButtonStyle(Qt::ToolButtonTextOnly); #endif _pbClose->setCheckable(false); _tbFullScreen->setCheckable(true); connect( _tbFullScreen, SIGNAL(toggled(bool)), this, SLOT(onShowFullscreen(bool)) ); connect( _pbClose, SIGNAL(clicked(bool)), this, SLOT(onCloseClicked()) ); connect( _imageView, SIGNAL(escapePressed()), this, SIGNAL(escapePressed()) ); connect( _imageView, SIGNAL(spaceBarPressed()), this, SIGNAL(spaceBarPressed()) ); connect( _imageView, SIGNAL( mousePress( QMouseEvent * ) ), _mainWindow, SLOT( imageViewMouseEvent( QMouseEvent * ) ) ); connect( _imageView, SIGNAL( mouseMove( QMouseEvent * ) ), _mainWindow, SLOT( imageViewMouseEvent( QMouseEvent * ) ) ); connect( _imageView, SIGNAL(mouseDoubleClick(QMouseEvent*)), this, SLOT(onToggleFullScreen()) ); _imageView->setMouseTracking( true ); setMouseTracking(true); layout()->setContentsMargins(1,0,1,0); }
FullScreenWidget::FullScreenWidget(MainWindow * mainwindow) : QWidget(0), _mainWindow(mainwindow) { setupUi(this); #if QT_VERSION >= 0x040600 _tbFoldRightPanel->setIcon( QIcon::fromTheme( "window-close") ); #else _tbFoldRightPanel->setText("Hide >>"); #endif connect(_tbFoldRightPanel,SIGNAL(clicked()), _rightFrame, SLOT(hide())); connect(_tbFoldRightPanel,SIGNAL(clicked()), _imageView, SLOT(setFocus())); connect( _imageView, SIGNAL(escapePressed()), this, SIGNAL(escapePressed()) ); connect( _imageView, SIGNAL(spaceBarPressed()), this, SIGNAL(spaceBarPressed()) ); connect( _imageView, SIGNAL( mousePress( QMouseEvent * ) ), _mainWindow, SLOT( imageViewMouseEvent( QMouseEvent * ) ) ); connect( _imageView, SIGNAL( mouseMove( QMouseEvent * ) ), _mainWindow, SLOT( imageViewMouseEvent( QMouseEvent * ) ) ); _imageView->setMouseTracking( true ); setMouseTracking(true); _rightFrame->setVisible(false); _splitter->setChildrenCollapsible(false); layout()->setContentsMargins(1,0,1,0); }
void FullScreenWidget::keyPressEvent( QKeyEvent * e ) { if ( e->key() == Qt::Key_Escape || e->key() == Qt::Key_F5) { emit escapePressed(); e->accept(); } if ( e->key() == Qt::Key_Space && !_rightFrame->isVisible() ) { emit spaceBarPressed(); e->accept(); } }
void ImageView::keyPressEvent( QKeyEvent * e ) { if ( e->key() == Qt::Key_Space ) { e->accept(); emit spaceBarPressed(); } if ( e->key() == Qt::Key_Escape) { emit escapePressed(); e->accept(); } }
void OutputWindow::keyPressEvent( QKeyEvent * e ) { if ( isFullScreen() && (e->key() == Qt::Key_Escape || e->key() == Qt::Key_F5) ) { onShowFullscreen(false); emit escapePressed(); e->accept(); } if ( e->key() == Qt::Key_Space ) { emit spaceBarPressed(); e->accept(); } }