aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/doc/how-tos/how-to-cpp-button/backend.h
diff options
context:
space:
mode:
authorMitch Curtis <mitch.curtis@qt.io>2023-02-20 13:22:15 +0800
committerMitch Curtis <mitch.curtis@qt.io>2023-03-24 15:44:21 +0800
commitac9830268a1c6d19cacaaf9413fefbfb3675034f (patch)
tree3c3baae9b4209faec0531d83e2217a306652159b /tests/auto/quick/doc/how-tos/how-to-cpp-button/backend.h
parentd66db6c80241e9ce7098e2650fb59a2183a42c84 (diff)
Add a how-to page for Qt Quick topics
The goal for this page is to have an easily discoverable, useful reference that shows the simplest and best way of performing specific tasks using Qt Quick. Each task will have its own section title (so they can be linked to) in the form of a question. For example: How do I make a QML Button call C++ code when clicked? Each section will provide QML and/or C++ code snippets, or link to other parts of Qt's documentation where those snippets already exist. The QML-only snippets will be tested by tests/auto/quick/doc/how-tos/qml, and the mixed QML and C++ snippets will be tested by individual auto tests under tests/auto/quick/doc/how-tos. Fixes: QTBUG-109634 Pick-to: 6.5 Change-Id: I512e016db2c914fd9e0241d5e0738af82a98d08b Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'tests/auto/quick/doc/how-tos/how-to-cpp-button/backend.h')
-rw-r--r--tests/auto/quick/doc/how-tos/how-to-cpp-button/backend.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/auto/quick/doc/how-tos/how-to-cpp-button/backend.h b/tests/auto/quick/doc/how-tos/how-to-cpp-button/backend.h
new file mode 100644
index 0000000000..4e3cb98216
--- /dev/null
+++ b/tests/auto/quick/doc/how-tos/how-to-cpp-button/backend.h
@@ -0,0 +1,17 @@
+// Copyright (C) 2023 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+//! [file]
+#include <QObject>
+#include <QQmlEngine>
+
+class Backend : public QObject
+{
+ Q_OBJECT
+ QML_ELEMENT
+ QML_SINGLETON
+
+public:
+ Q_INVOKABLE void doStuff();
+};
+//! [file]