QElectroTech
0.70
|
#include <recentfiles.h>
Public Slots | |
void | clear () |
void | save () |
void | fileWasOpened (const QString &) |
Signals | |
void | fileOpeningRequested (const QString &) |
Public Member Functions | |
RecentFiles (const QString &, int=10, QObject *=nullptr) | |
~RecentFiles () override | |
int | size () const |
QMenu * | menu () const |
QIcon | iconForFiles () const |
void | setIconForFiles (const QIcon &) |
Private Slots | |
void | handleMenuRequest (const QString &) |
Private Member Functions | |
RecentFiles (const RecentFiles &) | |
void | extractFilesFromSettings () |
RecentFiles::extractFilesFromSettings Read the list of recent file from settings. More... | |
void | insertFile (const QString &) |
void | saveFilesToSettings () |
RecentFiles::saveFilesToSettings Write the list of recent files to settings. More... | |
void | buildMenu () |
Private Attributes | |
QString | identifier_ |
int | size_ |
QList< QString > | list_ |
QMenu * | menu_ |
QSignalMapper * | mapper_ |
QIcon | files_icon_ |
This class provides a way to manage recently opened files.
Definition at line 26 of file recentfiles.h.
RecentFiles::RecentFiles | ( | const QString & | identifier, |
int | size = 10 , |
||
QObject * | parent = nullptr |
||
) |
Constructeur
identifier | prefixe a utiliser pour recuperer les fichiers recents dans la configuration de l'application |
size | Nombre de fichiers recents a retenir |
parent | QObject parent |
Definition at line 29 of file recentfiles.cpp.
References buildMenu(), extractFilesFromSettings(), handleMenuRequest(), and mapper_.
|
override |
|
private |
|
private |
Construit le menu
Definition at line 167 of file recentfiles.cpp.
References clear(), files_icon_, list_, mapper_, and menu_.
Referenced by clear(), fileWasOpened(), RecentFiles(), and setIconForFiles().
|
slot |
Oublie les fichiers recents
Definition at line 85 of file recentfiles.cpp.
References buildMenu(), and list_.
Referenced by buildMenu().
|
private |
RecentFiles::extractFilesFromSettings Read the list of recent file from settings.
Definition at line 117 of file recentfiles.cpp.
References identifier_, insertFile(), list_, and size_.
Referenced by RecentFiles().
|
signal |
Referenced by handleMenuRequest().
|
slot |
Gere le fait qu'un fichier ait ete ouvert
filepath | Chemin du fichier ouvert |
Definition at line 108 of file recentfiles.cpp.
References buildMenu(), and insertFile().
|
privateslot |
Gere les actions sur le menu
Definition at line 100 of file recentfiles.cpp.
References fileOpeningRequested().
Referenced by RecentFiles().
QIcon RecentFiles::iconForFiles | ( | ) | const |
Definition at line 68 of file recentfiles.cpp.
References files_icon_.
|
private |
Insere un fichier dans la liste des fichiers recents
Definition at line 135 of file recentfiles.cpp.
Referenced by extractFilesFromSettings(), and fileWasOpened().
QMenu * RecentFiles::menu | ( | ) | const |
Definition at line 60 of file recentfiles.cpp.
References menu_.
|
slot |
Sauvegarde les fichiers recents dans la configuration
Definition at line 93 of file recentfiles.cpp.
References saveFilesToSettings().
Referenced by QETApp::~QETApp().
|
private |
RecentFiles::saveFilesToSettings Write the list of recent files to settings.
Definition at line 154 of file recentfiles.cpp.
References identifier_, list_, and size_.
Referenced by save().
void RecentFiles::setIconForFiles | ( | const QIcon & | icon | ) |
Definit l'icone a afficher a cote de chaque fichier. Si une QIcon nulle est fournie, aucune icone n'est utilisee.
icon | Icone a afficher a cote de chaque fichier |
Definition at line 77 of file recentfiles.cpp.
References buildMenu(), and files_icon_.
int RecentFiles::size | ( | ) | const |
Definition at line 53 of file recentfiles.cpp.
References size_.
|
private |
Definition at line 67 of file recentfiles.h.
Referenced by buildMenu(), iconForFiles(), and setIconForFiles().
|
private |
Definition at line 62 of file recentfiles.h.
Referenced by extractFilesFromSettings(), and saveFilesToSettings().
|
private |
Definition at line 64 of file recentfiles.h.
Referenced by buildMenu(), clear(), extractFilesFromSettings(), insertFile(), and saveFilesToSettings().
|
private |
Definition at line 66 of file recentfiles.h.
Referenced by buildMenu(), and RecentFiles().
|
private |
Definition at line 65 of file recentfiles.h.
Referenced by buildMenu(), menu(), and ~RecentFiles().
|
private |
Definition at line 63 of file recentfiles.h.
Referenced by extractFilesFromSettings(), insertFile(), saveFilesToSettings(), and size().