Advanced line edit to select a file or directory.
More...
#include <pathLineEdit.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
} |
|
|
| Q_ENUM (SizeAdjustPolicy) |
|
| PathLineEdit (QWidget *parent=0) |
|
| PathLineEdit (const QString &label, const QStringList &nameFilters, Filters filters=PathLineEdit::AllEntries, QWidget *parent=0) |
|
QString | currentPath () const |
|
void | setLabel (const QString &label) |
|
const QString & | label () const |
|
void | setNameFilters (const QStringList &nameFilters) |
|
const QStringList & | nameFilters () const |
|
void | setFilters (const Filters &filters) |
|
Filters | filters () const |
|
void | setOptions (const Options &options) |
|
const Options & | options () const |
|
void | setCurrentFileExtension (const QString &extension) |
|
QString | settingKey () const |
|
void | setSettingKey (const QString &key) |
|
bool | showBrowseButton () const |
|
void | setShowBrowseButton (bool visible) |
|
bool | showHistoryButton () const |
|
void | setShowHistoryButton (bool visible) |
|
SizeAdjustPolicy | sizeAdjustPolicy () const |
|
void | setSizeAdjustPolicy (SizeAdjustPolicy policy) |
|
int | minimumContentsLength () const |
|
void | setMinimumContentsLength (int length) |
|
QComboBox * | comboBox () const |
| Return the combo box internally used by the path line edit.
|
|
virtual QSize | minimumSizeHint () const |
|
virtual QSize | sizeHint () const |
|
|
void | setCurrentDirectory (const QString &directory) |
|
void | updateHasValidInput () |
|
Advanced line edit to select a file or directory.
- See also
- ctkDirectoryButton, ctkPathListWidget
◆ 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.
|
◆ PathLineEdit() [1/2]
PathLineEdit::PathLineEdit |
( |
QWidget * | parent = 0 | ) |
|
◆ PathLineEdit() [2/2]
PathLineEdit::PathLineEdit |
( |
const QString & | label, |
|
|
const QStringList & | nameFilters, |
|
|
Filters | filters = PathLineEdit::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
◆ addCurrentPathToHistory
void PathLineEdit::addCurrentPathToHistory |
( |
| ) |
|
|
slot |
◆ browse
void PathLineEdit::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
◆ minimumSizeHint()
QSize PathLineEdit::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.
◆ retrieveHistory
void PathLineEdit::retrieveHistory |
( |
| ) |
|
|
slot |
◆ setCurrentFileExtension()
void PathLineEdit::setCurrentFileExtension |
( |
const QString & | extension | ) |
|
Change the current extension of the edit line. If there is no extension yet, set it
◆ setOptions()
void PathLineEdit::setOptions |
( |
const Options & | options | ) |
|
Options of the file dialog pop up.
- See also
- QFileDialog::getExistingDirectory
◆ sizeAdjustPolicy()
the policy describing how the size of the combobox changes when the content changes
The default value is AdjustToContentsOnFirstShow
.
- See also
- SizeAdjustPolicy
◆ sizeHint()
QSize PathLineEdit::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.
◆ validInputChanged
void PathLineEdit::validInputChanged |
( |
bool | | ) |
|
|
signal |
the signal is emit when the state of hasValidInput changed
◆ minimumContentsLength
int PathLineEdit::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.
◆ nameFilters
QStringList PathLineEdit::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)"
◆ options
Options PathLineEdit::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 instantiating a QFileDialog in PathLineEdit::browse()
◆ settingKey
QString PathLineEdit::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
◆ showBrowseButton
bool PathLineEdit::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()
◆ showHistoryButton
bool PathLineEdit::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.
The documentation for this class was generated from the following files:
- C:/Workspace/itom_development_VS2019_Qt5.15.2_x64/itomProject/itom/itomWidgets/pathLineEdit.h
- C:/Workspace/itom_development_VS2019_Qt5.15.2_x64/itomProject/itom/itomWidgets/pathLineEdit.cpp