summaryrefslogtreecommitdiffstats
path: root/examples/multimedia/screencapture/windowlistmodel.h
diff options
context:
space:
mode:
Diffstat (limited to 'examples/multimedia/screencapture/windowlistmodel.h')
-rw-r--r--examples/multimedia/screencapture/windowlistmodel.h31
1 files changed, 31 insertions, 0 deletions
diff --git a/examples/multimedia/screencapture/windowlistmodel.h b/examples/multimedia/screencapture/windowlistmodel.h
new file mode 100644
index 000000000..caccbb0de
--- /dev/null
+++ b/examples/multimedia/screencapture/windowlistmodel.h
@@ -0,0 +1,31 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+#ifndef WINDOWLISTMODEL_H
+#define WINDOWLISTMODEL_H
+
+#include <QAbstractListModel>
+#include <QCapturableWindow>
+
+QT_USE_NAMESPACE
+
+class WindowListModel : public QAbstractListModel
+{
+ Q_OBJECT
+
+public:
+ explicit WindowListModel(QObject *parent = nullptr);
+
+ int rowCount(const QModelIndex &parent = QModelIndex()) const override;
+ QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
+
+ QCapturableWindow window(const QModelIndex &index) const;
+
+public Q_SLOTS:
+ void populate();
+
+private:
+ QList<QCapturableWindow> windowList;
+};
+
+#endif // WINDOWLISTMODEL_H