QElectroTech  0.70
Public Member Functions | Protected Slots | Protected Member Functions | Protected Attributes | Private Member Functions | List of all members
TitleBlockTemplateLocationChooser Class Reference

#include <templatelocationchooser.h>

Public Member Functions

 TitleBlockTemplateLocationChooser (const TitleBlockTemplateLocation &, QWidget *=nullptr)
 
 ~TitleBlockTemplateLocationChooser () override
 
virtual TitleBlockTemplateLocation location () const
 
virtual TitleBlockTemplatesCollectioncollection () const
 
virtual QString name () const
 
virtual void setLocation (const TitleBlockTemplateLocation &)
 

Protected Slots

virtual void updateCollections ()
 
virtual void updateTemplates ()
 

Protected Member Functions

void init ()
 
virtual int indexForCollection (TitleBlockTemplatesCollection *) const
 

Protected Attributes

QFormLayout * form_layout_
 
QComboBox * collections_
 
QHash< int, TitleBlockTemplatesCollection * > collections_index_
 Collections index within the combo box. More...
 
QComboBox * templates_
 Existing templates combo box. More...
 

Private Member Functions

 TitleBlockTemplateLocationChooser (const TitleBlockTemplateLocationChooser &)
 

Detailed Description

This class is a widget that allows the user to choose a target title block template.

Definition at line 28 of file templatelocationchooser.h.

Constructor & Destructor Documentation

◆ TitleBlockTemplateLocationChooser() [1/2]

TitleBlockTemplateLocationChooser::TitleBlockTemplateLocationChooser ( const TitleBlockTemplateLocation location,
QWidget *  parent = nullptr 
)

Constructor

Parameters
locationInitial location displayed by the widget
widgetParent QWidget

Definition at line 28 of file templatelocationchooser.cpp.

References init(), location(), and setLocation().

◆ ~TitleBlockTemplateLocationChooser()

TitleBlockTemplateLocationChooser::~TitleBlockTemplateLocationChooser ( )
override

Destructor

Definition at line 41 of file templatelocationchooser.cpp.

◆ TitleBlockTemplateLocationChooser() [2/2]

TitleBlockTemplateLocationChooser::TitleBlockTemplateLocationChooser ( const TitleBlockTemplateLocationChooser )
private

Member Function Documentation

◆ collection()

TitleBlockTemplatesCollection * TitleBlockTemplateLocationChooser::collection ( ) const
virtual
Returns
the currently selected collection

Definition at line 54 of file templatelocationchooser.cpp.

References collections_, and collections_index_.

Referenced by location(), updateCollections(), TitleBlockTemplateLocationSaver::updateTemplates(), and updateTemplates().

◆ indexForCollection()

int TitleBlockTemplateLocationChooser::indexForCollection ( TitleBlockTemplatesCollection coll) const
protectedvirtual
Parameters
collA Title block templates collection which we want to know the index within the combo box of this dialog.
Returns
-1 if the collection is unknown to this dialog, or the index of coll

Definition at line 105 of file templatelocationchooser.cpp.

References collections_index_.

Referenced by TitleBlockTemplateLocationSaver::setLocation(), and setLocation().

◆ init()

void TitleBlockTemplateLocationChooser::init ( )
protected

Initialize this widget.

Parameters
locationInitial location displayed by the widget

Definition at line 88 of file templatelocationchooser.cpp.

References collections_, form_layout_, templates_, QET::Icons::tr, updateCollections(), and updateTemplates().

Referenced by TitleBlockTemplateLocationChooser().

◆ location()

TitleBlockTemplateLocation TitleBlockTemplateLocationChooser::location ( ) const
virtual

◆ name()

QString TitleBlockTemplateLocationChooser::name ( ) const
virtual
Returns
the currently selected/entered name

Reimplemented in TitleBlockTemplateLocationSaver.

Definition at line 61 of file templatelocationchooser.cpp.

References templates_.

Referenced by location().

◆ setLocation()

void TitleBlockTemplateLocationChooser::setLocation ( const TitleBlockTemplateLocation location)
virtual

Set the location displayed by this widget

Parameters
locationto be displayed by this widget

Reimplemented in TitleBlockTemplateLocationSaver.

Definition at line 70 of file templatelocationchooser.cpp.

References collections_, indexForCollection(), location(), TitleBlockTemplateLocation::name(), TitleBlockTemplateLocation::parentCollection(), and templates_.

Referenced by TitleBlockTemplateLocationChooser().

◆ updateCollections

void TitleBlockTemplateLocationChooser::updateCollections ( )
protectedvirtualslot

Update the collections list

Definition at line 114 of file templatelocationchooser.cpp.

References QETApp::availableTitleBlockTemplatesCollections(), collection(), collections_, collections_index_, and updateTemplates().

Referenced by init().

◆ updateTemplates

void TitleBlockTemplateLocationChooser::updateTemplates ( )
protectedvirtualslot

Update the templates list according to the selected collection.

Definition at line 131 of file templatelocationchooser.cpp.

References collection(), and templates_.

Referenced by init(), updateCollections(), and TitleBlockTemplateLocationSaver::updateTemplates().

Member Data Documentation

◆ collections_

QComboBox* TitleBlockTemplateLocationChooser::collections_
protected

◆ collections_index_

QHash<int, TitleBlockTemplatesCollection *> TitleBlockTemplateLocationChooser::collections_index_
protected

Collections index within the combo box.

Definition at line 58 of file templatelocationchooser.h.

Referenced by collection(), indexForCollection(), and updateCollections().

◆ form_layout_

QFormLayout* TitleBlockTemplateLocationChooser::form_layout_
protected

Definition at line 55 of file templatelocationchooser.h.

Referenced by TitleBlockTemplateLocationSaver::init(), and init().

◆ templates_

QComboBox* TitleBlockTemplateLocationChooser::templates_
protected

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