import QtQuick import QtQuick.Controls.Basic import QtQuick.Layouts ApplicationWindow { visible: true width: 800 height: 400 RowLayout { anchors.centerIn: parent width: 400 height: 48 spacing: 8 Rectangle { Layout.fillWidth: true height: 24 clip: true TextInput { id: input_field width: parent.width anchors.verticalCenter: parent.verticalCenter leftPadding: 8 font.pixelSize: 14 selectByMouse: true selectionColor: "lightgrey" selectedTextColor: "dodgerblue" } Rectangle { anchors.bottom: parent.bottom width:parent.width height: 1 color: "lightgrey" } } RoundButton { Layout.preferredWidth: 80 text: "Print" onClicked: print(input_field.selectedText.length) } } }