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
qquickimagecapture.cpp
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
6
7#include <QtCore/qurl.h>
8
10
57 : QImageCapture(parent)
58{
59 connect(this, &QImageCapture::imageCaptured, this, &QQuickImageCapture::_q_imageCaptured);
60}
61
63
125{
126 return m_capturedImagePath;
127}
128
137{
138 m_lastImage.save(location.toLocalFile());
139}
140
141void QQuickImageCapture::_q_imageCaptured(int id, const QImage &preview)
142{
143 QString previewId = QStringLiteral("preview_%1").arg(id);
145 m_capturedImagePath = QStringLiteral("image://camera/%2").arg(previewId);
146 m_lastImage = preview;
148}
149
188
189#include "moc_qquickimagecapture_p.cpp"
\inmodule QtMultimedia
void imageCaptured(int id, const QImage &preview)
Signal emitted when the frame with request id was captured, but not processed and saved yet.
\inmodule QtGui
Definition qimage.h:37
bool save(const QString &fileName, const char *format=nullptr, int quality=-1) const
Saves the image to the file with the given fileName, using the given image file format and quality fa...
Definition qimage.cpp:3888
\inmodule QtCore
Definition qobject.h:103
static QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
\threadsafe
Definition qobject.cpp:2960
void saveToFile(const QUrl &location) const
\qmlmethod QtMultimedia::ImageCapture::saveToFile(location)
QQuickImageCapture(QObject *parent=nullptr)
\qmltype ImageCapture \instantiates QQuickImageCapture
static void registerPreview(const QString &id, const QImage &preview)
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
\inmodule QtCore
Definition qurl.h:94
Combined button and popup list for selecting options.
GLint location
#define QStringLiteral(str)
#define emit