Skip to content

UniDeskPathSelector Type

File or directory path selector control. Combines a text input field with a browse button (opens FileDialog or FolderDialog), supporting manual path input and dialog selection.

ProjectDescription
Control TypeVisual Control
Source FileUniDesk/Controls/UniDeskPathSelector.qml
InheritsQtQuick Item
QML Importimport UniDesk.Controls 1.0

Custom Properties

PropertyTypeDefaultDescription
pathstringSelected path
modeintUniDeskFileMode.FileModeFileFile or folder mode
parentWindowWindownullParent window (used to display error messages)

Signals

submit()

Emitted when a valid path is confirmed (via Enter key or dialog selection).

Enums

UniDeskFileMode

ValueDescription
FileModeFile (0)File selection mode
FileModeFolder (1)Folder selection mode

Behavior

  • Path validation on Enter: checks local file existence or URL validity
  • Empty path allowed
  • Invalid path triggers parentWindow.showError("Invalid path")
  • Browse button opens FileDialog or FolderDialog based on mode

Example

qml
import UniDesk.Controls 1.0

UniDeskPathSelector {
    mode: UniDeskFileMode.FileModeFolder
    onSubmit: console.log("Path:", path)
}

Released under the CC BY-SA 4.0 open documentation license.