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

inherits from QGoComboBox, display not ony the names but also the QColor of the items as an Icon in the combobox More...

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

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

Public Types

typedef std::pair< std::string,
QColor > 
ItemColorComboboxData
 
- Public Types inherited from QGoComboBox
typedef std::vector< std::pair
< std::string, std::string > > 
NamesDescrContainerType
 

Signals

void ItemSelected (ItemColorComboboxData)
 
- Signals inherited from QGoComboBox
void AddANewOneActivated ()
 
void DeleteActivated ()
 
void ItemSelected (std::string)
 

Public Member Functions

void AddItemWithColor (ItemColorComboboxData iNewItemData, bool SelectTheAddedItem=true)
 add an item with color at the end of the list befor the "add new..." if they have already been added to the list and select it if selectetheaddeditem is set to true. More...
 
void InitializeTheListWithColor (std::list< ItemColorComboboxData > iDataFromList)
 call the method setItemsWithColorFromList and send a signal with the current index. More...
 
 QGoColorComboBox (std::string iTextToAddANewOne, QWidget *iparent=0, std::string iTextToDelete="")
 
void SetItemsFromListWithColor (std::list< ItemColorComboboxData > iDataFromList)
 clear the items already in the combobox,displayed the one in the iDataFromList and the items to add/delete More...
 
virtual ~QGoColorComboBox ()
 
- Public Member Functions inherited from QGoComboBox
 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

virtual void ActionWhenNewOneRequested ()=0
 slot linked to the signal AddANewOneActivated() More...
 
virtual void EmitActivatedItem (int iIndexActivatedItem)
 
- Protected Slots inherited from QGoComboBox
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

ItemColorComboboxData GetTheItemColorComboBoxData (int iIndex)
 get the name and the QColor of the item located at the index iIndex More...
 
- Protected Member Functions inherited from QGoComboBox
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...
 

Additional Inherited Members

- Public Slots inherited from QGoComboBox
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)
 
- Protected Attributes inherited from QGoComboBox
int m_NumberOfItemsAfterList
 
std::string m_TextToAddANewOne
 
std::string m_TextToDelete
 

Detailed Description

inherits from QGoComboBox, display not ony the names but also the QColor of the items as an Icon in the combobox

Definition at line 47 of file QGoColorComboBox.h.

Member Typedef Documentation

typedef std::pair< std::string, QColor > QGoColorComboBox::ItemColorComboboxData

Definition at line 56 of file QGoColorComboBox.h.

Constructor & Destructor Documentation

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

Definition at line 45 of file QGoColorComboBox.cxx.

QGoColorComboBox::~QGoColorComboBox ( )
virtual

Definition at line 58 of file QGoColorComboBox.cxx.

Member Function Documentation

virtual void QGoColorComboBox::ActionWhenNewOneRequested ( )
protectedpure virtualslot

slot linked to the signal AddANewOneActivated()

void QGoColorComboBox::AddItemWithColor ( ItemColorComboboxData  iNewItemData,
bool  SelectTheAddedItem = true 
)

add an item with color at the end of the list befor the "add new..." if they have already been added to the list and select it if selectetheaddeditem is set to true.

Parameters
[in]iNewItemDataname and QColor of the new item to be added
[in]SelectTheAddedItemif true, the new added item will be the selectedone in the combobox

Definition at line 105 of file QGoColorComboBox.cxx.

void QGoColorComboBox::EmitActivatedItem ( int  iIndexActivatedItem)
protectedvirtualslot

Definition at line 142 of file QGoColorComboBox.cxx.

QGoColorComboBox::ItemColorComboboxData QGoColorComboBox::GetTheItemColorComboBoxData ( int  iIndex)
protected

get the name and the QColor of the item located at the index iIndex

Parameters
[in]iIndexindex for which the name and QColor are wanted
Returns
ItemColorComboboxData contains the name and QColor of the item located at index iIndex

Definition at line 153 of file QGoColorComboBox.cxx.

void QGoColorComboBox::InitializeTheListWithColor ( std::list< ItemColorComboboxData iDataFromList)

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

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

Definition at line 65 of file QGoColorComboBox.cxx.

void QGoColorComboBox::ItemSelected ( ItemColorComboboxData  )
signal
void QGoColorComboBox::SetItemsFromListWithColor ( std::list< ItemColorComboboxData iDataFromList)

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

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

Definition at line 79 of file QGoColorComboBox.cxx.


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