diff options
Diffstat (limited to 'examples/multimedia/screencapture/screenlistmodel.h')
-rw-r--r-- | examples/multimedia/screencapture/screenlistmodel.h | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/examples/multimedia/screencapture/screenlistmodel.h b/examples/multimedia/screencapture/screenlistmodel.h new file mode 100644 index 000000000..3bfa30b8f --- /dev/null +++ b/examples/multimedia/screencapture/screenlistmodel.h @@ -0,0 +1,30 @@ +// Copyright (C) 2022 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause + +#ifndef SCREENLISTMODEL_H +#define SCREENLISTMODEL_H + +#include <QAbstractListModel> + +QT_BEGIN_NAMESPACE +class QScreen; +QT_END_NAMESPACE + +QT_USE_NAMESPACE + +class ScreenListModel : public QAbstractListModel +{ + Q_OBJECT + +public: + explicit ScreenListModel(QObject *parent = nullptr); + + int rowCount(const QModelIndex &parent = QModelIndex()) const override; + QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override; + QScreen *screen(const QModelIndex &index) const; + +private Q_SLOTS: + void screensChanged(); +}; + +#endif // SCREENLISTMODEL_H |