Qt
6.x
The Qt SDK
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
4
#ifndef QPIXMAPCACHE_P_H
5
#define QPIXMAPCACHE_P_H
6
7
//
8
// W A R N I N G
9
// -------------
10
//
11
// This file is not part of the Qt API. This header
12
// file may change from version to version without notice, or even be removed.
13
//
14
// We mean it.
15
//
16
17
#include <QtGui/private/qtguiglobal_p.h>
18
#include "
qpixmapcache.h
"
19
#include "
qpaintengine.h
"
20
#include <private/qimage_p.h>
21
#include <private/qpixmap_raster_p.h>
22
#include "
qcache.h
"
23
24
QT_BEGIN_NAMESPACE
25
26
class
QPixmapCache::KeyData
27
{
28
public
:
29
KeyData
() :
isValid
(true),
key
(0),
ref
(1) {}
30
KeyData
(
const
KeyData
&
other
)
31
:
isValid
(
other
.
isValid
),
key
(
other
.
key
),
ref
(1) {}
32
~KeyData
() {}
33
34
QString
stringKey
;
35
bool
isValid
;
36
int
key
;
37
int
ref
;
38
};
39
40
// XXX: hw: is this a general concept we need to abstract?
41
class
QPixmapCacheEntry
:
public
QPixmap
42
{
43
public
:
44
QPixmapCacheEntry
(
const
QPixmapCache::Key
&
key
,
const
QPixmap
&
pix
) :
QPixmap
(
pix
),
key
(
key
)
45
{
46
QPlatformPixmap
*pd =
handle
();
47
if
(pd && pd->
classId
() ==
QPlatformPixmap::RasterClass
) {
48
QRasterPlatformPixmap
*
d
=
static_cast<
QRasterPlatformPixmap
*
>
(pd);
49
if
(!
d
->image.isNull() &&
d
->image.d->paintEngine
50
&& !
d
->image.d->paintEngine->isActive())
51
{
52
delete
d
->image.d->paintEngine;
53
d
->image.d->paintEngine =
nullptr
;
54
}
55
}
56
}
57
~QPixmapCacheEntry
();
58
QPixmapCache::Key
key
;
59
};
60
61
QT_END_NAMESPACE
62
63
#endif
// QPIXMAPCACHE_P_H
QPixmapCacheEntry
Definition
qpixmapcache_p.h:42
QPixmapCacheEntry::key
QPixmapCache::Key key
Definition
qpixmapcache_p.h:58
QPixmapCacheEntry::~QPixmapCacheEntry
~QPixmapCacheEntry()
Definition
qpixmapcache.cpp:414
QPixmapCacheEntry::QPixmapCacheEntry
QPixmapCacheEntry(const QPixmapCache::Key &key, const QPixmap &pix)
Definition
qpixmapcache_p.h:44
QPixmapCache::KeyData
Definition
qpixmapcache_p.h:27
QPixmapCache::KeyData::KeyData
KeyData()
Definition
qpixmapcache_p.h:29
QPixmapCache::KeyData::KeyData
KeyData(const KeyData &other)
Definition
qpixmapcache_p.h:30
QPixmapCache::KeyData::key
int key
Definition
qpixmapcache_p.h:36
QPixmapCache::KeyData::ref
int ref
Definition
qpixmapcache_p.h:37
QPixmapCache::KeyData::isValid
bool isValid
Definition
qpixmapcache_p.h:35
QPixmapCache::KeyData::stringKey
QString stringKey
Definition
qpixmapcache_p.h:34
QPixmapCache::KeyData::~KeyData
~KeyData()
Definition
qpixmapcache_p.h:32
QPixmapCache::Key
The QPixmapCache::Key class can be used for efficient access to the QPixmapCache.
Definition
qpixmapcache.h:18
QPixmap
Returns a copy of the pixmap that is transformed using the given transformation transform and transfo...
Definition
qpixmap.h:27
QPixmap::handle
QPlatformPixmap * handle() const
Definition
qpixmap.cpp:1514
QPlatformPixmap
The QPlatformPixmap class provides an abstraction for native pixmaps.
Definition
qplatformpixmap.h:26
QPlatformPixmap::RasterClass
@ RasterClass
Definition
qplatformpixmap.h:34
QPlatformPixmap::classId
ClassId classId() const
Definition
qplatformpixmap.h:80
QRasterPlatformPixmap
Definition
qpixmap_raster_p.h:25
QString
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition
qstring.h:127
pix
QPixmap pix
Definition
doc_src_styles.cpp:78
QT_BEGIN_NAMESPACE
Combined button and popup list for selecting options.
Definition
qstandardpaths_haiku.cpp:21
QT_END_NAMESPACE
Definition
qsharedpointer.cpp:1545
qcache.h
key
GLuint64 key
Definition
qopengles2ext.h:2268
ref
GLint ref
Definition
qopengles2ext.h:3180
qpaintengine.h
qpixmapcache.h
d
double d
Definition
src_corelib_text_qlocale.cpp:9
other
QSharedPointer< T > other(t)
[5]
qtbase
src
gui
image
qpixmapcache_p.h
Generated by
1.9.7