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.
| Constant | Value | Description |
|---|---|---|
KGameStandardAction::New | 1 | Start a new game |
KGameStandardAction::Load | 2 | Open a saved game |
KGameStandardAction::LoadRecent | 3 | Open a recently saved game |
KGameStandardAction::Save | 4 | Save the current game |
KGameStandardAction::SaveAs | 5 | Save the current game to another file |
KGameStandardAction::End | 6 | End the current game |
KGameStandardAction::Pause | 7 | Pause the game |
KGameStandardAction::Highscores | 8 | Show high scores |
KGameStandardAction::Statistics | 9 | Show statistics |
KGameStandardAction::Print | 10 | Print game |
KGameStandardAction::Quit | 11 | Quit the program |
KGameStandardAction::Repeat | 12 | Repeat the last move |
KGameStandardAction::Undo | 13 | Undo the last move |
KGameStandardAction::Redo | 14 | Redo the latest move |
KGameStandardAction::Roll | 15 | Roll the dice |
KGameStandardAction::EndTurn | 16 | End turn |
KGameStandardAction::Carddecks | 17 | Configure card decks |
KGameStandardAction::ConfigureHighscores | 18 | Configure high scores |
KGameStandardAction::ClearHighscores | 19 | Clear high scores |
KGameStandardAction::ClearStatistics | 20 | Delete all-time statistics |
KGameStandardAction::Restart | 21 | Restart the game |
KGameStandardAction::Hint | 22 | Give a hint |
KGameStandardAction::Demo | 23 | Play a demo |
KGameStandardAction::Solve | 24 | Solve the game |
KGameStandardAction::ActionNone | 25 |
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.
[since 7.3] template <typename Receiver, typename Func> typename std::enable_if<!std::is_convertible<Func, const char *>::value, QAction>::type *KGameStandardAction::print(const Receiver *recvr, Func 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.
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.