40 std::string iTextToDelete) :
107 if ( !iDataFromList.
empty() )
132 NamesDescrContainerType::iterator iter = iContainer.
begin();
134 while ( iter != iContainer.end() )
136 oQListItems.
append( iter->first.c_str() );
149 int IndexDelete = this->
count() - 1;
155 IndexAdd = IndexDelete;
158 if ( iIndexActivatedItem == IndexAdd )
164 if ( IndexDelete != IndexAdd )
166 if ( iIndexActivatedItem == IndexDelete )
189 int index = this->
findText( iItemText.c_str() );
223 int index = this->
findText( iItemText.c_str() );
std::string m_TextToAddANewOne
virtual void InitializeTheList(QStringList iListItems)
call the method SetItemsFromList and send a signal with the current index.
void SetCurrentItemAndActivate(int iIndex)
select the current item located at iIndex and send a signal with the name of this item...
QString itemText(int index) const
void addItem(const QString &text, const QVariant &userData)
QStringList GetQStringListNames(NamesDescrContainerType iContainer)
Get a QStringList with the names of the item from a NamesDescrContainerType.
int findText(const QString &text, QFlags< Qt::MatchFlag > flags) const
void append(const T &value)
std::vector< std::pair< std::string, std::string > > NamesDescrContainerType
void ItemSelected(std::string)
void SetAddText()
add the "add new one" item at the end of the list
void activated(int index)
void SetCurrentItem(std::string iItemText)
set the activated item corresponding to the iTemText (no need to emit the signal ItemSelected) ...
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 ...
virtual void EmitActivatedItem(int iIndexActivatedItem)
call the signal to send the index of the activated item.
void AddANewOneActivated()
int m_NumberOfItemsAfterList
virtual void SetItemsFromList(QStringList iDataFromList)
clear the items already in the combobox,displayed the one in the QStringList and the items to add/del...
std::string m_TextToDelete
void AddItemsEndOfList()
Add the "Add a new one..." and "Delete..." text items at the end of the items list.
void CheckUserAction(int iIndexActivatedItem)
check which item has been clicked and emit the corresponding signal: addanewone, deleteactivated or i...
void addItems(const QStringList &texts)
bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)