ActionTextField QML Type
This is advanced textfield. It is recommended to use this class when there is a need to create a create a textfield with action buttons (e.g a clear action). More...
Import Statement: | import org.kde.plasma.extras |
Inherited By: |
Properties
- focusSequence : keysequence
- leftActions : list<T.Action>
- rightActions : list<T.Action>
Detailed Description
For common pattern like, a search field or a password field, prefer using the more specifig SearchField or PasswordField.
Example usage for a search field:
import QtQuick.Controls as QQC2 import org.kde.plasma.extras as PlasmaExtras PlasmaExtras.ActionTextField { id: searchField placeholderText: "Search…" focusSequence: StandardKey.Find rightActions: [ QQC2.Action { icon.name: "edit-clear" enabled: searchField.text !== "" onTriggered: { searchField.clear() searchField.accepted() } } ] onAccepted: console.log("Search text is " + searchField.text) }
Property Documentation
focusSequence : keysequence |
This property holds a shortcut sequence that will focus the text field.
leftActions : list<T.Action> |
This property holds a list of actions that will be displayed on the left side of the text field.
By default this list is empty.
rightActions : list<T.Action> |
This property holds a list of actions that will be displayed on the right side of the text field.
By default this list is empty.