Qt 6.x
The Qt SDK
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
58{
59 connect(this, SIGNAL(imageCaptured(int,QImage)), this, SLOT(_q_imageCaptured(int,QImage)));
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 = QString::fromLatin1("preview_%1").arg(id);
145 m_capturedImagePath = QString::fromLatin1("image://camera/%2").arg(previewId);
146 m_lastImage = preview;
148}
149
189
190#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:3870
\inmodule QtCore
Definition qobject.h:90
static QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
\threadsafe
Definition qobject.cpp:2823
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:127
static QString fromLatin1(QByteArrayView ba)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition qstring.cpp:5710
QString arg(qlonglong a, int fieldwidth=0, int base=10, QChar fillChar=u' ') const
Definition qstring.cpp:8606
\inmodule QtCore
Definition qurl.h:94
Combined button and popup list for selecting options.
#define SLOT(a)
Definition qobjectdefs.h:51
#define SIGNAL(a)
Definition qobjectdefs.h:52
GLint location
#define emit
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent