• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdegames API Reference
  • KDE Home
  • Contact Us
 

libkdegames

Public Member Functions | List of all members
KgImageProvider Class Reference

#include <kgimageprovider_p.h>

Inheritance diagram for KgImageProvider:
Inheritance graph
[legend]

Public Member Functions

 KgImageProvider (KgThemeProvider *provider)
 
QImage requestImage (const QString &source, QSize *size, const QSize &requestedSize)
 
- Public Member Functions inherited from QDeclarativeImageProvider
 QDeclarativeImageProvider (ImageType type)
 
virtual  ~QDeclarativeImageProvider ()
 
ImageType imageType () const
 
virtual QPixmap requestPixmap (const QString &id, QSize *size, const QSize &requestedSize)
 

Detailed Description

A QDeclarativeImageProvider that renders requested sprites and returns corresponding pixmap to the QML view.

Since
4.11 This class is a QDeclarativeImageProvider that takes a KgThemeProvider in its constructor and uses it to get full path to SVGs. These theme SVGs are read and requested sprite pixmap is extracted and given to the QML image element that requests it.

For porting KDE games to QML, there is a KgItem QML component provided by KgCore QML plugin which is a small wrapper to request pixmaps from this KgImageProvider. See KgItem's documentation for details.

Definition at line 42 of file kgimageprovider_p.h.

Constructor & Destructor Documentation

KgImageProvider::KgImageProvider ( KgThemeProvider *  provider)

Construcs a new KgImageProvider with the supplied KgThemeProvider.

Parameters
providerThe KgThemeProvider used to discover the game's themes.

Definition at line 24 of file kgimageprovider.cpp.

Member Function Documentation

QImage KgImageProvider::requestImage ( const QString &  source,
QSize *  size,
const QSize &  requestedSize 
)
virtual

Reimplemented method that is called when a sprite pixmap is requested.

Reimplemented from QDeclarativeImageProvider.

Definition at line 37 of file kgimageprovider.cpp.


The documentation for this class was generated from the following files:
  • kgimageprovider_p.h
  • kgimageprovider.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:18:42 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

libkdegames

Skip menu "libkdegames"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members

kdegames API Reference

Skip menu "kdegames API Reference"
  • granatier
  • kapman
  • kblackbox
  • kgoldrunner
  • kigo
  • kmahjongg
  • KShisen
  • ksquares
  • libkdegames
  •   highscore
  •   libkdegamesprivate
  •     kgame
  • libkmahjongg
  • palapeli
  •   libpala

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal