summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/corelib/serialization/convert/cborconverter.cpp13
-rw-r--r--examples/network/loopback/dialog.cpp6
-rw-r--r--examples/sql/querymodel/customsqlmodel.cpp2
-rw-r--r--examples/widgets/itemviews/spreadsheet/spreadsheetitem.cpp2
-rw-r--r--examples/widgets/mainwindows/application/mainwindow.cpp8
-rw-r--r--examples/widgets/mainwindows/dockwidgets/mainwindow.cpp4
-rw-r--r--examples/widgets/mainwindows/mdi/mdichild.cpp8
-rw-r--r--examples/widgets/mainwindows/sdi/mainwindow.cpp8
-rw-r--r--examples/widgets/tools/completer/mainwindow.cpp4
-rw-r--r--examples/widgets/tools/customcompleter/mainwindow.cpp4
-rw-r--r--examples/widgets/tools/treemodelcompleter/mainwindow.cpp4
11 files changed, 25 insertions, 38 deletions
diff --git a/examples/corelib/serialization/convert/cborconverter.cpp b/examples/corelib/serialization/convert/cborconverter.cpp
index 41724c935e..f906c81062 100644
--- a/examples/corelib/serialization/convert/cborconverter.cpp
+++ b/examples/corelib/serialization/convert/cborconverter.cpp
@@ -84,19 +84,6 @@ static const char diagnosticHelp[] =
QT_BEGIN_NAMESPACE
-QDataStream &operator<<(QDataStream &ds, QCborSimpleType st)
-{
- return ds << quint8(st);
-}
-
-QDataStream &operator>>(QDataStream &ds, QCborSimpleType &st)
-{
- quint8 v;
- ds >> v;
- st = QCborSimpleType(v);
- return ds;
-}
-
QDataStream &operator<<(QDataStream &ds, QCborTag tag)
{
return ds << quint64(tag);
diff --git a/examples/network/loopback/dialog.cpp b/examples/network/loopback/dialog.cpp
index b4e6b0fd5e..d87f024031 100644
--- a/examples/network/loopback/dialog.cpp
+++ b/examples/network/loopback/dialog.cpp
@@ -99,7 +99,7 @@ void Dialog::start()
startButton->setEnabled(false);
#ifndef QT_NO_CURSOR
- QApplication::setOverrideCursor(Qt::WaitCursor);
+ QGuiApplication::setOverrideCursor(Qt::WaitCursor);
#endif
bytesWritten = 0;
@@ -162,7 +162,7 @@ void Dialog::updateServerProgress()
tcpServerConnection->close();
startButton->setEnabled(true);
#ifndef QT_NO_CURSOR
- QApplication::restoreOverrideCursor();
+ QGuiApplication::restoreOverrideCursor();
#endif
}
}
@@ -198,6 +198,6 @@ void Dialog::displayError(QAbstractSocket::SocketError socketError)
serverStatusLabel->setText(tr("Server ready"));
startButton->setEnabled(true);
#ifndef QT_NO_CURSOR
- QApplication::restoreOverrideCursor();
+ QGuiApplication::restoreOverrideCursor();
#endif
}
diff --git a/examples/sql/querymodel/customsqlmodel.cpp b/examples/sql/querymodel/customsqlmodel.cpp
index 21bedee727..7be0a65882 100644
--- a/examples/sql/querymodel/customsqlmodel.cpp
+++ b/examples/sql/querymodel/customsqlmodel.cpp
@@ -67,7 +67,7 @@ QVariant CustomSqlModel::data(const QModelIndex &index, int role) const
else if (index.column() == 2)
return value.toString().toUpper();
}
- if (role == Qt::TextColorRole && index.column() == 1)
+ if (role == Qt::ForegroundRole && index.column() == 1)
return QVariant::fromValue(QColor(Qt::blue));
return value;
}
diff --git a/examples/widgets/itemviews/spreadsheet/spreadsheetitem.cpp b/examples/widgets/itemviews/spreadsheet/spreadsheetitem.cpp
index 4c18fa8251..92cbaff031 100644
--- a/examples/widgets/itemviews/spreadsheet/spreadsheetitem.cpp
+++ b/examples/widgets/itemviews/spreadsheet/spreadsheetitem.cpp
@@ -79,7 +79,7 @@ QVariant SpreadSheetItem::data(int role) const
bool isNumber = false;
int number = t.toInt(&isNumber);
- if (role == Qt::TextColorRole) {
+ if (role == Qt::ForegroundRole) {
if (!isNumber)
return QVariant::fromValue(QColor(Qt::black));
else if (number < 0)
diff --git a/examples/widgets/mainwindows/application/mainwindow.cpp b/examples/widgets/mainwindows/application/mainwindow.cpp
index dc93fe4eb2..4b639ead18 100644
--- a/examples/widgets/mainwindows/application/mainwindow.cpp
+++ b/examples/widgets/mainwindows/application/mainwindow.cpp
@@ -337,11 +337,11 @@ void MainWindow::loadFile(const QString &fileName)
QTextStream in(&file);
#ifndef QT_NO_CURSOR
- QApplication::setOverrideCursor(Qt::WaitCursor);
+ QGuiApplication::setOverrideCursor(Qt::WaitCursor);
#endif
textEdit->setPlainText(in.readAll());
#ifndef QT_NO_CURSOR
- QApplication::restoreOverrideCursor();
+ QGuiApplication::restoreOverrideCursor();
#endif
setCurrentFile(fileName);
@@ -364,11 +364,11 @@ bool MainWindow::saveFile(const QString &fileName)
QTextStream out(&file);
#ifndef QT_NO_CURSOR
- QApplication::setOverrideCursor(Qt::WaitCursor);
+ QGuiApplication::setOverrideCursor(Qt::WaitCursor);
#endif
out << textEdit->toPlainText();
#ifndef QT_NO_CURSOR
- QApplication::restoreOverrideCursor();
+ QGuiApplication::restoreOverrideCursor();
#endif
setCurrentFile(fileName);
diff --git a/examples/widgets/mainwindows/dockwidgets/mainwindow.cpp b/examples/widgets/mainwindows/dockwidgets/mainwindow.cpp
index 47a6e78265..a62765cdab 100644
--- a/examples/widgets/mainwindows/dockwidgets/mainwindow.cpp
+++ b/examples/widgets/mainwindows/dockwidgets/mainwindow.cpp
@@ -161,9 +161,9 @@ void MainWindow::save()
}
QTextStream out(&file);
- QApplication::setOverrideCursor(Qt::WaitCursor);
+ QGuiApplication::setOverrideCursor(Qt::WaitCursor);
out << textEdit->toHtml();
- QApplication::restoreOverrideCursor();
+ QGuiApplication::restoreOverrideCursor();
statusBar()->showMessage(tr("Saved '%1'").arg(fileName), 2000);
}
diff --git a/examples/widgets/mainwindows/mdi/mdichild.cpp b/examples/widgets/mainwindows/mdi/mdichild.cpp
index 006c84574a..16f2040de0 100644
--- a/examples/widgets/mainwindows/mdi/mdichild.cpp
+++ b/examples/widgets/mainwindows/mdi/mdichild.cpp
@@ -82,9 +82,9 @@ bool MdiChild::loadFile(const QString &fileName)
}
QTextStream in(&file);
- QApplication::setOverrideCursor(Qt::WaitCursor);
+ QGuiApplication::setOverrideCursor(Qt::WaitCursor);
setPlainText(in.readAll());
- QApplication::restoreOverrideCursor();
+ QGuiApplication::restoreOverrideCursor();
setCurrentFile(fileName);
@@ -124,9 +124,9 @@ bool MdiChild::saveFile(const QString &fileName)
}
QTextStream out(&file);
- QApplication::setOverrideCursor(Qt::WaitCursor);
+ QGuiApplication::setOverrideCursor(Qt::WaitCursor);
out << toPlainText();
- QApplication::restoreOverrideCursor();
+ QGuiApplication::restoreOverrideCursor();
setCurrentFile(fileName);
return true;
diff --git a/examples/widgets/mainwindows/sdi/mainwindow.cpp b/examples/widgets/mainwindows/sdi/mainwindow.cpp
index 301c85c144..d44f7c918d 100644
--- a/examples/widgets/mainwindows/sdi/mainwindow.cpp
+++ b/examples/widgets/mainwindows/sdi/mainwindow.cpp
@@ -338,9 +338,9 @@ void MainWindow::loadFile(const QString &fileName)
}
QTextStream in(&file);
- QApplication::setOverrideCursor(Qt::WaitCursor);
+ QGuiApplication::setOverrideCursor(Qt::WaitCursor);
textEdit->setPlainText(in.readAll());
- QApplication::restoreOverrideCursor();
+ QGuiApplication::restoreOverrideCursor();
setCurrentFile(fileName);
statusBar()->showMessage(tr("File loaded"), 2000);
@@ -434,9 +434,9 @@ bool MainWindow::saveFile(const QString &fileName)
}
QTextStream out(&file);
- QApplication::setOverrideCursor(Qt::WaitCursor);
+ QGuiApplication::setOverrideCursor(Qt::WaitCursor);
out << textEdit->toPlainText();
- QApplication::restoreOverrideCursor();
+ QGuiApplication::restoreOverrideCursor();
setCurrentFile(fileName);
statusBar()->showMessage(tr("File saved"), 2000);
diff --git a/examples/widgets/tools/completer/mainwindow.cpp b/examples/widgets/tools/completer/mainwindow.cpp
index d63d523548..8eb2e60030 100644
--- a/examples/widgets/tools/completer/mainwindow.cpp
+++ b/examples/widgets/tools/completer/mainwindow.cpp
@@ -159,7 +159,7 @@ QAbstractItemModel *MainWindow::modelFromFile(const QString& fileName)
//! [6]
#ifndef QT_NO_CURSOR
- QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
+ QGuiApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
#endif
QStringList words;
@@ -170,7 +170,7 @@ QAbstractItemModel *MainWindow::modelFromFile(const QString& fileName)
}
#ifndef QT_NO_CURSOR
- QApplication::restoreOverrideCursor();
+ QGuiApplication::restoreOverrideCursor();
#endif
//! [6]
diff --git a/examples/widgets/tools/customcompleter/mainwindow.cpp b/examples/widgets/tools/customcompleter/mainwindow.cpp
index 26948d0c8e..7b9db708b9 100644
--- a/examples/widgets/tools/customcompleter/mainwindow.cpp
+++ b/examples/widgets/tools/customcompleter/mainwindow.cpp
@@ -100,7 +100,7 @@ QAbstractItemModel *MainWindow::modelFromFile(const QString& fileName)
return new QStringListModel(completer);
#ifndef QT_NO_CURSOR
- QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
+ QGuiApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
#endif
QStringList words;
@@ -111,7 +111,7 @@ QAbstractItemModel *MainWindow::modelFromFile(const QString& fileName)
}
#ifndef QT_NO_CURSOR
- QApplication::restoreOverrideCursor();
+ QGuiApplication::restoreOverrideCursor();
#endif
return new QStringListModel(words, completer);
}
diff --git a/examples/widgets/tools/treemodelcompleter/mainwindow.cpp b/examples/widgets/tools/treemodelcompleter/mainwindow.cpp
index a8b51c7aa0..72b2fad833 100644
--- a/examples/widgets/tools/treemodelcompleter/mainwindow.cpp
+++ b/examples/widgets/tools/treemodelcompleter/mainwindow.cpp
@@ -180,7 +180,7 @@ QAbstractItemModel *MainWindow::modelFromFile(const QString& fileName)
return new QStringListModel(completer);
#ifndef QT_NO_CURSOR
- QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
+ QGuiApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
#endif
QStringList words;
@@ -218,7 +218,7 @@ QAbstractItemModel *MainWindow::modelFromFile(const QString& fileName)
}
#ifndef QT_NO_CURSOR
- QApplication::restoreOverrideCursor();
+ QGuiApplication::restoreOverrideCursor();
#endif
return model;