qt - qml 中的 TextField 内的矩形中不能有多个 InnerShadow
问题描述
我希望多个 InnerShadow 位于 TextField 内的矩形中,但我只设法制作了这个,我怎么能做到这一点。
我怎样才能让两个内阴影出现在我的矩形上?
TextField {
id: textField
anchors.fill: root
//anchors.verticalCenter: root.verticalCenter
text: "text"
focus: true
selectByMouse: !editableTextField
color: colorTexto
readOnly: !editableTextField
placeholderText: "--------"
maximumLength: 100
font.pixelSize: styleId.textSize.regular.x_large
font.family: fontName
echoMode: passwd ? TextInput.Password : TextInput.Normal
background:
Rectangle {
anchors.fill: parent
id: rectTextFieldId
color: styleId.colorGeneral.text.dark
//border.width: 1
radius: 4
layer.enabled: true
layer.mipmap: true
layer.effect: innerShadowTopId && innerShadowBottomId
Component {
id: innerShadowTopId
InnerShadow {
radius: 4
samples: 9
horizontalOffset: -2
verticalOffset: -2
color: Qt.rgba(255, 255, 255, 1)
}
}
Component {
id: innerShadowBottomId
InnerShadow {
radius: 4
samples: 9
horizontalOffset: 2
verticalOffset: 2
color: Qt.rgba(0, 0, 0, 0.35)
}
}
}
}//TextField
解决方案
推荐阅读
- django - 带有到期日期的随机 URL (Django)
- android - Android Studio Gradle 不想同步
- abap - 如何找回重定义被删除的重定义DPC方法?
- scala - Spark Kafka - 无法在 120000 毫秒内获取偏移记录
- django - 确保字段对于 Django 模型中的另一个字段是唯一的
- angular - Typescript 模型声明 - 有没有一种方法可以提供基于迭代键的方法,而无需对模型文件中的每个值进行硬编码?
- c - 如何在C中转储txt文件?
- python - 具有相同小部件 QMdiSubwindow 的多个子窗口
- c++ - 使用结构数组中的数据绘制折线图 (c++)
- docker - docker hub 速率限制还剩多少?