Skip to content

UniDeskTextField Type

Single-line text input field based on T.TextField (QtQuick Templates). Custom border, background, text color, and focus indicator styles.

ItemDescription
Control TypeVisual Control
Source FileUniDesk/Controls/UniDeskTextField.qml
InheritsT.TextField (QtQuick Templates)
QML Importimport UniDesk.Controls 1.0

Custom Properties

PropertyTypeDefaultDescription
enableFontDelegateboolfalseEnable font delegate mode: renders input text as a font name

Custom Styling

  • Focus border uses theme color (UniDeskSettings.primaryColor)
  • Non-focus border uses theme-adaptive color
  • Text color auto-adapts to light/dark theme
  • Selection color uses theme color
  • Font uses UniDeskTextStyle.little (or text as font name when font delegate enabled)
  • 5px corner radius, 1px border width
  • Focus automatically cleared when losing focus

Examples

qml
import UniDesk.Controls 1.0

UniDeskTextField {
    placeholderText: "Enter username"
    onEditingFinished: console.log("text:", text)
}

// Font delegate mode
UniDeskTextField {
    enableFontDelegate: true
    text: "Microsoft YaHei"
}

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