Advanced line edit to select a file or directory.
More...
#include <Libs/Widgets/ctkPathLineEdit.h>
|
enum | Filter {
Dirs = 0x001
, Files = 0x002
, Drives = 0x004
, NoSymLinks = 0x008
,
AllEntries = Dirs | Files | Drives
, TypeMask = 0x00f
, Readable = 0x010
, Writable = 0x020
,
Executable = 0x040
, PermissionMask = 0x070
, Modified = 0x080
, Hidden = 0x100
,
System = 0x200
, AccessMask = 0x3F0
, AllDirs = 0x400
, CaseSensitive = 0x800
,
NoDotAndDotDot = 0x1000
, NoDot = 0x2000
, NoDotDot = 0x4000
, NoFilter = -1
} |
|
enum | Option {
ShowDirsOnly = 0x00000001
, DontResolveSymlinks = 0x00000002
, DontConfirmOverwrite = 0x00000004
, DontUseSheet = 0x00000008
,
DontUseNativeDialog = 0x00000010
, ReadOnly = 0x00000020
, HideNameFilterDetails = 0x00000040
} |
|
enum | SizeAdjustPolicy { AdjustToContents
, AdjustToContentsOnFirstShow
, AdjustToMinimumContentsLength
} |
|
|
QScopedPointer< ctkPathLineEditPrivate > | d_ptr |
|
Advanced line edit to select a file or directory.
- See also
- ctkDirectoryButton, ctkPathListWidget
Definition at line 61 of file ctkPathLineEdit.h.
◆ Filter
Enumerator |
---|
Dirs | |
Files | |
Drives | |
NoSymLinks | |
AllEntries | |
TypeMask | |
Readable | |
Writable | |
Executable | |
PermissionMask | |
Modified | |
Hidden | |
System | |
AccessMask | |
AllDirs | |
CaseSensitive | |
NoDotAndDotDot | |
NoDot | |
NoDotDot | |
NoFilter | |
Definition at line 118 of file ctkPathLineEdit.h.
◆ Option
Enumerator |
---|
ShowDirsOnly | |
DontResolveSymlinks | |
DontConfirmOverwrite | |
DontUseSheet | |
DontUseNativeDialog | |
ReadOnly | |
HideNameFilterDetails | |
Definition at line 143 of file ctkPathLineEdit.h.
◆ SizeAdjustPolicy
Enumerator |
---|
AdjustToContents | The path line edit will always adjust to the contents.
|
AdjustToContentsOnFirstShow | The path line edit will adjust to its contents the first time it is shown.
|
AdjustToMinimumContentsLength | The combobox will adjust to minimumContentsLength. For performance reasons use this policy on large models.
|
Definition at line 156 of file ctkPathLineEdit.h.
◆ ctkPathLineEdit() [1/2]
ctkPathLineEdit::ctkPathLineEdit |
( |
QWidget * |
parent = 0 | ) |
|
◆ ctkPathLineEdit() [2/2]
ctkPathLineEdit::ctkPathLineEdit |
( |
const QString & |
label, |
|
|
const QStringList & |
nameFilters, |
|
|
Filters |
filters = ctkPathLineEdit::AllEntries , |
|
|
QWidget * |
parent = 0 |
|
) |
| |
Constructor /param label Used in file dialogs /param nameFilters Regular expression (in wildcard mode) used to help the user to complete the line, example: "Images (*.jpg *.gif *.png)" /param parent Parent widget
◆ ~ctkPathLineEdit()
virtual ctkPathLineEdit::~ctkPathLineEdit |
( |
| ) |
|
|
virtual |
◆ addCurrentPathToHistory
void ctkPathLineEdit::addCurrentPathToHistory |
( |
| ) |
|
|
slot |
◆ browse
void ctkPathLineEdit::browse |
( |
| ) |
|
|
slot |
Open a QFileDialog to select a file or directory and set current text to it You would probably connect a browse push button like this: connect(myPushButton,SIGNAL(clicked()),myPathLineEdit,SLOT(browse())) As a conveniency, such button is provided by default via the browseButton
- See also
- showBrowseButton
◆ comboBox()
QComboBox* ctkPathLineEdit::comboBox |
( |
| ) |
const |
Return the combo box internally used by the path line edit.
◆ currentPath()
QString ctkPathLineEdit::currentPath |
( |
| ) |
const |
◆ currentPathChanged
void ctkPathLineEdit::currentPathChanged |
( |
const QString & |
path | ) |
|
|
signal |
◆ filters()
Filters ctkPathLineEdit::filters |
( |
| ) |
const |
◆ label()
const QString& ctkPathLineEdit::label |
( |
| ) |
const |
◆ minimumContentsLength()
int ctkPathLineEdit::minimumContentsLength |
( |
| ) |
const |
◆ minimumSizeHint()
virtual QSize ctkPathLineEdit::minimumSizeHint |
( |
| ) |
const |
|
virtual |
The width returned, in pixels, is the length of the file name (with no path) if any. Otherwise, it's enough for 15 to 20 characters.
◆ nameFilters()
const QStringList& ctkPathLineEdit::nameFilters |
( |
| ) |
const |
◆ options()
const Options& ctkPathLineEdit::options |
( |
| ) |
const |
◆ retrieveHistory
void ctkPathLineEdit::retrieveHistory |
( |
| ) |
|
|
slot |
◆ setCurrentDirectory
void ctkPathLineEdit::setCurrentDirectory |
( |
const QString & |
directory | ) |
|
|
protectedslot |
◆ setCurrentFileExtension()
void ctkPathLineEdit::setCurrentFileExtension |
( |
const QString & |
extension | ) |
|
Change the current extension of the edit line. If there is no extension yet, set it
◆ setCurrentPath
void ctkPathLineEdit::setCurrentPath |
( |
const QString & |
path | ) |
|
|
slot |
◆ setFilters()
void ctkPathLineEdit::setFilters |
( |
const Filters & |
filters | ) |
|
◆ setLabel()
void ctkPathLineEdit::setLabel |
( |
const QString & |
label | ) |
|
◆ setMinimumContentsLength()
void ctkPathLineEdit::setMinimumContentsLength |
( |
int |
lenght | ) |
|
◆ setNameFilters()
void ctkPathLineEdit::setNameFilters |
( |
const QStringList & |
nameFilters | ) |
|
◆ setOptions()
void ctkPathLineEdit::setOptions |
( |
const Options & |
options | ) |
|
Options of the file dialog pop up.
- See also
- QFileDialog::getExistingDirectory
◆ setSettingKey()
void ctkPathLineEdit::setSettingKey |
( |
const QString & |
key | ) |
|
◆ setShowBrowseButton()
void ctkPathLineEdit::setShowBrowseButton |
( |
bool |
visible | ) |
|
◆ setShowHistoryButton()
void ctkPathLineEdit::setShowHistoryButton |
( |
bool |
visible | ) |
|
◆ setSizeAdjustPolicy()
◆ settingKey()
QString ctkPathLineEdit::settingKey |
( |
| ) |
const |
◆ showBrowseButton()
bool ctkPathLineEdit::showBrowseButton |
( |
| ) |
const |
◆ showHistoryButton()
bool ctkPathLineEdit::showHistoryButton |
( |
| ) |
const |
◆ sizeAdjustPolicy()
the policy describing how the size of the combobox changes when the content changes
The default value is AdjustToContentsOnFirstShow
.
- See also
- SizeAdjustPolicy
◆ sizeHint()
virtual QSize ctkPathLineEdit::sizeHint |
( |
| ) |
const |
|
virtual |
The width returned, in pixels, is the entire length of the current path if any. Otherwise, it's enough for 15 to 20 characters.
◆ updateHasValidInput
void ctkPathLineEdit::updateHasValidInput |
( |
| ) |
|
|
protectedslot |
◆ validInputChanged
void ctkPathLineEdit::validInputChanged |
( |
bool |
| ) |
|
|
signal |
the signal is emit when the state of hasValidInput changed
◆ d_ptr
QScopedPointer<ctkPathLineEditPrivate> ctkPathLineEdit::d_ptr |
|
protected |
◆ currentPath
QString ctkPathLineEdit::currentPath |
|
readwrite |
◆ filters
Filters ctkPathLineEdit::filters |
|
readwrite |
◆ label
QString ctkPathLineEdit::label |
|
readwrite |
◆ minimumContentsLength
int ctkPathLineEdit::minimumContentsLength |
|
readwrite |
This property holds the minimum number of characters that should fit into the path line edit. The default value is 0. If this property is set to a positive value, the minimumSizeHint() and sizeHint() take it into account.
Definition at line 284 of file ctkPathLineEdit.h.
◆ nameFilters
QStringList ctkPathLineEdit::nameFilters |
|
readwrite |
This property holds the list of regular expressions (in wildcard mode) used to help the user complete a line. For example: "Images (*.jpg *.gif *.png)"
Definition at line 284 of file ctkPathLineEdit.h.
◆ options
Options ctkPathLineEdit::options |
|
readwrite |
Qt versions prior to 4.7.0 didn't expose QFileDialog::Options in the public API. We need to create a custom property that will be used when instanciating a QFileDialog in ctkPathLineEdit::browse()
Definition at line 284 of file ctkPathLineEdit.h.
◆ settingKey
QString ctkPathLineEdit::settingKey |
|
readwrite |
This property controls the key used to search the settings for recorded paths. If multiple path line edits share the same key, their history is then shared. If an empty key string is given, the object name is used as key. Setting the key automatically retrieve the history from settings Empty by default.
- See also
- retrieveHistory(), addCurrentPathToHistory(), showHistoryButton
Definition at line 284 of file ctkPathLineEdit.h.
◆ showBrowseButton
bool ctkPathLineEdit::showBrowseButton |
|
readwrite |
This property controls whether the browse ("...") button is visible or not. Clicking on the button calls opens a dialog to select the current path. True by default
- See also
- browse()
Definition at line 284 of file ctkPathLineEdit.h.
◆ showHistoryButton
bool ctkPathLineEdit::showHistoryButton |
|
readwrite |
◆ sizeAdjustPolicy
This property holds the policy describing how the size of the path line edit widget changes when the content changes. The default value is AdjustToContentsOnFirstShow.
Definition at line 284 of file ctkPathLineEdit.h.
The documentation for this class was generated from the following file: