diff options
Diffstat (limited to 'src/client/vnc/vncwindow.cpp')
-rw-r--r-- | src/client/vnc/vncwindow.cpp | 28 |
1 files changed, 5 insertions, 23 deletions
diff --git a/src/client/vnc/vncwindow.cpp b/src/client/vnc/vncwindow.cpp index 581d503..13ad107 100644 --- a/src/client/vnc/vncwindow.cpp +++ b/src/client/vnc/vncwindow.cpp @@ -19,7 +19,7 @@ #include "vncthread.h" VncWindow::VncWindow(QWidget *parent) : - QDialog(parent), _vncWorker(NULL), _viewOnly(true), _clientId(0), _redrawTimer(0), _tcpTimeoutTimer(0) + QWidget(parent), _vncWorker(NULL), _viewOnly(true), _clientId(0), _redrawTimer(0), _tcpTimeoutTimer(0) { // } @@ -130,16 +130,16 @@ void VncWindow::open(const QString& host, int port, const QString& passwd, bool /** * Called by Qt if the window is requested to be closed. This can either happen - * through code (this->close()), or a keypress (Alt-F4, Esc). We'll ignore the - * request and simply hide the window. + * through code (this->close()), or a keypress (Alt-F4). As long as + * Qt::WA_DeleteOnClose is not set the QWidget gets just hidden and not quit. + * See http://qt-project.org/doc/qt-4.8/qcloseevent.html#details for more + * details. * * @param e close event data */ void VncWindow::closeEvent(QCloseEvent *e) { - e->ignore(); qDebug("Closing VNC viewer window."); - this->setVisible(false); this->terminateVncThread(); emit running(false, _clientId); } @@ -188,24 +188,6 @@ void VncWindow::onProjectionStopped() //////////////////////////////////////////////////////////////////////////////// // Protected - -/** - * Request to close the window. Overriden from QDialog/QWidget. - * If the window is already hidden, this just emits a signal that - * will tell the server that we're not watching a VNC stream - * currently. Otherwise it will just call the implementation of - * the super class. - * - * @return false - */ -bool VncWindow::close() -{ - if (this->isVisible()) - return QDialog::close(); - emit running(false, _clientId); - return false; -} - /** * Called when a Qt timer fires. * |