DeleteAction.qml 552 B

123456789101112131415161718
  1. // Copyright (C) 2025 The Qt Company Ltd.
  2. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
  3. // Qt-Security score:significant reason:default
  4. import QtQuick
  5. import QtQuick.Templates as T
  6. T.Action {
  7. text: qsTr("Delete")
  8. icon.name: "edit-delete"
  9. icon.width: 24
  10. icon.height: 24
  11. shortcut: StandardKey.Delete
  12. enabled: !editor.readOnly && editor.selectedText.length > 0
  13. onTriggered: editor.remove(editor.selectionStart, editor.selectionEnd)
  14. required property Item editor
  15. }