summaryrefslogtreecommitdiffstats
path: root/src/corelib/doc/snippets/code/doc_src_qcache.cpp
blob: a15a802760003dd65eef9ce40d02ad0dc20564e7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// Copyright (C) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause

//! [0]
QCache<int, Employee> cache;
//! [0]


//! [1]
Employee *employee = new Employee;
employee->setId(37);
employee->setName("Richard Schmit");
...
cache.insert(employee->id(), employee);
//! [1]


//! [2]
QCache<int, MyDataStructure> cache(5000);
//! [2]