| 12
 3
 4
 5
 6
 7
 8
 9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
 100
 101
 102
 103
 104
 105
 106
 107
 108
 109
 110
 111
 112
 113
 114
 115
 116
 117
 118
 119
 120
 121
 122
 123
 124
 125
 126
 127
 128
 129
 130
 131
 132
 133
 134
 135
 136
 137
 138
 139
 140
 141
 142
 143
 144
 145
 146
 147
 148
 149
 150
 151
 152
 153
 154
 155
 156
 157
 158
 159
 160
 161
 162
 163
 164
 165
 166
 167
 168
 169
 170
 171
 172
 173
 174
 175
 176
 177
 178
 179
 180
 181
 182
 183
 184
 185
 186
 187
 188
 189
 190
 191
 192
 193
 194
 195
 196
 197
 198
 199
 200
 201
 202
 203
 204
 205
 206
 207
 208
 209
 210
 211
 212
 213
 214
 215
 216
 217
 218
 219
 220
 221
 222
 223
 224
 225
 226
 227
 228
 229
 230
 231
 232
 233
 234
 235
 236
 237
 238
 239
 240
 241
 242
 243
 244
 245
 246
 247
 248
 249
 250
 251
 252
 253
 254
 255
 256
 257
 258
 259
 260
 261
 262
 263
 264
 265
 266
 267
 268
 269
 270
 271
 272
 273
 274
 275
 276
 277
 278
 279
 280
 281
 282
 283
 284
 285
 286
 287
 288
 289
 290
 291
 292
 293
 294
 295
 296
 297
 298
 299
 300
 301
 302
 303
 304
 305
 306
 307
 308
 309
 310
 311
 312
 313
 314
 315
 316
 317
 318
 319
 320
 321
 322
 323
 324
 325
 326
 327
 328
 329
 330
 331
 332
 333
 334
 335
 336
 337
 338
 339
 340
 341
 342
 343
 344
 345
 346
 347
 348
 349
 350
 351
 352
 353
 354
 355
 356
 357
 358
 359
 360
 361
 362
 363
 364
 365
 366
 367
 368
 369
 370
 371
 372
 373
 374
 375
 376
 377
 378
 379
 380
 381
 382
 383
 384
 385
 386
 387
 388
 389
 390
 391
 392
 393
 394
 395
 396
 397
 398
 399
 400
 401
 402
 403
 404
 405
 406
 407
 408
 409
 410
 411
 412
 413
 414
 415
 416
 417
 418
 419
 420
 421
 422
 423
 424
 425
 426
 427
 428
 429
 430
 431
 432
 433
 434
 435
 436
 437
 438
 439
 440
 441
 442
 443
 444
 445
 446
 447
 448
 449
 450
 451
 452
 453
 454
 455
 456
 457
 458
 459
 460
 461
 462
 463
 464
 465
 466
 467
 468
 469
 470
 471
 472
 473
 474
 475
 476
 477
 478
 479
 480
 481
 482
 483
 484
 485
 486
 487
 488
 489
 490
 491
 492
 493
 494
 495
 496
 497
 498
 499
 500
 501
 502
 503
 504
 505
 506
 507
 508
 509
 510
 511
 512
 513
 514
 515
 516
 517
 518
 519
 520
 521
 522
 523
 524
 525
 526
 527
 528
 529
 530
 531
 532
 
 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Qt Toolkit - QFileDialog Class</title><style type="text/css"><!--
h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm; }
a:link { color: #004faf; text-decoration: none }
a:visited { color: #672967; text-decoration: none }body { background: white; color: black; }
--></style>
</head><body bgcolor="#ffffff">
<table width="100%">
<tr><td><a href="index.html">
<img width="100" height="100" src="qtlogo.png"
alt="Home" border="0"><img width="100"
height="100" src="face.png" alt="Home" border="0">
</a><td valign=top><div align=right><img src="dochead.png" width="472" height="27"><br>
<a href="classes.html"><b>Classes</b></a>
-<a href="annotated.html">Annotated</a>
- <a href="hierarchy.html">Tree</a>
-<a href="functions.html">Functions</a>
-<a href="index.html">Home</a>
-<a href="topicals.html"><b>Structure</b></a>
</div>
</table>
<h1 align=center>QFileDialog Class Reference</h1><br clear="all">
<p>
The QFileDialog class provides a dialog widget for inputting file names.
<a href="#details">More...</a>
<p>
<code>#include <<a href="qfiledialog-h.html">qfiledialog.h</a>></code>
<p>
Inherits <a href="qdialog.html">QDialog</a>.
<p><a href="qfiledialog-members.html">List of all member functions.</a>
<h2>Public Members</h2>
<ul>
<li><div class="fn"><a href="#fcc590"><b>QFileDialog</b></a>(constQString&dirName, constQString&filter=QString::null, QWidget*parent=0, constchar*name=0, boolmodal=FALSE)</div>
<li><div class="fn"><a href="#fd0c57"><b>QFileDialog</b></a>(QWidget*parent=0, constchar*name=0, boolmodal=FALSE)</div>
<li><div class="fn"><a href="#2516af"><b>~QFileDialog</b></a>()</div>
<li><div class="fn">QString<a href="#87e5ca"><b>selectedFile</b></a>()const</div>
<li><div class="fn">QString<a href="#43c7cc"><b>selectedFilter</b></a>()const</div>
<li><div class="fn">void<a href="#8e8f0c"><b>setSelection</b></a>(constQString&)</div>
<li><div class="fn">void<a href="#6d632f"><b>selectAll</b></a>(boolb)</div>
<li><div class="fn">QStringList<a href="#4703d8"><b>selectedFiles</b></a>()const</div>
<li><div class="fn">QString<a href="#79c29b"><b>dirPath</b></a>()const</div>
<li><div class="fn">void<a href="#b67d89"><b>setDir</b></a>(constQDir&)</div>
<li><div class="fn">constQDir*<a href="#331d9e"><b>dir</b></a>()const</div>
<li><div class="fn">void<a href="#645886"><b>setShowHiddenFiles</b></a>(bools)</div>
<li><div class="fn">bool<a href="#edf18e"><b>showHiddenFiles</b></a>()const</div>
<li><div class="fn">void<a href="#fc531e"><b>rereadDir</b></a>()</div>
<li><div class="fn">void<a href="#673d0a"><b>resortDir</b></a>()</div>
<li><div class="fn">enum<a href="#Mode"><b>Mode</b></a>{AnyFile, ExistingFile, Directory, ExistingFiles, DirectoryOnly}</div>
<li><div class="fn">void<a href="#002fa6"><b>setMode</b></a>(Mode)</div>
<li><div class="fn">Mode<a href="#b59413"><b>mode</b></a>()const</div>
<li><div class="fn">enum<a href="#ViewMode"><b>ViewMode</b></a>{Detail, List}</div>
<li><div class="fn">enum<a href="#PreviewMode"><b>PreviewMode</b></a>{NoPreview, Contents, Info}</div>
<li><div class="fn">void<a href="#b9f368"><b>setViewMode</b></a>(ViewModem)</div>
<li><div class="fn">ViewMode<a href="#539ecb"><b>viewMode</b></a>()const</div>
<li><div class="fn">void<a href="#2a7428"><b>setPreviewMode</b></a>(PreviewModem)</div>
<li><div class="fn">PreviewMode<a href="#7f1ef6"><b>previewMode</b></a>()const</div>
<li><div class="fn">bool<a href="#8df610"><b>isInfoPreviewEnabled</b></a>()const</div>
<li><div class="fn">bool<a href="#08318c"><b>isContentsPreviewEnabled</b></a>()const</div>
<li><div class="fn">void<a href="#ad63ae"><b>setInfoPreviewEnabled</b></a>(bool)</div>
<li><div class="fn">void<a href="#53a9d7"><b>setContentsPreviewEnabled</b></a>(bool)</div>
<li><div class="fn">void<a href="#93d0d6"><b>setInfoPreview</b></a>(QWidget*w, QFilePreview*preview)</div>
<li><div class="fn">void<a href="#ffd0e7"><b>setContentsPreview</b></a>(QWidget*w, QFilePreview*preview)</div>
<li><div class="fn">QUrl<a href="#b10921"><b>url</b></a>()const</div>
</ul>
<h2>Public Slots</h2>
<ul>
<li><div class="fn">void<a href="#1c94c2"><b>setDir</b></a>(constQString&)</div>
<li><div class="fn">void<a href="#e967c6"><b>setUrl</b></a>(constQUrlOperator&url)</div>
<li><div class="fn">void<a href="#f25fe3"><b>setFilter</b></a>(constQString&)</div>
<li><div class="fn">void<a href="#14cadd"><b>setFilters</b></a>(constQString&)</div>
<li><div class="fn">void<a href="#d748ad"><b>setFilters</b></a>(constchar**)</div>
<li><div class="fn">void<a href="#3e010d"><b>setFilters</b></a>(constQStringList&)</div>
</ul>
<h2>Signals</h2>
<ul>
<li><div class="fn">void<a href="#b814e3"><b>fileHighlighted</b></a>(constQString&)</div>
<li><div class="fn">void<a href="#fbed6f"><b>fileSelected</b></a>(constQString&)</div>
<li><div class="fn">void<a href="#e3ab7b"><b>dirEntered</b></a>(constQString&)</div>
</ul>
<h2>Static Public Members</h2>
<ul>
<li><div class="fn">QString<a href="#0db5a5"><b>getOpenFileName</b></a>(constQString&initially=QString::null, constQString&filter=QString::null, QWidget*parent=0, constchar*name=0)</div>
<li><div class="fn">QString<a href="#2c9384"><b>getOpenFileName</b></a>(constQString&initially, constQString&filter, QWidget*parent, constchar*name, constQString&caption)</div>
<li><div class="fn">QString<a href="#3c5426"><b>getSaveFileName</b></a>(constQString&initially=QString::null, constQString&filter=QString::null, QWidget*parent=0, constchar*name=0)</div>
<li><div class="fn">QString<a href="#cbbb2e"><b>getSaveFileName</b></a>(constQString&initially, constQString&filter, QWidget*parent, constchar*name, constQString&caption)</div>
<li><div class="fn">QString<a href="#00d360"><b>getExistingDirectory</b></a>(constQString&dir=QString::null, QWidget*parent=0, constchar*name=0)</div>
<li><div class="fn">QString<a href="#8fb0f3"><b>getExistingDirectory</b></a>(constQString&dir, QWidget*parent, constchar*name, constQString&caption)</div>
<li><div class="fn">QString<a href="#7ffd07"><b>getExistingDirectory</b></a>(constQString&dir, QWidget*parent, constchar*name, constQString&caption, booldirOnly)</div>
<li><div class="fn">QStringList<a href="#89d3cd"><b>getOpenFileNames</b></a>(constQString&filter=QString::null, constQString&dir=QString::null, QWidget*parent=0, constchar*name=0)</div>
<li><div class="fn">QStringList<a href="#76e2a5"><b>getOpenFileNames</b></a>(constQString&filter, constQString&dir, QWidget*parent, constchar*name, constQString&caption)</div>
<li><div class="fn">void<a href="#7c742a"><b>setIconProvider</b></a>(QFileIconProvider*)</div>
<li><div class="fn">QFileIconProvider*<a href="#06d2c5"><b>iconProvider</b></a>()</div>
</ul>
<h2>Protected Members</h2>
<ul>
<li><div class="fn">void<a href="#796e3b"><b>addWidgets</b></a>(QLabel*, QWidget*, QPushButton*)</div>
<li><div class="fn">void<a href="#fac83b"><b>addToolButton</b></a>(QButton*b, boolseparator=FALSE)</div>
<li><div class="fn">void<a href="#c3210e"><b>addLeftWidget</b></a>(QWidget*w)</div>
<li><div class="fn">void<a href="#a76ef4"><b>addRightWidget</b></a>(QWidget*w)</div>
<li><div class="fn">void<a href="#cd4a73"><b>addFilter</b></a>(constQString&filter)</div>
</ul>
<h2>Properties</h2>
<table border=1 cellpadding=3 cellspacing=0>
<tr><th>Type<th>Name<th>READ<th>WRITE<th>Options
<tr><td>QString<td>selectedFile<td>selectedFile<td> <td> 
<tr><td>QString<td>selectedFilter<td>selectedFilter<td> <td> 
<tr><td>QStringList<td>selectedFiles<td>selectedFiles<td> <td> 
<tr><td>QString<td>dirPath<td>dirPath<td> <td> 
<tr><td>bool<td>showHiddenFiles<td>showHiddenFiles<td>setShowHiddenFiles<td> 
<tr><td>Mode<td>mode<td>mode<td>setMode<td> 
<tr><td>ViewMode<td>viewMode<td>viewMode<td>setViewMode<td> 
<tr><td>PreviewMode<td>previewMode<td>previewMode<td>setPreviewMode<td> 
<tr><td>bool<td>infoPreview<td>isInfoPreviewEnabled<td>setInfoPreviewEnabled<td> 
<tr><td>bool<td>contentsPreview<td>isContentsPreviewEnabled<td>setContentsPreviewEnabled<td> 
</table>
<hr><h2><a name="details"></a>Detailed Description</h2>
The QFileDialog class provides a dialog widget for inputting file names.
<p>
This class implements a dialog which can be used if the user should select
a file or a directory.
<p>Example (e.g. to get a filename for saving a file):
<p><pre>    <a href="qstring.html">QString</a> fileName = QFileDialog::getSaveFileName( "newfile.txt", "Textfiles (*.txt)", this );
    if ( !fileName.<a href="qstring.html#a2a6ba">isNull</a>() ) {                 // got a file name
        ...
    }
</pre>
<p>To let the user specify a filename for e.g. opening a file, you could use following
code:
<p><pre>    <a href="qstring.html">QString</a> s( <a href="#2c9384">QFileDialog::getOpenFileName</a>( QString::null, "Images (*.png *.xpm *.jpg)", this ) );
    if ( s.<a href="qstring.html#9a6d7e">isEmpty</a>() )
        return;
    open( s ); // open() being your function to read the file
</pre>
<p>Other convenient static methods are <a href="#7ffd07">QFileDialog::getExistingDirectory</a>() to let the user
choose a directory or <a href="#76e2a5">QFileDialog::getOpenFileNames</a>() to let the user select multiple
files.
<p>Additionally to these convenient static methods you can use one of QFileDialog's
constructors, set a mode (see <a href="#002fa6">setMode</a>()) and do more things, like adding a preview
widget which will preview the current file or information of the current file while
the user does the selection (see <a href="#93d0d6">setInfoPreview</a>(), <a href="#ffd0e7">setContentsPreview</a>(), <a href="#ad63ae">setInfoPreviewEnabled</a>() and
<a href="#53a9d7">setContentsPreviewEnabled</a>()) or add additional widgets to the filedialog then
(see <a href="#796e3b">addWidgets</a>(), <a href="#fac83b">addToolButton</a>(), <a href="#c3210e">addLeftWidget</a>() and <a href="#a76ef4">addRightWidget</a>()).
<p>To get the selection the user did then, see <a href="#87e5ca">selectedFile</a>(), <a href="#4703d8">selectedFiles</a>(), <a href="#43c7cc">selectedFilter</a>()
and <a href="#b10921">url</a>(). To set these things see <a href="#e967c6">setUrl</a>() and <a href="#8e8f0c">setSelection</a>().
<p>For an example about how to use this customization of the QFileDialog, take a look
at the qdir example (qt/examples/qdir/qdir.cpp)
<p><img src=qfiledlg-m.png> <img src=qfiledlg-w.png>
<p>See also  <a href="qprintdialog.html">QPrintDialog</a>.
<p>Examples:
 <a href="movies-main-cpp.html#QFileDialog">movies/main.cpp</a>
<hr><h2>Member Type Documentation</h2>
<h3 class="fn"><a name="Mode">QFileDialog::Mode</a></h3>
This enum type is used to set and read QFileDialog's operating mode.
The defined values are:
<ul>
<li> <code>AnyFile</code> - Return the name of any file, whether existing or not.
<li> <code>ExistingFile</code> - Return the name of a single, existing, file.
<li> <code>Directory</code> - Return the name of a directory.
<li> <code>DirectoryOnly</code> - Return the name of a directory and display no files in the file views of the filedialog.
<li> <code>ExistingFiles</code> - Return the names of zero or more existing files.
</ul>
<p>Using <a href="#002fa6">setMode</a>() you can set this mode to the file dialog.
<h3 class="fn"><a name="PreviewMode">QFileDialog::PreviewMode</a></h3>
This enum type describes the preview mode of the filedialog.
<ul>
<li> <code>NoPreview</code> - No preview is shown at all
<li> <code>Contents</code> - Besides the view with the files a preview
widget is shown which shows the contents of the currently selected file
<li> <code>Info</code> - Besides the view with the files a preview
widget is shown which shows infos of the currently selected file
</ul>
<p>Using <a href="#2a7428">setPreviewMode</a>() this mode can be set to the file dialog.
<h3 class="fn"><a name="ViewMode">QFileDialog::ViewMode</a></h3>
This enum type describes the view mode of the filedialog.
<ul>
<li> <code>Detail</code> - View which shows except the filename also
size, date, etc. of a file in columns
<li> <code>List</code> - Simple view which shows only all filenames plus icons
</ul>
<p>Using <a href="#b9f368">setViewMode</a>() you can set this mode to the file dialog.
<hr><h2>Member Function Documentation</h2>
<h3 class="fn"><a name="fd0c57"></a>QFileDialog::QFileDialog(<a href="qwidget.html">QWidget</a>*parent=0, constchar*name=0, boolmodal=FALSE)</h3>
<p>Constructs a file dialog with a <em>parent, name</em> and <em>modal</em> flag.
<p>The dialog becomes modal if <em>modal</em> is TRUE, otherwise modeless.
<h3 class="fn"><a name="fcc590"></a>QFileDialog::QFileDialog(const<a href="qstring.html">QString</a>&dirName, const<a href="qstring.html">QString</a>&filter=QString::null, <a href="qwidget.html">QWidget</a>*parent=0, constchar*name=0, boolmodal=FALSE)</h3>
<p>Constructs a file dialog with a <em>parent, name</em> and <em>modal</em> flag.
<p>The dialog becomes modal if <em>modal</em> is TRUE, otherwise modeless.
<h3 class="fn"><a name="2516af"></a>QFileDialog::~QFileDialog()</h3>
<p>Destructs the file dialog.
<h3 class="fn">void<a name="cd4a73"></a>QFileDialog::addFilter(const<a href="qstring.html">QString</a>&filter) <code>[protected]</code></h3>
<p>Adds <em>filter</em> to the filter list and makes it the current one.
<h3 class="fn">void<a name="c3210e"></a>QFileDialog::addLeftWidget(<a href="qwidget.html">QWidget</a>*w) <code>[protected]</code></h3>
<p>Adds the widget <em>w</em> to the left of the filedialog.
<p>See also  <a href="#a76ef4">addRightWidget</a>(), <a href="#796e3b">addWidgets</a>() and <a href="#fac83b">addToolButton</a>().
<h3 class="fn">void<a name="a76ef4"></a>QFileDialog::addRightWidget(<a href="qwidget.html">QWidget</a>*w) <code>[protected]</code></h3>
<p>Adds the widget <em>w</em> to the right of the filedialog.
<p>See also  <a href="#c3210e">addLeftWidget</a>(), <a href="#796e3b">addWidgets</a>() and <a href="#fac83b">addToolButton</a>().
<h3 class="fn">void<a name="fac83b"></a>QFileDialog::addToolButton(<a href="qbutton.html">QButton</a>*b, boolseparator=FALSE) <code>[protected]</code></h3>
<p>Adds a the button <em>b</em> to the row of tool buttons on the top of the
filedialog. The button is appended at the end (right) of
this row. If <em>separator</em> is TRUE, a small space is inserted between the
last button of the row and the new button <em>b.</em>
<p>See also  <a href="#796e3b">addWidgets</a>(), <a href="#c3210e">addLeftWidget</a>() and <a href="#a76ef4">addRightWidget</a>().
<h3 class="fn">void<a name="796e3b"></a>QFileDialog::addWidgets(<a href="qlabel.html">QLabel</a>*l, <a href="qwidget.html">QWidget</a>*w, <a href="qpushbutton.html">QPushButton</a>*b) <code>[protected]</code></h3>
<p>Adds 1-3 widgets to the bottom of the file dialog. <em>l</em> is the
(optional) label, which is put beneath the "file name" and "file
type" labels, <em>w</em> is a (optional) widget, which is put beneath the
file type combo box, and <em>b</em> is the (you guessed it - optional)
button, which is put beneath the cancel button.
<p>If you don't want to add something in one of the columns, pass 0.
<p>Each time calling this method adds a new row of widgets to the
bottom of the filedialog.
<p>See also  <a href="#fac83b">addToolButton</a>(), <a href="#c3210e">addLeftWidget</a>() and <a href="#a76ef4">addRightWidget</a>().
<h3 class="fn">const<a href="qdir.html">QDir</a>*<a name="331d9e"></a>QFileDialog::dir()const</h3>
<p>Returns the active directory in the file dialog.
<p>See also  <a href="#1c94c2">setDir</a>().
<h3 class="fn">void<a name="e3ab7b"></a>QFileDialog::dirEntered(const<a href="qstring.html">QString</a>&) <code>[signal]</code></h3>
<p>This signal is emitted when the user has selected a new directory.
<h3 class="fn"><a href="qstring.html">QString</a><a name="79c29b"></a>QFileDialog::dirPath()const</h3>
<p>Returns the active directory path string in the file dialog.
<p>See also  <a href="#331d9e">dir</a>() and <a href="#1c94c2">setDir</a>().
<h3 class="fn">void<a name="7e47f3"></a>QFileDialog::done(inti) <code>[virtualslot]</code></h3>
<p>Reimplemented for internal reasons; the API is not affected.
<p>Reimplemented from <a href="qdialog.html#c2ca17">QDialog.</a>
<h3 class="fn">bool<a name="ff0700"></a>QFileDialog::eventFilter(<a href="qobject.html">QObject</a>*o, <a href="qevent.html">QEvent</a>*e) <code>[virtual]</code></h3>
<p>Reimplemented for internal reasons; the API is not affected.
<p>Reimplemented from <a href="qobject.html#bb8547">QObject.</a>
<h3 class="fn">void<a name="b814e3"></a>QFileDialog::fileHighlighted(const<a href="qstring.html">QString</a>&) <code>[signal]</code></h3>
<p>This signal is emitted when the user highlights a file.
<h3 class="fn">void<a name="fbed6f"></a>QFileDialog::fileSelected(const<a href="qstring.html">QString</a>&) <code>[signal]</code></h3>
<p>This signal is emitted when the user selects a file.
<h3 class="fn"><a href="qstring.html">QString</a><a name="7ffd07"></a>QFileDialog::getExistingDirectory(const<a href="qstring.html">QString</a>&dir, <a href="qwidget.html">QWidget</a>*parent, constchar*name, const<a href="qstring.html">QString</a>&caption, booldirOnly) <code>[static]</code></h3>
<p>Ask the user for the name of an existing directory, starting at
<em>dir.</em>  Returns the name of the directory the user selected.
<p>If <em>dir</em> is null, getExistingDirectory() starts wherever the
previous file dialog left off.
<p><em>caption</em> specifies the caption of the dialog, if this is empty a
default caption will be used. If <em>dirOnly</em> if TRUE no files will be
displayed in the file view widgets.
<h3 class="fn"><a href="qstring.html">QString</a><a name="00d360"></a>QFileDialog::getExistingDirectory(const<a href="qstring.html">QString</a>&dir=QString::null, <a href="qwidget.html">QWidget</a>*parent=0, constchar*name=0) <code>[static]</code></h3>
<p>This is an overloaded member function, provided for convenience.  It differs from the above function only in what argument(s) it accepts.
<h3 class="fn"><a href="qstring.html">QString</a><a name="8fb0f3"></a>QFileDialog::getExistingDirectory(const<a href="qstring.html">QString</a>&dir, <a href="qwidget.html">QWidget</a>*parent, constchar*name, const<a href="qstring.html">QString</a>&caption) <code>[static]</code></h3>
<p>This is an overloaded member function, provided for convenience.  It differs from the above function only in what argument(s) it accepts.
<h3 class="fn"><a href="qstring.html">QString</a><a name="2c9384"></a>QFileDialog::getOpenFileName(const<a href="qstring.html">QString</a>&startWith, const<a href="qstring.html">QString</a>&filter, <a href="qwidget.html">QWidget</a>*parent, constchar*name, const<a href="qstring.html">QString</a>&caption) <code>[static]</code></h3>
<p>Opens a modal file dialog and returns the name of the file to be
opened.
<p>If <em>startWith</em> is the name of a directory, the dialog starts off in
that directory.  If <em>startWith</em> is the name of an existing file,
the dialogs starts in that directory, and with <em>startWith</em>
selected.
<p>Only files matching <em>filter</em> are selectable.  If <em>filter</em> is QString::null,
all files are selectable. In the filter string multiple filters can be specified
separated by either two semicolons next to each other or separated by newlines. To add
two filters, one to show all C++ files and one to show all header files, the filter
string could look like "C++ Files (*.cpp *.cc *.C *.cxx *.c++);;Header Files (*.h *.hxx *.h++)"
<p>If <em>widget</em> and/or <em>name</em> is provided, the dialog will be centered
over <em>widget</em> and <a href="qobject.html#6f3030">named</a> <em>name.</em>
<p>getOpenFileName() returns a <a href="qstring.html#a2a6ba">null string</a> if the user cancelled the dialog.
<p>This static function is less capable than the full QFileDialog object,
but is convenient and easy to use.
<p>Example:
<pre>    // start at the current working directory and with *.cpp as filter
    <a href="qstring.html">QString</a> f = QFileDialog::getOpenFileName( QString::null, "*.cpp", this );
    if ( !f.<a href="qstring.html#9a6d7e">isEmpty</a>() ) {
        // the user selected a valid existing file
    } else {
        // the user cancelled the dialog
    }
</pre>
<p><a href="#cbbb2e">getSaveFileName</a>() is another convenience function, equal to this one
except that it allows the user to specify the name of a nonexistent file
name.
<p>NOTE: In the windows version of Qt this static method uses the native
windows file dialog, and not the QFileDialog.
<p>See also  <a href="#cbbb2e">getSaveFileName</a>().
<h3 class="fn"><a href="qstring.html">QString</a><a name="0db5a5"></a>QFileDialog::getOpenFileName(const<a href="qstring.html">QString</a>&startWith=QString::null, const<a href="qstring.html">QString</a>&filter=QString::null, <a href="qwidget.html">QWidget</a>*parent=0, constchar*name=0) <code>[static]</code></h3>
<p>This is an overloaded member function, provided for convenience.  It differs from the above function only in what argument(s) it accepts.
<h3 class="fn"><a href="qstringlist.html">QStringList</a><a name="76e2a5"></a>QFileDialog::getOpenFileNames(const<a href="qstring.html">QString</a>&filter, const<a href="qstring.html">QString</a>&dir, <a href="qwidget.html">QWidget</a>*parent, constchar*name, const<a href="qstring.html">QString</a>&caption) <code>[static]</code></h3>
<p>Lets the user select N files from a single directory, and returns
a list of the selected files.  The list may be empty, and the file
names are fully qualified (i.e. "/usr/games/quake" or
"c:\\quake\\quake").
<p><em>filter</em> is the default glob pattern (which the user can change).
The default is all files. In the filter string multiple filters can be specified
separated by either two semicolons next to each other or separated by newlines. To add
two filters, one to show all C++ files and one to show all header files, the filter
string could look like "C++ Files (*.cpp *.cc *.C *.cxx *.c++);;Header Files (*.h *.hxx *.h++)"
<p><em>dir</em> is the starting directory.  If <em>dir</em> is not supplied, QFileDialog picks something presumably useful
(such as the directory where the user selected something last, or
the current working directory).
<p><em>parent</em> is a widget over which the dialog should be positioned and
<em>name</em> is the object name of the temporary QFileDialog object.
<p>Example:
<p><pre>    <a href="qstringlist.html">QStringList</a> s( <a href="#76e2a5">QFileDialog::getOpenFileNames</a>() );
    // do something with the files in s.
</pre>
<p>NOTE: In the windows version of Qt this static method uses the native
windows file dialog, and not the QFileDialog.
<h3 class="fn"><a href="qstringlist.html">QStringList</a><a name="89d3cd"></a>QFileDialog::getOpenFileNames(const<a href="qstring.html">QString</a>&filter=QString::null, const<a href="qstring.html">QString</a>&dir=QString::null, <a href="qwidget.html">QWidget</a>*parent=0, constchar*name=0) <code>[static]</code></h3>
<p>This is an overloaded member function, provided for convenience.  It differs from the above function only in what argument(s) it accepts.
<h3 class="fn"><a href="qstring.html">QString</a><a name="cbbb2e"></a>QFileDialog::getSaveFileName(const<a href="qstring.html">QString</a>&startWith, const<a href="qstring.html">QString</a>&filter, <a href="qwidget.html">QWidget</a>*parent, constchar*name, const<a href="qstring.html">QString</a>&caption) <code>[static]</code></h3>
<p>Opens a modal file dialog and returns the name of the file to be
saved.
<p>If <em>startWith</em> is the name of a directory, the dialog starts off in
that directory.  If <em>startWith</em> is the name of an existing file,
the dialogs starts in that directory, and with <em>startWith</em>
selected.
<p>Only files matching <em>filter</em> are selectable.  If <em>filter</em> is QString::null,
all files are selectable. In the filter string multiple filters can be specified
separated by either two semicolons next to each other or separated by newlines. To add
two filters, one to show all C++ files and one to show all header files, the filter
string could look like "C++ Files (*.cpp *.cc *.C *.cxx *.c++);;Header Files (*.h *.hxx *.h++)"
<p>If <em>widget</em> and/or <em>name</em> is provided, the dialog will be centered
over <em>widget</em> and <a href="qobject.html#6f3030">named</a> <em>name.</em>
<p>Returns a <a href="qstring.html#a2a6ba">null string</a> if the user
cancelled the dialog.
<p>This static function is less capable than the full QFileDialog object,
but is convenient and easy to use.
<p>Example:
<pre>    // start at the current working directory and with *.cpp as filter
    <a href="qstring.html">QString</a> f = QFileDialog::getSaveFileName( QString::null, "*.cpp", this );
    if ( !f.<a href="qstring.html#9a6d7e">isEmpty</a>() ) {
        // the user gave a file name
    } else {
        // the user cancelled the dialog
    }
</pre>
<p><a href="#2c9384">getOpenFileName</a>() is another convenience function, equal to this one
except that it does not allow the user to specify the name of a
nonexistent file name.
<p>NOTE: In the windows version of Qt this static method uses the native
windows file dialog, and not the QFileDialog.
<p>See also  <a href="#2c9384">getOpenFileName</a>().
<h3 class="fn"><a href="qstring.html">QString</a><a name="3c5426"></a>QFileDialog::getSaveFileName(const<a href="qstring.html">QString</a>&startWith=QString::null, const<a href="qstring.html">QString</a>&filter=QString::null, <a href="qwidget.html">QWidget</a>*parent=0, constchar*name=0) <code>[static]</code></h3>
<p>This is an overloaded member function, provided for convenience.  It differs from the above function only in what argument(s) it accepts.
<h3 class="fn"><a href="qfileiconprovider.html">QFileIconProvider</a>*<a name="06d2c5"></a>QFileDialog::iconProvider() <code>[static]</code></h3>
<p>Returns the icon provider currently in use.  By default there is
no icon provider and this function returns 0.
<p>See also  <a href="#7c742a">setIconProvider</a>() and <a href="qfileiconprovider.html">QFileIconProvider</a>.
<h3 class="fn">bool<a name="08318c"></a>QFileDialog::isContentsPreviewEnabled()const</h3>
<p>Returns TRUE if the file dialog offers the user
the possibility to preview the contents of
the currently selected file.
<p>See also  setContentsPreviewWidget().
<h3 class="fn">bool<a name="8df610"></a>QFileDialog::isInfoPreviewEnabled()const</h3>
<p>Returns TRUE if the file dialog offers the user
the possibility to preview the information of
the currently selected file.
<p>See also  <a href="#ad63ae">setInfoPreviewEnabled</a>().
<h3 class="fn">void<a name="460619"></a>QFileDialog::keyPressEvent(<a href="qkeyevent.html">QKeyEvent</a>*ke) <code>[virtualprotected]</code></h3>
<p>Reimplemented for internal reasons; the API is not affected.
<p>Reimplemented from <a href="qwidget.html#cdb1c7">QWidget.</a>
<h3 class="fn">QFileDialog::Mode<a name="b59413"></a>QFileDialog::mode()const</h3>
<p>Returns the file mode of this dialog.
<p>See also  <a href="#002fa6">setMode</a>().
<h3 class="fn">QFileDialog::PreviewMode<a name="7f1ef6"></a>QFileDialog::previewMode()const</h3>
<p>Returns the preview mode of the filedialog.
<p>See also  <a href="#2a7428">setPreviewMode</a>().
<h3 class="fn">void<a name="fc531e"></a>QFileDialog::rereadDir()</h3>
<p>Re-reads the active directory in the file dialog.
<p>It is seldom necessary to call this function.  It is provided in
case the directory contents change and you want to refresh the
directory list box.
<h3 class="fn">void<a name="00aa85"></a>QFileDialog::resizeEvent(<a href="qresizeevent.html">QResizeEvent</a>*e) <code>[virtualprotected]</code></h3>
<p>Reimplemented for internal reasons; the API is not affected.
<p>Reimplemented from <a href="qwidget.html#28c156">QWidget.</a>
<h3 class="fn">void<a name="673d0a"></a>QFileDialog::resortDir()</h3>
<p>Resorts the displayed directory.
<h3 class="fn">void<a name="6d632f"></a>QFileDialog::selectAll(boolb)</h3>
<p>If you pass TRUE for <em>b</em> all files are selected, otherwise they
are de-selected. This only works in ExistingFiles mode.
<h3 class="fn"><a href="qstring.html">QString</a><a name="87e5ca"></a>QFileDialog::selectedFile()const</h3>
<p>Returns the selected file name.
<p>If a file name was selected, the returned string contains the
absolute path name.  The returned string is an empty string if no file
name was selected.
<p>See also  <a href="qstring.html#a2a6ba">QString::isNull</a>(), <a href="#4703d8">QFileDialog::selectedFiles</a>() and <a href="#43c7cc">QFileDialog::selectedFilter</a>().
<h3 class="fn"><a href="qstringlist.html">QStringList</a><a name="4703d8"></a>QFileDialog::selectedFiles()const</h3>
<p>Returns a list of selected files. This is only useful,
if the mode of the filedialog is ExistingFiles. Else
the list will only contain one entry, which is the
the selectedFile. If no files were selected, this list
is empty.
<p>See also  <a href="#87e5ca">QFileDialog::selectedFile</a>() and <a href="qvaluelist.html#bfa923">QValueList::isEmpty</a>().
<h3 class="fn"><a href="qstring.html">QString</a><a name="43c7cc"></a>QFileDialog::selectedFilter()const</h3>
<p>Returns the filter which the user has chosen in
the file dialog.
<p>See also  <a href="qstring.html#a2a6ba">QString::isNull</a>() and <a href="#4703d8">QFileDialog::selectedFiles</a>().
<h3 class="fn">void<a name="ffd0e7"></a>QFileDialog::setContentsPreview(<a href="qwidget.html">QWidget</a>*w, <a href="qfilepreview.html">QFilePreview</a>*preview)</h3>
<p>Sets the widget which should be used for displaying the contents
of a file to <em>w</em> and the preview object of that to <em>preview.</em>
<p>Normally as preview widget you create a class which derives from
a widget type class (which actually displays the preview) and
from <a href="qfilepreview.html">QFilePreview</a>. So you will pass here two times the same pointer
then.
<p>A implementation of a preview class could look like this:
<p><pre>  class MyPreview : public QWidget, public QFilePreview
  {
  public:
      MyPreview() : <a href="qwidget.html">QWidget</a>(), QFilePreview() {}
      // reimplementation from QFilePreview
      void previewUrl( const QUrl &url ) {
          <a href="qpainter.html">QPainter</a> p( this );
          p.drawThePreviewOfUrl();
          p.<a href="qpainter.html#c7f9ac">end</a>();
      }
  }
</pre>
<p>Later you would use this...
<p><pre>  MyPreview *preview = new MyPreview;
  fd.setInfoPreviewEnabled( TRUE );
  fd.setInfoPreview( preview, preview );
</pre>
<h3 class="fn">void<a name="53a9d7"></a>QFileDialog::setContentsPreviewEnabled(boolcontents)</h3>
<p>Specifies if the filedialog should offer the possibility
to preview the contents of the currently selected
file, if <em>contents</em> is TRUE, else not.
<p>See also  <a href="#93d0d6">setInfoPreview</a>().
<h3 class="fn">void<a name="b67d89"></a>QFileDialog::setDir(const<a href="qdir.html">QDir</a>&dir)</h3>
<p>Sets a directory path for the file dialog.
<p>See also  <a href="#331d9e">dir</a>().
<h3 class="fn">void<a name="1c94c2"></a>QFileDialog::setDir(const<a href="qstring.html">QString</a>&pathstr) <code>[slot]</code></h3>
<p>Sets a directory path string for the file dialog.
<p>See also  <a href="#331d9e">dir</a>().
<h3 class="fn">void<a name="f25fe3"></a>QFileDialog::setFilter(const<a href="qstring.html">QString</a>&newFilter) <code>[slot]</code></h3>
<p>Sets the filter spec in use to <em>newFilter.</em>
<p>If <em>newFilter</em> matches the regular expression
<tt>([a-zA-Z0-9\.\*\?\ \+\;]*)$</tt> (ie. it ends with a normal wildcard
expression enclosed in parentheses), only the parenthesized is used.
This means that these calls are all equivalent:
<p><pre>     fd->setFilter( "All C++ files (*.cpp *.cc *.C *.cxx *.c++)" );
     fd->setFilter( "*.cpp *.cc *.C *.cxx *.c++" )
     fd->setFilter( "All C++ files (*.cpp;*.cc;*.C;*.cxx;*.c++)" );
     fd->setFilter( "*.cpp;*.cc;*.C;*.cxx;*.c++" )
</pre>
<h3 class="fn">void<a name="d748ad"></a>QFileDialog::setFilters(constchar**types) <code>[slot]</code></h3>
<p>Sets this file dialog to offer <em>types</em> in the File Type combo
box.  <em>types</em> must be a null-terminated list of strings; each
string must be in the format described in the documentation for
<a href="#f25fe3">setFilter</a>().
<p>See also  <a href="#f25fe3">setFilter</a>().
<h3 class="fn">void<a name="14cadd"></a>QFileDialog::setFilters(const<a href="qstring.html">QString</a>&) <code>[slot]</code></h3>
<p>This is an overloaded member function, provided for convenience.  It differs from the above function only in what argument(s) it accepts.
<h3 class="fn">void<a name="3e010d"></a>QFileDialog::setFilters(const<a href="qstringlist.html">QStringList</a>&) <code>[slot]</code></h3>
<p>This is an overloaded member function, provided for convenience.  It differs from the above function only in what argument(s) it accepts.
<h3 class="fn">void<a name="7c742a"></a>QFileDialog::setIconProvider(<a href="qfileiconprovider.html">QFileIconProvider</a>*provider) <code>[static]</code></h3>
<p>Sets all file dialogs to use <em>provider</em> to select icons to draw
for each file.  By default there is no icon provider, and
QFileDialog simply draws a "folder" icon next to each directory and
nothing next to the files.
<p>See also  <a href="qfileiconprovider.html">QFileIconProvider</a> and <a href="#06d2c5">iconProvider</a>().
<p>Examples:
 <a href="showimg-main-cpp.html#QFileDialog::setIconProvider">showimg/main.cpp</a>
<h3 class="fn">void<a name="93d0d6"></a>QFileDialog::setInfoPreview(<a href="qwidget.html">QWidget</a>*w, <a href="qfilepreview.html">QFilePreview</a>*preview)</h3>
<p>Sets the widget which should be used for displaying information
of a file to <em>w</em> and the preview object of that to <em>preview.</em>
<p>Normally as preview widget you create a class which derives from
a widget type class (which actually displays the preview) and
from <a href="qfilepreview.html">QFilePreview</a>. So you will pass here two times the same pointer
then.
<p>A implementation of a preview class could look like this:
<p><pre>  class MyPreview : public QWidget, public QFilePreview
  {
  public:
      MyPreview() : <a href="qwidget.html">QWidget</a>(), QFilePreview() {}
      // reimplementation from QFilePreview
      void previewUrl( const QUrl &url ) {
          <a href="qpainter.html">QPainter</a> p( this );
          p.drawThePreviewOfUrl();
          p.<a href="qpainter.html#c7f9ac">end</a>();
      }
  }
</pre>
<p>Later you would use this...
<p><pre>  MyPreview *preview = new MyPreview;
  fd.setInfoPreviewEnabled( TRUE );
  fd.setInfoPreview( preview, preview );
</pre>
<h3 class="fn">void<a name="ad63ae"></a>QFileDialog::setInfoPreviewEnabled(boolinfo)</h3>
<p>Specifies if the filedialog should offer the possibility
to preview the information of the currently selected
file, if <em>info</em> is TRUE, else not.
<p>See also  <a href="#93d0d6">setInfoPreview</a>().
<h3 class="fn">void<a name="002fa6"></a>QFileDialog::setMode(<a href="qfiledialog.html#Mode">Mode</a>newMode)</h3>
<p>Sets this file dialog to <em>newMode,</em> which can be one of <code>Directory</code> (directories are accepted), <code>ExistingFile</code> (existing
files are accepted), <code>AnyFile</code> (any valid file name is accepted)
or <code>ExistingFiles</code> (like <code>ExistingFile,</code> but multiple files may be
selected)
<p>See also  <a href="#b59413">mode</a>().
<h3 class="fn">void<a name="2a7428"></a>QFileDialog::setPreviewMode(<a href="qfiledialog.html#PreviewMode">PreviewMode</a>m)</h3>
<p>Set the preview mode of the filedialog. You can choose between
NoPreview, Info and Contents.
<p>To be able to set a preview mode other than NoPreview you need
to set the preview widget, and enable this preview mode.
<p>See also  <a href="#ad63ae">setInfoPreviewEnabled</a>(), <a href="#53a9d7">setContentsPreviewEnabled</a>(), <a href="#93d0d6">setInfoPreview</a>() and <a href="#ffd0e7">setContentsPreview</a>().
<h3 class="fn">void<a name="8e8f0c"></a>QFileDialog::setSelection(const<a href="qstring.html">QString</a>&filename)</h3>
<p>Sets the default selection to <em>filename.</em>  If <em>filename</em> is
absolute, <a href="#1c94c2">setDir</a>() is also called.
<h3 class="fn">void<a name="645886"></a>QFileDialog::setShowHiddenFiles(bools)</h3>
<p>If <em>s</em> is TRUE, hidden files are shown in the filedialog, else
no hidden files are shown.
<h3 class="fn">void<a name="e967c6"></a>QFileDialog::setUrl(const<a href="qurloperator.html">QUrlOperator</a>&url) <code>[slot]</code></h3>
<p>Sets the <em>url</em> which should be used as working directory.
<h3 class="fn">void<a name="b9f368"></a>QFileDialog::setViewMode(<a href="qfiledialog.html#ViewMode">ViewMode</a>m)</h3>
<p>Sets the viewmode of the filedialog. You can choose between
Detail, List.
<p>See also  <a href="#2a7428">setPreviewMode</a>().
<h3 class="fn">bool<a name="edf18e"></a>QFileDialog::showHiddenFiles()const</h3>
<p>Returns TRUE if hidden files are shown in the filedialog, else FALSE.
<h3 class="fn"><a href="qurl.html">QUrl</a><a name="b10921"></a>QFileDialog::url()const</h3>
<p>Returns the URL of the current working directory.
<h3 class="fn">QFileDialog::ViewMode<a name="539ecb"></a>QFileDialog::viewMode()const</h3>
<p>Returns the viewmode of the filedialog.
<p>See also  <a href="#b9f368">setViewMode</a>().
<hr><p>
Search the documentation, FAQ, qt-interest archive and more (uses
<a href="http://www.trolltech.com">www.trolltech.com</a>):<br>
<form method=post action="http://www.trolltech.com/search.cgi">
<input type=hidden name="version" value="2.3.1"><nobr>
<input size="50" name="search"><input type=submit value="Search">
</nobr></form><hr><p>
This file is part of the <a href="index.html">Qt toolkit</a>,
copyright © 1995-2000
<a href="http://www.trolltech.com">Trolltech</a>, all rights reserved.<p><address><hr><div align="center">
<table width="100%" cellspacing="0" border="0"><tr>
<td>Copyright  2000 Trolltech<td><a href="http://www.trolltech.com/trademarks.html">Trademarks</a>
<td align="right"><div align="right">Qt version 2.3.1</div>
</table></div></address></body></html>
 |