mirror of
https://github.com/AskDavis/Casinotest.git
synced 2026-01-09 06:09:47 -08:00
Adverts widget v0.2 added:
*Querying webAPI for adverts content; *Starting browsers new tab with url specified in json file *Basic QML items and models *Overview tab layout changes *Storing images on harddrive (temporary solution) *Sending queries to webAPI straight from widget (temporary solution) coming next: -store whole json file as url/desription need to be stored for further use -display images of adverts from QImage, not from file stored on harddrive -hide/show adverts button tweaking -proper webAPI base class for querying various servers for data (prypto for instance) *
This commit is contained in:
39
src/qt/qtquick_controls/cpp/qmlimageprovider.cpp
Normal file
39
src/qt/qtquick_controls/cpp/qmlimageprovider.cpp
Normal file
@@ -0,0 +1,39 @@
|
||||
#include "qmlimageprovider.h"
|
||||
|
||||
QmlImageProvider::QmlImageProvider( QQuickItem* a_pParent )
|
||||
: QQuickPaintedItem( a_pParent )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
QmlImageProvider::QmlImageProvider( const QImage& a_rImage, QQuickItem* a_pParent )
|
||||
: QQuickPaintedItem( a_pParent )
|
||||
, m_oImage( a_rImage )
|
||||
{
|
||||
}
|
||||
|
||||
void QmlImageProvider::SetImage( const QImage& a_rImage )
|
||||
{
|
||||
if ( a_rImage != m_oImage )
|
||||
{
|
||||
m_oImage = QImage( a_rImage );
|
||||
emit signalImageChanged();
|
||||
}
|
||||
}
|
||||
|
||||
void QmlImageProvider::paint( QPainter* a_pPainter )
|
||||
{
|
||||
if ( a_pPainter )
|
||||
{
|
||||
a_pPainter->drawImage( QPoint( 0, 0 ), m_oImage );
|
||||
}
|
||||
}
|
||||
|
||||
void QmlImageProvider::paintImage( const QImage& a_rImage, QPainter* a_pPainter )
|
||||
{
|
||||
SetImage( a_rImage );
|
||||
if ( a_pPainter )
|
||||
{
|
||||
a_pPainter->drawImage( QPoint( 0, 0 ), m_oImage );
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user