summaryrefslogtreecommitdiffstats
path: root/src/multimediaquick/qquickscreencapture.cpp
blob: 9c2b0ef6f326e06aa1c63ad249451fbccfb669c3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// Copyright (C) 2022 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only

#include "qquickscreencapture_p.h"

QT_BEGIN_NAMESPACE

QQuickScreenCatpure::QQuickScreenCatpure(QObject *parent) : QScreenCapture(parent)
{
    connect(this, &QScreenCapture::screenChanged, this, [this](QScreen *screen) {
        emit QQuickScreenCatpure::screenChanged(new QQuickScreenInfo(this, screen));
    });
}

void QQuickScreenCatpure::qmlSetScreen(const QQuickScreenInfo *info)
{
    setScreen(info ? info->wrappedScreen() : nullptr);
}

QQuickScreenInfo *QQuickScreenCatpure::qmlScreen()
{
    return new QQuickScreenInfo(this, screen());
}

QT_END_NAMESPACE

#include "moc_qquickscreencapture_p.cpp"