You're comparing pointers, not their contents. An item can only be in one list at once, therefore even if items have the same text, they are different items. Try doing something like:
if ( ChoosenParam_lb->currentItem() && AvailableParam_lb->currentItem() &&
ChoosenParam_lb->currentItem()->text() == AvailableParam_lb->currentItem()->text() ) ...
if ( ChoosenParam_lb->currentItem() && AvailableParam_lb->currentItem() &&
ChoosenParam_lb->currentItem()->text() == AvailableParam_lb->currentItem()->text() ) ...
To copy to clipboard, switch view to plain text mode
Or better yet:
for(QListBoxItem *iter = ChoosenParam_lb->item(0); iter!=0; iter = iter->next()){
delete AvailableParam_lb->findItem(iter->text(), Qt::ExactMatch);
}
for(QListBoxItem *iter = ChoosenParam_lb->item(0); iter!=0; iter = iter->next()){
delete AvailableParam_lb->findItem(iter->text(), Qt::ExactMatch);
}
To copy to clipboard, switch view to plain text mode
Bookmarks