You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
70 lines
1.8 KiB
70 lines
1.8 KiB
/***************************************************************************
|
|
* $Id$
|
|
**
|
|
* Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
|
|
**
|
|
* This file is part of an example program for Qt. This example
|
|
* program may be used, distributed and modified without limitation.
|
|
**
|
|
****************************************************************************/
|
|
import org.kde.qt.*;
|
|
|
|
|
|
class ListenDND extends TQObject
|
|
{
|
|
|
|
public ListenDND( TQWidget w )
|
|
{view = w;}
|
|
|
|
void dropped( TQDropEvent mime ) {
|
|
qDebug( "Dropped Mimesource {0} into the view {1}", new Object[] { mime, view } );
|
|
qDebug( " Formats:" );
|
|
int i = 0;
|
|
String str = mime.format( i );
|
|
qDebug( " " + str );
|
|
while ( str != null ) {
|
|
qDebug( " " + str );
|
|
str = mime.format( ++i );
|
|
}
|
|
};
|
|
void moved() {
|
|
qDebug( "All selected items were moved to another widget" );
|
|
}
|
|
|
|
protected TQWidget view;
|
|
|
|
|
|
public static void main( String[] args )
|
|
{
|
|
TQApplication a = new TQApplication( args );
|
|
|
|
TQIconView qiconview = new TQIconView();
|
|
qiconview.setSelectionMode( TQIconView.Extended );
|
|
|
|
for ( int i = 0; i < 3000; i++ ) {
|
|
TQIconViewItem item = new TQIconViewItem( qiconview, "Item " + (i + 1) );
|
|
item.setRenameEnabled( true );
|
|
}
|
|
|
|
qiconview.setCaption( "Qt Example - Iconview" );
|
|
|
|
ListenDND listen_dnd = new ListenDND( qiconview );
|
|
TQObject.connect( qiconview, SIGNAL(" dropped( TQDropEvent , ArrayList )"),
|
|
listen_dnd, SLOT(" dropped( TQDropEvent )") );
|
|
TQObject.connect( qiconview, SIGNAL(" moved()"), listen_dnd, SLOT(" moved()") );
|
|
|
|
a.setMainWidget( qiconview );
|
|
qiconview.show();
|
|
qiconview.resize( qiconview.sizeHint() );
|
|
|
|
a.exec();
|
|
return;
|
|
}
|
|
|
|
static {
|
|
qtjava.initialize();
|
|
}
|
|
|
|
}
|
|
|