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>

Public Types

enum  AcceptMode { AcceptOpen , AcceptSave }
 
enum  Mode { File , Directory }
 

Public Slots

virtual void setButtonText (const QString &)
 Sets the browse button's text to txt. More...
 
virtual void setFileName (const QString &fn)
 Sets the file name s. More...
 
virtual void setFilter (const QString &)
 Sets the filter for choosing a file. More...
 
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. More...
 

Signals

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

Public Member Functions

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

Protected Member Functions

void resizeEvent (QResizeEvent *)
 

Properties

AcceptMode acceptMode
 
QString buttonText
 
QString fileName
 This property holds the file name. More...
 
QString filter
 This property holds the set filter to choose a file. More...
 
Mode mode
 This property holds whether the widgets selects either a file or a directory. More...
 

Detailed Description

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

Author
Werner Mayer

Member Enumeration Documentation

◆ AcceptMode

Enumerator
AcceptOpen 
AcceptSave 

◆ Mode

Enumerator
File 
Directory 

Constructor & Destructor Documentation

◆ FileChooser()

FileChooser::FileChooser ( QWidget parent = nullptr)

Constructs a file chooser called name with the parent parent.

References draftgeoutils.intersections::connect(), and fileNameChanged().

◆ ~FileChooser()

FileChooser::~FileChooser ( )
virtual

Member Function Documentation

◆ acceptMode()

AcceptMode Gui::FileChooser::acceptMode ( ) const

Returns the accept mode.

◆ buttonText()

QString FileChooser::buttonText ( ) const

Returns the button's text.

Returns the browse button's text.

◆ fileName()

QString FileChooser::fileName ( ) const

Returns the filename.

◆ fileNameChanged

void Gui::FileChooser::fileNameChanged ( const QString &  )
signal

◆ fileNameSelected

void Gui::FileChooser::fileNameSelected ( const QString &  )
signal

◆ filter()

QString FileChooser::filter ( ) const

Returns the set filter.

◆ mode()

◆ resizeEvent()

void FileChooser::resizeEvent ( QResizeEvent *  e)
protected

◆ setAcceptMode()

void Gui::FileChooser::setAcceptMode ( AcceptMode  mode)

Sets the accept mode.

◆ setButtonText

void FileChooser::setButtonText ( const QString &  txt)
virtualslot

Sets the browse button's text to txt.

References Gui::QtTools::horizontalAdvance().

◆ setFileName

void FileChooser::setFileName ( const QString &  fn)
virtualslot

◆ setFilter

void FileChooser::setFilter ( const QString &  filter)
virtualslot

◆ setMode

Property Documentation

◆ acceptMode

AcceptMode Gui::FileChooser::acceptMode
readwrite

◆ buttonText

QString Gui::FileChooser::buttonText
readwrite

◆ fileName

FileChooser::fileName
readwrite

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().

Referenced by Gui::PrefFileChooser::restorePreferences(), and Gui::PrefFileChooser::savePreferences().

◆ filter

FileChooser::filter
readwrite

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().

Referenced by setFilter().

◆ mode


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