2

I am developing an Qt Quick Application where I am serving "main.qml" file over network:

QQuickView vv;
vv.engine()->setNetworkAccessManagerFactory(new MyFactory());
vv.setSource(QUrl("http://192.168.1.101/main.qml"));
vv.showFullScreen();

main.qml file is :

import QtQuick 2.7
import QtQuick.Window 2.2
Image
{
    id :pencere
    width: Screen.width
    height: Screen.height
    source: "back.png"
}

I created file server using HFS tool.

I am running my application,it fetches qml file from server.Application starts with a white screen,waiting for a long time than loads image and shows it.As the output shows,it requests for image file very long time after main.qml is requested :

enter image description here

Why it requests for image 1 MINUTES later than qml file? How to reduce that duration?

This is happening too,if I set an image on the internet.I am sure that there is no problem about HFS.

Muhammet Ali Asan
  • 1,486
  • 22
  • 39
  • 1
    Think about it -- how would your application possibly know that it needed to download that image file until *after* it had downloaded the QML file that requested the image? – MrEricSir Feb 18 '17 at 20:38
  • I am smart enough to know that. Is not 1 minutes long to find image to download in qml and download it ? – Muhammet Ali Asan Feb 19 '17 at 07:05
  • 3
    Add debug output for `Image.status` and compare that to your server's log. Usually loading images from the Internet takes milliseconds so I think the problem is on your machine. Maybe DNS lookup or firewall. – folibis Feb 19 '17 at 07:17
  • It's interesting that the image starts to load EXACTLY one minute after the QML has finished loading, as if there is a time-out involved. – Mark Feb 19 '17 at 20:42
  • @Mark And if I have more than one image, the request starts 1 minute later than QML but downloads all the images in a second. – Muhammet Ali Asan Feb 22 '17 at 06:41

0 Answers0