Last change
on this file since 168 was 160, checked in by dmik, 19 years ago |
Imported table and iconview modules and a bunch of dependent examples from the official release 3.3.1 from Trolltech.
|
-
Property svn:keywords
set to
Id
|
File size:
1.1 KB
|
Line | |
---|
1 | /****************************************************************************
|
---|
2 | ** $Id: main.cpp 160 2006-12-11 20:15:57Z dmik $
|
---|
3 | **
|
---|
4 | ** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
|
---|
5 | **
|
---|
6 | ** This file is part of an example program for Qt. This example
|
---|
7 | ** program may be used, distributed and modified without limitation.
|
---|
8 | **
|
---|
9 | *****************************************************************************/
|
---|
10 |
|
---|
11 | #include <qapplication.h>
|
---|
12 | #include <qfileinfo.h>
|
---|
13 | #include <qdir.h>
|
---|
14 | #include "dirview.h"
|
---|
15 |
|
---|
16 | int main( int argc, char ** argv )
|
---|
17 | {
|
---|
18 | QApplication a( argc, argv );
|
---|
19 |
|
---|
20 | DirectoryView mw;
|
---|
21 |
|
---|
22 | mw.addColumn( "Name" );
|
---|
23 | mw.addColumn( "Type" );
|
---|
24 | mw.setTreeStepSize( 20 );
|
---|
25 |
|
---|
26 | const QFileInfoList* roots = QDir::drives();
|
---|
27 | QPtrListIterator<QFileInfo> i(*roots);
|
---|
28 | QFileInfo* fi;
|
---|
29 | while ( (fi = *i) ) {
|
---|
30 | ++i;
|
---|
31 | Directory * root = new Directory( &mw, fi->filePath() );
|
---|
32 | if ( roots->count() <= 1 )
|
---|
33 | root->setOpen( TRUE ); // be interesting
|
---|
34 | }
|
---|
35 |
|
---|
36 | mw.resize( 400, 400 );
|
---|
37 | mw.setCaption( "Qt Example - Directory Browser" );
|
---|
38 | mw.setAllColumnsShowFocus( TRUE );
|
---|
39 | a.setMainWidget( &mw );
|
---|
40 | mw.show();
|
---|
41 |
|
---|
42 | return a.exec();
|
---|
43 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.