@ -34,7 +34,7 @@ body { background: #ffffff; color: black; }
< p >
This example implements a simple and not fully functional file manager using
a widget derived from < a href = " n tqiconview.html"> TQIconView< / a > to display the current directory.
a widget derived from < a href = " tqiconview.html"> TQIconView< / a > to display the current directory.
To display the directory tree the
widget written in the < a href = "dirview-example.html" > dirview< / a > example is
used.
@ -54,12 +54,12 @@ used.
#define TQTFILEICONVIEW_H
#include < < a href = " qiconset-h.html"> n tqiconset.h< / a > >
#include < < a href = " t qiconset-h.html"> tqiconset.h< / a > >
#include < < a href = "tqstring-h.html" > tqstring.h< / a > >
#include < < a href = "qfileinfo-h.html" > ntqfileinfo.h< / a > >
#include < < a href = "qdir-h.html" > ntqdir.h< / a > >
#include < < a href = "qtimer-h.html" > ntqtimer.h< / a > >
#include < < a href = " qiconview-h.html"> n tqiconview.h< / a > >
#include < < a href = " t qiconview-h.html"> tqiconview.h< / a > >
class TQtFileIconView;
class TQDragObject;
@ -71,7 +71,7 @@ class TQResizeEvent;
*
*****************************************************************************/
class TQtFileIconDrag : public < a href = " qicondrag.html"> TQIconDrag< / a >
class TQtFileIconDrag : public < a href = " t qicondrag.html"> TQIconDrag< / a >
{
< a href = "metaobjects.html#TQ_OBJECT" > TQ_OBJECT< / a >
@ -81,7 +81,7 @@ public:
const char* format( int i ) const;
< a href = "qbytearray.html" > TQByteArray< / a > encodedData( const char* mime ) const;
static bool canDecode( < a href = "qmimesource.html" > TQMimeSource< / a > * e );
void append( const < a href = " qicondragitem.html"> TQIconDragItem< / a > & item, const < a href = "ntqrect.html" > TQRect< / a > & pr, const < a href = "ntqrect.html" > TQRect< / a > & tr, const < a href = "tqstring.html" > TQString< / a > & url );
void append( const < a href = " t qicondragitem.html"> TQIconDragItem< / a > & item, const < a href = "ntqrect.html" > TQRect< / a > & pr, const < a href = "ntqrect.html" > TQRect< / a > & tr, const < a href = "tqstring.html" > TQString< / a > & url );
private:
< a href = "tqstringlist.html" > TQStringList< / a > urls;
@ -94,7 +94,7 @@ private:
*
*****************************************************************************/
class TQtFileIconViewItem;
class TQtFileIconView : public < a href = " n tqiconview.html"> TQIconView< / a >
class TQtFileIconView : public < a href = " tqiconview.html"> TQIconView< / a >
{
TQ_OBJECT
@ -126,7 +126,7 @@ signals:
void disableMkdir();
protected slots:
void itemDoubleClicked( < a href = " qiconviewitem.html"> TQIconViewItem< / a > *i );
void itemDoubleClicked( < a href = " t qiconviewitem.html"> TQIconViewItem< / a > *i );
void slotDropped( < a href = "qdropevent.html" > TQDropEvent< / a > *e, const < a href = "tqvaluelist.html" > TQValueList< / a > < TQIconDragItem> & );
void viewLarge();
@ -140,10 +140,10 @@ protected slots:
void sortAscending();
void sortDescending();
void arrangeItemsInGrid() {
< a name = "x807" > < / a > TQIconView::< a href = " n tqiconview.html#arrangeItemsInGrid"> arrangeItemsInGrid< / a > ( TRUE );
< a name = "x807" > < / a > TQIconView::< a href = " tqiconview.html#arrangeItemsInGrid"> arrangeItemsInGrid< / a > ( TRUE );
}
void slotRightPressed( < a href = " qiconviewitem.html"> TQIconViewItem< / a > *item );
void slotRightPressed( < a href = " t qiconviewitem.html"> TQIconViewItem< / a > *item );
void openFolder();
protected:
@ -167,7 +167,7 @@ protected:
*
*****************************************************************************/
class TQtFileIconViewItem : public < a href = " qiconviewitem.html"> TQIconViewItem< / a >
class TQtFileIconViewItem : public < a href = " t qiconviewitem.html"> TQIconViewItem< / a >
{
friend class TQtFileIconView;
@ -470,7 +470,7 @@ static void cleanup()
*****************************************************************************/
< a name = "f301" > < / a > TQtFileIconDrag::TQtFileIconDrag( < a href = "tqwidget.html" > TQWidget< / a > * dragSource, const char* name )
: < a href = " qicondrag.html"> TQIconDrag< / a > ( dragSource, name )
: < a href = " t qicondrag.html"> TQIconDrag< / a > ( dragSource, name )
{
}
@ -484,11 +484,11 @@ static void cleanup()
return 0;
}
< a name = "x831" > < / a > TQByteArray TQtFileIconDrag::< a href = " qicondrag.html#encodedData"> encodedData< / a > ( const char* mime ) const
< a name = "x831" > < / a > TQByteArray TQtFileIconDrag::< a href = " t qicondrag.html#encodedData"> encodedData< / a > ( const char* mime ) const
{
< a href = "qbytearray.html" > TQByteArray< / a > a;
if ( TQString( mime ) == "application/x-qiconlist" ) {
a = TQIconDrag::< a href = " qicondrag.html#encodedData"> encodedData< / a > ( mime );
a = TQIconDrag::< a href = " t qicondrag.html#encodedData"> encodedData< / a > ( mime );
} else if ( TQString( mime ) == "text/uri-list" ) {
< a href = "tqstring.html" > TQString< / a > s = urls.join( "\r\n" );
< a name = "x870" > < / a > < a name = "x856" > < / a > a.< a href = "ntqmemarray.html#resize" > resize< / a > ( s.< a href = "tqstring.html#length" > length< / a > () );
@ -497,16 +497,16 @@ static void cleanup()
return a;
}
< a name = "x830" > < / a > bool TQtFileIconDrag::< a href = " qicondrag.html#canDecode"> canDecode< / a > ( < a href = "qmimesource.html" > TQMimeSource< / a > * e )
< a name = "x830" > < / a > bool TQtFileIconDrag::< a href = " t qicondrag.html#canDecode"> canDecode< / a > ( < a href = "qmimesource.html" > TQMimeSource< / a > * e )
{
< a name = "x819" > < / a > return e-> < a href = "qdropevent.html#provides" > provides< / a > ( "application/x-qiconlist" ) ||
e-> < a href = "qdropevent.html#provides" > provides< / a > ( "text/uri-list" );
}
< a name = "x829" > < / a > void TQtFileIconDrag::< a href = " qicondrag.html#append"> append< / a > ( const < a href = " qicondragitem.html"> TQIconDragItem< / a > & item, const < a href = "ntqrect.html" > TQRect< / a > & pr,
< a name = "x829" > < / a > void TQtFileIconDrag::< a href = " t qicondrag.html#append"> append< / a > ( const < a href = " t qicondragitem.html"> TQIconDragItem< / a > & item, const < a href = "ntqrect.html" > TQRect< / a > & pr,
const < a href = "ntqrect.html" > TQRect< / a > & tr, const < a href = "tqstring.html" > TQString< / a > & url )
{
TQIconDrag::< a href = " qicondrag.html#append"> append< / a > ( item, pr, tr );
TQIconDrag::< a href = " t qicondrag.html#append"> append< / a > ( item, pr, tr );
< a href = "tqstring.html" > TQString< / a > ourUrl = url;
#ifdef TQ_WS_WIN
if (ourUrl.< a href = "tqstring.html#length" > length< / a > () > 2 & & ourUrl[1] != ':') {
@ -524,7 +524,7 @@ static void cleanup()
*****************************************************************************/
< a name = "f322" > < / a > TQtFileIconViewItem::TQtFileIconViewItem( TQtFileIconView *parent, TQFileInfo *fi )
< a name = "x824" > < / a > < a name = "x823" > < / a > : < a href = " qiconviewitem.html"> TQIconViewItem< / a > ( parent, fi-> < a href = "ntqfileinfo.html#fileName" > fileName< / a > () ), itemFileName( fi-> < a href = "ntqfileinfo.html#filePath" > filePath< / a > () ),
< a name = "x824" > < / a > < a name = "x823" > < / a > : < a href = " t qiconviewitem.html"> TQIconViewItem< / a > ( parent, fi-> < a href = "ntqfileinfo.html#fileName" > fileName< / a > () ), itemFileName( fi-> < a href = "ntqfileinfo.html#filePath" > filePath< / a > () ),
itemFileInfo( fi ), checkSetText( FALSE )
{
vm = TQtFileIconView::Large;
@ -536,19 +536,19 @@ static void cleanup()
< a name = "x827" > < / a > if ( itemFileInfo-> < a href = "ntqfileinfo.html#isSymLink" > isSymLink< / a > () )
itemType = Link;
viewModeChanged( ( (TQtFileIconView*)< a href = " qiconviewitem.html#iconView"> iconView< / a > () )-> viewMode() );
viewModeChanged( ( (TQtFileIconView*)< a href = " t qiconviewitem.html#iconView"> iconView< / a > () )-> viewMode() );
if ( itemFileInfo-> < a href = "ntqfileinfo.html#fileName" > fileName< / a > () == "." ||
itemFileInfo-> < a href = "ntqfileinfo.html#fileName" > fileName< / a > () == ".." )
< a href = " qiconviewitem.html#setRenameEnabled"> setRenameEnabled< / a > ( FALSE );
< a href = " t qiconviewitem.html#setRenameEnabled"> setRenameEnabled< / a > ( FALSE );
checkSetText = TRUE;
TQObject::< a href = "tqobject.html#connect" > connect< / a > ( & timer, TQ_SIGNAL( timeout() ),
< a href = " qiconviewitem.html#iconView"> iconView< / a > (), TQ_SLOT( openFolder() ) );
< a href = " t qiconviewitem.html#iconView"> iconView< / a > (), TQ_SLOT( openFolder() ) );
}
< a name = "x842" > < / a > void TQtFileIconViewItem::< a href = " qiconviewitem.html#paintItem"> paintItem< / a > ( < a href = "ntqpainter.html" > TQPainter< / a > *p, const < a href = "qcolorgroup.html" > TQColorGroup< / a > & cg )
< a name = "x842" > < / a > void TQtFileIconViewItem::< a href = " t qiconviewitem.html#paintItem"> paintItem< / a > ( < a href = "ntqpainter.html" > TQPainter< / a > *p, const < a href = "qcolorgroup.html" > TQColorGroup< / a > & cg )
{
if ( itemFileInfo-> < a href = "ntqfileinfo.html#isSymLink" > isSymLink< / a > () ) {
< a name = "x861" > < / a > < a href = "ntqfont.html" > TQFont< / a > f( p-> < a href = "ntqpainter.html#font" > font< / a > () );
@ -556,17 +556,17 @@ static void cleanup()
p-> < a href = "ntqpainter.html#setFont" > setFont< / a > ( f );
}
TQIconViewItem::< a href = " qiconviewitem.html#paintItem"> paintItem< / a > ( p, cg );
TQIconViewItem::< a href = " t qiconviewitem.html#paintItem"> paintItem< / a > ( p, cg );
}
void < a name = "f323" > < / a > TQtFileIconViewItem::viewModeChanged( TQtFileIconView::ViewMode m )
{
vm = m;
< a href = " qiconviewitem.html#setDropEnabled"> setDropEnabled< / a > ( itemType == Dir & & TQDir( itemFileName ).isReadable() );
< a href = " qiconviewitem.html#calcRect"> calcRect< / a > ();
< a href = " t qiconviewitem.html#setDropEnabled"> setDropEnabled< / a > ( itemType == Dir & & TQDir( itemFileName ).isReadable() );
< a href = " t qiconviewitem.html#calcRect"> calcRect< / a > ();
}
< a name = "x843" > < / a > TQPixmap *TQtFileIconViewItem::< a href = " qiconviewitem.html#pixmap"> pixmap< / a > () const
< a name = "x843" > < / a > TQPixmap *TQtFileIconViewItem::< a href = " t qiconviewitem.html#pixmap"> pixmap< / a > () const
{
switch ( itemType ) {
case Dir:
@ -605,7 +605,7 @@ TQtFileIconViewItem::~TQtFileIconViewItem()
delete itemFileInfo;
}
< a name = "x850" > < / a > void TQtFileIconViewItem::< a href = " qiconviewitem.html#setText"> setText< / a > ( const < a href = "tqstring.html" > TQString< / a > & text )
< a name = "x850" > < / a > void TQtFileIconViewItem::< a href = " t qiconviewitem.html#setText"> setText< / a > ( const < a href = "tqstring.html" > TQString< / a > & text )
{
if ( checkSetText ) {
if ( text == "." || text == "." || text.< a href = "tqstring.html#isEmpty" > isEmpty< / a > () )
@ -615,14 +615,14 @@ TQtFileIconViewItem::~TQtFileIconViewItem()
< a name = "x822" > < / a > itemFileName = itemFileInfo-> < a href = "ntqfileinfo.html#dirPath" > dirPath< / a > ( TRUE ) + "/" + text;
delete itemFileInfo;
itemFileInfo = new < a href = "ntqfileinfo.html" > TQFileInfo< / a > ( itemFileName );
TQIconViewItem::< a href = " qiconviewitem.html#setText"> setText< / a > ( text );
TQIconViewItem::< a href = " t qiconviewitem.html#setText"> setText< / a > ( text );
}
} else {
TQIconViewItem::< a href = " qiconviewitem.html#setText"> setText< / a > ( text );
TQIconViewItem::< a href = " t qiconviewitem.html#setText"> setText< / a > ( text );
}
}
< a name = "x836" > < / a > bool TQtFileIconViewItem::< a href = " qiconviewitem.html#acceptDrop"> acceptDrop< / a > ( const < a href = "qmimesource.html" > TQMimeSource< / a > *e ) const
< a name = "x836" > < / a > bool TQtFileIconViewItem::< a href = " t qiconviewitem.html#acceptDrop"> acceptDrop< / a > ( const < a href = "qmimesource.html" > TQMimeSource< / a > *e ) const
{
if ( type() == Dir & & e-> < a href = "qdropevent.html#provides" > provides< / a > ( "text/uri-list" ) & &
dropEnabled() )
@ -631,7 +631,7 @@ TQtFileIconViewItem::~TQtFileIconViewItem()
return FALSE;
}
< a name = "x839" > < / a > void TQtFileIconViewItem::< a href = " qiconviewitem.html#dropped"> dropped< / a > ( < a href = "qdropevent.html" > TQDropEvent< / a > *e, const < a href = "tqvaluelist.html" > TQValueList< / a > < TQIconDragItem> & )
< a name = "x839" > < / a > void TQtFileIconViewItem::< a href = " t qiconviewitem.html#dropped"> dropped< / a > ( < a href = "qdropevent.html" > TQDropEvent< / a > *e, const < a href = "tqvaluelist.html" > TQValueList< / a > < TQIconDragItem> & )
{
timer.stop();
@ -660,7 +660,7 @@ TQtFileIconViewItem::~TQtFileIconViewItem()
< a name = "x816" > < / a > e-> < a href = "qdropevent.html#acceptAction" > acceptAction< / a > ();
}
< a name = "x837" > < / a > void TQtFileIconViewItem::< a href = " qiconviewitem.html#dragEntered"> dragEntered< / a > ()
< a name = "x837" > < / a > void TQtFileIconViewItem::< a href = " t qiconviewitem.html#dragEntered"> dragEntered< / a > ()
{
if ( type() != Dir ||
type() == Dir & & !TQDir( itemFileName ).isReadable() )
@ -670,7 +670,7 @@ TQtFileIconViewItem::~TQtFileIconViewItem()
timer.start( 1500 );
}
< a name = "x838" > < / a > void TQtFileIconViewItem::< a href = " qiconviewitem.html#dragLeft"> dragLeft< / a > ()
< a name = "x838" > < / a > void TQtFileIconViewItem::< a href = " t qiconviewitem.html#dragLeft"> dragLeft< / a > ()
{
if ( type() != Dir ||
type() == Dir & & !TQDir( itemFileName ).isReadable() )
@ -686,7 +686,7 @@ TQtFileIconViewItem::~TQtFileIconViewItem()
*****************************************************************************/
< a name = "f302" > < / a > TQtFileIconView::TQtFileIconView( const < a href = "tqstring.html" > TQString< / a > & dir, TQWidget *parent, const char *name )
: < a href = " n tqiconview.html"> TQIconView< / a > ( parent, name ), viewDir( dir ), newFolderNum( 0 )
: < a href = " tqiconview.html"> TQIconView< / a > ( parent, name ), viewDir( dir ), newFolderNum( 0 )
{
if ( !iconFolderLockedLarge ) {
< a href = "ntqapplication.html#qAddPostRoutine" > tqAddPostRoutine< / a > ( cleanup );
@ -712,24 +712,24 @@ TQtFileIconViewItem::~TQtFileIconViewItem()
vm = Large;
< a href = " n tqiconview.html#setGridX"> setGridX< / a > ( 75 );
< a href = " n tqiconview.html#setResizeMode"> setResizeMode< / a > ( Adjust );
< a href = " n tqiconview.html#setWordWrapIconText"> setWordWrapIconText< / a > ( FALSE );
< a href = " tqiconview.html#setGridX"> setGridX< / a > ( 75 );
< a href = " tqiconview.html#setResizeMode"> setResizeMode< / a > ( Adjust );
< a href = " tqiconview.html#setWordWrapIconText"> setWordWrapIconText< / a > ( FALSE );
< a href = "tqobject.html#connect" > connect< / a > ( this, TQ_SIGNAL( < a href = " n tqiconview.html#doubleClicked"> doubleClicked< / a > ( < a href = " qiconviewitem.html"> TQIconViewItem< / a > * ) ),
this, TQ_SLOT( itemDoubleClicked( < a href = " qiconviewitem.html"> TQIconViewItem< / a > * ) ) );
< a href = "tqobject.html#connect" > connect< / a > ( this, TQ_SIGNAL( < a href = " n tqiconview.html#returnPressed"> returnPressed< / a > ( < a href = " qiconviewitem.html"> TQIconViewItem< / a > * ) ),
this, TQ_SLOT( itemDoubleClicked( < a href = " qiconviewitem.html"> TQIconViewItem< / a > * ) ) );
< a href = "tqobject.html#connect" > connect< / a > ( this, TQ_SIGNAL( < a href = " n tqiconview.html#dropped"> dropped< / a > ( < a href = "qdropevent.html" > TQDropEvent< / a > *, const < a href = "tqvaluelist.html" > TQValueList< / a > < TQIconDragItem> & ) ),
< a href = "tqobject.html#connect" > connect< / a > ( this, TQ_SIGNAL( < a href = " tqiconview.html#doubleClicked"> doubleClicked< / a > ( < a href = " t qiconviewitem.html"> TQIconViewItem< / a > * ) ),
this, TQ_SLOT( itemDoubleClicked( < a href = " t qiconviewitem.html"> TQIconViewItem< / a > * ) ) );
< a href = "tqobject.html#connect" > connect< / a > ( this, TQ_SIGNAL( < a href = " tqiconview.html#returnPressed"> returnPressed< / a > ( < a href = " t qiconviewitem.html"> TQIconViewItem< / a > * ) ),
this, TQ_SLOT( itemDoubleClicked( < a href = " t qiconviewitem.html"> TQIconViewItem< / a > * ) ) );
< a href = "tqobject.html#connect" > connect< / a > ( this, TQ_SIGNAL( < a href = " tqiconview.html#dropped"> dropped< / a > ( < a href = "qdropevent.html" > TQDropEvent< / a > *, const < a href = "tqvaluelist.html" > TQValueList< / a > < TQIconDragItem> & ) ),
this, TQ_SLOT( slotDropped( < a href = "qdropevent.html" > TQDropEvent< / a > *, const < a href = "tqvaluelist.html" > TQValueList< / a > < TQIconDragItem> & ) ) );
< a href = "tqobject.html#connect" > connect< / a > ( this, TQ_SIGNAL( < a href = " n tqiconview.html#contextMenuRequested"> contextMenuRequested< / a > ( < a href = " qiconviewitem.html"> TQIconViewItem< / a > *, const < a href = "ntqpoint.html" > TQPoint< / a > & ) ),
this, TQ_SLOT( slotRightPressed( < a href = " qiconviewitem.html"> TQIconViewItem< / a > * ) ) );
< a href = "tqobject.html#connect" > connect< / a > ( this, TQ_SIGNAL( < a href = " tqiconview.html#contextMenuRequested"> contextMenuRequested< / a > ( < a href = " t qiconviewitem.html"> TQIconViewItem< / a > *, const < a href = "ntqpoint.html" > TQPoint< / a > & ) ),
this, TQ_SLOT( slotRightPressed( < a href = " t qiconviewitem.html"> TQIconViewItem< / a > * ) ) );
< a href = "ntqscrollview.html#setHScrollBarMode" > setHScrollBarMode< / a > ( AlwaysOff );
< a href = "ntqscrollview.html#setVScrollBarMode" > setVScrollBarMode< / a > ( Auto );
< a href = " n tqiconview.html#setAutoArrange"> setAutoArrange< / a > ( TRUE );
< a href = " n tqiconview.html#setSorting"> setSorting< / a > ( TRUE );
< a href = " tqiconview.html#setAutoArrange"> setAutoArrange< / a > ( TRUE );
< a href = " tqiconview.html#setSorting"> setSorting< / a > ( TRUE );
openItem = 0;
}
@ -760,22 +760,22 @@ void TQtFileIconView::setDirectory( const <a href="ntqdir.html">TQDir</a> &d
void < a name = "f305" > < / a > TQtFileIconView::newDirectory()
{
< a href = " n tqiconview.html#setAutoArrange"> setAutoArrange< / a > ( FALSE );
< a href = " n tqiconview.html#selectAll"> selectAll< / a > ( FALSE );
< a href = " tqiconview.html#setAutoArrange"> setAutoArrange< / a > ( FALSE );
< a href = " tqiconview.html#selectAll"> selectAll< / a > ( FALSE );
if ( viewDir.mkdir( TQString( "New Folder %1" ).arg( ++newFolderNum ) ) ) {
< a href = "ntqfileinfo.html" > TQFileInfo< / a > *fi = new < a href = "ntqfileinfo.html" > TQFileInfo< / a > ( viewDir, TQString( "New Folder %1" ).arg( newFolderNum ) );
TQtFileIconViewItem *item = new TQtFileIconViewItem( this, new < a href = "ntqfileinfo.html" > TQFileInfo< / a > ( *fi ) );
< a name = "x847" > < / a > item-> < a href = " qiconviewitem.html#setKey"> setKey< / a > ( TQString( "000000%1" ).arg( fi-> < a href = "ntqfileinfo.html#fileName" > fileName< / a > () ) );
< a name = "x847" > < / a > item-> < a href = " t qiconviewitem.html#setKey"> setKey< / a > ( TQString( "000000%1" ).arg( fi-> < a href = "ntqfileinfo.html#fileName" > fileName< / a > () ) );
delete fi;
< a href = "ntqscrollview.html#repaintContents" > repaintContents< / a > ( < a href = "ntqscrollview.html#contentsX" > contentsX< / a > (), contentsY(), contentsWidth(), contentsHeight(), FALSE );
< a href = " n tqiconview.html#ensureItemVisible"> ensureItemVisible< / a > ( item );
< a name = "x849" > < / a > item-> < a href = " qiconviewitem.html#setSelected"> setSelected< / a > ( TRUE, TRUE );
< a href = " n tqiconview.html#setCurrentItem"> setCurrentItem< / a > ( item );
< a href = " n tqiconview.html#repaintItem"> repaintItem< / a > ( item );
< a href = " tqiconview.html#ensureItemVisible"> ensureItemVisible< / a > ( item );
< a name = "x849" > < / a > item-> < a href = " t qiconviewitem.html#setSelected"> setSelected< / a > ( TRUE, TRUE );
< a href = " tqiconview.html#setCurrentItem"> setCurrentItem< / a > ( item );
< a href = " tqiconview.html#repaintItem"> repaintItem< / a > ( item );
< a name = "x808" > < / a > tqApp-> < a href = "ntqapplication.html#processEvents" > processEvents< / a > ();
< a name = "x845" > < / a > item-> < a href = " qiconviewitem.html#rename"> rename< / a > ();
< a name = "x845" > < / a > item-> < a href = " t qiconviewitem.html#rename"> rename< / a > ();
}
< a href = " n tqiconview.html#setAutoArrange"> setAutoArrange< / a > ( TRUE );
< a href = " tqiconview.html#setAutoArrange"> setAutoArrange< / a > ( TRUE );
}
TQDir < a name = "f306" > < / a > TQtFileIconView::currentDir()
@ -815,7 +815,7 @@ void <a name="f307"></a>TQtFileIconView::readDir( const <a href="ntqdir.html">TQ
else
emit enableUp();
< a href = " n tqiconview.html#clear"> clear< / a > ();
< a href = " tqiconview.html#clear"> clear< / a > ();
emit directoryChanged( dir.< a href = "ntqdir.html#absPath" > absPath< / a > () );
@ -833,21 +833,21 @@ void <a name="f307"></a>TQtFileIconView::readDir( const <a href="ntqdir.html">TQ
emit readNextDir();
TQtFileIconViewItem *item = new TQtFileIconViewItem( this, new < a href = "ntqfileinfo.html" > TQFileInfo< / a > ( *fi ) );
if ( fi-> < a href = "ntqfileinfo.html#isDir" > isDir< / a > () )
item-> < a href = " qiconviewitem.html#setKey"> setKey< / a > ( TQString( "000000%1" ).arg( fi-> < a href = "ntqfileinfo.html#fileName" > fileName< / a > () ) );
item-> < a href = " t qiconviewitem.html#setKey"> setKey< / a > ( TQString( "000000%1" ).arg( fi-> < a href = "ntqfileinfo.html#fileName" > fileName< / a > () ) );
else
item-> < a href = " qiconviewitem.html#setKey"> setKey< / a > ( fi-> < a href = "ntqfileinfo.html#fileName" > fileName< / a > () );
item-> < a href = " t qiconviewitem.html#setKey"> setKey< / a > ( fi-> < a href = "ntqfileinfo.html#fileName" > fileName< / a > () );
if ( !allowRenameSet ) {
< a name = "x820" > < / a > if ( !TQFileInfo( fi-> < a href = "ntqfileinfo.html#absFilePath" > absFilePath< / a > () ).isWritable() ||
< a name = "x851" > < / a > item-> < a href = " qiconviewitem.html#text"> text< / a > () == "." || item-> < a href = " qiconviewitem.html#text"> text< / a > () == ".." )
< a name = "x851" > < / a > item-> < a href = " t qiconviewitem.html#text"> text< / a > () == "." || item-> < a href = " t qiconviewitem.html#text"> text< / a > () == ".." )
allowRename = FALSE;
else
allowRename = TRUE;
if ( item-> < a href = " qiconviewitem.html#text"> text< / a > () == "." || item-> < a href = " qiconviewitem.html#text"> text< / a > () == ".." )
if ( item-> < a href = " t qiconviewitem.html#text"> text< / a > () == "." || item-> < a href = " t qiconviewitem.html#text"> text< / a > () == ".." )
allowRenameSet = FALSE;
else
allowRenameSet = TRUE;
}
< a name = "x848" > < / a > item-> < a href = " qiconviewitem.html#setRenameEnabled"> setRenameEnabled< / a > ( allowRename );
< a name = "x848" > < / a > item-> < a href = " t qiconviewitem.html#setRenameEnabled"> setRenameEnabled< / a > ( allowRename );
}
if ( !TQFileInfo( dir.< a href = "ntqdir.html#absPath" > absPath< / a > () ).isWritable() )
@ -858,7 +858,7 @@ void <a name="f307"></a>TQtFileIconView::readDir( const <a href="ntqdir.html">TQ
emit readDirDone();
}
void < a name = "f308" > < / a > TQtFileIconView::itemDoubleClicked( < a href = " qiconviewitem.html"> TQIconViewItem< / a > *i )
void < a name = "f308" > < / a > TQtFileIconView::itemDoubleClicked( < a href = " t qiconviewitem.html"> TQIconViewItem< / a > *i )
{
TQtFileIconViewItem *item = ( TQtFileIconViewItem* )i;
@ -872,7 +872,7 @@ void <a name="f308"></a>TQtFileIconView::itemDoubleClicked( <a href="qiconviewit
}
}
< a name = "x834" > < / a > TQDragObject *TQtFileIconView::< a href = " n tqiconview.html#dragObject"> dragObject< / a > ()
< a name = "x834" > < / a > TQDragObject *TQtFileIconView::< a href = " tqiconview.html#dragObject"> dragObject< / a > ()
{
if ( !currentItem() )
return 0;
@ -880,19 +880,19 @@ void <a name="f308"></a>TQtFileIconView::itemDoubleClicked( <a href="qiconviewit
< a name = "x809" > < / a > < a href = "ntqpoint.html" > TQPoint< / a > orig = < a href = "ntqscrollview.html#viewportToContents" > viewportToContents< / a > ( < a href = "ntqscrollview.html#viewport" > viewport< / a > ()-> mapFromGlobal( TQCursor::< a href = "ntqcursor.html#pos" > pos< / a > () ) );
TQtFileIconDrag *drag = new TQtFileIconDrag( < a href = "ntqscrollview.html#viewport" > viewport< / a > () );
< a name = "x815" > < / a > drag-> < a href = "ntqdragobject.html#setPixmap" > setPixmap< / a > ( *currentItem()-> pixmap(),
TQPoint( < a href = " n tqiconview.html#currentItem"> currentItem< / a > ()-> pixmapRect().width() / 2, currentItem()-> pixmapRect().height() / 2 ) );
for ( TQtFileIconViewItem *item = (TQtFileIconViewItem*)< a href = " n tqiconview.html#firstItem"> firstItem< / a > (); item;
< a name = "x841" > < / a > item = (TQtFileIconViewItem*)item-> < a href = " qiconviewitem.html#nextItem"> nextItem< / a > () ) {
< a name = "x840" > < / a > if ( item-> < a href = " qiconviewitem.html#isSelected"> isSelected< / a > () ) {
< a href = " qicondragitem.html"> TQIconDragItem< / a > id;
< a name = "x833" > < / a > id.< a href = " qicondragitem.html#setData"> setData< / a > ( TQCString( item-> filename() ) );
drag-> < a href = " qicondrag.html#append"> append< / a > ( id,
< a name = "x864" > < / a > < a name = "x844" > < / a > TQRect( item-> < a href = " qiconviewitem.html#pixmapRect"> pixmapRect< / a > ( FALSE ).x() - orig.< a href = "ntqpoint.html#x" > x< / a > (),
< a name = "x865" > < / a > item-> < a href = " qiconviewitem.html#pixmapRect"> pixmapRect< / a > ( FALSE ).y() - orig.< a href = "ntqpoint.html#y" > y< / a > (),
item-> < a href = " qiconviewitem.html#pixmapRect"> pixmapRect< / a > ().width(), item-> < a href = " qiconviewitem.html#pixmapRect"> pixmapRect< / a > ().height() ),
< a name = "x852" > < / a > TQRect( item-> < a href = " qiconviewitem.html#textRect"> textRect< / a > ( FALSE ).x() - orig.< a href = "ntqpoint.html#x" > x< / a > (),
item-> < a href = " qiconviewitem.html#textRect"> textRect< / a > ( FALSE ).y() - orig.< a href = "ntqpoint.html#y" > y< / a > (),
item-> < a href = " qiconviewitem.html#textRect"> textRect< / a > ().width(), item-> < a href = " qiconviewitem.html#textRect"> textRect< / a > ().height() ),
TQPoint( < a href = " tqiconview.html#currentItem"> currentItem< / a > ()-> pixmapRect().width() / 2, currentItem()-> pixmapRect().height() / 2 ) );
for ( TQtFileIconViewItem *item = (TQtFileIconViewItem*)< a href = " tqiconview.html#firstItem"> firstItem< / a > (); item;
< a name = "x841" > < / a > item = (TQtFileIconViewItem*)item-> < a href = " t qiconviewitem.html#nextItem"> nextItem< / a > () ) {
< a name = "x840" > < / a > if ( item-> < a href = " t qiconviewitem.html#isSelected"> isSelected< / a > () ) {
< a href = " t qicondragitem.html"> TQIconDragItem< / a > id;
< a name = "x833" > < / a > id.< a href = " t qicondragitem.html#setData"> setData< / a > ( TQCString( item-> filename() ) );
drag-> < a href = " t qicondrag.html#append"> append< / a > ( id,
< a name = "x864" > < / a > < a name = "x844" > < / a > TQRect( item-> < a href = " t qiconviewitem.html#pixmapRect"> pixmapRect< / a > ( FALSE ).x() - orig.< a href = "ntqpoint.html#x" > x< / a > (),
< a name = "x865" > < / a > item-> < a href = " t qiconviewitem.html#pixmapRect"> pixmapRect< / a > ( FALSE ).y() - orig.< a href = "ntqpoint.html#y" > y< / a > (),
item-> < a href = " t qiconviewitem.html#pixmapRect"> pixmapRect< / a > ().width(), item-> < a href = " t qiconviewitem.html#pixmapRect"> pixmapRect< / a > ().height() ),
< a name = "x852" > < / a > TQRect( item-> < a href = " t qiconviewitem.html#textRect"> textRect< / a > ( FALSE ).x() - orig.< a href = "ntqpoint.html#x" > x< / a > (),
item-> < a href = " t qiconviewitem.html#textRect"> textRect< / a > ( FALSE ).y() - orig.< a href = "ntqpoint.html#y" > y< / a > (),
item-> < a href = " t qiconviewitem.html#textRect"> textRect< / a > ().width(), item-> < a href = " t qiconviewitem.html#textRect"> textRect< / a > ().height() ),
TQString( item-> filename() ) );
}
}
@ -951,49 +951,49 @@ void <a name="f311"></a>TQtFileIconView::viewSmall()
void < a name = "f312" > < / a > TQtFileIconView::viewBottom()
{
< a href = " n tqiconview.html#setItemTextPos"> setItemTextPos< / a > ( Bottom );
< a href = " tqiconview.html#setItemTextPos"> setItemTextPos< / a > ( Bottom );
}
void < a name = "f313" > < / a > TQtFileIconView::viewRight()
{
< a href = " n tqiconview.html#setItemTextPos"> setItemTextPos< / a > ( Right );
< a href = " tqiconview.html#setItemTextPos"> setItemTextPos< / a > ( Right );
}
void < a name = "f314" > < / a > TQtFileIconView::flowEast()
{
< a href = "ntqscrollview.html#setHScrollBarMode" > setHScrollBarMode< / a > ( AlwaysOff );
< a href = "ntqscrollview.html#setVScrollBarMode" > setVScrollBarMode< / a > ( Auto );
< a href = " n tqiconview.html#setArrangement"> setArrangement< / a > ( LeftToRight );
< a href = " tqiconview.html#setArrangement"> setArrangement< / a > ( LeftToRight );
}
void < a name = "f315" > < / a > TQtFileIconView::flowSouth()
{
< a href = "ntqscrollview.html#setVScrollBarMode" > setVScrollBarMode< / a > ( AlwaysOff );
< a href = "ntqscrollview.html#setHScrollBarMode" > setHScrollBarMode< / a > ( Auto );
< a href = " n tqiconview.html#setArrangement"> setArrangement< / a > ( TopToBottom );
< a href = " tqiconview.html#setArrangement"> setArrangement< / a > ( TopToBottom );
}
void < a name = "f316" > < / a > TQtFileIconView::sortAscending()
{
< a href = " n tqiconview.html#sort"> sort< / a > ( TRUE );
< a href = " tqiconview.html#sort"> sort< / a > ( TRUE );
}
void < a name = "f317" > < / a > TQtFileIconView::sortDescending()
{
< a href = " n tqiconview.html#sort"> sort< / a > ( FALSE );
< a href = " tqiconview.html#sort"> sort< / a > ( FALSE );
}
void < a name = "f318" > < / a > TQtFileIconView::itemTextTruncate()
{
< a href = " n tqiconview.html#setWordWrapIconText"> setWordWrapIconText< / a > ( FALSE );
< a href = " tqiconview.html#setWordWrapIconText"> setWordWrapIconText< / a > ( FALSE );
}
void < a name = "f319" > < / a > TQtFileIconView::itemTextWordWrap()
{
< a href = " n tqiconview.html#setWordWrapIconText"> setWordWrapIconText< / a > ( TRUE );
< a href = " tqiconview.html#setWordWrapIconText"> setWordWrapIconText< / a > ( TRUE );
}
void < a name = "f320" > < / a > TQtFileIconView::slotRightPressed( < a href = " qiconviewitem.html"> TQIconViewItem< / a > *item )
void < a name = "f320" > < / a > TQtFileIconView::slotRightPressed( < a href = " t qiconviewitem.html"> TQIconViewItem< / a > *item )
{
if ( !item ) { // right pressed on viewport
< a href = "ntqpopupmenu.html" > TQPopupMenu< / a > menu( this );
@ -1010,7 +1010,7 @@ void <a name="f320"></a>TQtFileIconView::slotRightPressed( <a href="qiconviewite
menu.< a href = "ntqmenudata.html#insertItem" > insertItem< / a > ( "& Truncate item text", this, TQ_SLOT( itemTextTruncate() ) );
menu.< a href = "ntqmenudata.html#insertItem" > insertItem< / a > ( "& Wordwrap item text", this, TQ_SLOT( itemTextWordWrap() ) );
menu.< a href = "ntqmenudata.html#insertSeparator" > insertSeparator< / a > ();
menu.< a href = "ntqmenudata.html#insertItem" > insertItem< / a > ( "Arrange items in & grid", this, TQ_SLOT( < a href = " n tqiconview.html#arrangeItemsInGrid"> arrangeItemsInGrid< / a > () ) );
menu.< a href = "ntqmenudata.html#insertItem" > insertItem< / a > ( "Arrange items in & grid", this, TQ_SLOT( < a href = " tqiconview.html#arrangeItemsInGrid"> arrangeItemsInGrid< / a > () ) );
menu.< a href = "ntqmenudata.html#insertSeparator" > insertSeparator< / a > ();
menu.< a href = "ntqmenudata.html#insertItem" > insertItem< / a > ( "Sort & ascending", this, TQ_SLOT( sortAscending() ) );
menu.< a href = "ntqmenudata.html#insertItem" > insertItem< / a > ( "Sort & descending", this, TQ_SLOT( sortDescending() ) );
@ -1029,8 +1029,8 @@ void <a name="f320"></a>TQtFileIconView::slotRightPressed( <a href="qiconviewite
if ( id == -1 )
return;
< a name = "x846" > < / a > if ( id == RENAME_ITEM & & item-> < a href = " qiconviewitem.html#renameEnabled"> renameEnabled< / a > () ) {
item-> < a href = " qiconviewitem.html#rename"> rename< / a > ();
< a name = "x846" > < / a > if ( id == RENAME_ITEM & & item-> < a href = " t qiconviewitem.html#renameEnabled"> renameEnabled< / a > () ) {
item-> < a href = " t qiconviewitem.html#rename"> rename< / a > ();
} else if ( id == REMOVE_ITEM ) {
delete item;
TQMessageBox::< a href = "ntqmessagebox.html#information" > information< / a > ( this, "Not implemented!", "Deleting files not implemented yet,\n"
@ -1045,11 +1045,11 @@ void <a name="f321"></a>TQtFileIconView::setViewMode( ViewMode m )
return;
vm = m;
TQtFileIconViewItem *item = (TQtFileIconViewItem*)< a href = " n tqiconview.html#firstItem"> firstItem< / a > ();
for ( ; item; item = (TQtFileIconViewItem*)item-> < a href = " qiconviewitem.html#nextItem"> nextItem< / a > () )
TQtFileIconViewItem *item = (TQtFileIconViewItem*)< a href = " tqiconview.html#firstItem"> firstItem< / a > ();
for ( ; item; item = (TQtFileIconViewItem*)item-> < a href = " t qiconviewitem.html#nextItem"> nextItem< / a > () )
item-> viewModeChanged( vm );
< a href = " n tqiconview.html#arrangeItemsInGrid"> arrangeItemsInGrid< / a > ();
< a href = " tqiconview.html#arrangeItemsInGrid"> arrangeItemsInGrid< / a > ();
}
< / pre >
@ -1208,7 +1208,7 @@ void <a name="f325"></a>FileMainWindow::setup()
< a name = "x894" > < / a > splitter-> < a href = "ntqsplitter.html#setResizeMode" > setResizeMode< / a > ( dirlist, TQSplitter::KeepSize );
fileview = new TQtFileIconView( "/", splitter );
< a name = "x884" > < / a > fileview-> < a href = " n tqiconview.html#setSelectionMode"> setSelectionMode< / a > ( TQIconView::Extended );
< a name = "x884" > < / a > fileview-> < a href = " tqiconview.html#setSelectionMode"> setSelectionMode< / a > ( TQIconView::Extended );
< a href = "ntqmainwindow.html#setCentralWidget" > setCentralWidget< / a > ( splitter );