Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
main.cpp
Go to the documentation of this file.
1
// Copyright (C) 2018 Samuel Gaist <samuel.gaist@idiap.ch>
2
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
3
#include <QtGui>
4
5
void
wrapper
() {
7
QString
imagePath(
QStringLiteral
(
"path/image.jpeg"
));
8
QImage
image
(64, 64,
QImage::Format_RGB32
);
9
image
.fill(
Qt::red
);
10
{
11
QImageWriter
writer(imagePath);
12
writer.write(
image
);
13
}
14
15
QFile::rename
(imagePath,
16
QStringLiteral
(
"path/other_image.jpeg"
));
18
19
}
// wrapper
QFile::rename
bool rename(const QString &newName)
Renames the file currently specified by fileName() to newName.
Definition
qfile.cpp:554
QImageWriter
The QImageWriter class provides a format independent interface for writing images to files or other d...
Definition
qimagewriter.h:21
QImage
\inmodule QtGui
Definition
qimage.h:37
QImage::Format_RGB32
@ Format_RGB32
Definition
qimage.h:46
QString
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition
qstring.h:129
Qt::red
@ red
Definition
qnamespace.h:35
image
Definition
image.cpp:4
QStringLiteral
#define QStringLiteral(str)
Definition
qstringliteral.h:36
wrapper
void wrapper()
Definition
main.cpp:5
qtbase
src
gui
doc
snippets
qimagewriter
main.cpp
Generated by
1.10.0