Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

QtFileDialog Class Reference

#include <QtFileDialog.h>

Inheritance diagram for QtFileDialog:

Inheritance graph
[legend]
Collaboration diagram for QtFileDialog:

Collaboration graph
[legend]
List of all members.

Detailed Description

A custom file dialog to allow users to select file of various types supported by HippoDraw.

Bug:
The dialog should remember the suffic of the last file selected.

Author:
Paul F. Kunz <Paul_Kunz@slac.stanford.edu>

Definition at line 35 of file QtFileDialog.h.

Public Member Functions

 addFilter (const QString &filter)
 addLeftWidget (QWidget *w)
 addRightWidget (QWidget *w)
 addToolButton (QButton *b, bool separator=FALSE)
 addWidgets (QLabel *l, QWidget *w, QPushButton *b)
void createBrowseFilter ()
 Creates the open file filter.
void createOpenFilter ()
 Creates the open file filter.
 dir () const
 dirEntered (const QString &)
 dirPath () const
 enum {NoPreview, Contents, Info}
 enum {Detail, List}
 enum {AnyFile, ExistingFile, Directory, ExistingFiles, DirectoryOnly}
int exec ()
 Shows the dialog as a modal dialog allowing user to select a single file.
 fileHighlighted (const QString &)
 fileSelected (const QString &)
 filesSelected (const QStringList &)
 filterSelected (const QString &)
 getExistingDirectory (const QString &dir=QString::null, QWidget *parent=0, const char *name=0, const QString &caption=QString::null, bool dirOnly=TRUE, bool resolveSymlinks=TRUE)
 getOpenFileName (const QString &startWith=QString::null, const QString &filter=QString::null, QWidget *parent=0, const char *name=0, const QString &caption=QString::null, QString *selectedFilter=0, bool resolveSymlinks=TRUE)
 getOpenFileNames (const QString &filter=QString::null, const QString &dir=QString::null, QWidget *parent=0, const char *name=0, const QString &caption=QString::null, QString *selectedFilter=0, bool resolveSymlinks=TRUE)
std::string getSaveDocFilename ()
 Displays a file dialog for the user to select a filename for saving the document.
 getSaveFileName (const QString &startWith=QString::null, const QString &filter=QString::null, QWidget *parent=0, const char *name=0, const QString &caption=QString::null, QString *selectedFilter=0, bool resolveSymlinks=TRUE)
 iconProvider ()
 isContentsPreviewEnabled () const
bool isFitsFile (const std::string &filename) const
 Returns true if the file filename is a FITS file.
bool isFitsSuffix (const std::string &suffix) const
 Returns true if suffix is one corresponding to FITS DataSource file.
 isInfoPreviewEnabled () const
bool isRootSuffix (const std::string &suffix) const
 Returns true if suffic is one corresponding to ROOT DataSource files.
 mode () const
void openFitsTuple (const std::string &filename)
 Opens a FITS DataSource file.
void openRootTuple (const std::string &filename)
 Opens a ROOT DataSource file.
 previewMode () const
 prop -the file dialog's view mode
 prop -whether hidden files are shown in the file dialog
 prop -the filter which the user has selected in the file dialog
 prop -the list of selected files
 prop -the name of the selected file
 prop -the preview mode for the file dialog
 prop -the file dialog's mode
 prop -whether the file dialog can provide preview information about the currently selected file
 prop -the file dialog's working directory
 prop -whether the file dialog can provide a contents preview of the currently selected file
 QtFileDialog (const QString &dirName, QWidget *parent=0, const char *name=0, bool modal=FALSE)
 The constructor.
 rereadDir ()
 resortDir ()
 selectAll (bool b)
 selectedFile () const
 selectedFiles () const
 selectedFilter () const
 setContentsPreview (QWidget *w, QFilePreview *preview)
 setContentsPreviewEnabled (bool)
 setDir (const QString &pathstr)
 setDir (const QDir &dir)
 setFilter (const QString &newFilter)
 setFilters (const QStringList &)
 setFilters (const char **types)
 setFilters (const QString &filters)
 setIconProvider (QFileIconProvider *provider)
 setInfoPreview (QWidget *w, QFilePreview *preview)
 setInfoPreviewEnabled (bool)
 setMode (Mode)
 setPreviewMode (PreviewMode m)
 setSelectedFilter (int n)
 setSelectedFilter (const QString &mask)
 setSelection (const QString &filename)
 setShowHiddenFiles (bool s)
 setUrl (const QUrlOperator &url)
 setViewMode (ViewMode m)
 showHiddenFiles () const
 url () const
 viewMode () const

Static Public Member Functions

static const std::stringgetDocSuffix ()
 Returns the suffix for a document.
static const std::stringgetTextSuffix ()
 Returns the suffix for a text data source files.
static bool isDocSuffix (const std::string &suffix)
 Returns true if suffix is one corresponding to document file.
static bool isTextSuffix (const std::string &suffix)
 Returns true if suffix is one corresponding to text NTuple file.
static void openFileError (const std::string &filename, std::exception &e)
 Raises dialog box for error in opening file.
static void openTextTuple (const std::string &filename)
 Opens a text NTuple file.

Private Attributes

std::string m_open_filter
 The open file filter.

Static Private Attributes

static const std::string s_data_suffix = ".tnt"
 The file name suffix used for the application's text data source files.
static const std::string s_doc_suffix = ".hpo"
 The file name suffix used for the application's document files.


Constructor & Destructor Documentation

QtFileDialog::QtFileDialog const QString dirName,
QWidget parent = 0,
const char *  name = 0,
bool  modal = FALSE
 

The constructor.

Definition at line 43 of file QtFileDialog.cxx.


Member Function Documentation

void QtFileDialog::createBrowseFilter  ) 
 

Creates the open file filter.

Definition at line 97 of file QtFileDialog.cxx.

References m_open_filter, and s_doc_suffix.

void QtFileDialog::createOpenFilter  ) 
 

Creates the open file filter.

Definition at line 53 of file QtFileDialog.cxx.

References m_open_filter, and s_doc_suffix.

Referenced by exec().

int QtFileDialog::exec  ) 
 

Shows the dialog as a modal dialog allowing user to select a single file.

Returns a QDialog::DialogCode result

Definition at line 222 of file QtFileDialog.cxx.

References createOpenFilter(), m_open_filter, QFileDialog::setFilters(), and QFileDialog::setMode().

Referenced by openFitsTuple(), and openRootTuple().

const std::string & QtFileDialog::getDocSuffix  )  [static]
 

Returns the suffix for a document.

Definition at line 124 of file QtFileDialog.cxx.

References s_doc_suffix.

std::string QtFileDialog::getSaveDocFilename  ) 
 

Displays a file dialog for the user to select a filename for saving the document.

Definition at line 166 of file QtFileDialog.cxx.

References QFileInfo::absFilePath(), QString::endsWith(), QFileInfo::exists(), QString::isEmpty(), QString::latin1(), s_doc_suffix, QFileDialog::selectedFile(), QFileDialog::setFilters(), QFileDialog::setMode(), and QMessageBox::warning().

const std::string & QtFileDialog::getTextSuffix  )  [static]
 

Returns the suffix for a text data source files.

Definition at line 131 of file QtFileDialog.cxx.

References s_data_suffix.

Referenced by CanvasWindow::fileExportTextTuple(), and CanvasWindow::saveAllAs().

bool QtFileDialog::isDocSuffix const std::string suffix  )  [static]
 

Returns true if suffix is one corresponding to document file.

Definition at line 138 of file QtFileDialog.cxx.

References s_doc_suffix.

Referenced by QtApp::setFirstWindow().

bool QtFileDialog::isFitsFile const std::string filename  )  const
 

Returns true if the file filename is a FITS file.

Definition at line 260 of file QtFileDialog.cxx.

References FitsController::instance(), and FitsController::openFile().

bool QtFileDialog::isFitsSuffix const std::string suffix  )  const
 

Returns true if suffix is one corresponding to FITS DataSource file.

Definition at line 159 of file QtFileDialog.cxx.

bool QtFileDialog::isRootSuffix const std::string suffix  )  const
 

Returns true if suffic is one corresponding to ROOT DataSource files.

Definition at line 152 of file QtFileDialog.cxx.

bool QtFileDialog::isTextSuffix const std::string suffix  )  [static]
 

Returns true if suffix is one corresponding to text NTuple file.

Definition at line 145 of file QtFileDialog.cxx.

References s_data_suffix.

Referenced by QtApp::setFirstWindow().

void QtFileDialog::openFileError const std::string filename,
std::exception e
[static]
 

Raises dialog box for error in opening file.

Raises dialog box for error opening file, giving the file name filename and the reason for the error from the message in the exception e.

Definition at line 372 of file QtFileDialog.cxx.

References QMessageBox::critical().

void QtFileDialog::openFitsTuple const std::string filename  ) 
 

Opens a FITS DataSource file.

Definition at line 280 of file QtFileDialog.cxx.

References exec(), QMessageBox::information(), FitsController::instance(), and DataSourceException::what().

void QtFileDialog::openRootTuple const std::string filename  ) 
 

Opens a ROOT DataSource file.

Definition at line 324 of file QtFileDialog.cxx.

References exec(), QMessageBox::information(), RootController::instance(), and DataSourceException::what().

void QtFileDialog::openTextTuple const std::string filename  )  [static]
 

Opens a text NTuple file.

Definition at line 236 of file QtFileDialog.cxx.

References QString::append(), QMessageBox::critical(), NTupleController::instance(), and DataSourceException::what().

Referenced by QtApp::setFirstWindow().


Member Data Documentation

std::string QtFileDialog::m_open_filter [private]
 

The open file filter.

Definition at line 55 of file QtFileDialog.h.

Referenced by createBrowseFilter(), createOpenFilter(), and exec().

const string QtFileDialog::s_data_suffix = ".tnt" [static, private]
 

The file name suffix used for the application's text data source files.

Definition at line 40 of file QtFileDialog.cxx.

Referenced by getTextSuffix(), and isTextSuffix().

const string QtFileDialog::s_doc_suffix = ".hpo" [static, private]
 

The file name suffix used for the application's document files.

Definition at line 39 of file QtFileDialog.cxx.

Referenced by createBrowseFilter(), createOpenFilter(), getDocSuffix(), getSaveDocFilename(), and isDocSuffix().


The documentation for this class was generated from the following files:
Generated for HippoDraw-1.14.8.5 by doxygen 1.4.3