casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Slots | Public Member Functions | Static Public Member Functions | Private Slots | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes | List of all members
casa::QtFileDialog Class Reference

Subclass of QFileDialog with additional functionality. More...

#include <QtFileDialog.qo.h>

Inheritance diagram for casa::QtFileDialog:

Public Slots

void accept ()
 Overrides QFileDialog::accept(). More...
 

Public Member Functions

 QtFileDialog (QWidget *parent, Qt::WindowFlags flags)
 Non-Static //. More...
 
 QtFileDialog (QWidget *parent=NULL, const QString &caption=QString(), const QString &directory=lastDirectory(), const QString &filter=QString())
 
 ~QtFileDialog ()
 Destructor. More...
 

Static Public Member Functions

static QString qgetExistingDir (QWidget *parent=NULL, const QString &caption=QString(), const QString &directory=lastDirectory(), int histLimit=historyLimit())
 Static //. More...
 
static casacore::String getExistingDir (QWidget *parent=NULL, const QString &caption=QString(), const QString &directory=lastDirectory(), int histLimit=historyLimit())
 
static QString qgetExistingFile (QWidget *parent=NULL, const QString &caption=QString(), const QString &directory=lastDirectory(), const QString &filter=QString(), int histLimit=historyLimit())
 Returns an existing file using the given optional parent, caption, starting directory, and filter parameters. More...
 
static casacore::String getExistingFile (QWidget *parent=NULL, const QString &caption=QString(), const QString &directory=lastDirectory(), const QString &filter=QString(), int histLimit=historyLimit())
 
static QString qgetAnyFile (QWidget *parent=NULL, const QString &caption=QString(), const QString &directory=lastDirectory(), const QString &=QString(), int histLimit=historyLimit())
 Returns a new filename using the given optional parent, caption, starting directory, and filter parameters. More...
 
static casacore::String getAnyFile (QWidget *parent=NULL, const QString &caption=QString(), const QString &directory=lastDirectory(), const QString &filter=QString(), int histLimit=historyLimit())
 
static const QString & lastDirectory ()
 Gets/Sets the last directory to be used by a QtFileDialog. More...
 
static void setNextDirectory (const QString &directory)
 
static int historyLimit ()
 Gets/Sets the limit for the history size used by a QtFileDialog. More...
 
static void setHistoryLimit (int limit)
 

Private Slots

void timeout ()
 Signal for timer timeout. More...
 

Private Member Functions

void initialize ()
 To be called from the constructors. More...
 

Static Private Member Functions

static QString qgetHelper (AcceptMode acceptMode, FileMode fileMode, QWidget *parent, const QString &caption, const QString &directory, const QString &filter, int histLimit)
 Helper method for the static qget* functions. More...
 

Private Attributes

QLabel * chosenLabel
 Label to display the currently chosen file(s). More...
 
QTimer * timer
 Timer. More...
 

Static Private Attributes

static QString lastDirectory_
 Static //. More...
 
static int historyLimit_
 Set history limit. More...
 

Detailed Description

Subclass of QFileDialog with additional functionality.

IMPORTANT: This class needs to be checked when the Qt version changes! Specifically: 1) The label at the bottom assumes that the layout is a QGridLayout, where the first column is for a label and the rest can be used for a widget. 2) As of Qt 4.3.4, the QFileDialog::filesSelected() signal is NOT emitted whenever the selection changes, but only when the selection is finalized. Because we're using a label to keep track of the current selection, this class uses a timer to update the label at a set time to the current selection. This is slightly inefficient, but there's no better way to do it without making our own file chooser dialog.

Definition at line 49 of file QtFileDialog.qo.h.

Constructor & Destructor Documentation

casa::QtFileDialog::QtFileDialog ( QWidget *  parent,
Qt::WindowFlags  flags 
)

Non-Static //.

See QFileDialog constructors.

casa::QtFileDialog::QtFileDialog ( QWidget *  parent = NULL,
const QString &  caption = QString(),
const QString &  directory = lastDirectory(),
const QString &  filter = QString() 
)
casa::QtFileDialog::~QtFileDialog ( )

Destructor.

Member Function Documentation

void casa::QtFileDialog::accept ( )
slot

Overrides QFileDialog::accept().

static casacore::String casa::QtFileDialog::getAnyFile ( QWidget *  parent = NULL,
const QString &  caption = QString(),
const QString &  directory = lastDirectory(),
const QString &  filter = QString(),
int  histLimit = historyLimit() 
)
inlinestatic

Definition at line 99 of file QtFileDialog.qo.h.

References casacore::filter(), and qgetAnyFile().

static casacore::String casa::QtFileDialog::getExistingDir ( QWidget *  parent = NULL,
const QString &  caption = QString(),
const QString &  directory = lastDirectory(),
int  histLimit = historyLimit() 
)
inlinestatic

Definition at line 64 of file QtFileDialog.qo.h.

References qgetExistingDir().

static casacore::String casa::QtFileDialog::getExistingFile ( QWidget *  parent = NULL,
const QString &  caption = QString(),
const QString &  directory = lastDirectory(),
const QString &  filter = QString(),
int  histLimit = historyLimit() 
)
inlinestatic

Definition at line 82 of file QtFileDialog.qo.h.

References casacore::filter(), and qgetExistingFile().

static int casa::QtFileDialog::historyLimit ( )
static

Gets/Sets the limit for the history size used by a QtFileDialog.

-1 means it is not managed, which is the default.

void casa::QtFileDialog::initialize ( )
private

To be called from the constructors.

static const QString& casa::QtFileDialog::lastDirectory ( )
static

Gets/Sets the last directory to be used by a QtFileDialog.

Blank means the current directory, which is the default.

static QString casa::QtFileDialog::qgetAnyFile ( QWidget *  parent = NULL,
const QString &  caption = QString(),
const QString &  directory = lastDirectory(),
const QString &  = QString(),
int  histLimit = historyLimit() 
)
inlinestatic

Returns a new filename using the given optional parent, caption, starting directory, and filter parameters.

See QFileDialog.

Definition at line 93 of file QtFileDialog.qo.h.

References qgetHelper().

Referenced by getAnyFile().

static QString casa::QtFileDialog::qgetExistingDir ( QWidget *  parent = NULL,
const QString &  caption = QString(),
const QString &  directory = lastDirectory(),
int  histLimit = historyLimit() 
)
inlinestatic

Static //.

Returns an existing directory using the given optional parent, caption, and starting directory parameters. See QFileDialog.

Definition at line 58 of file QtFileDialog.qo.h.

References qgetHelper().

Referenced by getExistingDir().

static QString casa::QtFileDialog::qgetExistingFile ( QWidget *  parent = NULL,
const QString &  caption = QString(),
const QString &  directory = lastDirectory(),
const QString &  filter = QString(),
int  histLimit = historyLimit() 
)
inlinestatic

Returns an existing file using the given optional parent, caption, starting directory, and filter parameters.

See QFileDialog.

Definition at line 75 of file QtFileDialog.qo.h.

References casacore::filter(), and qgetHelper().

Referenced by getExistingFile().

static QString casa::QtFileDialog::qgetHelper ( AcceptMode  acceptMode,
FileMode  fileMode,
QWidget *  parent,
const QString &  caption,
const QString &  directory,
const QString &  filter,
int  histLimit 
)
staticprivate

Helper method for the static qget* functions.

Referenced by qgetAnyFile(), qgetExistingDir(), and qgetExistingFile().

static void casa::QtFileDialog::setHistoryLimit ( int  limit)
static
static void casa::QtFileDialog::setNextDirectory ( const QString &  directory)
static
void casa::QtFileDialog::timeout ( )
privateslot

Signal for timer timeout.

Member Data Documentation

QLabel* casa::QtFileDialog::chosenLabel
private

Label to display the currently chosen file(s).

Definition at line 141 of file QtFileDialog.qo.h.

int casa::QtFileDialog::historyLimit_
staticprivate

Set history limit.

Definition at line 157 of file QtFileDialog.qo.h.

QString casa::QtFileDialog::lastDirectory_
staticprivate

Static //.

Last directory.

Definition at line 154 of file QtFileDialog.qo.h.

QTimer* casa::QtFileDialog::timer
private

Timer.

Definition at line 144 of file QtFileDialog.qo.h.


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