Implemented remove button.

This commit is contained in:
dfighter1985 2014-09-02 23:07:55 +02:00
parent a76a6b6e85
commit 8635cd3c65

View file

@ -59,6 +59,23 @@ void GeorgesTypDialog::onAddClicked()
void GeorgesTypDialog::onRemoveClicked()
{
QTreeWidgetItem *item = m_ui.tree->currentItem();
if( item == NULL )
return;
int i = 0;
for( i = 0; i < m_ui.tree->topLevelItemCount(); i++ )
{
if( item == m_ui.tree->topLevelItem( i ) )
break;
}
m_ui.tree->takeTopLevelItem( i );
delete item;
std::vector< NLGEORGES::CType::CDefinition >::iterator itr = m_pvt->typ->Definitions.begin() + i;
m_pvt->typ->Definitions.erase( itr );
}
void GeorgesTypDialog::setupConnections()