diff options
author | Tomi Korpipää <tomi.korpipaa@qt.io> | 2017-10-24 13:03:34 +0300 |
---|---|---|
committer | Tomi Korpipää <tomi.korpipaa@qt.io> | 2017-10-24 10:25:01 +0000 |
commit | 544204f17381e6e6ae025388ed4ee2d0cfd22b06 (patch) | |
tree | 07a3586217cd0eebddb84646a7a4b0cf205b8104 /src/Authoring/Studio/remotedeploymentsender.cpp | |
parent | 22b630afd2d454e73d7bf27f30cfc89f6485bcf3 (diff) |
Fix progress dialog visibility issue on Mac
Task-number: QT3DS-160
Change-Id: I6366a42d0f2129d62f68f2a4d14fcbe9233e84ad
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Diffstat (limited to 'src/Authoring/Studio/remotedeploymentsender.cpp')
-rw-r--r-- | src/Authoring/Studio/remotedeploymentsender.cpp | 30 |
1 files changed, 23 insertions, 7 deletions
diff --git a/src/Authoring/Studio/remotedeploymentsender.cpp b/src/Authoring/Studio/remotedeploymentsender.cpp index 47c8b8c5..3cc7ab2c 100644 --- a/src/Authoring/Studio/remotedeploymentsender.cpp +++ b/src/Authoring/Studio/remotedeploymentsender.cpp @@ -93,15 +93,22 @@ QPair<QString, int> ConnectionDialog::getInfo(QWidget *parent) RemoteDeploymentSender::RemoteDeploymentSender(QWidget *parent) : QObject(parent) - , m_tcpSocket(0) + , m_tcpSocket(nullptr) , m_mainWindow(parent) + , m_connectionError(nullptr) { } -void RemoteDeploymentSender::connect() +RemoteDeploymentSender::~RemoteDeploymentSender() +{ + delete m_tcpSocket; + delete m_connectionError; +} + +QPair<QString, int> RemoteDeploymentSender::initConnection() { if (isConnected()) - return; + return QPair<QString, int>(); delete m_tcpSocket; m_tcpSocket = new QTcpSocket(this); @@ -115,8 +122,11 @@ void RemoteDeploymentSender::connect() (&QAbstractSocket::error), this, &RemoteDeploymentSender::connectionError); - QPair<QString, int> info = ConnectionDialog::getInfo(m_mainWindow); + return ConnectionDialog::getInfo(m_mainWindow); + } +void RemoteDeploymentSender::connect(const QPair<QString, int> &info) +{ m_tcpSocket->connectToHost(info.first, info.second); if (!m_tcpSocket->waitForConnected(2000)) { m_tcpSocket->abort(); @@ -143,11 +153,17 @@ void RemoteDeploymentSender::checkConnection() void RemoteDeploymentSender::connectionError() { + Q_EMIT connectionChanged(isConnected()); if (m_tcpSocket) { - QMessageBox::warning(m_mainWindow, tr("Connect to Device"), - tr("Device connection error: ") + m_tcpSocket->errorString()); + delete m_connectionError; + m_connectionError = new QMessageBox(QMessageBox::Warning, tr("Connect to Device"), + tr("Device connection error: ") + + m_tcpSocket->errorString(), + QMessageBox::Ok, m_mainWindow, Qt::Dialog + | Qt::MSWindowsFixedSizeDialogHint + | Qt::WindowStaysOnTopHint); + m_connectionError->open(); } - Q_EMIT connectionChanged(isConnected()); } void RemoteDeploymentSender::streamProject(const QString &projectFile) |