|
Krita Source Code Documentation
|
Recent files action. More...
#include <krecentfilesaction.h>
Inheritance diagram for KRecentFilesAction:Signals | |
| void | urlSelected (const QUrl &url) |
Public Member Functions | |
| void | addAction (QAction *action, const QUrl &url, const QString &name) |
| KRecentFilesAction (const QIcon &icon, const QString &text, QObject *parent) | |
| KRecentFilesAction (const QString &text, QObject *parent) | |
| KRecentFilesAction (QObject *parent) | |
| QAction * | removeAction (QAction *action) override |
| void | setRecentFilesModel (const QStandardItemModel *model) |
| ~KRecentFilesAction () override | |
Private Slots | |
| virtual void | clearActionTriggered () |
| void | fileAdded (const QUrl &url) |
| void | fileRemoved (const QUrl &url) |
| void | listRenewed () |
| void | menuAboutToShow () |
| void | modelItemChanged (QStandardItem *item) |
| void | modelRowsInserted (const QModelIndex &parent, int first, int last) |
Private Member Functions | |
| void | clearEntries () |
| Q_PRIVATE_SLOT (d_func(), void _k_urlSelected(QAction *)) void rebuildEntries() | |
Private Attributes | |
| KRecentFilesActionPrivate * | d_ptr |
Recent files action.
This class is an action to handle a recent files submenu. The best way to create the action is to use KStandardAction::openRecent. Then you simply need to call loadEntries on startup, saveEntries on shutdown, addURL when your application loads/saves a file.
Definition at line 40 of file krecentfilesaction.h.
|
explicit |
Constructs an action with the specified parent.
| parent | The parent of this action. |
Definition at line 53 of file krecentfilesaction.cpp.
| KRecentFilesAction::KRecentFilesAction | ( | const QString & | text, |
| QObject * | parent ) |
Constructs an action with text; a shortcut may be specified by the ampersand character (e.g. "&Option" creates a shortcut with key O )
This is the most common KAction used when you do not have a corresponding icon (note that it won't appear in the current version of the "Edit ToolBar" dialog, because an action needs an icon to be plugged in a toolbar...).
| text | The text that will be displayed. |
| parent | The parent of this action. |
Definition at line 61 of file krecentfilesaction.cpp.
| KRecentFilesAction::KRecentFilesAction | ( | const QIcon & | icon, |
| const QString & | text, | ||
| QObject * | parent ) |
Constructs an action with text and an icon; a shortcut may be specified by the ampersand character (e.g. "&Option" creates a shortcut with key O )
This is the other common KAction used. Use it when you do have a corresponding icon.
| icon | The icon to display. |
| text | The text that will be displayed. |
| parent | The parent of this action. |
Definition at line 72 of file krecentfilesaction.cpp.
|
override |
| void KRecentFilesAction::addAction | ( | QAction * | action, |
| const QUrl & | url, | ||
| const QString & | name ) |
Adds action to the list of URLs, with url and title name.
Do not use addAction(QAction*), as no url will be associated, and consequently urlSelected() will not be emitted when action is selected.
Definition at line 198 of file krecentfilesaction.cpp.
References value().
|
privatevirtualslot |
Clears the recent files list. Note that there is also an action shown to the user for clearing the list.
Definition at line 262 of file krecentfilesaction.cpp.
References KisRecentFilesManager::clear(), and KisRecentFilesManager::instance().
|
private |
Definition at line 267 of file krecentfilesaction.cpp.
|
privateslot |
Definition at line 317 of file krecentfilesaction.cpp.
References addAction(), removeAction(), and titleWithSensibleWidth().
|
privateslot |
Definition at line 351 of file krecentfilesaction.cpp.
References removeAction().
|
privateslot |
Definition at line 362 of file krecentfilesaction.cpp.
|
privateslot |
Definition at line 244 of file krecentfilesaction.cpp.
References connect(), modelItemChanged(), and modelRowsInserted().
|
privateslot |
Definition at line 230 of file krecentfilesaction.cpp.
|
privateslot |
Definition at line 236 of file krecentfilesaction.cpp.
|
private |
|
override |
Reimplemented for internal reasons.
Definition at line 206 of file krecentfilesaction.cpp.
| void KRecentFilesAction::setRecentFilesModel | ( | const QStandardItemModel * | model | ) |
Definition at line 216 of file krecentfilesaction.cpp.
|
signal |
This signal gets emitted when the user selects a URL.
| url | The URL that the user selected. |
|
private |
Definition at line 123 of file krecentfilesaction.h.