当前位置: 代码迷 >> QT开发 >> QML的基础有关问题
  详细解决方案

QML的基础有关问题

热度:95   发布时间:2016-04-25 04:43:28.0
QML的基础问题
c++中如何获取QML TextInput 的输入数据?

------解决方案--------------------
TextInput {
id: text_input1
x: 111
y: 80
width: 80
height: 20
text: qsTr("text")
font.pixelSize: 12
}
text_input1.text

------解决方案--------------------
我一般是通过调用一个C++的槽函数来解决,类似以下:
C/C++ code
viewer.rootContext()->setContextProperty("global", CGlobal::instance());
  相关解决方案