Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
exampleqjsascontainer.cpp
Go to the documentation of this file.
1// Copyright (C) 2022 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
3
4
5//! [qjs-as-container]
6
7 class Cache : public QObject
8 {
9 Q_OBJECT
10 QML_ELEMENT
11
12 public:
14 if (auto it = m_cache.constFind(key); it != m_cache.constEnd()) {
15 return *it; // impicit conversion
16 } else {
17 return QJSValue::UndefinedValue; // implicit conversion
18 }
19 }
20
22 }
23
24//! [qjs-as-container]
[qjs-as-container]