A widget comprising of a line edit and a "browse" button. More...
#include <klfpathchooser.h>
Public Slots | |
virtual void | setMode (int mode) |
virtual void | setCaption (const QString &caption) |
virtual void | setFilter (const QString &filter) |
virtual void | setPath (const QString &path) |
virtual void | setDialogConfirmOverwrite (bool confirm) |
virtual void | requestBrowse () |
Signals | |
void | fileDialogPathChosen (const QString &fname) |
Public Member Functions | |
KLFPathChooser (QWidget *parent) | |
virtual | ~KLFPathChooser () |
virtual int | mode () const |
virtual QString | caption () const |
virtual QString | filter () const |
virtual QString | path () const |
virtual bool | dialogConfirmOverwrite () const |
virtual bool | possibleOverwriteWasConfirmed () const |
Properties | |
int | mode |
bool | dialogConfirmOverwrite |
QString | caption |
QString | filter |
QString | path |
bool | possibleOverwriteWasConfirmed |
A widget comprising of a line edit and a "browse" button.
This widget can be used to open existing files, save files, and open existing directories.
Definition at line 38 of file klfpathchooser.h.
KLFPathChooser::KLFPathChooser | ( | QWidget * | parent | ) |
Definition at line 36 of file klfpathchooser.cpp.
References requestBrowse().
KLFPathChooser::~KLFPathChooser | ( | ) | [virtual] |
Definition at line 67 of file klfpathchooser.cpp.
virtual QString KLFPathChooser::caption | ( | ) | const [inline, virtual] |
Definition at line 61 of file klfpathchooser.h.
Referenced by setCaption().
virtual bool KLFPathChooser::dialogConfirmOverwrite | ( | ) | const [inline, virtual] |
Returns the current dialogConfirmOverwrite
setting. See setDialogConfirmOverwrite()
Definition at line 66 of file klfpathchooser.h.
void KLFPathChooser::fileDialogPathChosen | ( | const QString & | fname | ) | [signal] |
Referenced by requestBrowse().
virtual QString KLFPathChooser::filter | ( | ) | const [inline, virtual] |
Definition at line 62 of file klfpathchooser.h.
Referenced by setFilter().
virtual int KLFPathChooser::mode | ( | ) | const [inline, virtual] |
The path chooser's mode.
0
: choose an existing file for opening1
: choose a (most likely non-existant) file for saving2
: choose an existing directory Definition at line 60 of file klfpathchooser.h.
Referenced by setMode().
virtual QString KLFPathChooser::path | ( | ) | const [virtual] |
Referenced by requestBrowse().
virtual bool KLFPathChooser::possibleOverwriteWasConfirmed | ( | ) | const [inline, virtual] |
Whether the user has already been asked confirmation for overwrite or not
This function returns TRUE if the path was obtained by the file dialog, and the option dialogConfirmOverwrite is enabled. In other words, if the file were to exist, then the dialog would have asked confirmation already.
If this function returns FALSE, and the file exists, and the dialogConfirmOverwrite setting is enabled, that means that the user entered the path manually and was NOT prompted for overwrite confirmation.
This value is only relevant in "save" mode. (see mode())
Definition at line 82 of file klfpathchooser.h.
void KLFPathChooser::requestBrowse | ( | ) | [virtual, slot] |
Definition at line 83 of file klfpathchooser.cpp.
References fileDialogPathChosen(), QString::isEmpty(), QList::isEmpty(), path(), setPath(), and QStandardPaths::standardLocations().
Referenced by KLFPathChooser().
void KLFPathChooser::setCaption | ( | const QString & | caption | ) | [virtual, slot] |
Definition at line 120 of file klfpathchooser.cpp.
References caption().
virtual void KLFPathChooser::setDialogConfirmOverwrite | ( | bool | confirm | ) | [inline, virtual, slot] |
If this setting is set to TRUE, then the file dialog will ask to confirm before selecting an existing file.
Note that if the user entered manually the path, no overwrite confirmation will have been required. see possibleOverwriteWasConfirmed().
This option is only relevant in "save" mode (mode()==1). It has no effect in the other modes.
Definition at line 109 of file klfpathchooser.h.
void KLFPathChooser::setFilter | ( | const QString & | filter | ) | [virtual, slot] |
Definition at line 131 of file klfpathchooser.cpp.
References filter().
void KLFPathChooser::setMode | ( | int | mode | ) | [virtual, slot] |
Set the path chooser's mode. See mode()
Definition at line 125 of file klfpathchooser.cpp.
References mode().
void KLFPathChooser::setPath | ( | const QString & | path | ) | [virtual, slot] |
Displays the path path
in the widget.
Note that if mode is save mode (mode()==1), the new path is flagged as not overwrite-confirmed, ie. possibleOverwriteWasConfirmed() will return FALSE.
Definition at line 77 of file klfpathchooser.cpp.
Referenced by requestBrowse().
QString KLFPathChooser::caption [read, write] |
Definition at line 45 of file klfpathchooser.h.
bool KLFPathChooser::dialogConfirmOverwrite [read, write] |
Definition at line 44 of file klfpathchooser.h.
QString KLFPathChooser::filter [read, write] |
Definition at line 46 of file klfpathchooser.h.
int KLFPathChooser::mode [read, write] |
Definition at line 43 of file klfpathchooser.h.
QString KLFPathChooser::path [read, write] |
Definition at line 47 of file klfpathchooser.h.
bool KLFPathChooser::possibleOverwriteWasConfirmed [read] |
Definition at line 49 of file klfpathchooser.h.