QElectroTech 0.100.0-dev
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
ElementDialog Class Reference

#include <elementdialog.h>

Inherits QDialog.

Collaboration diagram for ElementDialog:
Collaboration graph

Public Member Functions

 ElementDialog (uint=ElementDialog::OpenElement, QWidget *parent=nullptr)
 ElementDialog::ElementDialog.
 
ElementsLocation location () const
 ElementDialog::location.
 

Static Public Member Functions

static ElementsLocation getOpenElementLocation (QWidget *parent=nullptr)
 ElementDialog::getOpenElementLocation Display a dialog for open an element through her location.
 
static ElementsLocation getSaveElementLocation (QWidget *parent=nullptr)
 ElementDialog::getSaveElementLocation Display a dialog that allow to user to select an element (existing or not) who he want to save.
 

Private Types

enum  { OpenElement = 0 , SaveElement = 1 , OpenCategory = 2 , SaveCategory = 3 }
 

Private Member Functions

 ElementDialog (const ElementDialog &)
 
void setUpWidget ()
 ElementDialog::setUpWidget Build and setup the widgets of this dialog.
 
void setUpConnection ()
 ElementDialog::setUpConnection Setup connection of this dialog.
 
void indexClicked (const QModelIndex &index)
 ElementDialog::indexClicked.
 
void updateWidget ()
 
void checkCurrentLocation ()
 ElementDialog::checkCurrentLocation Update this dialog according to the current selected location and the current mode.
 
void checkAccept ()
 

Static Private Member Functions

static ElementsLocation execConfiguredDialog (int, QWidget *parent=nullptr)
 ElementDialog::execConfiguredDialog launch a dialog with the chosen mode.
 

Private Attributes

uint m_mode
 
ElementsLocation m_location
 
QDialogButtonBox * m_buttons_box = nullptr
 
QFileNameEditm_text_field = nullptr
 
QTreeView * m_tree_view = nullptr
 
ElementsCollectionModelm_model = nullptr
 

Detailed Description

This class provides several dialogs to select an element or a category (e.g. new or existing, for opening or for saving...).

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
private

This enum represents the available configurations for the required dialog

Enumerator
OpenElement 

The dialog should open an element.

SaveElement 

The dialog should select an element for saving.

OpenCategory 

The dialog should open a category.

SaveCategory 

The dialog should select a category for saving.

Constructor & Destructor Documentation

◆ ElementDialog() [1/2]

ElementDialog::ElementDialog ( uint  mode = ElementDialog::OpenElement,
QWidget *  parent = nullptr 
)

ElementDialog::ElementDialog.

Parameters
mode
parent
Here is the call graph for this function:

◆ ElementDialog() [2/2]

ElementDialog::ElementDialog ( const ElementDialog )
private

Member Function Documentation

◆ checkAccept()

void ElementDialog::checkAccept ( )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ checkCurrentLocation()

void ElementDialog::checkCurrentLocation ( )
private

ElementDialog::checkCurrentLocation Update this dialog according to the current selected location and the current mode.

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

◆ execConfiguredDialog()

ElementsLocation ElementDialog::execConfiguredDialog ( int  mode,
QWidget *  parentWidget = nullptr 
)
staticprivate

ElementDialog::execConfiguredDialog launch a dialog with the chosen mode.

Parameters
mode: mode of the dialog
parentWidget: parent widget of the dialog
Returns
the chosen location
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getOpenElementLocation()

ElementsLocation ElementDialog::getOpenElementLocation ( QWidget *  parentWidget = nullptr)
static

ElementDialog::getOpenElementLocation Display a dialog for open an element through her location.

Parameters
parentWidget
Returns
The location of the selected element
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getSaveElementLocation()

ElementsLocation ElementDialog::getSaveElementLocation ( QWidget *  parentWidget = nullptr)
static

ElementDialog::getSaveElementLocation Display a dialog that allow to user to select an element (existing or not) who he want to save.

Parameters
parentWidget
Returns
The location where the element must be save
Here is the call graph for this function:
Here is the caller graph for this function:

◆ indexClicked()

void ElementDialog::indexClicked ( const QModelIndex &  index)
private

ElementDialog::indexClicked.

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

◆ location()

ElementsLocation ElementDialog::location ( ) const

ElementDialog::location.

Returns
The selected location or a null location if user has selected nothing or selection isn't compatible with the current mode
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setUpConnection()

void ElementDialog::setUpConnection ( )
private

ElementDialog::setUpConnection Setup connection of this dialog.

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

◆ setUpWidget()

void ElementDialog::setUpWidget ( )
private

ElementDialog::setUpWidget Build and setup the widgets of this dialog.

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

◆ updateWidget()

void ElementDialog::updateWidget ( )
private

Member Data Documentation

◆ m_buttons_box

QDialogButtonBox* ElementDialog::m_buttons_box = nullptr
private

◆ m_location

ElementsLocation ElementDialog::m_location
private

◆ m_mode

uint ElementDialog::m_mode
private

◆ m_model

ElementsCollectionModel* ElementDialog::m_model = nullptr
private

◆ m_text_field

QFileNameEdit* ElementDialog::m_text_field = nullptr
private

◆ m_tree_view

QTreeView* ElementDialog::m_tree_view = nullptr
private

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