Menu-item based view for a RecentFilesModel.
More...
#include <Workspace/Presentation/recentfilesmenuview.h>
Inherits QObject.
Presents the list of files as selectable menu items under a parent menu. Other menu items can also exist in the same menu - the view will make sure to track items it creates and where they are in the menu.
- See also
- RecentFilesModel
◆ RecentFilesMenuView()
- Parameters
-
parent | The menu into which the recent files menu items are to be inserted. |
before | The existing action in the menu parent before which all items are to be inserted. If 0 is specified, actions will be appended to the menu. |
◆ ~RecentFilesMenuView()
◆ fileSelected
void fileSelected |
( |
QString |
fileName | ) |
|
|
signal |
◆ selectFile
bool selectFile |
( |
int |
index | ) |
|
|
slot |
- Parameters
-
index | Index of the file to select in the recent files list. |
- Returns
- True if index was within range of recent files, false otherwise.
If successful, emits the signal fileSelected with the filename at the given index in the recent files list.
◆ selectMostRecentFile
bool selectMostRecentFile |
( |
| ) |
|
|
slot |
- Returns
- True if at least one recent file exists, false otherwise.
If successful, emits the signal fileSelected with the first filename listed in the recent files list.
◆ setModel()
- Parameters
-
model | The model that this view is to observe and reflect its contents. An empty model can be assigned - this will result in the view being cleared. |
Sets the model used by the view. This will result in the views contents being reconstructed to match the model.