Quark  0.1
FileDialogBuilder Class Reference

A builder object for constructing file dialogs, such as "Open" and "Save As" dialogs. More...

#include <FileDialogBuilder.h++>

Inheritance diagram for FileDialogBuilder:

Public Types

enum  Type { Open, Save, Directory }
 File dialog types. More...
 

Public Member Functions

 FileDialogBuilder (QWidget *parent, Type type, const QString &message)
 Constructor. More...
 
virtual ~FileDialogBuilder ()
 Destructor. More...
 
FileDialogBuildersetFeature (const QString &feature)
 Specifies the feature name for the dialog. More...
 
FileDialogBuildersetStartingDir (const QString &dir)
 Specifies the starting directory for the dialog. More...
 
FileDialogBuildersetNameFilter (const QString &filter)
 Specifies a filename filter for the dialog. More...
 
FileDialogBuildersetNameFilters (const QStringList &filters)
 Specifies a list of filename filters for the dialog. More...
 
FileDialogBuildersetOption (QFileDialog::Option option, bool on)
 Specifies options for the dialog. More...
 
FileDialogBuildersetSlot (QObject *target, const char *slot)
 Specifies a slot to be invoked when the dialog is accepted. More...
 
FileDialogBuildersetSlot (const char *slot)
 Specifies a slot of the dialog's parent widget to be invoked when the dialog is accepted. More...
 
template<typename T >
FileDialogBuilderaddSlotArg (const T &arg)
 Adds an argument to be passed to the slot when the dialog is accepted. More...
 
void show ()
 Constructs and displays the dialog. More...
 

Detailed Description

A builder object for constructing file dialogs, such as "Open" and "Save As" dialogs.

Author
Mark Lindner

Member Enumeration Documentation

◆ Type

enum Type

File dialog types.

Enumerator
Open 

Open file dialog.

Save 

Save file dialog.

Directory 

Select directory dialog.

Constructor & Destructor Documentation

◆ FileDialogBuilder()

FileDialogBuilder ( QWidget *  parent,
Type  type,
const QString &  message 
)

Constructor.

Begins the construction of an input dialog.

Parameters
parentThe parent widget for the dialog.
typeThe type of dialog to be constructed.
messageThe message text to be displayed in the dialog.

◆ ~FileDialogBuilder()

virtual ~FileDialogBuilder ( )
virtual

Destructor.

Member Function Documentation

◆ addSlotArg()

FileDialogBuilder& addSlotArg ( const T &  arg)
inline

Adds an argument to be passed to the slot when the dialog is accepted.

This is useful for passing application state through the dialog.

Template Parameters
TThe type of the slot argument. This must be a type that can be converted to/from a QVariant.
Parameters
argThe slot argument. A copy of the argument is made and stored within the dialog.

◆ setFeature()

FileDialogBuilder& setFeature ( const QString &  feature)

Specifies the feature name for the dialog.

◆ setNameFilter()

FileDialogBuilder& setNameFilter ( const QString &  filter)

Specifies a filename filter for the dialog.

◆ setNameFilters()

FileDialogBuilder& setNameFilters ( const QStringList &  filters)

Specifies a list of filename filters for the dialog.

◆ setOption()

FileDialogBuilder& setOption ( QFileDialog::Option  option,
bool  on 
)

Specifies options for the dialog.

See QFileDialog::setOption().

◆ setSlot() [1/2]

FileDialogBuilder& setSlot ( QObject *  target,
const char *  slot 
)

Specifies a slot to be invoked when the dialog is accepted.

Parameters
targetThe target object to invoke the slot on.
slotThe slot to invoke.

◆ setSlot() [2/2]

FileDialogBuilder& setSlot ( const char *  slot)
inline

Specifies a slot of the dialog's parent widget to be invoked when the dialog is accepted.

Parameters
slotThe slot to invoke.

◆ setStartingDir()

FileDialogBuilder& setStartingDir ( const QString &  dir)

Specifies the starting directory for the dialog.

◆ show()

void show ( )
inherited

Constructs and displays the dialog.


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