mirror of
https://github.com/AskDavis/Casinotest.git
synced 2026-01-03 12:29:46 -08:00
35 lines
801 B
C++
35 lines
801 B
C++
#include "qmlimageprovider.h"
|
|
|
|
#include <QDebug>
|
|
|
|
QmlImageProvider::QmlImageProvider()
|
|
: QQuickImageProvider( QQuickImageProvider::Image )
|
|
{
|
|
}
|
|
|
|
void QmlImageProvider::AddToImagePool( QString a_strImageID, const QImage& a_rImage )
|
|
{
|
|
m_aImagePool.insert( a_strImageID, a_rImage );
|
|
}
|
|
|
|
void QmlImageProvider::AddToImagePool( const QMap<QString, QImage>& a_aImages )
|
|
{
|
|
QMapIterator<QString,QImage> iter( a_aImages );
|
|
while( iter.hasNext() )
|
|
{
|
|
iter.next();
|
|
AddToImagePool( iter.key(), iter.value() );
|
|
}
|
|
}
|
|
|
|
QImage QmlImageProvider::requestImage( const QString& a_rImageID, QSize* a_pSize, const QSize& a_ra_rRequestedSize )
|
|
{
|
|
QImage oImage( m_aImagePool.value( a_rImageID ) );
|
|
if ( a_pSize )
|
|
{
|
|
a_pSize->setWidth( oImage.width() );
|
|
a_pSize->setHeight( oImage.height() );
|
|
}
|
|
return oImage;
|
|
}
|