Changing the position of an item in a QListWidget
Hi all, in my app I use a QListWidget and a fill it with QListWidgetItems in icon mode. One of the options in my app is to move a selected item up or down one position in the list. I want to know what's the best/"elegant" way to do it. I've thought in two ways: Extracting the item from the list with "QListWidget::takeItem" and inserting it again in the correct position with "QListWidget::insertItem()". Another solution could be in copying the contents (icon and text) between the current item and the "destination item". Is there any better/other solution to do this? Thanks.
Re: Changing the position of an item in a QListWidget
Re: Changing the position of an item in a QListWidget
Quote:
Originally Posted by zlatko
Maiby drag and drop ;)
Drag and drop, as far as I know, is manually (the user has to move manually the item). What I want is just change the position of the item up or down automaticly by pressing a button :)
Re: Changing the position of an item in a QListWidget
Any other suggestion, please?