KGameStandardAction Namespace

Extension for KStandardAction in KDE Games. More...

Header: #include <KGameStandardAction>

Types

enum GameStandardAction { New, Load, LoadRecent, Save, SaveAs, …, ActionNone }

Functions

QAction *carddecks(const QObject *recvr, const char *slot, QObject *parent)
(since 7.3) typename std::enable_if<!std::is_convertible<Func, const char *>::value, QAction>::type *carddecks(const Receiver *recvr, Func slot, QObject *parent)
QAction *clearHighscores(const QObject *recvr, const char *slot, QObject *parent)
(since 7.3) typename std::enable_if<!std::is_convertible<Func, const char *>::value, QAction>::type *clearHighscores(const Receiver *recvr, Func slot, QObject *parent)
QAction *clearStatistics(const QObject *recvr, const char *slot, QObject *parent)
(since 7.3) typename std::enable_if<!std::is_convertible<Func, const char *>::value, QAction>::type *clearStatistics(const Receiver *recvr, Func slot, QObject *parent)
QAction *configureHighscores(const QObject *recvr, const char *slot, QObject *parent)
(since 7.3) typename std::enable_if<!std::is_convertible<Func, const char *>::value, QAction>::type *configureHighscores(const Receiver *recvr, Func slot, QObject *parent)
QAction *create(KGameStandardAction::GameStandardAction id, const QObject *recvr, const char *slot, QObject *parent)
(since 7.3) typename std::enable_if<!std::is_convertible<Func, const char *>::value, QAction>::type *create(KGameStandardAction::GameStandardAction id, const Receiver *recvr, Func slot, QObject *parent)
KToggleAction *demo(const QObject *recvr, const char *slot, QObject *parent)
(since 7.3) typename std::enable_if<!std::is_convertible<Func, const char *>::value, KToggleAction>::type *demo(const Receiver *recvr, Func slot, QObject *parent)
QAction *end(const QObject *recvr, const char *slot, QObject *parent)
(since 7.3) typename std::enable_if<!std::is_convertible<Func, const char *>::value, QAction>::type *end(const Receiver *recvr, Func slot, QObject *parent)
QAction *endTurn(const QObject *recvr, const char *slot, QObject *parent)
(since 7.3) typename std::enable_if<!std::is_convertible<Func, const char *>::value, QAction>::type *endTurn(const Receiver *recvr, Func slot, QObject *parent)
QAction *gameNew(const QObject *recvr, const char *slot, QObject *parent)
(since 7.3) typename std::enable_if<!std::is_convertible<Func, const char *>::value, QAction>::type *gameNew(const Receiver *recvr, Func slot, QObject *parent)
QAction *highscores(const QObject *recvr, const char *slot, QObject *parent)
(since 7.3) typename std::enable_if<!std::is_convertible<Func, const char *>::value, QAction>::type *highscores(const Receiver *recvr, Func slot, QObject *parent)
QAction *hint(const QObject *recvr, const char *slot, QObject *parent)
(since 7.3) typename std::enable_if<!std::is_convertible<Func, const char *>::value, QAction>::type *hint(const Receiver *recvr, Func slot, QObject *parent)
QAction *load(const QObject *recvr, const char *slot, QObject *parent)
(since 7.3) typename std::enable_if<!std::is_convertible<Func, const char *>::value, QAction>::type *load(const Receiver *recvr, Func slot, QObject *parent)
KRecentFilesAction *loadRecent(const QObject *recvr, const char *slot, QObject *parent)
(since 7.3) typename std::enable_if<!std::is_convertible<Func, const char *>::value, KRecentFilesAction>::type *loadRecent(const Receiver *recvr, Func slot, QObject *parent)
QString name(KGameStandardAction::GameStandardAction id)
KToggleAction *pause(const QObject *recvr, const char *slot, QObject *parent)
(since 7.3) typename std::enable_if<!std::is_convertible<Func, const char *>::value, KToggleAction>::type *pause(const Receiver *recvr, Func slot, QObject *parent)
QAction *print(const QObject *recvr, const char *slot, QObject *parent)
(since 7.3) typename std::enable_if<!std::is_convertible<Func, const char *>::value, QAction>::type *print(const Receiver *recvr, Func slot, QObject *parent)
QAction *quit(const QObject *recvr, const char *slot, QObject *parent)
(since 7.3) typename std::enable_if<!std::is_convertible<Func, const char *>::value, QAction>::type *quit(const Receiver *recvr, Func slot, QObject *parent)
QAction *redo(const QObject *recvr, const char *slot, QObject *parent)
(since 7.3) typename std::enable_if<!std::is_convertible<Func, const char *>::value, QAction>::type *redo(const Receiver *recvr, Func slot, QObject *parent)
QAction *repeat(const QObject *recvr, const char *slot, QObject *parent)
(since 7.3) typename std::enable_if<!std::is_convertible<Func, const char *>::value, QAction>::type *repeat(const Receiver *recvr, Func slot, QObject *parent)
QAction *restart(const QObject *recvr, const char *slot, QObject *parent)
(since 7.3) typename std::enable_if<!std::is_convertible<Func, const char *>::value, QAction>::type *restart(const Receiver *recvr, Func slot, QObject *parent)
QAction *roll(const QObject *recvr, const char *slot, QObject *parent)
(since 7.3) typename std::enable_if<!std::is_convertible<Func, const char *>::value, QAction>::type *roll(const Receiver *recvr, Func slot, QObject *parent)
QAction *save(const QObject *recvr, const char *slot, QObject *parent)
(since 7.3) typename std::enable_if<!std::is_convertible<Func, const char *>::value, QAction>::type *save(const Receiver *recvr, Func slot, QObject *parent)
QAction *saveAs(const QObject *recvr, const char *slot, QObject *parent)
(since 7.3) typename std::enable_if<!std::is_convertible<Func, const char *>::value, QAction>::type *saveAs(const Receiver *recvr, Func slot, QObject *parent)
QAction *solve(const QObject *recvr, const char *slot, QObject *parent)
(since 7.3) typename std::enable_if<!std::is_convertible<Func, const char *>::value, QAction>::type *solve(const Receiver *recvr, Func slot, QObject *parent)
QAction *statistics(const QObject *recvr, const char *slot, QObject *parent)
(since 7.3) typename std::enable_if<!std::is_convertible<Func, const char *>::value, QAction>::type *statistics(const Receiver *recvr, Func slot, QObject *parent)
QAction *undo(const QObject *recvr, const char *slot, QObject *parent)
(since 7.3) typename std::enable_if<!std::is_convertible<Func, const char *>::value, QAction>::type *undo(const Receiver *recvr, Func slot, QObject *parent)

Detailed Description

This class is an extension to the usual KStandardAction class which provides easy access to often used KDE actions.

Using these actions helps in maintaining consistency among the games.

Games often use different menu entries than other programs, for example games use the menu "game" instead of "file". This class provides the entries which differ from the usual KStandardAction entries.

See also KStandardAction.

Type Documentation

enum KGameStandardAction::GameStandardAction

The standard menubar and toolbar actions.

ConstantValueDescription
KGameStandardAction::New1Start a new game
KGameStandardAction::Load2Open a saved game
KGameStandardAction::LoadRecent3Open a recently saved game
KGameStandardAction::Save4Save the current game
KGameStandardAction::SaveAs5Save the current game to another file
KGameStandardAction::End6End the current game
KGameStandardAction::Pause7Pause the game
KGameStandardAction::Highscores8Show high scores
KGameStandardAction::Statistics9Show statistics
KGameStandardAction::Print10Print game
KGameStandardAction::Quit11Quit the program
KGameStandardAction::Repeat12Repeat the last move
KGameStandardAction::Undo13Undo the last move
KGameStandardAction::Redo14Redo the latest move
KGameStandardAction::Roll15Roll the dice
KGameStandardAction::EndTurn16End turn
KGameStandardAction::Carddecks17Configure card decks
KGameStandardAction::ConfigureHighscores18Configure high scores
KGameStandardAction::ClearHighscores19Clear high scores
KGameStandardAction::ClearStatistics20Delete all-time statistics
KGameStandardAction::Restart21Restart the game
KGameStandardAction::Hint22Give a hint
KGameStandardAction::Demo23Play a demo
KGameStandardAction::Solve24Solve the game
KGameStandardAction::ActionNone25 

Function Documentation

QAction *KGameStandardAction::carddecks(const QObject *recvr, const char *slot, QObject *parent)

Returns an action to display a configure card decks dialog, connected to the receiver recvr's slot slot, with parent parent.

[since 7.3] template <typename Receiver, typename Func> typename std::enable_if<!std::is_convertible<Func, const char *>::value, QAction>::type *KGameStandardAction::carddecks(const Receiver *recvr, Func slot, QObject *parent)

Returns an action to display a configure card decks dialog, connected to the receiver recvr's slot slot, with parent parent.

This function was introduced in 7.3.

QAction *KGameStandardAction::clearHighscores(const QObject *recvr, const char *slot, QObject *parent)

Returns an action to clear highscores, connected to the receiver recvr's slot slot, with parent parent.

[since 7.3] template <typename Receiver, typename Func> typename std::enable_if<!std::is_convertible<Func, const char *>::value, QAction>::type *KGameStandardAction::clearHighscores(const Receiver *recvr, Func slot, QObject *parent)

Returns an action to clear highscores, connected to the receiver recvr's slot slot, with parent parent.

This function was introduced in 7.3.

QAction *KGameStandardAction::clearStatistics(const QObject *recvr, const char *slot, QObject *parent)

Returns an action to clear statistics, connected to the receiver recvr's slot slot, with parent parent.

[since 7.3] template <typename Receiver, typename Func> typename std::enable_if<!std::is_convertible<Func, const char *>::value, QAction>::type *KGameStandardAction::clearStatistics(const Receiver *recvr, Func slot, QObject *parent)

Returns an action to clear statistics, connected to the receiver recvr's slot slot, with parent parent.

This function was introduced in 7.3.

QAction *KGameStandardAction::configureHighscores(const QObject *recvr, const char *slot, QObject *parent)

Returns an action to display a configure highscores dialog, connected to the receiver recvr's slot slot, with parent parent. Display configure highscores dialog.

[since 7.3] template <typename Receiver, typename Func> typename std::enable_if<!std::is_convertible<Func, const char *>::value, QAction>::type *KGameStandardAction::configureHighscores(const Receiver *recvr, Func slot, QObject *parent)

Returns an action to display a configure highscores dialog, connected to the receiver recvr's slot slot, with parent parent.

This function was introduced in 7.3.

QAction *KGameStandardAction::create(KGameStandardAction::GameStandardAction id, const QObject *recvr, const char *slot, QObject *parent)

Creates an action corresponding to the id in the KStandardAction::StandardAction enum, connected to the receiver recvr's slot slot, with parent parent.

[since 7.3] template <typename Receiver, typename Func> typename std::enable_if<!std::is_convertible<Func, const char *>::value, QAction>::type *KGameStandardAction::create(KGameStandardAction::GameStandardAction id, const Receiver *recvr, Func slot, QObject *parent)

This overloads create() to allow using the new connect syntax.

Creates an action corresponding to the id in the KStandardAction::StandardAction enum, connected to the receiver recvr's slot slot, with parent parent.

Note: If you use LoadRecent as id, you should manually connect to the urlSelected(const QUrl &) signal of the returned KRecentFilesAction instead or use KGameStandardAction::loadRecent(Receiver *, Func, QObject*).

This is an overloaded function.

This function was introduced in 7.3.

KToggleAction *KGameStandardAction::demo(const QObject *recvr, const char *slot, QObject *parent)

Returns an action to show a demo, connected to the receiver recvr's slot slot, with parent parent.

[since 7.3] template <typename Receiver, typename Func> typename std::enable_if<!std::is_convertible<Func, const char *>::value, KToggleAction>::type *KGameStandardAction::demo(const Receiver *recvr, Func slot, QObject *parent)

Returns an action to show a demo, connected to the receiver recvr's slot slot, with parent parent.

This function was introduced in 7.3.

QAction *KGameStandardAction::end(const QObject *recvr, const char *slot, QObject *parent)

Returns an action to end the current game without quitting the program, similar to a "close" entry, connected to the receiver recvr's slot slot, with parent parent.

[since 7.3] template <typename Receiver, typename Func> typename std::enable_if<!std::is_convertible<Func, const char *>::value, QAction>::type *KGameStandardAction::end(const Receiver *recvr, Func slot, QObject *parent)

Returns an action to end the current game without quitting the program, similar to a "close" entry, connected to the receiver recvr's slot slot, with parent parent.

This function was introduced in 7.3.

QAction *KGameStandardAction::endTurn(const QObject *recvr, const char *slot, QObject *parent)

Returns an action to end the current turn (not the game), usually to let the next player start, connected to the receiver recvr's slot slot, with parent parent.

[since 7.3] template <typename Receiver, typename Func> typename std::enable_if<!std::is_convertible<Func, const char *>::value, QAction>::type *KGameStandardAction::endTurn(const Receiver *recvr, Func slot, QObject *parent)

Returns an action to end the current turn (not the game), usually to let the next player start, connected to the receiver recvr's slot slot, with parent parent.

This function was introduced in 7.3.

QAction *KGameStandardAction::gameNew(const QObject *recvr, const char *slot, QObject *parent)

Returns an action to start a new game, connected to the receiver recvr's slot slot, with parent parent.

[since 7.3] template <typename Receiver, typename Func> typename std::enable_if<!std::is_convertible<Func, const char *>::value, QAction>::type *KGameStandardAction::gameNew(const Receiver *recvr, Func slot, QObject *parent)

Returns an action to start a new game, connected to the receiver recvr's slot slot, with parent parent.

This function was introduced in 7.3.

QAction *KGameStandardAction::highscores(const QObject *recvr, const char *slot, QObject *parent)

Returns an action to show the highscores, connected to the receiver recvr's slot slot, with parent parent.

[since 7.3] template <typename Receiver, typename Func> typename std::enable_if<!std::is_convertible<Func, const char *>::value, QAction>::type *KGameStandardAction::highscores(const Receiver *recvr, Func slot, QObject *parent)

Returns an action to show the highscores, connected to the receiver recvr's slot slot, with parent parent.

This function was introduced in 7.3.

QAction *KGameStandardAction::hint(const QObject *recvr, const char *slot, QObject *parent)

Returns an action to give advice or a hint, connected to the receiver recvr's slot slot, with parent parent.

[since 7.3] template <typename Receiver, typename Func> typename std::enable_if<!std::is_convertible<Func, const char *>::value, QAction>::type *KGameStandardAction::hint(const Receiver *recvr, Func slot, QObject *parent)

Returns an action to give advice or a hint, connected to the receiver recvr's slot slot, with parent parent.

This function was introduced in 7.3.

QAction *KGameStandardAction::load(const QObject *recvr, const char *slot, QObject *parent)

Returns an action to load a previously saved game, connected to the receiver recvr's slot slot, with parent parent.

[since 7.3] template <typename Receiver, typename Func> typename std::enable_if<!std::is_convertible<Func, const char *>::value, QAction>::type *KGameStandardAction::load(const Receiver *recvr, Func slot, QObject *parent)

Returns an action to load a previously saved game, connected to the receiver recvr's slot slot, with parent parent.

This function was introduced in 7.3.

KRecentFilesAction *KGameStandardAction::loadRecent(const QObject *recvr, const char *slot, QObject *parent)

Returns an action to load a recently loaded game, connected to the receiver recvr's slot slot, with parent parent. The signature of slot is of the form slotURLSelected(const QUrl&).

[since 7.3] template <typename Receiver, typename Func> typename std::enable_if<!std::is_convertible<Func, const char *>::value, KRecentFilesAction>::type *KGameStandardAction::loadRecent(const Receiver *recvr, Func slot, QObject *parent)

Returns an action to load a recently loaded game, connected to the receiver recvr's slot slot, with parent parent.

This function was introduced in 7.3.

QString KGameStandardAction::name(KGameStandardAction::GameStandardAction id)

Returns the internal name of the given standard action id.

KToggleAction *KGameStandardAction::pause(const QObject *recvr, const char *slot, QObject *parent)

Returns an action to pause the game, connected to the receiver recvr's slot slot, with parent parent.

[since 7.3] template <typename Receiver, typename Func> typename std::enable_if<!std::is_convertible<Func, const char *>::value, KToggleAction>::type *KGameStandardAction::pause(const Receiver *recvr, Func slot, QObject *parent)

Returns an action to pause the game, connected to the receiver recvr's slot slot, with parent parent.

This function was introduced in 7.3.

QAction *KGameStandardAction::print(const QObject *recvr, const char *slot, QObject *parent)

Returns an action to print the current game, not useful in all games, connected to the receiver recvr's slot slot, with parent parent.

Returns an action to print the current game, not useful in all games, connected to the receiver recvr's slot slot, with parent parent.

This function was introduced in 7.3.

QAction *KGameStandardAction::quit(const QObject *recvr, const char *slot, QObject *parent)

Returns an action to quit the game, connected to the receiver recvr's slot slot, with parent parent.

[since 7.3] template <typename Receiver, typename Func> typename std::enable_if<!std::is_convertible<Func, const char *>::value, QAction>::type *KGameStandardAction::quit(const Receiver *recvr, Func slot, QObject *parent)

Returns an action to quit the game, connected to the receiver recvr's slot slot, with parent parent.

This function was introduced in 7.3.

QAction *KGameStandardAction::redo(const QObject *recvr, const char *slot, QObject *parent)

Returns an action to redo the latest move that has been undone, connected to the receiver recvr's slot slot, with parent parent.

[since 7.3] template <typename Receiver, typename Func> typename std::enable_if<!std::is_convertible<Func, const char *>::value, QAction>::type *KGameStandardAction::redo(const Receiver *recvr, Func slot, QObject *parent)

Returns an action to redo the latest move that has been undone, connected to the receiver recvr's slot slot, with parent parent.

This function was introduced in 7.3.

QAction *KGameStandardAction::repeat(const QObject *recvr, const char *slot, QObject *parent)

Returns an action to repeat the last move, connected to the receiver recvr's slot slot, with parent parent.

[since 7.3] template <typename Receiver, typename Func> typename std::enable_if<!std::is_convertible<Func, const char *>::value, QAction>::type *KGameStandardAction::repeat(const Receiver *recvr, Func slot, QObject *parent)

Returns an action to repeat the last move, connected to the receiver recvr's slot slot, with parent parent.

This function was introduced in 7.3.

QAction *KGameStandardAction::restart(const QObject *recvr, const char *slot, QObject *parent)

Returns an action to restart the game, connected to the receiver recvr's slot slot, with parent parent.

[since 7.3] template <typename Receiver, typename Func> typename std::enable_if<!std::is_convertible<Func, const char *>::value, QAction>::type *KGameStandardAction::restart(const Receiver *recvr, Func slot, QObject *parent)

Returns an action to restart the game, connected to the receiver recvr's slot slot, with parent parent.

This function was introduced in 7.3.

QAction *KGameStandardAction::roll(const QObject *recvr, const char *slot, QObject *parent)

Returns an action to roll a die or dice, connected to the receiver recvr's slot slot, with parent parent.

[since 7.3] template <typename Receiver, typename Func> typename std::enable_if<!std::is_convertible<Func, const char *>::value, QAction>::type *KGameStandardAction::roll(const Receiver *recvr, Func slot, QObject *parent)

Returns an action to roll a die or dice, connected to the receiver recvr's slot slot, with parent parent.

This function was introduced in 7.3.

QAction *KGameStandardAction::save(const QObject *recvr, const char *slot, QObject *parent)

Returns an action to save the current game, connected to the receiver recvr's slot slot, with parent parent.

[since 7.3] template <typename Receiver, typename Func> typename std::enable_if<!std::is_convertible<Func, const char *>::value, QAction>::type *KGameStandardAction::save(const Receiver *recvr, Func slot, QObject *parent)

Returns an action to save the current game, connected to the receiver recvr's slot slot, with parent parent.

This function was introduced in 7.3.

QAction *KGameStandardAction::saveAs(const QObject *recvr, const char *slot, QObject *parent)

Returns an action to save the current game under a different filename, connected to the receiver recvr's slot slot, with parent parent.

[since 7.3] template <typename Receiver, typename Func> typename std::enable_if<!std::is_convertible<Func, const char *>::value, QAction>::type *KGameStandardAction::saveAs(const Receiver *recvr, Func slot, QObject *parent)

Returns an action to save the current game under a different filename, connected to the receiver recvr's slot slot, with parent parent.

This function was introduced in 7.3.

QAction *KGameStandardAction::solve(const QObject *recvr, const char *slot, QObject *parent)

Returns an action to solve the game, connected to the receiver recvr's slot slot, with parent parent.

[since 7.3] template <typename Receiver, typename Func> typename std::enable_if<!std::is_convertible<Func, const char *>::value, QAction>::type *KGameStandardAction::solve(const Receiver *recvr, Func slot, QObject *parent)

Returns an action to solve the game, connected to the receiver recvr's slot slot, with parent parent.

This function was introduced in 7.3.

QAction *KGameStandardAction::statistics(const QObject *recvr, const char *slot, QObject *parent)

Returns an action to show the statistics, connected to the receiver recvr's slot slot, with parent parent. Show the statistics.

[since 7.3] template <typename Receiver, typename Func> typename std::enable_if<!std::is_convertible<Func, const char *>::value, QAction>::type *KGameStandardAction::statistics(const Receiver *recvr, Func slot, QObject *parent)

Returns an action to show the statistics, connected to the receiver recvr's slot slot, with parent parent.

This function was introduced in 7.3.

QAction *KGameStandardAction::undo(const QObject *recvr, const char *slot, QObject *parent)

Returns an action to undo the last move, connected to the receiver recvr's slot slot, with parent parent.

[since 7.3] template <typename Receiver, typename Func> typename std::enable_if<!std::is_convertible<Func, const char *>::value, QAction>::type *KGameStandardAction::undo(const Receiver *recvr, Func slot, QObject *parent)

Returns an action to undo the last move, connected to the receiver recvr's slot slot, with parent parent.

This function was introduced in 7.3.