QListWidget reorder with Drag and Drop
-
I am using Windows 7 with the Qt SDK downloaded from qt.nokia.com/downloads. I did not build it myself.
-
This works for me:
@
#include <QApplication>
#include <QListWidget>int main(int argc, char **argv)
{
QApplication a(argc, argv);QListWidget lw; for(int i = 1; i < 10; ++i) lw.addItem(new QListWidgetItem(QString("Item %1").arg(i))); lw.setDragDropMode(QAbstractItemView::InternalMove); lw.show(); a.connect(&a, SIGNAL(lastWindowClosed()), &a, SLOT(quit())); a.exec();
}
@ -