You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

44 lines
662 B

import QtQuick 2.0
Item
{
10 years ago
property string value
property alias readOnly: textinput.readOnly
id: editRoot
10 years ago
height: 20
width: readOnly ? textinput.implicitWidth : 150
10 years ago
onValueChanged:
{
textinput.text = value
}
SourceSansProBold
{
id: boldFont
}
Rectangle {
anchors.fill: parent
radius: 4
TextInput {
id: textinput
clip: true
anchors.fill: parent
10 years ago
wrapMode: Text.WrapAnywhere
font.family: boldFont.name
selectByMouse: true
10 years ago
onTextChanged: {
var stringRegEx = new RegExp('"^\\"*', "g")
var str = stringRegEx.exec(text)
if (str && str.length > 0)
value = str[0]
else
value = text
}
}
}
}