From ccbc1c3572fd0e26480c1432fff55d2909545538 Mon Sep 17 00:00:00 2001 From: Michele Calgaro Date: Sat, 8 Jun 2024 14:55:59 +0900 Subject: Rename icon nt* related files to equivalent tq* Signed-off-by: Michele Calgaro --- doc/html/fileiconview-example.html | 182 ++++++++++++++++++------------------- 1 file changed, 91 insertions(+), 91 deletions(-) (limited to 'doc/html/fileiconview-example.html') diff --git a/doc/html/fileiconview-example.html b/doc/html/fileiconview-example.html index c2e69747d..23ec51495 100644 --- a/doc/html/fileiconview-example.html +++ b/doc/html/fileiconview-example.html @@ -34,7 +34,7 @@ body { background: #ffffff; color: black; }

This example implements a simple and not fully functional file manager using -a widget derived from TQIconView to display the current directory. +a widget derived from TQIconView to display the current directory. To display the directory tree the widget written in the dirview example is used. @@ -54,12 +54,12 @@ used. #define TQTFILEICONVIEW_H -#include <ntqiconset.h> +#include <tqiconset.h> #include <tqstring.h> #include <ntqfileinfo.h> #include <ntqdir.h> #include <ntqtimer.h> -#include <ntqiconview.h> +#include <tqiconview.h> class TQtFileIconView; class TQDragObject; @@ -71,7 +71,7 @@ class TQResizeEvent; * *****************************************************************************/ -class TQtFileIconDrag : public TQIconDrag +class TQtFileIconDrag : public TQIconDrag { TQ_OBJECT @@ -81,7 +81,7 @@ public: const char* format( int i ) const; TQByteArray encodedData( const char* mime ) const; static bool canDecode( TQMimeSource* e ); - void append( const TQIconDragItem &item, const TQRect &pr, const TQRect &tr, const TQString &url ); + void append( const TQIconDragItem &item, const TQRect &pr, const TQRect &tr, const TQString &url ); private: TQStringList urls; @@ -94,7 +94,7 @@ private: * *****************************************************************************/ class TQtFileIconViewItem; -class TQtFileIconView : public TQIconView +class TQtFileIconView : public TQIconView { TQ_OBJECT @@ -126,7 +126,7 @@ signals: void disableMkdir(); protected slots: - void itemDoubleClicked( TQIconViewItem *i ); + void itemDoubleClicked( TQIconViewItem *i ); void slotDropped( TQDropEvent *e, const TQValueList<TQIconDragItem> & ); void viewLarge(); @@ -140,10 +140,10 @@ protected slots: void sortAscending(); void sortDescending(); void arrangeItemsInGrid() { - TQIconView::arrangeItemsInGrid( TRUE ); + TQIconView::arrangeItemsInGrid( TRUE ); } - void slotRightPressed( TQIconViewItem *item ); + void slotRightPressed( TQIconViewItem *item ); void openFolder(); protected: @@ -167,7 +167,7 @@ protected: * *****************************************************************************/ -class TQtFileIconViewItem : public TQIconViewItem +class TQtFileIconViewItem : public TQIconViewItem { friend class TQtFileIconView; @@ -470,7 +470,7 @@ static void cleanup() *****************************************************************************/ TQtFileIconDrag::TQtFileIconDrag( TQWidget * dragSource, const char* name ) - : TQIconDrag( dragSource, name ) + : TQIconDrag( dragSource, name ) { } @@ -484,11 +484,11 @@ static void cleanup() return 0; } -TQByteArray TQtFileIconDrag::encodedData( const char* mime ) const +TQByteArray TQtFileIconDrag::encodedData( const char* mime ) const { TQByteArray a; if ( TQString( mime ) == "application/x-qiconlist" ) { - a = TQIconDrag::encodedData( mime ); + a = TQIconDrag::encodedData( mime ); } else if ( TQString( mime ) == "text/uri-list" ) { TQString s = urls.join( "\r\n" ); a.resize( s.length() ); @@ -497,16 +497,16 @@ static void cleanup() return a; } -bool TQtFileIconDrag::canDecode( TQMimeSource* e ) +bool TQtFileIconDrag::canDecode( TQMimeSource* e ) { return e->provides( "application/x-qiconlist" ) || e->provides( "text/uri-list" ); } -void TQtFileIconDrag::append( const TQIconDragItem &item, const TQRect &pr, +void TQtFileIconDrag::append( const TQIconDragItem &item, const TQRect &pr, const TQRect &tr, const TQString &url ) { - TQIconDrag::append( item, pr, tr ); + TQIconDrag::append( item, pr, tr ); TQString ourUrl = url; #ifdef TQ_WS_WIN if (ourUrl.length() > 2 && ourUrl[1] != ':') { @@ -524,7 +524,7 @@ static void cleanup() *****************************************************************************/ TQtFileIconViewItem::TQtFileIconViewItem( TQtFileIconView *parent, TQFileInfo *fi ) - : TQIconViewItem( parent, fi->fileName() ), itemFileName( fi->filePath() ), + : TQIconViewItem( parent, fi->fileName() ), itemFileName( fi->filePath() ), itemFileInfo( fi ), checkSetText( FALSE ) { vm = TQtFileIconView::Large; @@ -536,19 +536,19 @@ static void cleanup() if ( itemFileInfo->isSymLink() ) itemType = Link; - viewModeChanged( ( (TQtFileIconView*)iconView() )->viewMode() ); + viewModeChanged( ( (TQtFileIconView*)iconView() )->viewMode() ); if ( itemFileInfo->fileName() == "." || itemFileInfo->fileName() == ".." ) - setRenameEnabled( FALSE ); + setRenameEnabled( FALSE ); checkSetText = TRUE; TQObject::connect( &timer, TQ_SIGNAL( timeout() ), - iconView(), TQ_SLOT( openFolder() ) ); + iconView(), TQ_SLOT( openFolder() ) ); } -void TQtFileIconViewItem::paintItem( TQPainter *p, const TQColorGroup &cg ) +void TQtFileIconViewItem::paintItem( TQPainter *p, const TQColorGroup &cg ) { if ( itemFileInfo->isSymLink() ) { TQFont f( p->font() ); @@ -556,17 +556,17 @@ static void cleanup() p->setFont( f ); } - TQIconViewItem::paintItem( p, cg ); + TQIconViewItem::paintItem( p, cg ); } void TQtFileIconViewItem::viewModeChanged( TQtFileIconView::ViewMode m ) { vm = m; - setDropEnabled( itemType == Dir && TQDir( itemFileName ).isReadable() ); - calcRect(); + setDropEnabled( itemType == Dir && TQDir( itemFileName ).isReadable() ); + calcRect(); } -TQPixmap *TQtFileIconViewItem::pixmap() const +TQPixmap *TQtFileIconViewItem::pixmap() const { switch ( itemType ) { case Dir: @@ -605,7 +605,7 @@ TQtFileIconViewItem::~TQtFileIconViewItem() delete itemFileInfo; } -void TQtFileIconViewItem::setText( const TQString &text ) +void TQtFileIconViewItem::setText( const TQString &text ) { if ( checkSetText ) { if ( text == "." || text == "." || text.isEmpty() ) @@ -615,14 +615,14 @@ TQtFileIconViewItem::~TQtFileIconViewItem() itemFileName = itemFileInfo->dirPath( TRUE ) + "/" + text; delete itemFileInfo; itemFileInfo = new TQFileInfo( itemFileName ); - TQIconViewItem::setText( text ); + TQIconViewItem::setText( text ); } } else { - TQIconViewItem::setText( text ); + TQIconViewItem::setText( text ); } } -bool TQtFileIconViewItem::acceptDrop( const TQMimeSource *e ) const +bool TQtFileIconViewItem::acceptDrop( const TQMimeSource *e ) const { if ( type() == Dir && e->provides( "text/uri-list" ) && dropEnabled() ) @@ -631,7 +631,7 @@ TQtFileIconViewItem::~TQtFileIconViewItem() return FALSE; } -void TQtFileIconViewItem::dropped( TQDropEvent *e, const TQValueList<TQIconDragItem> & ) +void TQtFileIconViewItem::dropped( TQDropEvent *e, const TQValueList<TQIconDragItem> & ) { timer.stop(); @@ -660,7 +660,7 @@ TQtFileIconViewItem::~TQtFileIconViewItem() e->acceptAction(); } -void TQtFileIconViewItem::dragEntered() +void TQtFileIconViewItem::dragEntered() { if ( type() != Dir || type() == Dir && !TQDir( itemFileName ).isReadable() ) @@ -670,7 +670,7 @@ TQtFileIconViewItem::~TQtFileIconViewItem() timer.start( 1500 ); } -void TQtFileIconViewItem::dragLeft() +void TQtFileIconViewItem::dragLeft() { if ( type() != Dir || type() == Dir && !TQDir( itemFileName ).isReadable() ) @@ -686,7 +686,7 @@ TQtFileIconViewItem::~TQtFileIconViewItem() *****************************************************************************/ TQtFileIconView::TQtFileIconView( const TQString &dir, TQWidget *parent, const char *name ) - : TQIconView( parent, name ), viewDir( dir ), newFolderNum( 0 ) + : TQIconView( parent, name ), viewDir( dir ), newFolderNum( 0 ) { if ( !iconFolderLockedLarge ) { tqAddPostRoutine( cleanup ); @@ -712,24 +712,24 @@ TQtFileIconViewItem::~TQtFileIconViewItem() vm = Large; - setGridX( 75 ); - setResizeMode( Adjust ); - setWordWrapIconText( FALSE ); + setGridX( 75 ); + setResizeMode( Adjust ); + setWordWrapIconText( FALSE ); - connect( this, TQ_SIGNAL( doubleClicked( TQIconViewItem * ) ), - this, TQ_SLOT( itemDoubleClicked( TQIconViewItem * ) ) ); - connect( this, TQ_SIGNAL( returnPressed( TQIconViewItem * ) ), - this, TQ_SLOT( itemDoubleClicked( TQIconViewItem * ) ) ); - connect( this, TQ_SIGNAL( dropped( TQDropEvent *, const TQValueList<TQIconDragItem> & ) ), + connect( this, TQ_SIGNAL( doubleClicked( TQIconViewItem * ) ), + this, TQ_SLOT( itemDoubleClicked( TQIconViewItem * ) ) ); + connect( this, TQ_SIGNAL( returnPressed( TQIconViewItem * ) ), + this, TQ_SLOT( itemDoubleClicked( TQIconViewItem * ) ) ); + connect( this, TQ_SIGNAL( dropped( TQDropEvent *, const TQValueList<TQIconDragItem> & ) ), this, TQ_SLOT( slotDropped( TQDropEvent *, const TQValueList<TQIconDragItem> & ) ) ); - connect( this, TQ_SIGNAL( contextMenuRequested( TQIconViewItem *, const TQPoint & ) ), - this, TQ_SLOT( slotRightPressed( TQIconViewItem * ) ) ); + connect( this, TQ_SIGNAL( contextMenuRequested( TQIconViewItem *, const TQPoint & ) ), + this, TQ_SLOT( slotRightPressed( TQIconViewItem * ) ) ); setHScrollBarMode( AlwaysOff ); setVScrollBarMode( Auto ); - setAutoArrange( TRUE ); - setSorting( TRUE ); + setAutoArrange( TRUE ); + setSorting( TRUE ); openItem = 0; } @@ -760,22 +760,22 @@ void TQtFileIconView::setDirectory( const TQDir &d void TQtFileIconView::newDirectory() { - setAutoArrange( FALSE ); - selectAll( FALSE ); + setAutoArrange( FALSE ); + selectAll( FALSE ); if ( viewDir.mkdir( TQString( "New Folder %1" ).arg( ++newFolderNum ) ) ) { TQFileInfo *fi = new TQFileInfo( viewDir, TQString( "New Folder %1" ).arg( newFolderNum ) ); TQtFileIconViewItem *item = new TQtFileIconViewItem( this, new TQFileInfo( *fi ) ); - item->setKey( TQString( "000000%1" ).arg( fi->fileName() ) ); + item->setKey( TQString( "000000%1" ).arg( fi->fileName() ) ); delete fi; repaintContents( contentsX(), contentsY(), contentsWidth(), contentsHeight(), FALSE ); - ensureItemVisible( item ); - item->setSelected( TRUE, TRUE ); - setCurrentItem( item ); - repaintItem( item ); + ensureItemVisible( item ); + item->setSelected( TRUE, TRUE ); + setCurrentItem( item ); + repaintItem( item ); tqApp->processEvents(); - item->rename(); + item->rename(); } - setAutoArrange( TRUE ); + setAutoArrange( TRUE ); } TQDir TQtFileIconView::currentDir() @@ -815,7 +815,7 @@ void TQtFileIconView::readDir( const TQ else emit enableUp(); - clear(); + clear(); emit directoryChanged( dir.absPath() ); @@ -833,21 +833,21 @@ void TQtFileIconView::readDir( const TQ emit readNextDir(); TQtFileIconViewItem *item = new TQtFileIconViewItem( this, new TQFileInfo( *fi ) ); if ( fi->isDir() ) - item->setKey( TQString( "000000%1" ).arg( fi->fileName() ) ); + item->setKey( TQString( "000000%1" ).arg( fi->fileName() ) ); else - item->setKey( fi->fileName() ); + item->setKey( fi->fileName() ); if ( !allowRenameSet ) { if ( !TQFileInfo( fi->absFilePath() ).isWritable() || - item->text() == "." || item->text() == ".." ) + item->text() == "." || item->text() == ".." ) allowRename = FALSE; else allowRename = TRUE; - if ( item->text() == "." || item->text() == ".." ) + if ( item->text() == "." || item->text() == ".." ) allowRenameSet = FALSE; else allowRenameSet = TRUE; } - item->setRenameEnabled( allowRename ); + item->setRenameEnabled( allowRename ); } if ( !TQFileInfo( dir.absPath() ).isWritable() ) @@ -858,7 +858,7 @@ void TQtFileIconView::readDir( const TQ emit readDirDone(); } -void TQtFileIconView::itemDoubleClicked( TQIconViewItem *i ) +void TQtFileIconView::itemDoubleClicked( TQIconViewItem *i ) { TQtFileIconViewItem *item = ( TQtFileIconViewItem* )i; @@ -872,7 +872,7 @@ void TQtFileIconView::itemDoubleClicked( TQDragObject *TQtFileIconView::dragObject() +TQDragObject *TQtFileIconView::dragObject() { if ( !currentItem() ) return 0; @@ -880,19 +880,19 @@ void TQtFileIconView::itemDoubleClicked( TQPoint orig = viewportToContents( viewport()->mapFromGlobal( TQCursor::pos() ) ); TQtFileIconDrag *drag = new TQtFileIconDrag( viewport() ); drag->setPixmap( *currentItem()->pixmap(), - TQPoint( currentItem()->pixmapRect().width() / 2, currentItem()->pixmapRect().height() / 2 ) ); - for ( TQtFileIconViewItem *item = (TQtFileIconViewItem*)firstItem(); item; - item = (TQtFileIconViewItem*)item->nextItem() ) { - if ( item->isSelected() ) { - TQIconDragItem id; - id.setData( TQCString( item->filename() ) ); - drag->append( id, - TQRect( item->pixmapRect( FALSE ).x() - orig.x(), - item->pixmapRect( FALSE ).y() - orig.y(), - item->pixmapRect().width(), item->pixmapRect().height() ), - TQRect( item->textRect( FALSE ).x() - orig.x(), - item->textRect( FALSE ).y() - orig.y(), - item->textRect().width(), item->textRect().height() ), + TQPoint( currentItem()->pixmapRect().width() / 2, currentItem()->pixmapRect().height() / 2 ) ); + for ( TQtFileIconViewItem *item = (TQtFileIconViewItem*)firstItem(); item; + item = (TQtFileIconViewItem*)item->nextItem() ) { + if ( item->isSelected() ) { + TQIconDragItem id; + id.setData( TQCString( item->filename() ) ); + drag->append( id, + TQRect( item->pixmapRect( FALSE ).x() - orig.x(), + item->pixmapRect( FALSE ).y() - orig.y(), + item->pixmapRect().width(), item->pixmapRect().height() ), + TQRect( item->textRect( FALSE ).x() - orig.x(), + item->textRect( FALSE ).y() - orig.y(), + item->textRect().width(), item->textRect().height() ), TQString( item->filename() ) ); } } @@ -951,49 +951,49 @@ void TQtFileIconView::viewSmall() void TQtFileIconView::viewBottom() { - setItemTextPos( Bottom ); + setItemTextPos( Bottom ); } void TQtFileIconView::viewRight() { - setItemTextPos( Right ); + setItemTextPos( Right ); } void TQtFileIconView::flowEast() { setHScrollBarMode( AlwaysOff ); setVScrollBarMode( Auto ); - setArrangement( LeftToRight ); + setArrangement( LeftToRight ); } void TQtFileIconView::flowSouth() { setVScrollBarMode( AlwaysOff ); setHScrollBarMode( Auto ); - setArrangement( TopToBottom ); + setArrangement( TopToBottom ); } void TQtFileIconView::sortAscending() { - sort( TRUE ); + sort( TRUE ); } void TQtFileIconView::sortDescending() { - sort( FALSE ); + sort( FALSE ); } void TQtFileIconView::itemTextTruncate() { - setWordWrapIconText( FALSE ); + setWordWrapIconText( FALSE ); } void TQtFileIconView::itemTextWordWrap() { - setWordWrapIconText( TRUE ); + setWordWrapIconText( TRUE ); } -void TQtFileIconView::slotRightPressed( TQIconViewItem *item ) +void TQtFileIconView::slotRightPressed( TQIconViewItem *item ) { if ( !item ) { // right pressed on viewport TQPopupMenu menu( this ); @@ -1010,7 +1010,7 @@ void TQtFileIconView::slotRightPressed( insertItem( "&Truncate item text", this, TQ_SLOT( itemTextTruncate() ) ); menu.insertItem( "&Wordwrap item text", this, TQ_SLOT( itemTextWordWrap() ) ); menu.insertSeparator(); - menu.insertItem( "Arrange items in &grid", this, TQ_SLOT( arrangeItemsInGrid() ) ); + menu.insertItem( "Arrange items in &grid", this, TQ_SLOT( arrangeItemsInGrid() ) ); menu.insertSeparator(); menu.insertItem( "Sort &ascending", this, TQ_SLOT( sortAscending() ) ); menu.insertItem( "Sort &descending", this, TQ_SLOT( sortDescending() ) ); @@ -1029,8 +1029,8 @@ void TQtFileIconView::slotRightPressed( if ( id == RENAME_ITEM && item->renameEnabled() ) { - item->rename(); + if ( id == RENAME_ITEM && item->renameEnabled() ) { + item->rename(); } else if ( id == REMOVE_ITEM ) { delete item; TQMessageBox::information( this, "Not implemented!", "Deleting files not implemented yet,\n" @@ -1045,11 +1045,11 @@ void TQtFileIconView::setViewMode( ViewMode m ) return; vm = m; - TQtFileIconViewItem *item = (TQtFileIconViewItem*)firstItem(); - for ( ; item; item = (TQtFileIconViewItem*)item->nextItem() ) + TQtFileIconViewItem *item = (TQtFileIconViewItem*)firstItem(); + for ( ; item; item = (TQtFileIconViewItem*)item->nextItem() ) item->viewModeChanged( vm ); - arrangeItemsInGrid(); + arrangeItemsInGrid(); } @@ -1208,7 +1208,7 @@ void FileMainWindow::setup() splitter->setResizeMode( dirlist, TQSplitter::KeepSize ); fileview = new TQtFileIconView( "/", splitter ); - fileview->setSelectionMode( TQIconView::Extended ); + fileview->setSelectionMode( TQIconView::Extended ); setCentralWidget( splitter ); -- cgit v1.2.1