From $ROOTSYS/tutorials/gui/QtFileDialog.C

// @(#)root/qt:$Name:  $:$Id$
// Author: Valeri Fine   23/03/2006
#ifndef __CINT__
#  include <QFileDialog>
#  include <QString>
#  include "TString.h"
#  include <string>
#endif
TString QtFileDialog() {
  // This is a small ROOT macro to use Qt 3.3 class: begin_html <a href="http://doc.trolltech.com/3.3/qfiledialog.html">QFileDialog</a> end_html
  // See: begin_html <a href="http://doc.trolltech.com/3.3/qfiledialog.html#getOpenFileName">http://doc.trolltech.com/3.3/qfiledialog.html#getOpenFileName</a> end_html
  //
  // To use, invoke ACLiC from the ROOT prompt:
  // root [] .x QtFileDialog.C++
  //
  // To use it with no ACLiC, omit the trailing "++"
  // root [] .x QtFileDialog.C
  //
  // The QtFileDialog returns TString object that contains the selected file name.
  // returns its pointer.
  // The macro QtMultiFileDialog.C provides an advanced example.
  //
  // The full list of the Qt classes available from Cint is defined by
  // begin_html <a href="http://root.bnl.gov/QtRoot/htmldoc/src/qtclasses.h.html">by $ROOTSYS/cint/lib/qtclasses.h</a> end_html
  //
  // All Qt classes can be used from ACLiC though.

#ifdef __CINT__
  // Load the qt cint dictionary.
  // One is recommended to do that at once somewhere.
  // For example from one's custom rootlogon.C script
  gSystem->Load("$ROOTSYS/cint/cint/include/qtcint");
#endif
  QString fileName = QFileDialog::getOpenFileName ();
  std::string flnm = fileName.toStdString();
  return TString(flnm.c_str());
}

 QtFileDialog.C:1
 QtFileDialog.C:2
 QtFileDialog.C:3
 QtFileDialog.C:4
 QtFileDialog.C:5
 QtFileDialog.C:6
 QtFileDialog.C:7
 QtFileDialog.C:8
 QtFileDialog.C:9
 QtFileDialog.C:10
 QtFileDialog.C:11
 QtFileDialog.C:12
 QtFileDialog.C:13
 QtFileDialog.C:14
 QtFileDialog.C:15
 QtFileDialog.C:16
 QtFileDialog.C:17
 QtFileDialog.C:18
 QtFileDialog.C:19
 QtFileDialog.C:20
 QtFileDialog.C:21
 QtFileDialog.C:22
 QtFileDialog.C:23
 QtFileDialog.C:24
 QtFileDialog.C:25
 QtFileDialog.C:26
 QtFileDialog.C:27
 QtFileDialog.C:28
 QtFileDialog.C:29
 QtFileDialog.C:30
 QtFileDialog.C:31
 QtFileDialog.C:32
 QtFileDialog.C:33
 QtFileDialog.C:34
 QtFileDialog.C:35
 QtFileDialog.C:36
 QtFileDialog.C:37
 QtFileDialog.C:38
 QtFileDialog.C:39