Qt 4.8
Public Functions | Public Variables | List of all members
QDeclarativePixmapData Class Reference

Public Functions

void addref ()
 
void addToCache ()
 
int cost () const
 
 QDeclarativePixmapData (const QUrl &u, const QSize &s, const QString &e)
 
 QDeclarativePixmapData (const QUrl &u, const QSize &r)
 
 QDeclarativePixmapData (const QUrl &u, const QPixmap &p, const QSize &s, const QSize &r)
 
 QDeclarativePixmapData (const QPixmap &p)
 
void release ()
 
void removeFromCache ()
 

Public Variables

QString errorString
 
QSize implicitSize
 
bool inCache:1
 
QDeclarativePixmapDatanextUnreferenced
 
QPixmap pixmap
 
QDeclarativePixmap::Status pixmapStatus
 
QDeclarativePixmapDataprevUnreferenced
 
QDeclarativePixmapData ** prevUnreferencedPtr
 
bool privatePixmap:1
 
uint refCount
 
QDeclarativePixmapReplyreply
 
QSize requestSize
 
QUrl url
 

Detailed Description

Definition at line 185 of file qdeclarativepixmapcache.cpp.

Constructors and Destructors

◆ QDeclarativePixmapData() [1/4]

QDeclarativePixmapData::QDeclarativePixmapData ( const QUrl u,
const QSize s,
const QString e 
)
inline

◆ QDeclarativePixmapData() [2/4]

QDeclarativePixmapData::QDeclarativePixmapData ( const QUrl u,
const QSize r 
)
inline

◆ QDeclarativePixmapData() [3/4]

QDeclarativePixmapData::QDeclarativePixmapData ( const QUrl u,
const QPixmap p,
const QSize s,
const QSize r 
)
inline

Definition at line 202 of file qdeclarativepixmapcache.cpp.

204  url(u), pixmap(p), implicitSize(s), requestSize(r), reply(0), prevUnreferenced(0),
206  {
207  }
QDeclarativePixmapReply * reply
QDeclarativePixmapData * nextUnreferenced
QDeclarativePixmapData * prevUnreferenced
QDeclarativePixmapData ** prevUnreferencedPtr
QDeclarativePixmap::Status pixmapStatus

◆ QDeclarativePixmapData() [4/4]

QDeclarativePixmapData::QDeclarativePixmapData ( const QPixmap p)
inline

Definition at line 209 of file qdeclarativepixmapcache.cpp.

213  {
214  }
QSize size() const
Returns the size of the pixmap.
Definition: qpixmap.cpp:661
QDeclarativePixmapReply * reply
QDeclarativePixmapData * nextUnreferenced
QDeclarativePixmapData * prevUnreferenced
QDeclarativePixmapData ** prevUnreferencedPtr
QDeclarativePixmap::Status pixmapStatus

Functions

◆ addref()

void QDeclarativePixmapData::addref ( )

Definition at line 759 of file qdeclarativepixmapcache.cpp.

Referenced by QDeclarativePixmap::load().

760 {
761  ++refCount;
762  if (prevUnreferencedPtr)
763  pixmapStore()->referencePixmap(this);
764 }
QDeclarativePixmapData ** prevUnreferencedPtr

◆ addToCache()

void QDeclarativePixmapData::addToCache ( )

Definition at line 792 of file qdeclarativepixmapcache.cpp.

Referenced by QDeclarativePixmap::load().

793 {
794  if (!inCache) {
796  pixmapStore()->m_cache.insert(key, this);
797  inCache = true;
798  }
799 }
int key

◆ cost()

int QDeclarativePixmapData::cost ( ) const

Definition at line 754 of file qdeclarativepixmapcache.cpp.

Referenced by QDeclarativePixmapStore::referencePixmap(), QDeclarativePixmapStore::shrinkCache(), and QDeclarativePixmapStore::unreferencePixmap().

755 {
756  return (pixmap.width() * pixmap.height() * pixmap.depth()) / 8;
757 }
int width() const
Returns the width of the pixmap.
Definition: qpixmap.cpp:630
int depth() const
Returns the depth of the pixmap.
Definition: qpixmap.cpp:695
int height() const
Returns the height of the pixmap.
Definition: qpixmap.cpp:645

◆ release()

void QDeclarativePixmapData::release ( )

Definition at line 766 of file qdeclarativepixmapcache.cpp.

Referenced by QDeclarativePixmap::clear(), QDeclarativePixmap::load(), and QDeclarativePixmap::~QDeclarativePixmap().

767 {
768  Q_ASSERT(refCount > 0);
769  --refCount;
770 
771  if (refCount == 0) {
772  if (reply) {
773  QDeclarativePixmapReply *cancelReply = reply;
774  reply->data = 0;
775  reply = 0;
778  if (reader)
779  reader->cancel(cancelReply);
781  }
782 
784  pixmapStore()->unreferencePixmap(this);
785  } else {
786  removeFromCache();
787  delete this;
788  }
789  }
790 }
QDeclarativePixmapData * data
void lock()
Locks the mutex.
Definition: qmutex.cpp:151
void cancel(QDeclarativePixmapReply *rep)
#define Q_ASSERT(cond)
Definition: qglobal.h:1823
QDeclarativeEngine * engineForReader
QDeclarativePixmapReply * reply
void unlock()
Unlocks the mutex.
Definition: qmutex.cpp:296
QDeclarativePixmap::Status pixmapStatus
static QDeclarativePixmapReader * existingInstance(QDeclarativeEngine *engine)

◆ removeFromCache()

void QDeclarativePixmapData::removeFromCache ( )

Properties

◆ errorString

QString QDeclarativePixmapData::errorString

◆ implicitSize

QSize QDeclarativePixmapData::implicitSize

◆ inCache

bool QDeclarativePixmapData::inCache

Definition at line 224 of file qdeclarativepixmapcache.cpp.

◆ nextUnreferenced

QDeclarativePixmapData* QDeclarativePixmapData::nextUnreferenced

◆ pixmap

QPixmap QDeclarativePixmapData::pixmap

◆ pixmapStatus

QDeclarativePixmap::Status QDeclarativePixmapData::pixmapStatus

◆ prevUnreferenced

QDeclarativePixmapData* QDeclarativePixmapData::prevUnreferenced

◆ prevUnreferencedPtr

QDeclarativePixmapData** QDeclarativePixmapData::prevUnreferencedPtr

◆ privatePixmap

bool QDeclarativePixmapData::privatePixmap

Definition at line 225 of file qdeclarativepixmapcache.cpp.

◆ refCount

uint QDeclarativePixmapData::refCount

Definition at line 222 of file qdeclarativepixmapcache.cpp.

◆ reply

QDeclarativePixmapReply* QDeclarativePixmapData::reply

◆ requestSize

QSize QDeclarativePixmapData::requestSize

Definition at line 232 of file qdeclarativepixmapcache.cpp.

Referenced by QDeclarativePixmap::requestSize().

◆ url

QUrl QDeclarativePixmapData::url

Definition at line 228 of file qdeclarativepixmapcache.cpp.

Referenced by QDeclarativePixmap::url().


The documentation for this class was generated from the following file: