python - Move items from one QListWidget to another -


i have qlistwidgets, 1 source list, 1 destiny list , 1 button. whenever button clicked, want selected item(s) source list removed , inserted destiny list. tried source_list.removewidgetitem(aselecteditem) not thing. :( doing wrong? need update list afterwards somehow?

takeitem take item source_list , give pointer can use append destination list. like:

source_list = new qlistwidget(); dest_list = new qlistwidget(); new qlistwidgetitem(tr("oak"), source_list); new qlistwidgetitem(tr("birch"), source_list); connect(source_list, signal(clicked(qmodelindex)), this, slot(swapentry(qmodelindex)));   void mywidget::swapentry(qmodelindex index) {     dest_list->insertitem(dest_list->count(), source_list->takeitem(index.row())); } 

Comments

Popular posts from this blog

java - SNMP4J General Variable Binding Error -

sql server - python to mssql encoding problem -

windows - Python Service Installation - "Could not find PythonClass entry" -