QElectroTech  0.8-dev
Public Slots | Signals | Public Member Functions | Private Slots | Private Member Functions | Private Attributes | List of all members
RecentFiles Class Reference

#include <recentfiles.h>

Inherits QObject.

Collaboration diagram for RecentFiles:
Collaboration graph

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_
 

Detailed Description

This class provides a way to manage recently opened files.

Constructor & Destructor Documentation

◆ RecentFiles() [1/2]

RecentFiles::RecentFiles ( const QString &  identifier,
int  size = 10,
QObject *  parent = nullptr 
)

Constructeur

Parameters
identifierprefixe a utiliser pour recuperer les fichiers recents dans la configuration de l'application
sizeNombre de fichiers recents a retenir
parentQObject parent
Here is the call graph for this function:

◆ ~RecentFiles()

RecentFiles::~RecentFiles ( )
override

Destructeur

Todo:
determiner s'il faut detruire ou non le menu

◆ RecentFiles() [2/2]

RecentFiles::RecentFiles ( const RecentFiles )
private

Member Function Documentation

◆ buildMenu()

void RecentFiles::buildMenu ( )
private

Construit le menu

Here is the call graph for this function:
Here is the caller graph for this function:

◆ clear

void RecentFiles::clear ( )
slot

Oublie les fichiers recents

Here is the call graph for this function:
Here is the caller graph for this function:

◆ extractFilesFromSettings()

void RecentFiles::extractFilesFromSettings ( )
private

RecentFiles::extractFilesFromSettings Read the list of recent file from settings.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ fileOpeningRequested

void RecentFiles::fileOpeningRequested ( const QString &  )
signal
Here is the caller graph for this function:

◆ fileWasOpened

void RecentFiles::fileWasOpened ( const QString &  filepath)
slot

Gere le fait qu'un fichier ait ete ouvert

Parameters
filepathChemin du fichier ouvert
Here is the call graph for this function:

◆ handleMenuRequest

void RecentFiles::handleMenuRequest ( const QString &  filepath)
privateslot

Gere les actions sur le menu

Here is the caller graph for this function:

◆ iconForFiles()

QIcon RecentFiles::iconForFiles ( ) const
Returns
l'icone affichee a cote de chaque fichier, ou une QIcon nulle si aucune icone n'est utilisee.

◆ insertFile()

void RecentFiles::insertFile ( const QString &  filepath)
private

Insere un fichier dans la liste des fichiers recents

Here is the caller graph for this function:

◆ menu()

QMenu * RecentFiles::menu ( ) const
Returns
un menu listant les derniers fichiers ouverts

◆ save

void RecentFiles::save ( )
slot

Sauvegarde les fichiers recents dans la configuration

Here is the call graph for this function:
Here is the caller graph for this function:

◆ saveFilesToSettings()

void RecentFiles::saveFilesToSettings ( )
private

RecentFiles::saveFilesToSettings Write the list of recent files to settings.

Here is the caller graph for this function:

◆ setIconForFiles()

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.

Parameters
iconIcone a afficher a cote de chaque fichier
Here is the call graph for this function:

◆ size()

int RecentFiles::size ( ) const
Returns
le nombre de fichiers a retenir

Member Data Documentation

◆ files_icon_

QIcon RecentFiles::files_icon_
private

◆ identifier_

QString RecentFiles::identifier_
private

◆ list_

QList<QString> RecentFiles::list_
private

◆ mapper_

QSignalMapper* RecentFiles::mapper_
private

◆ menu_

QMenu* RecentFiles::menu_
private

◆ size_

int RecentFiles::size_
private

The documentation for this class was generated from the following files: