why QDesktopServices::openUrl() open a file slowly for the first time
I use QDesktopServices::openUrl() to open a file(.doc,xls,pdf), it takes 30-60 seconds to open file(.doc) for the first time, after that, it only takes 1-5 seconds to open anther file(.doc).it is same to file(xls, pdf).
Why it takes long time to open file for the first time?
Re: why QDesktopServices::openUrl() open a file slowly for the first time
It looks for best matched application to open the particular URL. I think this searches in file associations. And this first time trick is with all things we do on a machine. Everything we opens is slower for first time than opening same ting afterward.
Re: why QDesktopServices::openUrl() open a file slowly for the first time
Quote:
Originally Posted by
yogeshgokul
It looks for best matched application to open the particular URL. I think this searches in file associations. And this first time trick is with all things we do on a machine. Everything we opens is slower for first time than opening same ting afterward.
How can i make QDesktopServices::openUrl() open file speed up for first time?
Re: why QDesktopServices::openUrl() open a file slowly for the first time
There is very less you can do. Dfragment ur HDD or just replace it with higher RPM one. ;);) Kidding..
Just try to use this:
NOTICE QUrl::StrictMode
This should not make significant change but may be. Dont forget, that this will not check for validity of URL. Thats why it can speed up.
Re: why QDesktopServices::openUrl() open a file slowly for the first time
I think this is not a fault of Qt. If you open a doc the first time Word (the program) needs to be completely loaded into the memory. This takes a long time. If you open a second doc Word is already in memory (even if word was closed) and only the doc needs to be loaded.
I dont think, that using Strictmode for QUrl will have any significant speed improvements.