GOFIGURE2  0.9.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Public Types | Public Slots | Signals | Public Member Functions | Protected Slots | Protected Member Functions | Protected Attributes | List of all members
QGoComboBox Class Reference

inherits from Qt QCombobox but add a the end of the list of items, 1 or 2 items: the first one to add new items and the second one to delete them More...

#include <Code/GUI/lib/QGoComboBox.h>

Inheritance diagram for QGoComboBox:
Inheritance graph
[legend]
Collaboration diagram for QGoComboBox:
Collaboration graph
[legend]

Public Types

typedef std::vector< std::pair
< std::string, std::string > > 
NamesDescrContainerType
 

Public Slots

virtual void InitializeTheList (QStringList iListItems)
 call the method SetItemsFromList and send a signal with the current index. More...
 
virtual void InitializeTheList (NamesDescrContainerType iItemsData)
 
void SetCurrentItem (std::string iItemText)
 set the activated item corresponding to the iTemText (no need to emit the signal ItemSelected) More...
 
virtual void SetItemsFromList (QStringList iDataFromList)
 clear the items already in the combobox,displayed the one in the QStringList and the items to add/delete More...
 
virtual void SetItemsFromList (NamesDescrContainerType iItemsData)
 

Signals

void AddANewOneActivated ()
 
void DeleteActivated ()
 
void ItemSelected (std::string)
 

Public Member Functions

 QGoComboBox (std::string iTextToAddANewOne, QWidget *iparent=0, std::string iTextToDelete="")
 if the string iTextToDelete is empty, there will be only the add a new item at the end of the list More...
 
void SetCurrentItemAndActivate (int iIndex)
 select the current item located at iIndex and send a signal with the name of this item. More...
 
void SetCurrentItemAndActivate (std::string iItemText)
 
virtual ~QGoComboBox ()
 

Protected Slots

void CheckUserAction (int iIndexActivatedItem)
 check which item has been clicked and emit the corresponding signal: addanewone, deleteactivated or itemselected More...
 
virtual void EmitActivatedItem (int iIndexActivatedItem)
 call the signal to send the index of the activated item. More...
 

Protected Member Functions

void AddItemsEndOfList ()
 Add the "Add a new one..." and "Delete..." text items at the end of the items list. More...
 
QStringList GetQStringListNames (NamesDescrContainerType iContainer)
 Get a QStringList with the names of the item from a NamesDescrContainerType. More...
 
void SetAddText ()
 add the "add new one" item at the end of the list More...
 

Protected Attributes

int m_NumberOfItemsAfterList
 
std::string m_TextToAddANewOne
 
std::string m_TextToDelete
 

Detailed Description

inherits from Qt QCombobox but add a the end of the list of items, 1 or 2 items: the first one to add new items and the second one to delete them

Definition at line 47 of file QGoComboBox.h.

Member Typedef Documentation

typedef std::vector< std::pair< std::string, std::string > > QGoComboBox::NamesDescrContainerType

Definition at line 58 of file QGoComboBox.h.

Constructor & Destructor Documentation

QGoComboBox::QGoComboBox ( std::string  iTextToAddANewOne,
QWidget *  iparent = 0,
std::string  iTextToDelete = "" 
)
explicit

if the string iTextToDelete is empty, there will be only the add a new item at the end of the list

Definition at line 38 of file QGoComboBox.cxx.

QGoComboBox::~QGoComboBox ( )
virtual

Definition at line 63 of file QGoComboBox.cxx.

Member Function Documentation

void QGoComboBox::AddANewOneActivated ( )
signal
void QGoComboBox::AddItemsEndOfList ( )
protected

Add the "Add a new one..." and "Delete..." text items at the end of the items list.

Definition at line 91 of file QGoComboBox.cxx.

void QGoComboBox::CheckUserAction ( int  iIndexActivatedItem)
protectedslot

check which item has been clicked and emit the corresponding signal: addanewone, deleteactivated or itemselected

Parameters
[in]iIndexActivatedItemindex of the clicked item

Definition at line 145 of file QGoComboBox.cxx.

void QGoComboBox::DeleteActivated ( )
signal
void QGoComboBox::EmitActivatedItem ( int  iIndexActivatedItem)
protectedvirtualslot

call the signal to send the index of the activated item.

Parameters
[in]iIndexActivatedItemindex of the activated item

Definition at line 179 of file QGoComboBox.cxx.

QStringList QGoComboBox::GetQStringListNames ( NamesDescrContainerType  iContainer)
protected

Get a QStringList with the names of the item from a NamesDescrContainerType.

Parameters
[in]iContainercontains all the items with their name and description
Returns
QStringList with the names of the items

Definition at line 129 of file QGoComboBox.cxx.

void QGoComboBox::InitializeTheList ( QStringList  iListItems)
virtualslot

call the method SetItemsFromList and send a signal with the current index.

Parameters
[in]iListItemscontains the names of the items to be displayed in the combobox

Definition at line 70 of file QGoComboBox.cxx.

void QGoComboBox::InitializeTheList ( NamesDescrContainerType  iItemsData)
virtualslot

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 83 of file QGoComboBox.cxx.

void QGoComboBox::ItemSelected ( std::string  )
signal
void QGoComboBox::SetAddText ( )
protected

add the "add new one" item at the end of the list

Definition at line 204 of file QGoComboBox.cxx.

void QGoComboBox::SetCurrentItem ( std::string  iItemText)
slot

set the activated item corresponding to the iTemText (no need to emit the signal ItemSelected)

Parameters
[in]iItemTextname of the item to be set to activated in the combobox

Definition at line 187 of file QGoComboBox.cxx.

void QGoComboBox::SetCurrentItemAndActivate ( int  iIndex)

select the current item located at iIndex and send a signal with the name of this item.

Parameters
[in]iIndexindex to select and at which to get the info

Definition at line 212 of file QGoComboBox.cxx.

void QGoComboBox::SetCurrentItemAndActivate ( std::string  iItemText)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 221 of file QGoComboBox.cxx.

void QGoComboBox::SetItemsFromList ( QStringList  iDataFromList)
virtualslot

clear the items already in the combobox,displayed the one in the QStringList and the items to add/delete

Parameters
[in]iDataFromListcontains the names of the items to be displayed in the combobox

Definition at line 104 of file QGoComboBox.cxx.

void QGoComboBox::SetItemsFromList ( NamesDescrContainerType  iItemsData)
virtualslot

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 121 of file QGoComboBox.cxx.

Member Data Documentation

int QGoComboBox::m_NumberOfItemsAfterList
protected

Definition at line 112 of file QGoComboBox.h.

std::string QGoComboBox::m_TextToAddANewOne
protected

Definition at line 110 of file QGoComboBox.h.

std::string QGoComboBox::m_TextToDelete
protected

Definition at line 111 of file QGoComboBox.h.


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