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
qpixmapcache_p.h
Go to the documentation of this file.
1
// Copyright (C) 2016 The Qt Company Ltd.
2
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
// Qt-Security score:significant reason:default
4
5
#
ifndef
QPIXMAPCACHE_P_H
6
#
define
QPIXMAPCACHE_P_H
7
8
//
9
// W A R N I N G
10
// -------------
11
//
12
// This file is not part of the Qt API. This header
13
// file may change from version to version without notice, or even be removed.
14
//
15
// We mean it.
16
//
17
18
#
include
<
QtGui
/
private
/
qtguiglobal_p
.
h
>
19
#
include
"qpixmapcache.h"
20
#
include
"qpaintengine.h"
21
#
include
<
private
/
qimage_p
.
h
>
22
#
include
<
private
/
qpixmap_raster_p
.
h
>
23
#
include
"qcache.h"
24
25
QT_BEGIN_NAMESPACE
26
27
class
QPixmapCache
::
KeyData
28
{
29
public
:
30
KeyData
() :
isValid
(
true
),
key
(0),
ref
(1) {}
31
KeyData
(
const
KeyData &other)
32
:
isValid
(
other
.
isValid
),
key
(
other
.
key
),
ref
(1) {}
33
~
KeyData
() {}
34
35
QString
stringKey
;
36
bool
isValid
;
37
int
key
;
38
int
ref
;
39
};
40
41
// XXX: hw: is this a general concept we need to abstract?
42
class
QPixmapCacheEntry
:
public
QPixmap
43
{
44
public
:
45
QPixmapCacheEntry
(
const
QPixmapCache::Key &key,
const
QPixmap &pix) :
QPixmap
(
pix
),
key
(
key
)
46
{
47
QPlatformPixmap *pd = handle();
48
if
(pd && pd->classId() == QPlatformPixmap::RasterClass) {
49
QRasterPlatformPixmap *d =
static_cast
<QRasterPlatformPixmap*>(pd);
50
if
(!d->image.isNull() && d->image.d->paintEngine
51
&& !d->image.d->paintEngine->isActive())
52
{
53
delete
d->image.d->paintEngine;
54
d->image.d->paintEngine =
nullptr
;
55
}
56
}
57
}
58
~
QPixmapCacheEntry
();
59
QPixmapCache
::
Key
key
;
60
};
61
62
QT_END_NAMESPACE
63
64
#
endif
// QPIXMAPCACHE_P_H
QPMCache
Definition
qpixmapcache.cpp:179
QPMCache::remove
bool remove(const QString &key)
Definition
qpixmapcache.cpp:328
QPMCache::insert
bool insert(const QString &key, const QPixmap &pixmap, int cost)
Definition
qpixmapcache.cpp:299
QPMCache::releaseKey
void releaseKey(const QPixmapCache::Key &key)
Definition
qpixmapcache.cpp:362
QPMCache::clear
void clear()
Definition
qpixmapcache.cpp:378
QPMCache::getKeyData
static QPixmapCache::KeyData * getKeyData(QPixmapCache::Key *key)
Definition
qpixmapcache.cpp:395
QPMCache::~QPMCache
~QPMCache()
Definition
qpixmapcache.cpp:238
QPMCache::flushDetachedPixmaps
bool flushDetachedPixmaps(bool nt)
Definition
qpixmapcache.cpp:258
QPMCache::object
QPixmap * object(const QString &key) const
Definition
qpixmapcache.cpp:282
QPMCache::get
static QPixmapCache::KeyData * get(const QPixmapCache::Key &key)
Definition
qpixmapcache.cpp:199
QPMCache::resizeKeyArray
void resizeKeyArray(int size)
Definition
qpixmapcache.cpp:339
QPMCache::createKey
QPixmapCache::Key createKey()
Definition
qpixmapcache.cpp:350
QPMCache::insert
QPixmapCache::Key insert(const QPixmap &pixmap, int cost)
Definition
qpixmapcache.cpp:314
QPMCache::timerEvent
void timerEvent(QTimerEvent *) override
This event handler can be reimplemented in a subclass to receive timer events for the object.
Definition
qpixmapcache.cpp:270
QPixmapCacheEntry
Definition
qpixmapcache_p.h:43
QPixmapCacheEntry::key
QPixmapCache::Key key
Definition
qpixmapcache_p.h:59
QPixmapCacheEntry::~QPixmapCacheEntry
~QPixmapCacheEntry()
Definition
qpixmapcache.cpp:409
QPixmapCacheEntry::QPixmapCacheEntry
QPixmapCacheEntry(const QPixmapCache::Key &key, const QPixmap &pix)
Definition
qpixmapcache_p.h:45
QPixmapCache::KeyData
Definition
qpixmapcache_p.h:28
QPixmapCache::KeyData::KeyData
KeyData()
Definition
qpixmapcache_p.h:30
QPixmapCache::KeyData::KeyData
KeyData(const KeyData &other)
Definition
qpixmapcache_p.h:31
QPixmapCache::KeyData::key
int key
Definition
qpixmapcache_p.h:37
QPixmapCache::KeyData::ref
int ref
Definition
qpixmapcache_p.h:38
QPixmapCache::KeyData::isValid
bool isValid
Definition
qpixmapcache_p.h:36
QT_BEGIN_NAMESPACE
Combined button and popup list for selecting options.
Definition
qrandomaccessasyncfile_darwin.mm:17
cache_limit_default
static const int cache_limit_default
Definition
qpixmapcache.cpp:61
qt_pixmapcache_thread_test
static bool qt_pixmapcache_thread_test()
Definition
qpixmapcache.cpp:73
cost
static qsizetype cost(const QPixmap &pixmap)
Definition
qpixmapcache.cpp:63
qt_qpixmapcache_qpixmapcache_total_used
Q_AUTOTEST_EXPORT int qt_qpixmapcache_qpixmapcache_total_used()
Definition
qpixmapcache.cpp:596
qt_qpixmapcache_flush_detached_pixmaps
Q_AUTOTEST_EXPORT void qt_qpixmapcache_flush_detached_pixmaps()
Definition
qpixmapcache.cpp:589
qtbase
src
gui
image
qpixmapcache_p.h
Generated on
for Qt by
1.16.1