How do I "move" an item from one QListWidget to another?
-
takeWidgetItem only removes the widget of the item which was set with setWidgetItem before. It does not remove the QListWidgetItem itself from the view; this is achieved with takeItem.
You can safely transfer a QListWidgetItem from on list widget to another:
@
void ListManager::on_addButton_clicked()
{
if( ui->leftList->count() == 0 )
// nothing to transfer...
return;QListWidgetItem *widget = ui->leftList->takeItem( ui->leftList->currentRow() );
ui->rightList->addItem(widget);
}
@This obviously works only with single selection mode of the list widget. For a multi-item selection mode you will have to do some more work.
-
Not always. If you need a UI toolkit that is perhaps cross platform, what else to use? wxWidgets? it's different, but better? I think no. And you can reduce the fragemntation but just don't use some things. The software we are creating is running 24/7 normally. So you should look at such things a bit, and where you can prevent, you should...
-
For linux, you use valgrin, for windows, I know no free solution, only commercial ones.
But for those tools, ther are already threads "here":http://developer.qt.nokia.com/forums/viewthread/2248 and "here":https://developer.qt.nokia.com/forums/viewthread/1924 -
We had a thread "here":http://developer.qt.nokia.com/forums/viewthread/1924 which had discussed the such tools.
(Sorry for spaming, I was to slow and meantime Gerolf answered the question)
-
[quote author="Jonathan" date="1292788447"]Perhaps the biggest hole in the Qt environment is the lack of integrated analysis tools, eg for memory leaks, performance analysis. The only option AFAIK is Valgrind.[/quote]
Analysis tools are highly platform dependent, so it would be hard to provide this in a platform independent manner and quality like the Qt libs. I personally am convinced, that it is also out of scope for a toolkit.