favoritesEditorList->setItemsMovable( true );
favoritesEditorList->setSorting( -1 );
- connect( favoritesEditorList, SIGNAL( moved( QListViewItem*, QListViewItem*, QListViewItem* ) ),
- SLOT( slotMoved( QListViewItem*, QListViewItem*, QListViewItem* ) ) );
-
QListViewItem* root = new QListViewItem( favoritesEditorList, "root" );
new QListViewItem( root, "Nullpo" );
new QListViewItem( root, "Kita" );
FavoritesWindow::~FavoritesWindow()
{}
-void FavoritesWindow::slotMoved( QListViewItem* item, QListViewItem* afterFirst, QListViewItem* afterNow )
-{
- qDebug( "moved, item = %s", ( const char * ) item->text( 0 ).local8Bit() );
- if ( afterFirst ) {
- qDebug( "moved, afterFirst = %s", ( const char * ) afterFirst->text( 0 ).local8Bit() );
- }
- if ( afterNow ) {
- qDebug( "moved, afterNow = %s", ( const char * ) afterNow->text( 0 ).local8Bit() );
- }
-
- if ( afterNow ) {
- qDebug( "move %s -> %s", ( const char * ) item->text( 0 ).local8Bit(), ( const char * ) afterNow->text( 0 ).local8Bit() );
- favoritesEditorList->moveItem( item, afterNow->parent(), afterNow );
- }
-}
-
#include "favoriteswindow.moc"