Friday, May 3, 2024
 Popular · Latest · Hot · Upcoming
1
rated 0 times [  1] [ 0]  / answers: 1 / hits: 2222  / 3 Years ago, sat, october 9, 2021, 4:47:42

I have a program to preview images that store every image's path (all images are in my computer) in text file. first i open text file and read line by line images paths and store to a list then i source image to the list[i],(for i=0 to numbers of images). it returns to me some error like this:



QML Image: Cannot open: qrc:///D:/QtApp/Gui_qml_app/res/1.png%0D
DirectShowPlayerService::doSetUrlSource: Unresolved error code 800c000d


this is my text file:



file:/D:/QtApp/Gui_qml_app/res/1.png
file:/D:/QtApp/Gui_qml_app/res/2.png
file:/C:/Users/info/Desktop/wall_images/3.png


and this is my code:



           property int i: -1
var request = new XMLHttpRequest()
request.open('GET','in.txt')
request.onreadystatechange = function(event) {
if (request.readyState == XMLHttpRequest.DONE) {

list = request.responseText.split('
');
}
}
request.send()
item.source =String(list[i+1])
i++;


can every one help me?


More From » c++

 Answers
6

The DirectShow error tells us that you're running on Windows and most of the time, newlines are coded with
on this platform.



Before assigning the item source path, remove the extra
:



list[i+1] = list[i+1].replace(/(
|
|
)/gm,"");
item.source = String(list[i+1])

[#24361] Sunday, October 10, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
calcur

Total Points: 189
Total Questions: 80
Total Answers: 95

Location: Burkina Faso
Member since Thu, Dec 15, 2022
1 Year ago
;