Gui::FileChooser Class Reference

The FileChooser class provides a lineedit with a button on the right side to specify a file or directory. More...

#include <FileDialog.h>

Inheritance diagram for Gui::FileChooser:
Gui::PrefFileChooser

List of all members.

Public Types

enum  Mode { File, Directory }

Public Slots

virtual void setButtonText (const QString &)
 Sets the browse button's text to txt.
virtual void setFileName (const QString &fn)
 Sets the file name s.
virtual void setFilter (const QString &)
 Sets the filter for choosing a file.
virtual void setMode (Mode m)
 If m is File the widget is set to choose a file, otherwise it is set to choose a directory.

Signals

void fileNameChanged (const QString &)
void fileNameSelected (const QString &)

Public Member Functions

QString buttonText () const
 Returns the button's text.
 FileChooser (QWidget *parent=0)
 Constructs a file chooser called name with the parent parent.
QString fileName () const
 Returns the filename.
QString filter () const
 Returns the set filter.
Mode mode () const
 Returns true if this widgets is set to choose a file, if it is set to choose false is returned.
virtual ~FileChooser ()

Properties

QString buttonText
 Returns the browse button's text.
QString fileName
 This property holds the file name.
QString filter
 This property holds the set filter to choose a file.
Mode mode
 This property holds whether the widgets selects either a file or a directory.

Detailed Description

The FileChooser class provides a lineedit with a button on the right side to specify a file or directory.

Author:
Werner Mayer

Definition at line 120 of file FileDialog.h.


Member Enumeration Documentation

Enumerator:
File 
Directory 

Definition at line 131 of file FileDialog.h.


Constructor & Destructor Documentation

FileChooser::FileChooser ( QWidget *  parent = 0  ) 

Constructs a file chooser called name with the parent parent.

Definition at line 347 of file FileDialog.cpp.

References draftlibs::fcgeo::connect(), and fileNameChanged().

FileChooser::~FileChooser (  )  [virtual]

Definition at line 369 of file FileDialog.cpp.


Member Function Documentation

QString Gui::FileChooser::buttonText (  )  const

Returns the button's text.

QString Gui::FileChooser::fileName (  )  const
void Gui::FileChooser::fileNameChanged ( const QString &   )  [signal]

Referenced by FileChooser().

void Gui::FileChooser::fileNameSelected ( const QString &   )  [signal]
QString Gui::FileChooser::filter (  )  const

Returns the set filter.

Mode Gui::FileChooser::mode (  )  const

Returns true if this widgets is set to choose a file, if it is set to choose false is returned.

void FileChooser::setButtonText ( const QString &  txt  )  [virtual, slot]

Sets the browse button's text to txt.

Definition at line 458 of file FileDialog.cpp.

void FileChooser::setFileName ( const QString &  fn  )  [virtual, slot]
void FileChooser::setFilter ( const QString &  filter  )  [virtual, slot]
void FileChooser::setMode ( FileChooser::Mode  m  )  [virtual, slot]

If m is File the widget is set to choose a file, otherwise it is set to choose a directory.

Definition at line 429 of file FileDialog.cpp.

Referenced by RaytracingGui::Ui_DlgSettingsRay::setupUi(), Gui::Dialog::Ui_DlgSettingsMacro::setupUi(), Gui::Dialog::Ui_DlgProjectUtility::setupUi(), and Gui::Dialog::Ui_DlgMacroExecute::setupUi().


Property Documentation

QString FileChooser::buttonText [read, write]

Returns the browse button's text.

Definition at line 128 of file FileDialog.h.

QString FileChooser::fileName [read, write]

This property holds the file name.

Set this property's value with setFileName() and get this property's value with fileName().

See also:
fileName(), setFileName().

Definition at line 126 of file FileDialog.h.

Referenced by Gui::Dialog::DlgOnlineHelpImp::DlgOnlineHelpImp(), and Gui::Dialog::DlgSettingsMacroImp::DlgSettingsMacroImp().

QString FileChooser::filter [read, write]

This property holds the set filter to choose a file.

This property is used only if FileChooser::Mode is set to File.

See also:
chooseFile(), filter(), setFilter().

Definition at line 127 of file FileDialog.h.

FileChooser::Mode FileChooser::mode [read, write]

This property holds whether the widgets selects either a file or a directory.

The default value of chooseFile is set to File.

See also:
chooseFile(), mode(), setMode().

Definition at line 125 of file FileDialog.h.


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

Generated on Wed Nov 23 19:02:00 2011 for FreeCAD by  doxygen 1.6.1