summaryrefslogtreecommitdiffstats
path: root/framework/src/domainobjectcontroller.h
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2018-01-05 16:17:51 +0100
committerChristian Mollekopf <chrigi_1@fastmail.fm>2018-01-08 16:26:38 +0100
commit0dc0b4be6e9ba07774efedee102a23e89eef8e85 (patch)
tree2d6c3a9388c5dde159ffbc72fdd6d0bd285741ed /framework/src/domainobjectcontroller.h
parent772eeaa715551cbb4693ab221ea8fc6dad7e1bb6 (diff)
downloadkube-0dc0b4be6e9ba07774efedee102a23e89eef8e85.tar.gz
kube-0dc0b4be6e9ba07774efedee102a23e89eef8e85.zip
Composer test
Diffstat (limited to 'framework/src/domainobjectcontroller.h')
-rw-r--r--framework/src/domainobjectcontroller.h48
1 files changed, 48 insertions, 0 deletions
diff --git a/framework/src/domainobjectcontroller.h b/framework/src/domainobjectcontroller.h
new file mode 100644
index 00000000..5805c5a8
--- /dev/null
+++ b/framework/src/domainobjectcontroller.h
@@ -0,0 +1,48 @@
1/*
2 Copyright (c) 2018 Christian Mollekopf <mollekopf@kolabsys.com>
3
4 This library is free software; you can redistribute it and/or modify it
5 under the terms of the GNU Library General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or (at your
7 option) any later version.
8
9 This library is distributed in the hope that it will be useful, but WITHOUT
10 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
12 License for more details.
13
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to the
16 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
17 02110-1301, USA.
18*/
19#pragma once
20
21#include <QObject>
22#include <QVariant>
23#include <QAbstractItemModel>
24#include <QSharedPointer>
25
26namespace Kube {
27
28class DomainObjectController : public QObject
29{
30 Q_OBJECT
31 Q_PROPERTY(QVariant currentObject READ currentObject NOTIFY currentObjectChanged)
32public:
33 explicit DomainObjectController(QObject *parent = 0);
34
35 QVariant currentObject() const;
36
37 Q_INVOKABLE void create(const QVariantMap &object);
38 Q_INVOKABLE void monitor(const QVariant &object);
39
40signals:
41 void currentObjectChanged();
42
43private:
44 QVariant mCurrentObject;
45 QSharedPointer<QAbstractItemModel> mModel;
46};
47
48}