QPathEdit  1.2.2
A Qt-Widget to get local file and folder-paths in an optimized and simple way
Public Types | Public Slots | Signals | Public Member Functions | Properties | List of all members
QPathEdit Class Reference

The QPathEdit provides a simple way to get a path from the user as comfortable as possible. More...

#include <qpathedit.h>

Inheritance diagram for QPathEdit:
QWidget QObject QPaintDevice

Public Types

enum  Style { SeperatedButton, JoinedButton, NoButton }
 Descibes various styles that the edit can take. More...
 
enum  PathMode { ExistingFile, ExistingFolder, AnyFile }
 Describes modes for the kind of path. More...
 

Public Slots

void showDialog ()
 Shows the QFileDialog so the user can select a path. More...
 

Signals

void pathChanged (QString path)
 NOTIFY-ACCESSOR for QPathEdit::path.
 

Public Member Functions

 QPathEdit (QWidget *parent=nullptr, Style style=SeperatedButton)
 Constructs a new QPathEdit widget. The mode will be QPathEdit::ExistingFile.
 
 QPathEdit (PathMode pathMode, QWidget *parent=nullptr, Style style=SeperatedButton)
 Constructs a new QPathEdit widget.
 
 QPathEdit (PathMode pathMode, QString defaultDirectory, QWidget *parent=nullptr, Style style=SeperatedButton)
 Constructs a new QPathEdit widget with the given default directory.
 
PathMode pathMode () const
 READ-ACCESSOR for QPathEdit::pathMode.
 
QFileDialog::Options dialogOptions () const
 READ-ACCESSOR for QPathEdit::dialogOptions.
 
bool isEmptyPathAllowed () const
 READ-ACCESSOR for QPathEdit::allowEmptyPath.
 
QString defaultDirectory () const
 READ-ACCESSOR for QPathEdit::defaultDirectory.
 
QString path () const
 READ-ACCESSOR for QPathEdit::path.
 
QUrl pathUrl () const
 Returns the entered path as an QUrl.
 
QString placeholder () const
 READ-ACCESSOR for QPathEdit::placeholder.
 
QStringList nameFilters () const
 READ-ACCESSOR for QPathEdit::nameFilters.
 
QStringList mimeTypeFilters () const
 READ-ACCESSOR for QPathEdit::mimeTypeFilters.
 
bool isEditable () const
 READ-ACCESSOR for QPathEdit::editable.
 
bool useCompleter () const
 READ-ACCESSOR for QPathEdit::useCompleter.
 
Style style () const
 READ-ACCESSOR for QPathEdit::style.
 
QIcon dialogButtonIcon () const
 READ-ACCESSOR for QPathEdit::dialogButtonIcon.
 
void setPathMode (PathMode pathMode)
 WRITE-ACCESSOR for QPathEdit::pathMode.
 
void setDialogOptions (QFileDialog::Options dialogOptions)
 WRITE-ACCESSOR for QPathEdit::dialogOptions.
 
void setAllowEmptyPath (bool allowEmptyPath)
 WRITE-ACCESSOR for QPathEdit::allowEmptyPath.
 
void setDefaultDirectory (QString defaultDirectory)
 WRITE-ACCESSOR for QPathEdit::defaultDirectory.
 
bool setPath (QString path, bool allowInvalid=false)
 WRITE-ACCESSOR for QPathEdit::path. More...
 
void clear ()
 RESET-ACCESSOR for QPathEdit::path.
 
void setPlaceholder (QString placeholder)
 WRITE-ACCESSOR for QPathEdit::placeholder.
 
void setNameFilters (QStringList nameFilters)
 WRITE-ACCESSOR for QPathEdit::nameFilters.
 
void setMimeTypeFilters (QStringList mimeTypeFilters)
 WRITE-ACCESSOR for QPathEdit::mimeTypeFilters.
 
void setEditable (bool editable)
 WRITE-ACCESSOR for QPathEdit::editable.
 
void setUseCompleter (bool useCompleter)
 WRITE-ACCESSOR for QPathEdit::useCompleter.
 
void setStyle (Style style, QLineEdit::ActionPosition position=QLineEdit::TrailingPosition)
 WRITE-ACCESSOR for QPathEdit::style.
 
void setDialogButtonIcon (const QIcon &icon)
 WRITE-ACCESSOR for QPathEdit::dialogButtonIcon.
 
void resetDialogButtonIcon ()
 RESET-ACCESSOR for QPathEdit::dialogButtonIcon.
 
- Public Member Functions inherited from QWidget
 QWidget (QWidget *parent, Qt::WindowFlags f)
 
WId winId () const
 
WId effectiveWinId () const
 
QStylestyle () const
 
void setStyle (QStyle *style)
 
bool isTopLevel () const
 
bool isWindow () const
 
bool isModal () const
 
Qt::WindowModality windowModality () const
 
void setWindowModality (Qt::WindowModality windowModality)
 
bool isEnabled () const
 
bool isEnabledTo (const QWidget *ancestor) const
 
bool isEnabledToTLW () const
 
void setEnabled (bool)
 
void setDisabled (bool disable)
 
void setWindowModified (bool)
 
QRect frameGeometry () const
 
const QRectgeometry () const
 
QRect normalGeometry () const
 
int x () const
 
int y () const
 
QPoint pos () const
 
QSize frameSize () const
 
QSize size () const
 
int width () const
 
int height () const
 
QRect rect () const
 
QRect childrenRect () const
 
QRegion childrenRegion () const
 
QSize minimumSize () const
 
QSize maximumSize () const
 
int minimumWidth () const
 
int minimumHeight () const
 
int maximumWidth () const
 
int maximumHeight () const
 
void setMinimumSize (const QSize &)
 
void setMinimumSize (int minw, int minh)
 
void setMaximumSize (const QSize &)
 
void setMaximumSize (int maxw, int maxh)
 
void setMinimumWidth (int minw)
 
void setMinimumHeight (int minh)
 
void setMaximumWidth (int maxw)
 
void setMaximumHeight (int maxh)
 
void setupUi (QWidget *widget)
 
QSize sizeIncrement () const
 
void setSizeIncrement (const QSize &)
 
void setSizeIncrement (int w, int h)
 
QSize baseSize () const
 
void setBaseSize (const QSize &)
 
void setBaseSize (int basew, int baseh)
 
void setFixedSize (const QSize &s)
 
void setFixedSize (int w, int h)
 
void setFixedWidth (int w)
 
void setFixedHeight (int h)
 
QPoint mapToGlobal (const QPoint &pos) const
 
QPoint mapFromGlobal (const QPoint &pos) const
 
QPoint mapToParent (const QPoint &pos) const
 
QPoint mapFromParent (const QPoint &pos) const
 
QPoint mapTo (const QWidget *parent, const QPoint &pos) const
 
QPoint mapFrom (const QWidget *parent, const QPoint &pos) const
 
QWidgetwindow () const
 
QWidgetnativeParentWidget () const
 
QWidgettopLevelWidget () const
 
const QPalettepalette () const
 
void setPalette (const QPalette &)
 
void setBackgroundRole (QPalette::ColorRole role)
 
QPalette::ColorRole backgroundRole () const
 
void setForegroundRole (QPalette::ColorRole role)
 
QPalette::ColorRole foregroundRole () const
 
const QFontfont () const
 
void setFont (const QFont &)
 
QFontMetrics fontMetrics () const
 
QFontInfo fontInfo () const
 
QCursor cursor () const
 
void setCursor (const QCursor &)
 
void unsetCursor ()
 
void setMouseTracking (bool enable)
 
bool hasMouseTracking () const
 
bool underMouse () const
 
void setMask (const QBitmap &bitmap)
 
void setMask (const QRegion &region)
 
QRegion mask () const
 
void clearMask ()
 
void render (QPaintDevice *target, const QPoint &targetOffset, const QRegion &sourceRegion, RenderFlags renderFlags)
 
void render (QPainter *painter, const QPoint &targetOffset, const QRegion &sourceRegion, RenderFlags renderFlags)
 
QPixmap grab (const QRect &rectangle)
 
QGraphicsEffectgraphicsEffect () const
 
void setGraphicsEffect (QGraphicsEffect *effect)
 
void grabGesture (Qt::GestureType gesture, Qt::GestureFlags flags)
 
void ungrabGesture (Qt::GestureType gesture)
 
void setWindowTitle (const QString &)
 
void setStyleSheet (const QString &styleSheet)
 
QString styleSheet () const
 
QString windowTitle () const
 
void setWindowIcon (const QIcon &icon)
 
QIcon windowIcon () const
 
void setWindowIconText (const QString &)
 
QString windowIconText () const
 
void setWindowRole (const QString &role)
 
QString windowRole () const
 
void setWindowFilePath (const QString &filePath)
 
QString windowFilePath () const
 
void setWindowOpacity (qreal level)
 
qreal windowOpacity () const
 
bool isWindowModified () const
 
void setToolTip (const QString &)
 
QString toolTip () const
 
void setToolTipDuration (int msec)
 
int toolTipDuration () const
 
void setStatusTip (const QString &)
 
QString statusTip () const
 
void setWhatsThis (const QString &)
 
QString whatsThis () const
 
QString accessibleName () const
 
void setAccessibleName (const QString &name)
 
QString accessibleDescription () const
 
void setAccessibleDescription (const QString &description)
 
void setLayoutDirection (Qt::LayoutDirection direction)
 
Qt::LayoutDirection layoutDirection () const
 
void unsetLayoutDirection ()
 
void setLocale (const QLocale &locale)
 
QLocale locale () const
 
void unsetLocale ()
 
void setFocus ()
 
bool isActiveWindow () const
 
void activateWindow ()
 
void clearFocus ()
 
void setFocus (Qt::FocusReason reason)
 
Qt::FocusPolicy focusPolicy () const
 
void setFocusPolicy (Qt::FocusPolicy policy)
 
bool hasFocus () const
 
void setFocusProxy (QWidget *w)
 
QWidgetfocusProxy () const
 
Qt::ContextMenuPolicy contextMenuPolicy () const
 
void setContextMenuPolicy (Qt::ContextMenuPolicy policy)
 
void grabMouse ()
 
void grabMouse (const QCursor &cursor)
 
void releaseMouse ()
 
void grabKeyboard ()
 
void releaseKeyboard ()
 
int grabShortcut (const QKeySequence &key, Qt::ShortcutContext context)
 
void releaseShortcut (int id)
 
void setShortcutEnabled (int id, bool enable)
 
void setShortcutAutoRepeat (int id, bool enable)
 
bool updatesEnabled () const
 
void setUpdatesEnabled (bool enable)
 
QGraphicsProxyWidgetgraphicsProxyWidget () const
 
void update ()
 
void repaint ()
 
void update (int x, int y, int w, int h)
 
void update (const QRect &rect)
 
void update (const QRegion &rgn)
 
void repaint (int x, int y, int w, int h)
 
void repaint (const QRect &rect)
 
void repaint (const QRegion &rgn)
 
virtual void setVisible (bool visible)
 
void setHidden (bool hidden)
 
void show ()
 
void hide ()
 
void showMinimized ()
 
void showMaximized ()
 
void showFullScreen ()
 
void showNormal ()
 
bool close ()
 
void raise ()
 
void lower ()
 
void stackUnder (QWidget *w)
 
void move (int x, int y)
 
void move (const QPoint &)
 
void resize (int w, int h)
 
void resize (const QSize &)
 
void setGeometry (int x, int y, int w, int h)
 
void setGeometry (const QRect &)
 
QByteArray saveGeometry () const
 
bool restoreGeometry (const QByteArray &geometry)
 
void adjustSize ()
 
bool isVisible () const
 
bool isVisibleTo (const QWidget *ancestor) const
 
bool isHidden () const
 
bool isMinimized () const
 
bool isMaximized () const
 
bool isFullScreen () const
 
Qt::WindowStates windowState () const
 
void setWindowState (Qt::WindowStates windowState)
 
virtual QSize sizeHint () const
 
virtual QSize minimumSizeHint () const
 
QSizePolicy sizePolicy () const
 
void setSizePolicy (QSizePolicy)
 
void setSizePolicy (QSizePolicy::Policy horizontal, QSizePolicy::Policy vertical)
 
virtual int heightForWidth (int w) const
 
virtual bool hasHeightForWidth () const
 
QRegion visibleRegion () const
 
void setContentsMargins (int left, int top, int right, int bottom)
 
void setContentsMargins (const QMargins &margins)
 
void getContentsMargins (int *left, int *top, int *right, int *bottom) const
 
QMargins contentsMargins () const
 
QRect contentsRect () const
 
QLayoutlayout () const
 
void setLayout (QLayout *layout)
 
void updateGeometry ()
 
void setParent (QWidget *parent)
 
void setParent (QWidget *parent, Qt::WindowFlags f)
 
void scroll (int dx, int dy)
 
void scroll (int dx, int dy, const QRect &r)
 
QWidgetfocusWidget () const
 
QWidgetnextInFocusChain () const
 
QWidgetpreviousInFocusChain () const
 
bool acceptDrops () const
 
void setAcceptDrops (bool on)
 
void addAction (QAction *action)
 
void addActions (QList< QAction * > actions)
 
void insertActions (QAction *before, QList< QAction * > actions)
 
void insertAction (QAction *before, QAction *action)
 
void removeAction (QAction *action)
 
QList< QAction * > actions () const
 
QWidgetparentWidget () const
 
void setWindowFlags (Qt::WindowFlags type)
 
Qt::WindowFlags windowFlags () const
 
void overrideWindowFlags (Qt::WindowFlags flags)
 
Qt::WindowType windowType () const
 
QWidgetchildAt (int x, int y) const
 
QWidgetchildAt (const QPoint &p) const
 
void setAttribute (Qt::WidgetAttribute attribute, bool on)
 
bool testAttribute (Qt::WidgetAttribute attribute) const
 
virtual QPaintEnginepaintEngine () const
 
void ensurePolished () const
 
bool isAncestorOf (const QWidget *child) const
 
bool hasEditFocus () const
 
void setEditFocus (bool enable)
 
bool autoFillBackground () const
 
void setAutoFillBackground (bool enabled)
 
QBackingStorebackingStore () const
 
QWindowwindowHandle () const
 
void windowTitleChanged (const QString &title)
 
void windowIconChanged (const QIcon &icon)
 
void windowIconTextChanged (const QString &iconText)
 
void customContextMenuRequested (const QPoint &pos)
 
virtual QVariant inputMethodQuery (Qt::InputMethodQuery query) const
 
Qt::InputMethodHints inputMethodHints () const
 
void setInputMethodHints (Qt::InputMethodHints hints)
 
- Public Member Functions inherited from QObject
 QObject (QObject *parent)
 
virtual const QMetaObjectmetaObject () const
 
QString objectName () const
 
void setObjectName (const QString &name)
 
bool isWidgetType () const
 
bool isWindowType () const
 
bool signalsBlocked () const
 
bool blockSignals (bool block)
 
QThreadthread () const
 
void moveToThread (QThread *targetThread)
 
int startTimer (int interval, Qt::TimerType timerType)
 
void killTimer (int id)
 
findChild (const QString &name, Qt::FindChildOptions options) const
 
QList< T > findChildren (const QString &name, Qt::FindChildOptions options) const
 
QList< T > findChildren (const QRegExp &regExp, Qt::FindChildOptions options) const
 
QList< T > findChildren (const QRegularExpression &re, Qt::FindChildOptions options) const
 
const QObjectList & children () const
 
void setParent (QObject *parent)
 
void installEventFilter (QObject *filterObj)
 
void removeEventFilter (QObject *obj)
 
QMetaObject::Connection connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const
 
bool disconnect (const char *signal, const QObject *receiver, const char *method) const
 
bool disconnect (const QObject *receiver, const char *method) const
 
void dumpObjectTree ()
 
void dumpObjectInfo ()
 
bool setProperty (const char *name, const QVariant &value)
 
QVariant property (const char *name) const
 
QList< QByteArraydynamicPropertyNames () const
 
void destroyed (QObject *obj)
 
void objectNameChanged (const QString &objectName)
 
QObjectparent () const
 
bool inherits (const char *className) const
 
void deleteLater ()
 
- Public Member Functions inherited from QPaintDevice
bool paintingActive () const
 
int width () const
 
int height () const
 
int widthMM () const
 
int heightMM () const
 
int logicalDpiX () const
 
int logicalDpiY () const
 
int physicalDpiX () const
 
int physicalDpiY () const
 
int devicePixelRatio () const
 
qreal devicePixelRatioF () const
 
int colorCount () const
 
int depth () const
 

Properties

Style style
 Defines the Widgets appereance. More...
 
QIcon dialogButtonIcon
 Holds the icon to be used for the edits button. More...
 
PathMode pathMode
 Specifies the kind of path to be entered. More...
 
QFileDialog::Options dialogOptions
 Options for the QFileDialog. More...
 
bool editable
 Specifies whether the path can be manually entered or not. More...
 
bool allowEmptyPath
 Specifies whether an empty path is allowed or not.
 
bool useCompleter
 Turns the auto-completer for manual editing on and off. More...
 
QString defaultDirectory
 Holds the default directory for the QFileDialog. More...
 
QString path
 Holds the currently entered, valid path. More...
 
QString placeholder
 Specifiy a placeholder to be shown if no path is entered. More...
 
QStringList nameFilters
 Holds name filters for the dialog and the completer. More...
 
QStringList mimeTypeFilters
 Holds mime filters for the dialog and the completer. More...
 
- Properties inherited from QWidget
 modal
 
 windowModality
 
 enabled
 
 geometry
 
 frameGeometry
 
 normalGeometry
 
 x
 
 y
 
 pos
 
 frameSize
 
 size
 
 width
 
 height
 
 rect
 
 childrenRect
 
 childrenRegion
 
 sizePolicy
 
 minimumSize
 
 maximumSize
 
 minimumWidth
 
 minimumHeight
 
 maximumWidth
 
 maximumHeight
 
 sizeIncrement
 
 baseSize
 
 palette
 
 font
 
 cursor
 
 mouseTracking
 
 isActiveWindow
 
 focusPolicy
 
 focus
 
 contextMenuPolicy
 
 updatesEnabled
 
 visible
 
 minimized
 
 maximized
 
 fullScreen
 
 sizeHint
 
 minimumSizeHint
 
 acceptDrops
 
 windowTitle
 
 windowIcon
 
 windowIconText
 
 windowOpacity
 
 windowModified
 
 toolTip
 
 toolTipDuration
 
 statusTip
 
 whatsThis
 
 accessibleName
 
 accessibleDescription
 
 layoutDirection
 
 windowFlags
 
 autoFillBackground
 
 styleSheet
 
 locale
 
 windowFilePath
 
 inputMethodHints
 
- Properties inherited from QObject
 objectName
 

Additional Inherited Members

- Static Public Member Functions inherited from QWidget
void setTabOrder (QWidget *first, QWidget *second)
 
QWidgetmouseGrabber ()
 
QWidgetkeyboardGrabber ()
 
QWidgetfind (WId id)
 
QWidgetcreateWindowContainer (QWindow *window, QWidget *parent, Qt::WindowFlags flags)
 
- Static Public Member Functions inherited from QObject
QString tr (const char *sourceText, const char *disambiguation, int n)
 
QString trUtf8 (const char *sourceText, const char *disambiguation, int n)
 
QMetaObject::Connection connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, Functor functor)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, const QObject *context, Functor functor, Qt::ConnectionType type)
 
bool disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method)
 
bool disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method)
 
bool disconnect (const QMetaObject::Connection &connection)
 
bool disconnect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method)
 
- Public Attributes inherited from QWidget
typedef RenderFlags
 
- Protected Member Functions inherited from QWidget
virtual bool event (QEvent *event)
 
virtual void mousePressEvent (QMouseEvent *event)
 
virtual void mouseReleaseEvent (QMouseEvent *event)
 
virtual void mouseDoubleClickEvent (QMouseEvent *event)
 
virtual void mouseMoveEvent (QMouseEvent *event)
 
virtual void wheelEvent (QWheelEvent *event)
 
virtual void keyPressEvent (QKeyEvent *event)
 
virtual void keyReleaseEvent (QKeyEvent *event)
 
virtual void focusInEvent (QFocusEvent *event)
 
virtual void focusOutEvent (QFocusEvent *event)
 
virtual void enterEvent (QEvent *event)
 
virtual void leaveEvent (QEvent *event)
 
virtual void paintEvent (QPaintEvent *event)
 
virtual void moveEvent (QMoveEvent *event)
 
virtual void resizeEvent (QResizeEvent *event)
 
virtual void closeEvent (QCloseEvent *event)
 
virtual void contextMenuEvent (QContextMenuEvent *event)
 
virtual void tabletEvent (QTabletEvent *event)
 
virtual void actionEvent (QActionEvent *event)
 
virtual void dragEnterEvent (QDragEnterEvent *event)
 
virtual void dragMoveEvent (QDragMoveEvent *event)
 
virtual void dragLeaveEvent (QDragLeaveEvent *event)
 
virtual void dropEvent (QDropEvent *event)
 
virtual void showEvent (QShowEvent *event)
 
virtual void hideEvent (QHideEvent *event)
 
virtual bool nativeEvent (const QByteArray &eventType, void *message, long *result)
 
virtual void changeEvent (QEvent *event)
 
virtual int metric (PaintDeviceMetric m) const
 
virtual void initPainter (QPainter *painter) const
 
virtual void inputMethodEvent (QInputMethodEvent *event)
 
void updateMicroFocus ()
 
void create (WId window, bool initializeWindow, bool destroyOldWindow)
 
void destroy (bool destroyWindow, bool destroySubWindows)
 
virtual bool focusNextPrevChild (bool next)
 
bool focusNextChild ()
 
bool focusPreviousChild ()
 
- Protected Member Functions inherited from QObject
QObjectsender () const
 
int senderSignalIndex () const
 
int receivers (const char *signal) const
 
bool isSignalConnected (const QMetaMethod &signal) const
 
virtual void timerEvent (QTimerEvent *event)
 
virtual void childEvent (QChildEvent *event)
 
virtual void customEvent (QEvent *event)
 
virtual void connectNotify (const QMetaMethod &signal)
 
virtual void disconnectNotify (const QMetaMethod &signal)
 

Detailed Description

The QPathEdit widget class is a special kind of an edit field, with the purpose to retriev file-paths from the user. See Main Page for more details

Definition at line 25 of file qpathedit.h.

Member Enumeration Documentation

§ PathMode

Enumerator
ExistingFile 

A single, existings file. This is basically "Open file".

ExistingFolder 

A single, existing directory. This is basically "Open Folder".

AnyFile 

A single, valid file, no matter if exisiting or not (the directory, however, must exist). This is basically "Save File".

Definition at line 64 of file qpathedit.h.

§ Style

Enumerator
SeperatedButton 

The button to open the dialog will be place next to the edit.

JoinedButton 

The button to open the dialog will be placed inside the edit.

NoButton 

The QFileDialog is completly disabled and will never show. Thus, there is no button either.

Definition at line 56 of file qpathedit.h.

Member Function Documentation

§ setPath()

QPathEdit::setPath ( QString  path,
bool  allowInvalid = false 
)
Parameters
paththe path to be set
allowInvalidAllow path to be invalid.
Returns
true, if the set path is valid, false if not (If invalid paths are allowed, the path inside the edit will be set, even if false is returend)

If allowInvalid is true, and the path is invalid, only the contents of the QLineEdit will be changed, not the stored, valid path. If invalid and false, this function does nothing. If the path is valid, it will always be set.

§ showDialog

QPathEdit::showDialog ( )
slot

This slot can be used to manually show the Dialog. It will be automatically called, when the user clicks the button. Even if the Dialog is not user-accessibale (style is set to QPathEdit::NoDialog), this slot will still show the dialog. This way you can use the complete functionality of the QPathEdit, even if you can't show a button next to the edit

Property Documentation

§ defaultDirectory

QPathEdit::defaultDirectory
readwrite

Default: QStandardPaths::HomeLocation

The default directory is the directory for the QFileDialog. If currently no path is set, the QFileDialog will show the default directory. If not set, this will be the users home directory.

Accessors
READdefaultDirectory()
WRITEsetDefaultDirectory()

Definition at line 44 of file qpathedit.h.

§ dialogButtonIcon

QPathEdit::dialogButtonIcon
readwrite

Default: <Depends on the style. Check QPathEdit::style to see how each default icon looks like>

This property holds the icon to be used for the QToolButton that shows the QFileDialog. It is save to change this property, even if the current Style does not use the icon

Accessors
READdialogButtonIcon()
WRITEsetDialogButtonIcon()
RESETresetDialogButtonIcon()

Definition at line 32 of file qpathedit.h.

§ dialogOptions

QPathEdit::dialogOptions
readwrite

Default: 0

Options for the QFileDialog. See QFileDialog::Options for details

Accessors
READdialogOptions()
WRITEsetDialogOptions()

Definition at line 36 of file qpathedit.h.

§ editable

QPathEdit::editable
readwrite

Default: false

If set to false, the user will see the path and be able to select and copy it. However, he will not be able to edit it manually. If set to true, the user can edit the path manually. However, since theres a validator working in the background, the QPathEdit::path will only be update, if the entered path is valid. In addition to that, invalid paths will be marked red, to indicate the user, that his path is wrong

Accessors
READisEditable()
WRITEsetEditable()

Definition at line 38 of file qpathedit.h.

§ mimeTypeFilters

QPathEdit::mimeTypeFilters
readwrite

Default: "application/octet-stream" (may differ, since the value of QFileDialog::mimeTypeFilters is used)

This property holds the name filters for both the dialog and the completer. For more details on this filters, check QFileDialog::setMimeTypeFilters.

Accessors
READnameFilters()
WRITEsetNameFilters()

Definition at line 52 of file qpathedit.h.

§ nameFilters

QPathEdit::nameFilters
readwrite

Default: "All Files (*)" (may differ, since the value of QFileDialog::nameFilters is used)

This property holds the name filters for both the dialog and the completer. For more details on this filters, check QFileDialog::setNameFilters.

Accessors
READnameFilters()
WRITEsetNameFilters()

Definition at line 50 of file qpathedit.h.

§ path

QPathEdit::path
readwrite

Default: QString()

Holds the current entered path. This path is guaranteed to be always a valid file path or empty. If the user enters invalid data, this path won't be updated. In fact, it only changes as soon as the user finish editing (QLineEdit::editingFinished() is used to determine this). If you set the path, the displayed path will always be updated. However, if you pass an invalid path, it may or may not be stored as path. Check the write accessor for more details.

Accessors
READpath()
WRITEsetPath()
RESETclear()
NOTIFYpathChanged()

Definition at line 46 of file qpathedit.h.

§ pathMode

QPathEdit::pathMode
readwrite

Default: QPathEdit::ExistingFile

The mode for filters for the completer, the validator, and the dialog. See QPathEdit::PathMode for more details.

Accessors
READpathMode()
WRITEsetPathMode()

Definition at line 34 of file qpathedit.h.

§ placeholder

QPathEdit::placeholder
readwrite

Default: QString()

The line edits placeholder to be shown if currently no path is entered.

Accessors
READplaceholder()
WRITEsetPlaceholder()

Definition at line 48 of file qpathedit.h.

§ style

QPathEdit::style
readwrite

Default: QPathEdit::SeperatedButton

The Style describes the visual appeareance of the edit. The following styles are available

Name QPathEdit::SeperatedButton QPathEdit::JoinedButton QPathEdit::NoButton
Edit-Style (Windows):
sepbtn_win.png
joinbtn_win.png
nobtn_win.png
Edit-Style (OsX):
sepbtn_mac.png
joinbtn_mac.png
nobtn_mac.png
Edit-Style (Ubuntu):
sepbtn_x11.png
joinbtn_x11.png
nobtn_x11.png

The style has no effect on the functionality, except that the NoButton style will make it impossible for the user to open the file dialog. But it can still be used with the showDialog() slot.

Accessors
READstyle()
WRITEsetStyle()

Definition at line 30 of file qpathedit.h.

§ useCompleter

QPathEdit::useCompleter
readwrite

Default: true

Activates or deactivates the completer. The completer is an auto-completer-mechanism, that will allow the user easier path finding, if the QPathEdit is editable. It uses an underlying QFileSystemModel to get the paths. Since I have only limited control with that model, there are a few important points regarding the completer:

  • Filters: All filters will be applied to the completer too. However, since you can't choose a filter like in the QFileDialog, the completer will always use all filters. That means, if you one of you filters is the wildcard-filter (*), the model will show all files, ignoring any other filters. Files that don't apply to the filter will hidden
  • Paths: The model uses native paths, more accurate native seperators. To maintain the cross-plattform-ability of this class, all entered paths will be converted to Qt-style seperators (/). The model does accept both seperators, if listing paths. This means no matter what seperators the user enters, QPathEdit::path will always return a path using "/"
Accessors
READuseCompleter()
WRITEsetUseCompleter()

Definition at line 42 of file qpathedit.h.


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