KMahjonggTileset Class

KMahjonggTileset represents a tileset. More...

Header: #include <KMahjonggTileset>

Public Functions

QString authorEmailAddress() const
QString authorName() const
QString bugReportUrl() const
QString copyrightText() const
QString description() const
short height() const
short levelOffsetX() const
short levelOffsetY() const
QString license() const
bool loadDefault()
bool loadGraphics()
bool loadTileset(const QString &tilesetPath)
QString name() const
QString path() const
QSize preferredTileSize(QSize boardsize, int horizontalCells, int verticalCells) const
short qHeight() const
short qWidth() const
bool reloadTileset(QSize newTilesize)
QPixmap selectedTile(int num) const
QPixmap tileface(int num) const
QPixmap unselectedTile(int num) const
QString version() const
QString website() const
short width() const

Detailed Description

This class contains a tileset and its associated metadata.

Member Function Documentation

QString KMahjonggTileset::authorEmailAddress() const

Returns the email address of the author of this tileset.

QString KMahjonggTileset::authorName() const

Returns the name of the author of this tileset.

QString KMahjonggTileset::bugReportUrl() const

Returns the bug report URL of this tileset.

QString KMahjonggTileset::copyrightText() const

Returns the copyright text of this tileset.

QString KMahjonggTileset::description() const

Returns the description of this tileset.

short KMahjonggTileset::height() const

Returns the height of a tile.

See also reloadTileset, width, and qHeight.

short KMahjonggTileset::levelOffsetX() const

Returns the x offset used for 3D indentation of a tile.

See also levelOffsetY.

short KMahjonggTileset::levelOffsetY() const

Returns the y offset used for 3D indentation of a tile.

See also levelOffsetX.

QString KMahjonggTileset::license() const

Returns the license of this tileset.

bool KMahjonggTileset::loadDefault()

Loads the default tileset, QStandardPaths::GenericDataLocation/kmahjongglib/tilesets/default.desktop, and returns whether it was successful.

bool KMahjonggTileset::loadGraphics()

Loads the graphics from the configured location unless the graphics were already loaded, and returns whether it was successful.

bool KMahjonggTileset::loadTileset(const QString &tilesetPath)

Loads the tileset from the file path tilesetPath, and returns whether it was successful.

QString KMahjonggTileset::name() const

Returns the name of this tileset.

QString KMahjonggTileset::path() const

Returns the file path of this tileset.

QSize KMahjonggTileset::preferredTileSize(QSize boardsize, int horizontalCells, int verticalCells) const

Returns the best size calculated to fit the board with the size boardsize, number of columns horizontalCells, and number of rows verticalCells.

short KMahjonggTileset::qHeight() const

Returns the height of a tile's face / 2.

See also qWidth and height.

short KMahjonggTileset::qWidth() const

Returns the width of a tile's face / 2.

See also qHeight and width.

bool KMahjonggTileset::reloadTileset(QSize newTilesize)

Sets the tile size to newTilesize, and returns whether it was successful.

See also width and height.

QPixmap KMahjonggTileset::selectedTile(int num) const

Returns the selected variant pixmap of the tile with the element ID num scaled according to width and height.

See also unselectedTile and tileface.

QPixmap KMahjonggTileset::tileface(int num) const

Returns the pixmap of the tile face with the element ID num scaled according to the config's face width and height times the ratio of width / height.

See also selectedTile and unselectedTile.

QPixmap KMahjonggTileset::unselectedTile(int num) const

Returns the unselected variant pixmap of the tile with the element ID num scaled according to width and height.

See also selectedTile and tileface.

QString KMahjonggTileset::version() const

Returns the version string of this tileset.

QString KMahjonggTileset::website() const

Returns the website of this tileset.

short KMahjonggTileset::width() const

Returns the width of a tile.

See also reloadTileset, height, and qWidth.