ParaView
Public Types | Signals | Public Member Functions | Protected Member Functions
pqFileDialog Class Reference

Provides a standard file dialog "front-end" for the pqFileDialogModel "back-end", i.e. More...

#include <pqFileDialog.h>

List of all members.

Public Types

enum  FileMode { AnyFile, ExistingFile, ExistingFiles, Directory }
 choose mode for selecting file/folder. More...

Signals

void filesSelected (const QList< QStringList > &)
 Signal emitted when the user has chosen a set of files.
void filesSelected (const QStringList &)
 Signal emitted when the user has chosen a set of files NOTE: The mode has to be not ExistingFiles for this signal to be emitted! This signal is deprecated and should not be used anymore.
void fileAccepted (const QString &)
 signal emitted when user has chosen a set of files and accepted the dialog.

Public Member Functions

 pqFileDialog (pqServer *, QWidget *Parent, const QString &Title=QString(), const QString &Directory=QString(), const QString &Filter=QString())
 Creates a file dialog with the specified server if the server is NULL, files are browsed locally the title, and start directory may be specified the filter is a string of semi-colon separated filters.
 ~pqFileDialog ()
void setFileMode (FileMode)
 set the file mode
void setRecentlyUsedExtension (const QString &fileExtension)
 set the most recently used file extension
QStringList getSelectedFiles (int index=0)
 Returns the group of files for the given index.
QList< QStringList > getAllSelectedFiles ()
 Returns all the file groups.
void accept ()
 accept this dialog
bool selectFile (const QString &)
 set a file current to support test playback
void setShowHidden (const bool &hidden)
 set if we show hidden files and holders
bool getShowHidden ()
 returns the state of the show hidden flag

Protected Member Functions

bool acceptExistingFiles ()
bool acceptDefault (const bool &checkForGrouping)
QStringList buildFileGroup (const QString &filename)
virtual void showEvent (QShowEvent *showEvent)

Detailed Description

Provides a standard file dialog "front-end" for the pqFileDialogModel "back-end", i.e.

it can be used for both local and remote file browsing.

pqFileDialog can be used in both "modal" and "non-modal" operations. For "non-modal" operation, create an instance of pqFileDialog on the heap, set the Qt::WA_DeleteOnClose flag, connect to the fileSelected() signal, and show the dialog. The dialog will be automatically destroyed when the user completes their file selection, and your slot will be called with the files the user selected:

/code pqFileDialog* dialog = new pqFileDialog(NULL, this); dialog->setAttribute(Qt::WA_DeleteOnClose);

QObject::connect( dialog, SIGNAL(filesSelected(const QList<QStringList>&)), this, SLOT(onOpenSessionFile(const QList<QStringList>&)));

dialog->show(); /endcode

For "modal" operation, create an instance of pqFileDialog on the stack, call its exec() method, and retrieve the user's file selection with the getSelectedFiles() method:

/code pqFileDialog dialog(NULL, this); if(Qt::Accepted == dialog.exec()) { each string list holds a list of files that represent a file-series QList<QStringList> files = dialog.getAllSelectedFiles(); } /endcode

See also:
pqFileDialogModel

Definition at line 85 of file pqFileDialog.h.


Member Enumeration Documentation

choose mode for selecting file/folder.

AnyFile: The name of a file, whether it exists or not. Typically used by "Save As..." ExistingFile: The name of a single existing file. Typically used by "Open..." This mode allows the user to select a single file, or one time series group of files. ExistingFiles: The names of zero or more existing files. Typically used by "Open..." when you want multiple file selection This mode allows the user to select multiples files, and multiple time series groups at the same time. Directory: The name of a directory.

Enumerator:
AnyFile 
ExistingFile 
ExistingFiles 
Directory 

Definition at line 102 of file pqFileDialog.h.


Constructor & Destructor Documentation

pqFileDialog::pqFileDialog ( pqServer ,
QWidget *  Parent,
const QString &  Title = QString(),
const QString &  Directory = QString(),
const QString &  Filter = QString() 
)

Creates a file dialog with the specified server if the server is NULL, files are browsed locally the title, and start directory may be specified the filter is a string of semi-colon separated filters.

pqFileDialog::~pqFileDialog ( )

Member Function Documentation

void pqFileDialog::setFileMode ( FileMode  )

set the file mode

void pqFileDialog::setRecentlyUsedExtension ( const QString &  fileExtension)

set the most recently used file extension

QStringList pqFileDialog::getSelectedFiles ( int  index = 0)

Returns the group of files for the given index.

QList<QStringList> pqFileDialog::getAllSelectedFiles ( )

Returns all the file groups.

void pqFileDialog::accept ( )

accept this dialog

bool pqFileDialog::selectFile ( const QString &  )

set a file current to support test playback

void pqFileDialog::setShowHidden ( const bool &  hidden)

set if we show hidden files and holders

bool pqFileDialog::getShowHidden ( )

returns the state of the show hidden flag

void pqFileDialog::filesSelected ( const QList< QStringList > &  ) [signal]

Signal emitted when the user has chosen a set of files.

void pqFileDialog::filesSelected ( const QStringList &  ) [signal]

Signal emitted when the user has chosen a set of files NOTE: The mode has to be not ExistingFiles for this signal to be emitted! This signal is deprecated and should not be used anymore.

Instead use the fileSelected(const QList<QStringList> &)

void pqFileDialog::fileAccepted ( const QString &  ) [signal]

signal emitted when user has chosen a set of files and accepted the dialog.

This signal includes only the path and file string as is This is to support test recording

bool pqFileDialog::acceptExistingFiles ( ) [protected]
bool pqFileDialog::acceptDefault ( const bool &  checkForGrouping) [protected]
QStringList pqFileDialog::buildFileGroup ( const QString &  filename) [protected]
virtual void pqFileDialog::showEvent ( QShowEvent *  showEvent) [protected, virtual]

The documentation for this class was generated from the following file: