查看完整版本: [-- qml里面Image控件不能识别中文路径是咋回事 --]

QTCN开发网 -> Qt QML开发 -> qml里面Image控件不能识别中文路径是咋回事 [打印本页] 登录 -> 注册 -> 回复主题 -> 发表主题

自强不吸 2017-06-13 08:10

qml里面Image控件不能识别中文路径是咋回事

我的本意是用C++读出文件路径在qml界面上显示图片,可是路径能打印出来中文,但是加入到image的source里面就不识别
错误提示:file:///D:/Work/QtProject/qml/ImagePreview.qml:39:23: QML Image: ????Ad?????????

后来我直接用一个Image控件写上中文路径还是不行,

Image {        
    anchors.fill: parent        
    source: "../image/usbImage/UI界面/IMG_2438.JPG"
}

提示错误:
QML Image: Cannot open: file:///D:/Work/QtProject/untitled/image/usbImage/UI????/IMG_2438.JPG


lemonzll 2017-06-13 08:30
你得确定下你的qml文件的编码是否是utf8的,如果是其它编码会有乱码,utf8文件没问题,用中文路径都正常的

never_forget 2017-06-13 08:46
Qt 完全不支持中文路径的,别挣扎了,老铁~~~

自强不吸 2017-06-13 08:50
never_forget:Qt 完全不支持中文路径的,别挣扎了,老铁~~~ (2017-06-13 08:46) 

只是qml不支持而已,Qt5用中文路径完全没问题

never_forget 2017-06-13 13:27
自强不吸:只是qml不支持而已,Qt5用中文路径完全没问题 (2017-06-13 08:50) 

哦。那我试试看~~~


查看完整版本: [-- qml里面Image控件不能识别中文路径是咋回事 --] [-- top --]



Powered by phpwind v8.7 Code ©2003-2011 phpwind
Gzip disabled