Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qquickitemgrabresult.h
Go to the documentation of this file.
1// Copyright (C) 2016 Jolla Ltd, author: <gunnar.sletta@jollamobile.com>
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3// Qt-Security score:significant reason:default
4
5#ifndef QQUICKITEMGRABRESULT_H
6#define QQUICKITEMGRABRESULT_H
7
8#include <QtCore/QObject>
9#include <QtCore/QSize>
10#include <QtCore/QUrl>
11#include <QtGui/QImage>
12#include <QtQml/QJSValue>
13#include <QtQml/qqml.h>
14#include <QtQuick/qtquickglobal.h>
15
16QT_BEGIN_NAMESPACE
17
18class QQuickItemGrabResultPrivate;
19
20class Q_QUICK_EXPORT QQuickItemGrabResult : public QObject
21{
22 Q_OBJECT
23 Q_DECLARE_PRIVATE(QQuickItemGrabResult)
24
25 Q_PROPERTY(QImage image READ image CONSTANT)
26 Q_PROPERTY(QUrl url READ url CONSTANT)
27 QML_ANONYMOUS
28 QML_ADDED_IN_VERSION(2, 0)
29
30public:
31 QImage image() const;
32 QUrl url() const;
33
34#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
35#if QT_DEPRECATED_SINCE(5, 15)
36 QT_DEPRECATED_X("This overload is deprecated. Use the const member function instead")
37 Q_INVOKABLE bool saveToFile(const QString &fileName);
38#endif
39#endif
40 Q_INVOKABLE bool saveToFile(const QString &fileName) const;
41 Q_REVISION(6, 2) Q_INVOKABLE bool saveToFile(const QUrl &fileName) const;
42
43protected:
44 bool event(QEvent *) override;
45
46Q_SIGNALS:
47 void ready();
48
49private Q_SLOTS:
50 void setup();
51 void render();
52
53private:
54 friend class QQuickItem;
55
56 QQuickItemGrabResult(QObject *parent = nullptr);
57};
58
59QT_END_NAMESPACE
60
61#endif
QPointer< QQuickWindow > window
static QQuickItemGrabResult * create(QQuickItem *item, const QSize &size)
QT_BEGIN_NAMESPACE const QEvent::Type Event_Grab_Completed