Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Toggle main menu visibility
Loading...
Searching...
No Matches
qgraphicsframecapture.cpp
Go to the documentation of this file.
1
// Copyright (C) 2023 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
// Qt-Security score:significant reason:default
4
5
#
include
"qgraphicsframecapture_p.h"
6
#
if
(
defined
(
Q_OS_WIN
)
||
defined
(
Q_OS_LINUX
)
)
&&
QT_CONFIG
(
library
)
7
#
include
"qgraphicsframecapturerenderdoc_p_p.h"
8
#
elif
QT_CONFIG
(
metal
)
9
#
include
"qgraphicsframecapturemetal_p_p.h"
10
#
else
11
#
include
"qgraphicsframecapture_p_p.h"
12
#
endif
13
14
#
include
<
QtCore
/
qstandardpaths
.
h
>
15
#
include
<
QtCore
/
qcoreapplication
.
h
>
16
17
QT_BEGIN_NAMESPACE
18
19
QGraphicsFrameCapturePrivate::QGraphicsFrameCapturePrivate()
20
: m_capturePath(QStandardPaths::writableLocation(QStandardPaths::TempLocation) +
21
QStringLiteral(
"/"
) + QCoreApplication::applicationName() +
22
QStringLiteral(
"/captures"
)),
23
m_capturePrefix(QCoreApplication::applicationName())
24
{
25
26
}
27
28
QGraphicsFrameCapture::QGraphicsFrameCapture()
29
{
30
#
if
(
defined
(
Q_OS_WIN
)
||
defined
(
Q_OS_LINUX
)
)
&&
QT_CONFIG
(
library
)
31
d.reset(
new
QGraphicsFrameCaptureRenderDoc);
32
#
elif
QT_CONFIG
(
metal
)
33
d.reset(
new
QGraphicsFrameCaptureMetal);
34
#
endif
35
}
36
37
QGraphicsFrameCapture::~QGraphicsFrameCapture()
38
{
39
40
}
41
42
void
QGraphicsFrameCapture::setRhi(QRhi *rhi)
43
{
44
if
(!d.isNull())
45
d->setRhi(rhi);
46
}
47
48
void
QGraphicsFrameCapture::startCaptureFrame()
49
{
50
if
(!d.isNull())
51
d->startCaptureFrame();
52
}
53
54
void
QGraphicsFrameCapture::endCaptureFrame()
55
{
56
if
(!d.isNull())
57
d->endCaptureFrame();
58
}
59
60
QString QGraphicsFrameCapture::capturePath()
const
61
{
62
if
(!d.isNull())
63
return
d->capturePath();
64
return
QString();
65
}
66
67
void
QGraphicsFrameCapture::setCapturePath(
const
QString &path)
68
{
69
if
(!d.isNull())
70
d->setCapturePath(path);
71
}
72
73
QString QGraphicsFrameCapture::capturePrefix()
const
74
{
75
if
(!d.isNull())
76
return
d->capturePrefix();
77
return
QString();
78
}
79
80
void
QGraphicsFrameCapture::setCapturePrefix(
const
QString &prefix)
81
{
82
if
(!d.isNull())
83
d->setCapturePrefix(prefix);
84
}
85
86
QString QGraphicsFrameCapture::capturedFileName()
87
{
88
if
(!d.isNull())
89
return
d->capturedFileName();
90
91
return
QString();
92
}
93
94
QStringList QGraphicsFrameCapture::capturedFilesNames()
95
{
96
if
(!d.isNull())
97
return
d->capturedFilesNames();
98
99
return
QStringList();
100
}
101
102
bool
QGraphicsFrameCapture::isLoaded()
const
103
{
104
if
(!d.isNull())
105
return
d->initialized();
106
107
return
false
;
108
}
109
110
bool
QGraphicsFrameCapture::isCapturing()
const
111
{
112
if
(!d.isNull())
113
return
d->isCapturing();
114
115
return
false
;
116
}
117
118
void
QGraphicsFrameCapture::openCapture()
const
119
{
120
if
(!d.isNull())
121
d->openCapture();
122
}
123
124
QT_END_NAMESPACE
QT_BEGIN_NAMESPACE
Combined button and popup list for selecting options.
Definition
qsequentialanimationgroup.cpp:47
qtbase
src
gui
util
qgraphicsframecapture.cpp
Generated on
for Qt by
1.18.0