summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/embedded/flightinfo/flightinfo.cpp2
-rw-r--r--examples/embedded/lightmaps/slippymap.cpp2
-rw-r--r--examples/network/download/main.cpp2
-rw-r--r--examples/network/downloadmanager/downloadmanager.cpp2
-rw-r--r--examples/network/googlesuggest/googlesuggest.cpp2
-rw-r--r--examples/network/http/httpwindow.cpp2
-rw-r--r--examples/network/network.pro2
-rw-r--r--examples/network/torrent/trackerclient.cpp4
-rw-r--r--examples/widgets/doc/src/gallery.qdoc36
-rw-r--r--examples/widgets/widgets/styles/widgetgallery.cpp8
-rw-r--r--examples/widgets/widgets/styles/widgetgallery.h2
11 files changed, 47 insertions, 17 deletions
diff --git a/examples/embedded/flightinfo/flightinfo.cpp b/examples/embedded/flightinfo/flightinfo.cpp
index f46fc9693f..732e07583a 100644
--- a/examples/embedded/flightinfo/flightinfo.cpp
+++ b/examples/embedded/flightinfo/flightinfo.cpp
@@ -144,7 +144,7 @@ public:
private slots:
void handleNetworkData(QNetworkReply *networkReply) {
- if (!networkReply->error()) {
+ if (!networkReply->networkError()) {
if (!mapReplies.contains(networkReply)) {
// Assume UTF-8 encoded
QByteArray data = networkReply->readAll();
diff --git a/examples/embedded/lightmaps/slippymap.cpp b/examples/embedded/lightmaps/slippymap.cpp
index da003981ff..dfc21862fb 100644
--- a/examples/embedded/lightmaps/slippymap.cpp
+++ b/examples/embedded/lightmaps/slippymap.cpp
@@ -162,7 +162,7 @@ void SlippyMap::handleNetworkData(QNetworkReply *reply)
{
QImage img;
QPoint tp = reply->request().attribute(QNetworkRequest::User).toPoint();
- if (!reply->error())
+ if (!reply->networkError())
if (!img.load(reply, 0))
img = QImage();
reply->deleteLater();
diff --git a/examples/network/download/main.cpp b/examples/network/download/main.cpp
index 076dfdfd0b..f496c1723e 100644
--- a/examples/network/download/main.cpp
+++ b/examples/network/download/main.cpp
@@ -175,7 +175,7 @@ void DownloadManager::sslErrors(const QList<QSslError> &sslErrors)
void DownloadManager::downloadFinished(QNetworkReply *reply)
{
QUrl url = reply->url();
- if (reply->error()) {
+ if (reply->networkError()) {
fprintf(stderr, "Download of %s failed: %s\n",
url.toEncoded().constData(),
qPrintable(reply->errorString()));
diff --git a/examples/network/downloadmanager/downloadmanager.cpp b/examples/network/downloadmanager/downloadmanager.cpp
index cbad29541a..eceb48977b 100644
--- a/examples/network/downloadmanager/downloadmanager.cpp
+++ b/examples/network/downloadmanager/downloadmanager.cpp
@@ -162,7 +162,7 @@ void DownloadManager::downloadFinished()
progressBar.clear();
output.close();
- if (currentDownload->error()) {
+ if (currentDownload->networkError()) {
// download failed
fprintf(stderr, "Failed: %s\n", qPrintable(currentDownload->errorString()));
output.remove();
diff --git a/examples/network/googlesuggest/googlesuggest.cpp b/examples/network/googlesuggest/googlesuggest.cpp
index 2cba43178e..1ae515f530 100644
--- a/examples/network/googlesuggest/googlesuggest.cpp
+++ b/examples/network/googlesuggest/googlesuggest.cpp
@@ -209,7 +209,7 @@ void GSuggestCompletion::preventSuggest()
void GSuggestCompletion::handleNetworkData(QNetworkReply *networkReply)
{
QUrl url = networkReply->url();
- if (networkReply->error() == QNetworkReply::NoError) {
+ if (networkReply->networkError() == QNetworkReply::NoError) {
QVector<QString> choices;
QByteArray response(networkReply->readAll());
diff --git a/examples/network/http/httpwindow.cpp b/examples/network/http/httpwindow.cpp
index c7bf0c0dff..d0eb2529cd 100644
--- a/examples/network/http/httpwindow.cpp
+++ b/examples/network/http/httpwindow.cpp
@@ -249,7 +249,7 @@ void HttpWindow::httpFinished()
return;
}
- if (reply->error()) {
+ if (reply->networkError()) {
QFile::remove(fi.absoluteFilePath());
statusLabel->setText(tr("Download failed:\n%1.").arg(reply->errorString()));
downloadButton->setEnabled(true);
diff --git a/examples/network/network.pro b/examples/network/network.pro
index 1556e26ab1..af3c0df43e 100644
--- a/examples/network/network.pro
+++ b/examples/network/network.pro
@@ -29,7 +29,7 @@ qtHaveModule(widgets) {
}
- qtConfig(openssl): SUBDIRS += securesocketclient
+ qtConfig(ssl): SUBDIRS += securesocketclient
qtConfig(dtls): SUBDIRS += secureudpserver secureudpclient
qtConfig(sctp): SUBDIRS += multistreamserver multistreamclient
}
diff --git a/examples/network/torrent/trackerclient.cpp b/examples/network/torrent/trackerclient.cpp
index 00810a98af..540ab31557 100644
--- a/examples/network/torrent/trackerclient.cpp
+++ b/examples/network/torrent/trackerclient.cpp
@@ -165,8 +165,8 @@ void TrackerClient::httpRequestDone(QNetworkReply *reply)
return;
}
- if (reply->error() != QNetworkReply::NoError) {
- emit connectionError(reply->error());
+ if (reply->networkError() != QNetworkReply::NoError) {
+ emit connectionError(reply->networkError());
return;
}
diff --git a/examples/widgets/doc/src/gallery.qdoc b/examples/widgets/doc/src/gallery.qdoc
new file mode 100644
index 0000000000..a262374ce6
--- /dev/null
+++ b/examples/widgets/doc/src/gallery.qdoc
@@ -0,0 +1,36 @@
+/****************************************************************************
+**
+** Copyright (C) 2020 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Free Documentation License Usage
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file. Please review the following information to ensure
+** the GNU Free Documentation License version 1.3 requirements
+** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+ \example widgets/gallery
+ \title Widgets Gallery Example
+ \ingroup examples-widgets
+ \brief The Widgets Gallery example shows widgets relevant for designing UIs.
+
+ This example demonstrates widgets typically used in dialogs and forms.
+ It also allows for changing the style.
+*/
diff --git a/examples/widgets/widgets/styles/widgetgallery.cpp b/examples/widgets/widgets/styles/widgetgallery.cpp
index d70c503f53..bf8e93feb4 100644
--- a/examples/widgets/widgets/styles/widgetgallery.cpp
+++ b/examples/widgets/widgets/styles/widgetgallery.cpp
@@ -75,8 +75,6 @@
WidgetGallery::WidgetGallery(QWidget *parent)
: QDialog(parent)
{
- originalPalette = QApplication::palette();
-
styleComboBox = new QComboBox;
const QString defaultStyleName = QApplication::style()->objectName();
QStringList styleNames = QStyleFactory::keys();
@@ -162,10 +160,8 @@ void WidgetGallery::changeStyle(const QString &styleName)
void WidgetGallery::changePalette()
//! [7] //! [8]
{
- if (useStylePaletteCheckBox->isChecked())
- QApplication::setPalette(QApplication::style()->standardPalette());
- else
- QApplication::setPalette(originalPalette);
+ QApplication::setPalette(useStylePaletteCheckBox->isChecked() ?
+ QApplication::style()->standardPalette() : QPalette());
}
//! [8]
diff --git a/examples/widgets/widgets/styles/widgetgallery.h b/examples/widgets/widgets/styles/widgetgallery.h
index 4deee6839a..8c4c880536 100644
--- a/examples/widgets/widgets/styles/widgetgallery.h
+++ b/examples/widgets/widgets/styles/widgetgallery.h
@@ -96,8 +96,6 @@ private:
void createBottomRightGroupBox();
void createProgressBar();
- QPalette originalPalette;
-
QLabel *styleLabel;
QComboBox *styleComboBox;
QCheckBox *useStylePaletteCheckBox;