diff options
author | Frederik Gladhorn <frederik.gladhorn@theqtcompany.com> | 2014-10-27 13:00:36 +0100 |
---|---|---|
committer | Frederik Gladhorn <frederik.gladhorn@theqtcompany.com> | 2014-10-27 13:00:36 +0100 |
commit | 2eb26c170920d28213b71e549d5dac4663febb14 (patch) | |
tree | 8df5223ac114d758c2112a8fc787992175556418 /examples | |
parent | 49ddae28e0dcd1c59dd5d742cffedd5290d1224a (diff) | |
parent | 81998b4e8e440076bd22a9164f0a93481c0e597a (diff) |
Merge remote-tracking branch 'origin/5.4' into dev
Conflicts:
src/gui/text/qfontdatabase.cpp
Change-Id: I6ac1f55faa22b8e7b591386fb67f0333d0ea443d
Diffstat (limited to 'examples')
-rw-r--r-- | examples/network/securesocketclient/sslclient.cpp | 12 | ||||
-rw-r--r-- | examples/network/securesocketclient/sslclient.h | 3 | ||||
-rw-r--r-- | examples/opengl/threadedqopenglwidget/main.cpp | 33 |
3 files changed, 30 insertions, 18 deletions
diff --git a/examples/network/securesocketclient/sslclient.cpp b/examples/network/securesocketclient/sslclient.cpp index 3ca0a6dc59..23ca7e41e7 100644 --- a/examples/network/securesocketclient/sslclient.cpp +++ b/examples/network/securesocketclient/sslclient.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of the examples of the Qt Toolkit. @@ -46,6 +46,7 @@ #include <QtWidgets/QScrollBar> #include <QtWidgets/QStyle> #include <QtWidgets/QToolButton> +#include <QtWidgets/QMessageBox> #include <QtNetwork/QSslCipher> SslClient::SslClient(QWidget *parent) @@ -96,6 +97,8 @@ void SslClient::secureConnect() this, SLOT(socketStateChanged(QAbstractSocket::SocketState))); connect(socket, SIGNAL(encrypted()), this, SLOT(socketEncrypted())); + connect(socket, SIGNAL(error(QAbstractSocket::SocketError)), + this, SLOT(socketError(QAbstractSocket::SocketError))); connect(socket, SIGNAL(sslErrors(QList<QSslError>)), this, SLOT(sslErrors(QList<QSslError>))); connect(socket, SIGNAL(readyRead()), @@ -118,8 +121,6 @@ void SslClient::socketStateChanged(QAbstractSocket::SocketState state) form->cipherLabel->setText(tr("<none>")); if (padLock) padLock->hide(); - socket->deleteLater(); - socket = 0; } } @@ -180,6 +181,11 @@ void SslClient::sendData() form->sessionInput->clear(); } +void SslClient::socketError(QAbstractSocket::SocketError error) +{ + QMessageBox::critical(this, tr("Connection error"), socket->errorString()); +} + void SslClient::sslErrors(const QList<QSslError> &errors) { QDialog errorDialog(this); diff --git a/examples/network/securesocketclient/sslclient.h b/examples/network/securesocketclient/sslclient.h index 8ebf2cc536..efc3569743 100644 --- a/examples/network/securesocketclient/sslclient.h +++ b/examples/network/securesocketclient/sslclient.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of the examples of the Qt Toolkit. @@ -65,6 +65,7 @@ private slots: void socketEncrypted(); void socketReadyRead(); void sendData(); + void socketError(QAbstractSocket::SocketError error); void sslErrors(const QList<QSslError> &errors); void displayCertificateInfo(); diff --git a/examples/opengl/threadedqopenglwidget/main.cpp b/examples/opengl/threadedqopenglwidget/main.cpp index 2c94469b7c..66ee4c2f7f 100644 --- a/examples/opengl/threadedqopenglwidget/main.cpp +++ b/examples/opengl/threadedqopenglwidget/main.cpp @@ -75,26 +75,31 @@ int main( int argc, char ** argv ) + QLatin1Char('/') + getGlString(topLevelGlWidget.context()->functions(), GL_RENDERER); const bool supportsThreading = !glInfo.contains(QLatin1String("nouveau"), Qt::CaseInsensitive) - && !glInfo.contains(QLatin1String("ANGLE"), Qt::CaseInsensitive); + && !glInfo.contains(QLatin1String("ANGLE"), Qt::CaseInsensitive) + && !glInfo.contains(QLatin1String("llvmpipe"), Qt::CaseInsensitive); const QString toolTip = supportsThreading ? glInfo : glInfo + QStringLiteral("\ndoes not support threaded OpenGL."); topLevelGlWidget.setToolTip(toolTip); QScopedPointer<MainWindow> mw1; QScopedPointer<MainWindow> mw2; - if (supportsThreading && !QApplication::arguments().contains(QStringLiteral("--single"))) { - pos += QPoint(100, 100); - mw1.reset(new MainWindow); - mw1->setToolTip(toolTip); - mw1->move(pos); - mw1->setWindowTitle(QStringLiteral("Threaded QOpenGLWidget example #1")); - mw1->show(); - pos += QPoint(100, 100); - mw2.reset(new MainWindow); - mw2->setToolTip(toolTip); - mw2->move(pos); - mw2->setWindowTitle(QStringLiteral("Threaded QOpenGLWidget example #2")); - mw2->show(); + if (!QApplication::arguments().contains(QStringLiteral("--single"))) { + if (supportsThreading) { + pos += QPoint(100, 100); + mw1.reset(new MainWindow); + mw1->setToolTip(toolTip); + mw1->move(pos); + mw1->setWindowTitle(QStringLiteral("Threaded QOpenGLWidget example #1")); + mw1->show(); + pos += QPoint(100, 100); + mw2.reset(new MainWindow); + mw2->setToolTip(toolTip); + mw2->move(pos); + mw2->setWindowTitle(QStringLiteral("Threaded QOpenGLWidget example #2")); + mw2->show(); + } else { + qWarning() << toolTip; + } } return a.exec(); |