#include <Libs/Widgets/ctkDirectoryButton.h>
|
QScopedPointer< ctkDirectoryButtonPrivate > | d_ptr |
|
ctkDirectoryButton is a QPushButton to select a directory path. The absolute path is displayed on the button. When clicked, a file dialog pops up to select a new directory path.
- See also
- ctkPathLineEdit, ctkPathListWidget, QPushButton, QDir
Definition at line 43 of file ctkDirectoryButton.h.
◆ Option
Enumerator |
---|
ShowDirsOnly | |
DontResolveSymlinks | |
DontConfirmOverwrite | |
DontUseSheet | |
DontUseNativeDialog | |
ReadOnly | |
HideNameFilterDetails | |
Definition at line 77 of file ctkDirectoryButton.h.
◆ ctkDirectoryButton() [1/3]
ctkDirectoryButton::ctkDirectoryButton |
( |
QWidget * |
parent = 0 | ) |
|
Constructor Creates a default ctkDirectoryButton that points to the application current directory.
◆ ctkDirectoryButton() [2/3]
ctkDirectoryButton::ctkDirectoryButton |
( |
const QString & |
directory, |
|
|
QWidget * |
parent = 0 |
|
) |
| |
◆ ctkDirectoryButton() [3/3]
ctkDirectoryButton::ctkDirectoryButton |
( |
const QIcon & |
icon, |
|
|
const QString & |
directory, |
|
|
QWidget * |
parent = 0 |
|
) |
| |
◆ ~ctkDirectoryButton()
virtual ctkDirectoryButton::~ctkDirectoryButton |
( |
| ) |
|
|
virtual |
◆ acceptMode()
QFileDialog::AcceptMode ctkDirectoryButton::acceptMode |
( |
| ) |
const |
◆ browse
void ctkDirectoryButton::browse |
( |
| ) |
|
|
slot |
browse() opens a pop up where the user can select a new directory for the button. browse() is automatically called when the button is clicked.
◆ caption()
const QString& ctkDirectoryButton::caption |
( |
| ) |
const |
Get the caption of the directory dialog
- See also
- setCaption
◆ directory()
QString ctkDirectoryButton::directory |
( |
| ) |
const |
◆ directoryChanged
void ctkDirectoryButton::directoryChanged |
( |
const QString & |
| ) |
|
|
signal |
directoryChanged is emitted when the current directory changes. Programatically or by the user via the file dialog that pop up when clicking on the button.
- See also
- directorySelected
◆ directorySelected
void ctkDirectoryButton::directorySelected |
( |
const QString & |
| ) |
|
|
signal |
directorySelected() is emitted anytime the current directory is set (even if the new directory is the same than the current value). This is particularly useful when the browse dialog is accepted without changing the current directory.
- See also
- directoryChanged
◆ icon()
QIcon ctkDirectoryButton::icon |
( |
| ) |
const |
◆ options()
const Options& ctkDirectoryButton::options |
( |
| ) |
const |
◆ setAcceptMode()
void ctkDirectoryButton::setAcceptMode |
( |
QFileDialog::AcceptMode |
mode | ) |
|
◆ setCaption()
void ctkDirectoryButton::setCaption |
( |
const QString & |
caption | ) |
|
Set the caption of the directory dialog
- See also
- caption
◆ setDirectory()
void ctkDirectoryButton::setDirectory |
( |
const QString & |
path | ) |
|
Set/get the current directory If path is empty, the program's working directory, ("."), is used. By default, directory is the current working directory.
◆ setIcon()
void ctkDirectoryButton::setIcon |
( |
const QIcon & |
icon | ) |
|
The icon of the button By default use QStyle::SP_DirIcon
◆ setOptions()
void ctkDirectoryButton::setOptions |
( |
const Options & |
options | ) |
|
Options of the file dialog pop up.
- See also
- QFileDialog::getExistingDirectory
◆ setText()
void ctkDirectoryButton::setText |
( |
const QString & |
text | ) |
|
Set the text of the button. If null (not just empty), the directory path is used as text. This doesn't set the "directory", just the displayed text.
- See also
- setDirectory
◆ text()
const QString& ctkDirectoryButton::text |
( |
| ) |
const |
Return the text of the button if any. Doesn't return the directory path.
- See also
- directory
◆ d_ptr
QScopedPointer<ctkDirectoryButtonPrivate> ctkDirectoryButton::d_ptr |
|
protected |
◆ acceptMode
QFileDialog::AcceptMode ctkDirectoryButton::acceptMode |
|
readwrite |
This property holds the accept mode of the dialog. The action mode defines whether the dialog is for opening or saving files. By default, this property is set to AcceptOpen. If set to QFileDialog::AcceptSave mode, the regular behavior of QFileDialog will be extended to prevent user from selecting read-only folder. The caveat is that writable folder existing in a readonly one won't be selectable. AcceptOpen by default.
Definition at line 173 of file ctkDirectoryButton.h.
◆ caption
QString ctkDirectoryButton::caption |
|
readwrite |
This property holds the title of the file dialog used to select a new directory If caption is not set, internally use QWidget::tooltip()
Definition at line 173 of file ctkDirectoryButton.h.
◆ directory
QString ctkDirectoryButton::directory |
|
readwrite |
◆ icon
QIcon ctkDirectoryButton::icon |
|
readwrite |
This property holds the icon displayed on the button. QStyle::SP_DirIcon by default.
Definition at line 173 of file ctkDirectoryButton.h.
◆ options
Options ctkDirectoryButton::options |
|
readwrite |
◆ text
QString ctkDirectoryButton::text |
|
readwrite |
This property holds the text to display on the button. If null (by default), the current directory path is displayed instead.
Definition at line 173 of file ctkDirectoryButton.h.
The documentation for this class was generated from the following file: