TextArea
是一个用于显示和编辑多行可滚动文本的控件,通常用于需要用户输入或展示大量文本的应用中。以下是 TextArea
中常用的属性、信号和方法的详解:
常用属性
-
text:
- 描述:用于设置或获取显示的文本内容。
- 类型:
string
- 示例:
text: "Hello, World!"
-
readOnly:
- 描述:设置为
true
时,文本框为只读状态,用户不能编辑内容。 - 类型:
bool
- 默认值:
false
- 示例:
readOnly: true
- 描述:设置为
-
placeholderText:
- 描述:当
TextArea
为空时显示的占位符文本。 - 类型:
string
- 示例:
placeholderText: qsTr("Enter
- 描述:当