aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken6/tests/libsample/objectview.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'sources/shiboken6/tests/libsample/objectview.cpp')
-rw-r--r--sources/shiboken6/tests/libsample/objectview.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/sources/shiboken6/tests/libsample/objectview.cpp b/sources/shiboken6/tests/libsample/objectview.cpp
new file mode 100644
index 000000000..1b727f88c
--- /dev/null
+++ b/sources/shiboken6/tests/libsample/objectview.cpp
@@ -0,0 +1,24 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+
+#include "objectview.h"
+#include "objectmodel.h"
+#include "str.h"
+
+Str ObjectView::displayModelData()
+{
+ if (!m_model)
+ return {"(NULL)"};
+ return Str("Name: %VAR").arg(m_model->objectName());
+}
+
+void ObjectView::modifyModelData(Str &data)
+{
+ if (m_model)
+ m_model->setObjectName(data);
+}
+
+ObjectType *ObjectView::getRawModelData()
+{
+ return m_model->data();
+}