Skip to main content

QCustomFileDropZone

QCustomFileDropZone

Drag-and-drop file input with click-to-browse.

A dashed zone that accepts dropped files (filtered by extension) or opens a file dialog on click. Highlights while dragging (a dragActive property). Tokenized. Emits filesDropped / filesChanged.

At a glance​

TierFree (GPLv3)
Importfrom Custom_Widgets.QCustomFileDropZone import QCustomFileDropZone
Qt DesignerYes — drag it from the palette

Quick start​

from Custom_Widgets.QCustomFileDropZone import QCustomFileDropZone

widget = QCustomFileDropZone()

Dark theme​

Colours come from the design tokens, so the widget follows the app theme with no extra work.

QCustomFileDropZone in dark theme

Signals​

Signal
filesChanged(QVariantList)
filesDropped(QVariantList)

Methods​

MethodDescription
clear()Clear.
files()Files.
filesChanged(...)Files changed.
filesDropped(...)Files dropped.
setAcceptedExtensions(extensions)Set the accepted extensions.
setMultiple(multiple)Set the multiple.

Theming​

Colours come from the design tokens, so they follow the active theme. Roles used: surface, surface-muted, on-surface, outline, accent.

See Design tokens.

QCustomButtonGroup · QCustomCheckBox · QCustomColorPicker · QCustomComboBox · QCustomDateEdit · QCustomDateRangeEdit · QCustomDateRangePicker · QCustomEmojiPicker