diff options
Diffstat (limited to 'doc/html/qdir-example.html')
-rw-r--r-- | doc/html/qdir-example.html | 262 |
1 files changed, 131 insertions, 131 deletions
diff --git a/doc/html/qdir-example.html b/doc/html/qdir-example.html index df2b245f0..45d7982e3 100644 --- a/doc/html/qdir-example.html +++ b/doc/html/qdir-example.html @@ -46,26 +46,26 @@ body { background: #ffffff; color: black; } *****************************************************************************/ #include "../dirview/dirview.h" -#include "qdir.h" - -#include <<a href="qapplication-h.html">qapplication.h</a>> -#include <<a href="qtextview-h.html">qtextview.h</a>> -#include <<a href="qfileinfo-h.html">qfileinfo.h</a>> -#include <<a href="qfile-h.html">qfile.h</a>> -#include <<a href="qtextstream-h.html">qtextstream.h</a>> -#include <<a href="qhbox-h.html">qhbox.h</a>> -#include <<a href="qspinbox-h.html">qspinbox.h</a>> -#include <<a href="qlabel-h.html">qlabel.h</a>> -#include <<a href="qmultilineedit-h.html">qmultilineedit.h</a>> -#include <<a href="qheader-h.html">qheader.h</a>> -#include <<a href="qevent-h.html">qevent.h</a>> -#include <<a href="qpainter-h.html">qpainter.h</a>> -#include <<a href="qpopupmenu-h.html">qpopupmenu.h</a>> -#include <<a href="qpushbutton-h.html">qpushbutton.h</a>> -#include <<a href="qtoolbutton-h.html">qtoolbutton.h</a>> -#include <<a href="qfile-h.html">qfile.h</a>> -#include <<a href="qtextstream-h.html">qtextstream.h</a>> -#include <<a href="qtooltip-h.html">qtooltip.h</a>> +#include "ntqdir.h" + +#include <<a href="qapplication-h.html">ntqapplication.h</a>> +#include <<a href="qtextview-h.html">ntqtextview.h</a>> +#include <<a href="qfileinfo-h.html">ntqfileinfo.h</a>> +#include <<a href="qfile-h.html">ntqfile.h</a>> +#include <<a href="qtextstream-h.html">ntqtextstream.h</a>> +#include <<a href="qhbox-h.html">ntqhbox.h</a>> +#include <<a href="qspinbox-h.html">ntqspinbox.h</a>> +#include <<a href="qlabel-h.html">ntqlabel.h</a>> +#include <<a href="qmultilineedit-h.html">ntqmultilineedit.h</a>> +#include <<a href="qheader-h.html">ntqheader.h</a>> +#include <<a href="qevent-h.html">ntqevent.h</a>> +#include <<a href="qpainter-h.html">ntqpainter.h</a>> +#include <<a href="qpopupmenu-h.html">ntqpopupmenu.h</a>> +#include <<a href="qpushbutton-h.html">ntqpushbutton.h</a>> +#include <<a href="qtoolbutton-h.html">ntqtoolbutton.h</a>> +#include <<a href="qfile-h.html">ntqfile.h</a>> +#include <<a href="qtextstream-h.html">ntqtextstream.h</a>> +#include <<a href="qtooltip-h.html">ntqtooltip.h</a>> #include <stdlib.h> @@ -122,201 +122,201 @@ static const char *home[]={ // **************************************************************************************************** -<a name="f495"></a>PixmapView::PixmapView( <a href="qwidget.html">TQWidget</a> *parent ) - : <a href="qscrollview.html">TQScrollView</a>( parent ) +<a name="f495"></a>PixmapView::PixmapView( <a href="ntqwidget.html">TQWidget</a> *parent ) + : <a href="ntqscrollview.html">TQScrollView</a>( parent ) { - <a href="qscrollview.html#viewport">viewport</a>()->setBackgroundMode( PaletteBase ); + <a href="ntqscrollview.html#viewport">viewport</a>()->setBackgroundMode( PaletteBase ); } -void <a name="f496"></a>PixmapView::setPixmap( const <a href="qpixmap.html">TQPixmap</a> &pix ) +void <a name="f496"></a>PixmapView::setPixmap( const <a href="ntqpixmap.html">TQPixmap</a> &pix ) { pixmap = pix; -<a name="x1855"></a> <a href="qscrollview.html#resizeContents">resizeContents</a>( pixmap.<a href="qwidget.html#size">size</a>().width(), pixmap.<a href="qwidget.html#size">size</a>().height() ); - <a href="qscrollview.html#viewport">viewport</a>()->repaint( FALSE ); +<a name="x1855"></a> <a href="ntqscrollview.html#resizeContents">resizeContents</a>( pixmap.<a href="ntqwidget.html#size">size</a>().width(), pixmap.<a href="ntqwidget.html#size">size</a>().height() ); + <a href="ntqscrollview.html#viewport">viewport</a>()->repaint( FALSE ); } -<a name="x1837"></a>void PixmapView::<a href="qscrollview.html#drawContents">drawContents</a>( <a href="qpainter.html">TQPainter</a> *p, int cx, int cy, int cw, int ch ) +<a name="x1837"></a>void PixmapView::<a href="ntqscrollview.html#drawContents">drawContents</a>( <a href="ntqpainter.html">TQPainter</a> *p, int cx, int cy, int cw, int ch ) { -<a name="x1833"></a> p-><a href="qpainter.html#fillRect">fillRect</a>( cx, cy, cw, ch, colorGroup().brush( TQColorGroup::Base ) ); -<a name="x1832"></a> p-><a href="qpainter.html#drawPixmap">drawPixmap</a>( 0, 0, pixmap ); +<a name="x1833"></a> p-><a href="ntqpainter.html#fillRect">fillRect</a>( cx, cy, cw, ch, colorGroup().brush( TQColorGroup::Base ) ); +<a name="x1832"></a> p-><a href="ntqpainter.html#drawPixmap">drawPixmap</a>( 0, 0, pixmap ); } // **************************************************************************************************** -<a name="f497"></a>Preview::Preview( <a href="qwidget.html">TQWidget</a> *parent ) - : <a href="qwidgetstack.html">TQWidgetStack</a>( parent ) +<a name="f497"></a>Preview::Preview( <a href="ntqwidget.html">TQWidget</a> *parent ) + : <a href="ntqwidgetstack.html">TQWidgetStack</a>( parent ) { - normalText = new <a href="qmultilineedit.html">TQMultiLineEdit</a>( this ); -<a name="x1845"></a> normalText-><a href="qtextedit.html#setReadOnly">setReadOnly</a>( TRUE ); - html = new <a href="qtextview.html">TQTextView</a>( this ); + normalText = new <a href="ntqmultilineedit.html">TQMultiLineEdit</a>( this ); +<a name="x1845"></a> normalText-><a href="ntqtextedit.html#setReadOnly">setReadOnly</a>( TRUE ); + html = new <a href="ntqtextview.html">TQTextView</a>( this ); pixmap = new PixmapView( this ); - <a href="qwidgetstack.html#raiseWidget">raiseWidget</a>( normalText ); + <a href="ntqwidgetstack.html#raiseWidget">raiseWidget</a>( normalText ); } -void <a name="f498"></a>Preview::showPreview( const <a href="qurl.html">TQUrl</a> &u, int size ) +void <a name="f498"></a>Preview::showPreview( const <a href="ntqurl.html">TQUrl</a> &u, int size ) { -<a name="x1849"></a> if ( u.<a href="qurl.html#isLocalFile">isLocalFile</a>() ) { -<a name="x1850"></a> <a href="qstring.html">TQString</a> path = u.<a href="qurl.html#path">path</a>(); - <a href="qfileinfo.html">TQFileInfo</a> fi( path ); -<a name="x1825"></a><a name="x1824"></a> if ( fi.<a href="qfileinfo.html#isFile">isFile</a>() && (int)fi.<a href="qfileinfo.html#size">size</a>() > size * 1000 ) { -<a name="x1846"></a> normalText-><a href="qtextedit.html#setText">setText</a>( <a href="qobject.html#tr">tr</a>( "The File\n%1\nis too large, so I don't show it!" ).arg( path ) ); - <a href="qwidgetstack.html#raiseWidget">raiseWidget</a>( normalText ); +<a name="x1849"></a> if ( u.<a href="ntqurl.html#isLocalFile">isLocalFile</a>() ) { +<a name="x1850"></a> <a href="ntqstring.html">TQString</a> path = u.<a href="ntqurl.html#path">path</a>(); + <a href="ntqfileinfo.html">TQFileInfo</a> fi( path ); +<a name="x1825"></a><a name="x1824"></a> if ( fi.<a href="ntqfileinfo.html#isFile">isFile</a>() && (int)fi.<a href="ntqfileinfo.html#size">size</a>() > size * 1000 ) { +<a name="x1846"></a> normalText-><a href="ntqtextedit.html#setText">setText</a>( <a href="ntqobject.html#tr">tr</a>( "The File\n%1\nis too large, so I don't show it!" ).arg( path ) ); + <a href="ntqwidgetstack.html#raiseWidget">raiseWidget</a>( normalText ); return; } - <a href="qpixmap.html">TQPixmap</a> pix( path ); -<a name="x1834"></a> if ( pix.<a href="qpixmap.html#isNull">isNull</a>() ) { - if ( fi.<a href="qfileinfo.html#isFile">isFile</a>() ) { - <a href="qfile.html">TQFile</a> f( path ); -<a name="x1815"></a> if ( f.<a href="qfile.html#open">open</a>( <a href="qfile.html#open">IO_ReadOnly</a> ) ) { - <a href="qtextstream.html">TQTextStream</a> ts( &f ); -<a name="x1847"></a> <a href="qstring.html">TQString</a> text = ts.<a href="qtextstream.html#read">read</a>(); -<a name="x1814"></a> f.<a href="qfile.html#close">close</a>(); -<a name="x1823"></a> if ( fi.<a href="qfileinfo.html#extension">extension</a>().lower().contains( "htm" ) ) { -<a name="x1844"></a><a name="x1843"></a> <a href="qstring.html">TQString</a> url = html-><a href="qtextedit.html#mimeSourceFactory">mimeSourceFactory</a>()->makeAbsolute( path, html-><a href="qtextedit.html#context">context</a>() ); - html-><a href="qtextedit.html#setText">setText</a>( text, url ); + <a href="ntqpixmap.html">TQPixmap</a> pix( path ); +<a name="x1834"></a> if ( pix.<a href="ntqpixmap.html#isNull">isNull</a>() ) { + if ( fi.<a href="ntqfileinfo.html#isFile">isFile</a>() ) { + <a href="ntqfile.html">TQFile</a> f( path ); +<a name="x1815"></a> if ( f.<a href="ntqfile.html#open">open</a>( <a href="ntqfile.html#open">IO_ReadOnly</a> ) ) { + <a href="ntqtextstream.html">TQTextStream</a> ts( &f ); +<a name="x1847"></a> <a href="ntqstring.html">TQString</a> text = ts.<a href="ntqtextstream.html#read">read</a>(); +<a name="x1814"></a> f.<a href="ntqfile.html#close">close</a>(); +<a name="x1823"></a> if ( fi.<a href="ntqfileinfo.html#extension">extension</a>().lower().contains( "htm" ) ) { +<a name="x1844"></a><a name="x1843"></a> <a href="ntqstring.html">TQString</a> url = html-><a href="ntqtextedit.html#mimeSourceFactory">mimeSourceFactory</a>()->makeAbsolute( path, html-><a href="ntqtextedit.html#context">context</a>() ); + html-><a href="ntqtextedit.html#setText">setText</a>( text, url ); raiseWidget( html ); return; } else { - normalText-><a href="qtextedit.html#setText">setText</a>( text ); + normalText-><a href="ntqtextedit.html#setText">setText</a>( text ); raiseWidget( normalText ); return; } } } - normalText-><a href="qtextedit.html#setText">setText</a>( <a href="qstring.html#TQString-null">TQString::null</a> ); + normalText-><a href="ntqtextedit.html#setText">setText</a>( <a href="ntqstring.html#TQString-null">TQString::null</a> ); raiseWidget( normalText ); } else { pixmap->setPixmap( pix ); raiseWidget( pixmap ); } } else { - normalText-><a href="qtextedit.html#setText">setText</a>( "I only show local files!" ); + normalText-><a href="ntqtextedit.html#setText">setText</a>( "I only show local files!" ); raiseWidget( normalText ); } } // **************************************************************************************************** -<a name="f499"></a>PreviewWidget::PreviewWidget( <a href="qwidget.html">TQWidget</a> *parent ) - : <a href="qvbox.html">TQVBox</a>( parent ), TQFilePreview() +<a name="f499"></a>PreviewWidget::PreviewWidget( <a href="ntqwidget.html">TQWidget</a> *parent ) + : <a href="ntqvbox.html">TQVBox</a>( parent ), TQFilePreview() { setSpacing( 5 ); setMargin( 5 ); - <a href="qhbox.html">TQHBox</a> *row = new <a href="qhbox.html">TQHBox</a>( this ); -<a name="x1826"></a> row-><a href="qhbox.html#setSpacing">setSpacing</a>( 5 ); - (void)new <a href="qlabel.html">TQLabel</a>( <a href="qobject.html#tr">tr</a>( "Only show files smaller than: " ), row ); - sizeSpinBox = new <a href="qspinbox.html">TQSpinBox</a>( 1, 10000, 1, row ); -<a name="x1838"></a> sizeSpinBox-><a href="qspinbox.html#setSuffix">setSuffix</a>( " KB" ); -<a name="x1839"></a> sizeSpinBox-><a href="qspinbox.html#setValue">setValue</a>( 64 ); -<a name="x1852"></a><a name="x1840"></a> row-><a href="qwidget.html#setFixedHeight">setFixedHeight</a>( 10 + sizeSpinBox-><a href="qwidget.html#sizeHint">sizeHint</a>().height() ); + <a href="ntqhbox.html">TQHBox</a> *row = new <a href="ntqhbox.html">TQHBox</a>( this ); +<a name="x1826"></a> row-><a href="ntqhbox.html#setSpacing">setSpacing</a>( 5 ); + (void)new <a href="ntqlabel.html">TQLabel</a>( <a href="ntqobject.html#tr">tr</a>( "Only show files smaller than: " ), row ); + sizeSpinBox = new <a href="ntqspinbox.html">TQSpinBox</a>( 1, 10000, 1, row ); +<a name="x1838"></a> sizeSpinBox-><a href="ntqspinbox.html#setSuffix">setSuffix</a>( " KB" ); +<a name="x1839"></a> sizeSpinBox-><a href="ntqspinbox.html#setValue">setValue</a>( 64 ); +<a name="x1852"></a><a name="x1840"></a> row-><a href="ntqwidget.html#setFixedHeight">setFixedHeight</a>( 10 + sizeSpinBox-><a href="ntqwidget.html#sizeHint">sizeHint</a>().height() ); preview = new Preview( this ); } -void <a name="f500"></a>PreviewWidget::previewUrl( const <a href="qurl.html">TQUrl</a> &u ) +void <a name="f500"></a>PreviewWidget::previewUrl( const <a href="ntqurl.html">TQUrl</a> &u ) { -<a name="x1841"></a> preview->showPreview( u, sizeSpinBox-><a href="qspinbox.html#value">value</a>() ); +<a name="x1841"></a> preview->showPreview( u, sizeSpinBox-><a href="ntqspinbox.html#value">value</a>() ); } // **************************************************************************************************** <a name="f491"></a>CustomFileDialog::CustomFileDialog() - : <a href="qfiledialog.html">TQFileDialog</a>( 0, 0, TRUE ) + : <a href="ntqfiledialog.html">TQFileDialog</a>( 0, 0, TRUE ) { - <a href="qfiledialog.html#setDir">setDir</a>( "/" ); + <a href="ntqfiledialog.html#setDir">setDir</a>( "/" ); dirView = new DirectoryView( this, 0, TRUE ); -<a name="x1827"></a> dirView-><a href="qlistview.html#addColumn">addColumn</a>( "" ); -<a name="x1828"></a> dirView-><a href="qlistview.html#header">header</a>()->hide(); +<a name="x1827"></a> dirView-><a href="ntqlistview.html#addColumn">addColumn</a>( "" ); +<a name="x1828"></a> dirView-><a href="ntqlistview.html#header">header</a>()->hide(); ::Directory *root = new ::Directory( dirView, "/" ); root->setOpen( TRUE ); -<a name="x1853"></a> dirView-><a href="qwidget.html#setFixedWidth">setFixedWidth</a>( 150 ); +<a name="x1853"></a> dirView-><a href="ntqwidget.html#setFixedWidth">setFixedWidth</a>( 150 ); - <a href="qfiledialog.html#addLeftWidget">addLeftWidget</a>( dirView ); + <a href="ntqfiledialog.html#addLeftWidget">addLeftWidget</a>( dirView ); - <a href="qpushbutton.html">TQPushButton</a> *p = new <a href="qpushbutton.html">TQPushButton</a>( this ); -<a name="x1811"></a> p-><a href="qbutton.html#setPixmap">setPixmap</a>( TQPixmap( bookmarks ) ); -<a name="x1848"></a> TQToolTip::<a href="qtooltip.html#add">add</a>( p, tr( "Bookmarks" ) ); + <a href="ntqpushbutton.html">TQPushButton</a> *p = new <a href="ntqpushbutton.html">TQPushButton</a>( this ); +<a name="x1811"></a> p-><a href="ntqbutton.html#setPixmap">setPixmap</a>( TQPixmap( bookmarks ) ); +<a name="x1848"></a> TQToolTip::<a href="ntqtooltip.html#add">add</a>( p, tr( "Bookmarks" ) ); - bookmarkMenu = new <a href="qpopupmenu.html">TQPopupMenu</a>( this ); -<a name="x1835"></a> <a href="qobject.html#connect">connect</a>( bookmarkMenu, SIGNAL( <a href="qpopupmenu.html#activated">activated</a>( int ) ), + bookmarkMenu = new <a href="ntqpopupmenu.html">TQPopupMenu</a>( this ); +<a name="x1835"></a> <a href="ntqobject.html#connect">connect</a>( bookmarkMenu, SIGNAL( <a href="ntqpopupmenu.html#activated">activated</a>( int ) ), this, SLOT( bookmarkChosen( int ) ) ); - addId = bookmarkMenu-><a href="qmenudata.html#insertItem">insertItem</a>( <a href="qobject.html#tr">tr</a>( "Add bookmark" ) ); - bookmarkMenu-><a href="qmenudata.html#insertSeparator">insertSeparator</a>(); + addId = bookmarkMenu-><a href="ntqmenudata.html#insertItem">insertItem</a>( <a href="ntqobject.html#tr">tr</a>( "Add bookmark" ) ); + bookmarkMenu-><a href="ntqmenudata.html#insertSeparator">insertSeparator</a>(); - <a href="qfile.html">TQFile</a> f( ".bookmarks" ); - if ( f.<a href="qfile.html#open">open</a>( IO_ReadOnly ) ) { - <a href="qdatastream.html">TQDataStream</a> ds( &f ); + <a href="ntqfile.html">TQFile</a> f( ".bookmarks" ); + if ( f.<a href="ntqfile.html#open">open</a>( IO_ReadOnly ) ) { + <a href="ntqdatastream.html">TQDataStream</a> ds( &f ); ds >> bookmarkList; - f.<a href="qfile.html#close">close</a>(); + f.<a href="ntqfile.html#close">close</a>(); TQStringList::Iterator it = bookmarkList.begin(); for ( ; it != bookmarkList.end(); ++it ) { - bookmarkMenu-><a href="qmenudata.html#insertItem">insertItem</a>( *it ); + bookmarkMenu-><a href="ntqmenudata.html#insertItem">insertItem</a>( *it ); } } -<a name="x1836"></a> p-><a href="qpushbutton.html#setPopup">setPopup</a>( bookmarkMenu ); +<a name="x1836"></a> p-><a href="ntqpushbutton.html#setPopup">setPopup</a>( bookmarkMenu ); - <a href="qfiledialog.html#addToolButton">addToolButton</a>( p, TRUE ); + <a href="ntqfiledialog.html#addToolButton">addToolButton</a>( p, TRUE ); - <a href="qobject.html#connect">connect</a>( dirView, SIGNAL( folderSelected( const <a href="qstring.html">TQString</a> & ) ), - this, SLOT( setDir2( const <a href="qstring.html">TQString</a> & ) ) ); - <a href="qobject.html#connect">connect</a>( this, SIGNAL( <a href="qfiledialog.html#dirEntered">dirEntered</a>( const <a href="qstring.html">TQString</a> & ) ), - dirView, SLOT( <a href="qfiledialog.html#setDir">setDir</a>( const <a href="qstring.html">TQString</a> & ) ) ); + <a href="ntqobject.html#connect">connect</a>( dirView, SIGNAL( folderSelected( const <a href="ntqstring.html">TQString</a> & ) ), + this, SLOT( setDir2( const <a href="ntqstring.html">TQString</a> & ) ) ); + <a href="ntqobject.html#connect">connect</a>( this, SIGNAL( <a href="ntqfiledialog.html#dirEntered">dirEntered</a>( const <a href="ntqstring.html">TQString</a> & ) ), + dirView, SLOT( <a href="ntqfiledialog.html#setDir">setDir</a>( const <a href="ntqstring.html">TQString</a> & ) ) ); - <a href="qtoolbutton.html">TQToolButton</a> *b = new <a href="qtoolbutton.html">TQToolButton</a>( this ); - TQToolTip::<a href="qtooltip.html#add">add</a>( b, tr( "Go Home!" ) ); - b-><a href="qbutton.html#setPixmap">setPixmap</a>( TQPixmap( home ) ); - <a href="qobject.html#connect">connect</a>( b, SIGNAL( <a href="qbutton.html#clicked">clicked</a>() ), + <a href="ntqtoolbutton.html">TQToolButton</a> *b = new <a href="ntqtoolbutton.html">TQToolButton</a>( this ); + TQToolTip::<a href="ntqtooltip.html#add">add</a>( b, tr( "Go Home!" ) ); + b-><a href="ntqbutton.html#setPixmap">setPixmap</a>( TQPixmap( home ) ); + <a href="ntqobject.html#connect">connect</a>( b, SIGNAL( <a href="ntqbutton.html#clicked">clicked</a>() ), this, SLOT( goHome() ) ); - <a href="qfiledialog.html#addToolButton">addToolButton</a>( b ); + <a href="ntqfiledialog.html#addToolButton">addToolButton</a>( b ); - <a href="qwidget.html#resize">resize</a>( <a href="qwidget.html#width">width</a>() + width() / 3, height() ); + <a href="ntqwidget.html#resize">resize</a>( <a href="ntqwidget.html#width">width</a>() + width() / 3, height() ); } CustomFileDialog::~CustomFileDialog() { if ( !bookmarkList.isEmpty() ) { - <a href="qfile.html">TQFile</a> f( ".bookmarks" ); - if ( f.<a href="qfile.html#open">open</a>( <a href="qfile.html#open">IO_WriteOnly</a> ) ) { - <a href="qdatastream.html">TQDataStream</a> ds( &f ); + <a href="ntqfile.html">TQFile</a> f( ".bookmarks" ); + if ( f.<a href="ntqfile.html#open">open</a>( <a href="ntqfile.html#open">IO_WriteOnly</a> ) ) { + <a href="ntqdatastream.html">TQDataStream</a> ds( &f ); ds << bookmarkList; - f.<a href="qfile.html#close">close</a>(); + f.<a href="ntqfile.html#close">close</a>(); } } } -void <a name="f492"></a>CustomFileDialog::setDir2( const <a href="qstring.html">TQString</a> &s ) +void <a name="f492"></a>CustomFileDialog::setDir2( const <a href="ntqstring.html">TQString</a> &s ) { - <a href="qobject.html#blockSignals">blockSignals</a>( TRUE ); - <a href="qfiledialog.html#setDir">setDir</a>( s ); - <a href="qobject.html#blockSignals">blockSignals</a>( FALSE ); + <a href="ntqobject.html#blockSignals">blockSignals</a>( TRUE ); + <a href="ntqfiledialog.html#setDir">setDir</a>( s ); + <a href="ntqobject.html#blockSignals">blockSignals</a>( FALSE ); } -<a name="x1854"></a>void CustomFileDialog::<a href="qwidget.html#showEvent">showEvent</a>( <a href="qshowevent.html">TQShowEvent</a> *e ) +<a name="x1854"></a>void CustomFileDialog::<a href="ntqwidget.html#showEvent">showEvent</a>( <a href="qshowevent.html">TQShowEvent</a> *e ) { - TQFileDialog::<a href="qwidget.html#showEvent">showEvent</a>( e ); - dirView->setDir( <a href="qfiledialog.html#dirPath">dirPath</a>() ); + TQFileDialog::<a href="ntqwidget.html#showEvent">showEvent</a>( e ); + dirView->setDir( <a href="ntqfiledialog.html#dirPath">dirPath</a>() ); } void <a name="f493"></a>CustomFileDialog::bookmarkChosen( int i ) { if ( i == addId ) { bookmarkList << dirPath(); - bookmarkMenu-><a href="qmenudata.html#insertItem">insertItem</a>( <a href="qfiledialog.html#dirPath">dirPath</a>() ); + bookmarkMenu-><a href="ntqmenudata.html#insertItem">insertItem</a>( <a href="ntqfiledialog.html#dirPath">dirPath</a>() ); } else { -<a name="x1831"></a> <a href="qfiledialog.html#setDir">setDir</a>( bookmarkMenu-><a href="qmenudata.html#text">text</a>( i ) ); +<a name="x1831"></a> <a href="ntqfiledialog.html#setDir">setDir</a>( bookmarkMenu-><a href="ntqmenudata.html#text">text</a>( i ) ); } } void <a name="f494"></a>CustomFileDialog::goHome() { if ( getenv( "HOME" ) ) - <a href="qfiledialog.html#setDir">setDir</a>( getenv( "HOME" ) ); + <a href="ntqfiledialog.html#setDir">setDir</a>( getenv( "HOME" ) ); else - <a href="qfiledialog.html#setDir">setDir</a>( "/" ); + <a href="ntqfiledialog.html#setDir">setDir</a>( "/" ); } // **************************************************************************************************** @@ -324,14 +324,14 @@ void <a name="f494"></a>CustomFileDialog::goHome() int main( int argc, char ** argv ) { TQFileDialog::Mode mode = TQFileDialog::ExistingFile; - <a href="qstring.html">TQString</a> start; - <a href="qstring.html">TQString</a> filter; - <a href="qstring.html">TQString</a> caption; + <a href="ntqstring.html">TQString</a> start; + <a href="ntqstring.html">TQString</a> filter; + <a href="ntqstring.html">TQString</a> caption; bool preview = FALSE; bool custom = FALSE; - <a href="qapplication.html">TQApplication</a> a( argc, argv ); + <a href="ntqapplication.html">TQApplication</a> a( argc, argv ); for (int i=1; i<argc; i++) { - <a href="qstring.html">TQString</a> arg = argv[i]; + <a href="ntqstring.html">TQString</a> arg = argv[i]; if ( arg == "-any" ) mode = TQFileDialog::AnyFile; else if ( arg == "-dir" ) @@ -345,7 +345,7 @@ int main( int argc, char ** argv ) else if ( arg == "-custom" ) custom = TRUE; else if ( arg[0] == '-' ) { - <a href="qapplication.html#qDebug">qDebug</a>("Usage: qdir [-any | -dir | -custom] [-preview] [-default f] {-filter f} [caption ...]\n" + <a href="ntqapplication.html#qDebug">qDebug</a>("Usage: qdir [-any | -dir | -custom] [-preview] [-default f] {-filter f} [caption ...]\n" " -any Get any filename, need not exist.\n" " -dir Return a directory rather than a file.\n" " -custom Opens a customized TQFileDialog with \n" @@ -357,33 +357,33 @@ int main( int argc, char ** argv ) ); return 1; } else { -<a name="x1842"></a> if ( !caption.<a href="qstring.html#isNull">isNull</a>() ) +<a name="x1842"></a> if ( !caption.<a href="ntqstring.html#isNull">isNull</a>() ) caption += ' '; caption += arg; } } if ( !start ) -<a name="x1813"></a> start = TQDir::<a href="qdir.html#currentDirPath">currentDirPath</a>(); +<a name="x1813"></a> start = TQDir::<a href="ntqdir.html#currentDirPath">currentDirPath</a>(); if ( !caption ) caption = mode == TQFileDialog::Directory ? "Choose directory..." : "Choose file..."; if ( !custom ) { - <a href="qfiledialog.html">TQFileDialog</a> fd( TQString::null, filter, 0, 0, TRUE ); -<a name="x1819"></a> fd.<a href="qfiledialog.html#setMode">setMode</a>( mode ); + <a href="ntqfiledialog.html">TQFileDialog</a> fd( TQString::null, filter, 0, 0, TRUE ); +<a name="x1819"></a> fd.<a href="ntqfiledialog.html#setMode">setMode</a>( mode ); if ( preview ) { -<a name="x1818"></a> fd.<a href="qfiledialog.html#setContentsPreviewEnabled">setContentsPreviewEnabled</a>( TRUE ); +<a name="x1818"></a> fd.<a href="ntqfiledialog.html#setContentsPreviewEnabled">setContentsPreviewEnabled</a>( TRUE ); PreviewWidget *pw = new PreviewWidget( &fd ); -<a name="x1817"></a> fd.<a href="qfiledialog.html#setContentsPreview">setContentsPreview</a>( pw, pw ); -<a name="x1822"></a> fd.<a href="qfiledialog.html#setViewMode">setViewMode</a>( TQFileDialog::List ); -<a name="x1820"></a> fd.<a href="qfiledialog.html#setPreviewMode">setPreviewMode</a>( TQFileDialog::Contents ); +<a name="x1817"></a> fd.<a href="ntqfiledialog.html#setContentsPreview">setContentsPreview</a>( pw, pw ); +<a name="x1822"></a> fd.<a href="ntqfiledialog.html#setViewMode">setViewMode</a>( TQFileDialog::List ); +<a name="x1820"></a> fd.<a href="ntqfiledialog.html#setPreviewMode">setPreviewMode</a>( TQFileDialog::Contents ); } - fd.<a href="qwidget.html#setCaption">setCaption</a>( caption ); -<a name="x1821"></a> fd.<a href="qfiledialog.html#setSelection">setSelection</a>( start ); -<a name="x1812"></a> if ( fd.<a href="qdialog.html#exec">exec</a>() == TQDialog::Accepted ) { -<a name="x1816"></a> <a href="qstring.html">TQString</a> result = fd.<a href="qfiledialog.html#selectedFile">selectedFile</a>(); + fd.<a href="ntqwidget.html#setCaption">setCaption</a>( caption ); +<a name="x1821"></a> fd.<a href="ntqfiledialog.html#setSelection">setSelection</a>( start ); +<a name="x1812"></a> if ( fd.<a href="ntqdialog.html#exec">exec</a>() == TQDialog::Accepted ) { +<a name="x1816"></a> <a href="ntqstring.html">TQString</a> result = fd.<a href="ntqfiledialog.html#selectedFile">selectedFile</a>(); printf("%s\n", (const char*)result); return 0; } else { @@ -391,7 +391,7 @@ int main( int argc, char ** argv ) } } else { CustomFileDialog fd; - fd.<a href="qdialog.html#exec">exec</a>(); + fd.<a href="ntqdialog.html#exec">exec</a>(); return 1; } } |