Search for usage in LXR

KGameTheme Class Reference

#include <KGameTheme>

Public Member Functions

 KGameTheme (const QString &themeGroup=QStringLiteral("KGameTheme"))
QString fileName () const
virtual QString graphics () const
virtual bool load (const QString &file)
virtual bool loadDefault ()
QString path () const
QString prefix () const
QPixmap preview () const
QString property (const QString &key) const
virtual QString themeProperty (const QString &key) const

Detailed Description

Class for loading theme files.

Essentially just a wrapper around a .desktop theme file. Load a file with load() and then access its properties.

For more advanced features like dynamic themes or custom game rules, it will likely be necessary to derive from this class

Mauricio Piacentini
Since 4.9, use KgTheme instead.

Definition at line 40 of file kgametheme.h.

Member Function Documentation

◆ fileName()

QString KGameTheme::fileName ( ) const
just the "*.desktop" part

Definition at line 151 of file kgametheme.cpp.

◆ graphics()

QString KGameTheme::graphics ( ) const
the full path of the svg file which is specified in "FileName" key

Definition at line 160 of file kgametheme.cpp.

◆ load()

bool KGameTheme::load ( const QString file)

Load a specific theme file.

Note that although theme could be successfully loaded, no check on the validity of theme's SVG file contents is done. Application writers will need to perform this check manually e.g. by calling QSvgRenderer::isValid()

filethe name of the theme file relative to the share/apps/appname directory. e.g. "themes/classic.desktop"
true if the theme files and properties could be loaded

Definition at line 60 of file kgametheme.cpp.

◆ loadDefault()

bool KGameTheme::loadDefault ( )

Load the default theme file.

Called "default.desktop"

true if the theme files and properties could be loaded

Definition at line 52 of file kgametheme.cpp.

◆ path()

QString KGameTheme::path ( ) const
the full path of the .desktop file

Definition at line 133 of file kgametheme.cpp.

◆ prefix()

QString KGameTheme::prefix ( ) const
the path of the theme

Definition at line 142 of file kgametheme.cpp.

◆ preview()

QPixmap KGameTheme::preview ( ) const
a preview pixmap

Definition at line 169 of file kgametheme.cpp.

◆ property()

QString KGameTheme::property ( const QString key) const
a property directly from the .desktop file

Definition at line 122 of file kgametheme.cpp.

◆ themeProperty()

QString KGameTheme::themeProperty ( const QString key) const

Possible keys:

  • Name
  • Author
  • Description
  • AuthorEmail
    keythe key of the wanted property
    the data related to 'key'

Definition at line 178 of file kgametheme.cpp.

The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Sun Dec 4 2022 03:50:22 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.