Results 1 to 4 of 4

Thread: Is loading a built exe from QT Creator different from loading from file system?

  1. #1
    Join Date
    Jul 2012
    Posts
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Is loading a built exe from QT Creator different from loading from file system?

    I'm writing a desktop app that connects to my company's intranet. The page I'm trying to load is HTTP, but it will redirect to a login site that uses HTTPS. The app loads the page well when launched from QT Creator (both redirection and authentication succeeded, and the page is shown correctly), but when I run the app from file system (all DLLs are put into the folder correctly), the loading fails (QWebView's loadFinished(bool) signal is emitted with a false, which is a rare case as I learned online). I can catch the first 302 redirection status from QNetworkManager's SIGNAL(finished(QNetworkReply*)), but when the second time the signal is captured, the status becomes invalid. From QNetworkReply's documentation I read that "If the connection was not HTTP-based, this attribute will not be present." I don't know why. In addition, not SSL error signal is emitted. Since the app runs well from QT Creator. I believe it should be due to some difference in environment when launching. Anyone have a clue? Thanks!

    Edit:
    FYI QT creator is not running with privilege. One thing is that the app runs ok from FS several days ago but fails now. (I tried the backed up build from several days ago recently but with no luck) I don't know if that's some server side problem since I tried on multiple computers, which all managed to run the app before. But the most weird thing is why it has no problem when launching from IDE.
    Last edited by andygongyb; 27th July 2012 at 02:18.

  2. #2
    Join Date
    May 2012
    Posts
    136
    Thanks
    2
    Thanked 27 Times in 24 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Is loading a built exe from QT Creator different from loading from file system?

    Did you copy the correct version of the dll's? i had a similar problem a while ago but then I realized i just installed a newer version of qt and I still used the older dlls for the app

  3. #3
    Join Date
    Jun 2012
    Posts
    98
    Thanks
    11
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Is loading a built exe from QT Creator different from loading from file system?

    In my experience with simply loading images, the .exe when ran has the base folder as the folder IT is in; where when you open the project and run it the base directory is where the .project file you opened was.

    I.E. if you have a path that's specific to where your project file was: E.G. C:\Derp\ProjFoo and you have your files you need in Derp the project would reference ..\ for where they are. However, when the exe builds in C:\Derp\ProjFoo\Release it's searching ProjFoo for the files that use the term "..\".

    I'm not sure of the *why* exactly, but in my experience it took awhile to figure out why it would "forget" all the graphics I had added in designer that didn't use a resource file.


    I imagine you simple need to have a .qrc file include these .dlls in it's listed resources so the .exe knows where to find them, but I'm just guessing (and a bit noobish with this.)


    EDIT:
    My instance was I was getting ready to demo a shiny new GUI so some supervisors and when running through the .exe (since I hadn't used a resource file) I was losing all my resources. Had to learn that fix real quick lol

    IMO, move the exe to your project's base directory and run it; if it runs you know you have some local paths that need to be done more creatively in order to be correctly referenced. Personally I use a set of global paths if I'm unsure where things will end up; I figured I can always build an install that updates those paths based on the install_dir later
    Last edited by tescrin; 31st July 2012 at 17:05.

  4. #4
    Join Date
    May 2012
    Posts
    136
    Thanks
    2
    Thanked 27 Times in 24 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Is loading a built exe from QT Creator different from loading from file system?

    Quote Originally Posted by tescrin View Post
    In my experience with simply loading images, the .exe when ran has the base folder as the folder IT is in; where when you open the project and run it the base directory is where the .project file you opened was.

    I.E. if you have a path that's specific to where your project file was: E.G. C:\Derp\ProjFoo and you have your files you need in Derp the project would reference ..\ for where they are. However, when the exe builds in C:\Derp\ProjFoo\Release it's searching ProjFoo for the files that use the term "..\".

    I'm not sure of the *why* exactly, but in my experience it took awhile to figure out why it would "forget" all the graphics I had added in designer that didn't use a resource file.


    I imagine you simple need to have a .qrc file include these .dlls in it's listed resources so the .exe knows where to find them, but I'm just guessing (and a bit noobish with this.)


    EDIT:
    My instance was I was getting ready to demo a shiny new GUI so some supervisors and when running through the .exe (since I hadn't used a resource file) I was losing all my resources. Had to learn that fix real quick lol

    IMO, move the exe to your project's base directory and run it; if it runs you know you have some local paths that need to be done more creatively in order to be correctly referenced. Personally I use a set of global paths if I'm unsure where things will end up; I figured I can always build an install that updates those paths based on the install_dir later
    you can change the working directory (base path) for a project
    click on project in the Qt creator
    click on run (on the top of the window)
    change the working directory (for instance to the location where you build your app or some entierly other directory)

Similar Threads

  1. Loading a qmldir from a qrc file
    By bunjee in forum Qt Quick
    Replies: 7
    Last Post: 17th January 2017, 22:09
  2. Replies: 2
    Last Post: 30th October 2010, 16:15
  3. Replies: 5
    Last Post: 18th June 2010, 22:13
  4. Replies: 18
    Last Post: 21st May 2010, 16:08
  5. Qt Creator - problem loading project
    By Ferric in forum Newbie
    Replies: 1
    Last Post: 7th January 2010, 23:25

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.