summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--examples/desktop/screenshot/screenshot.cpp2
-rw-r--r--examples/tools/codecs/mainwindow.cpp2
-rw-r--r--examples/touch/fingerpaint/mainwindow.cpp6
-rw-r--r--examples/widgets/scribble/mainwindow.cpp6
-rw-r--r--examples/widgets/stylesheet/stylesheeteditor.cpp2
5 files changed, 9 insertions, 9 deletions
diff --git a/examples/desktop/screenshot/screenshot.cpp b/examples/desktop/screenshot/screenshot.cpp
index 7773728daa..66467d439f 100644
--- a/examples/desktop/screenshot/screenshot.cpp
+++ b/examples/desktop/screenshot/screenshot.cpp
@@ -102,7 +102,7 @@ void Screenshot::saveScreenshot()
.arg(format.toUpper())
.arg(format));
if (!fileName.isEmpty())
- originalPixmap.save(fileName, format.toAscii());
+ originalPixmap.save(fileName, format.toAscii().constData());
}
//! [3]
diff --git a/examples/tools/codecs/mainwindow.cpp b/examples/tools/codecs/mainwindow.cpp
index 8f3c94e3d5..4adff6da6e 100644
--- a/examples/tools/codecs/mainwindow.cpp
+++ b/examples/tools/codecs/mainwindow.cpp
@@ -99,7 +99,7 @@ void MainWindow::save()
QByteArray codecName = action->data().toByteArray();
QTextStream out(&file);
- out.setCodec(codecName);
+ out.setCodec(codecName.constData());
out << textEdit->toPlainText();
}
}
diff --git a/examples/touch/fingerpaint/mainwindow.cpp b/examples/touch/fingerpaint/mainwindow.cpp
index 288068fa09..be005cf612 100644
--- a/examples/touch/fingerpaint/mainwindow.cpp
+++ b/examples/touch/fingerpaint/mainwindow.cpp
@@ -206,12 +206,12 @@ bool MainWindow::saveFile(const QByteArray &fileFormat)
QString fileName = QFileDialog::getSaveFileName(this, tr("Save As"),
initialPath,
tr("%1 Files (*.%2);;All Files (*)")
- .arg(QString(fileFormat.toUpper()))
- .arg(QString(fileFormat)));
+ .arg(QString::fromLatin1(fileFormat.toUpper()))
+ .arg(QString::fromLatin1(fileFormat)));
if (fileName.isEmpty()) {
return false;
} else {
- return scribbleArea->saveImage(fileName, fileFormat);
+ return scribbleArea->saveImage(fileName, fileFormat.constData());
}
}
//! [20]
diff --git a/examples/widgets/scribble/mainwindow.cpp b/examples/widgets/scribble/mainwindow.cpp
index 4a59e93a61..00bf9884c9 100644
--- a/examples/widgets/scribble/mainwindow.cpp
+++ b/examples/widgets/scribble/mainwindow.cpp
@@ -239,12 +239,12 @@ bool MainWindow::saveFile(const QByteArray &fileFormat)
QString fileName = QFileDialog::getSaveFileName(this, tr("Save As"),
initialPath,
tr("%1 Files (*.%2);;All Files (*)")
- .arg(QString(fileFormat.toUpper()))
- .arg(QString(fileFormat)));
+ .arg(QString::fromLatin1(fileFormat.toUpper()))
+ .arg(QString::fromLatin1(fileFormat)));
if (fileName.isEmpty()) {
return false;
} else {
- return scribbleArea->saveImage(fileName, fileFormat);
+ return scribbleArea->saveImage(fileName, fileFormat.constData());
}
}
//! [20]
diff --git a/examples/widgets/stylesheet/stylesheeteditor.cpp b/examples/widgets/stylesheet/stylesheeteditor.cpp
index 88f5100d12..5514291a7f 100644
--- a/examples/widgets/stylesheet/stylesheeteditor.cpp
+++ b/examples/widgets/stylesheet/stylesheeteditor.cpp
@@ -85,7 +85,7 @@ void StyleSheetEditor::loadStyleSheet(const QString &sheetName)
{
QFile file(":/qss/" + sheetName.toLower() + ".qss");
file.open(QFile::ReadOnly);
- QString styleSheet = QLatin1String(file.readAll());
+ QString styleSheet = QString::fromLatin1(file.readAll());
ui.styleTextEdit->setPlainText(styleSheet);
qApp->setStyleSheet(styleSheet);