Results 1 to 8 of 8

Thread: Deploying a Qt app

  1. #1
    Join Date
    Dec 2009
    Posts
    21
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Deploying a Qt app

    Err ! How ?

    I have an app in "c:\Program Files\MyApp" with all the qt dll's and plugins in subdirectors below that.

    I created a qt.conf with
    [Paths]
    Prefix = c:\Program Files\MyApp

    and put that in my app directory, but this not picked up. QT insists that plugins should be where they are on my dev machine ie. "c:\Qt\2010.02.1\qt"

    whats the problem?

    thanks

  2. #2
    Join Date
    Jan 2006
    Location
    Belgium
    Posts
    1,938
    Thanked 268 Times in 268 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Wiki edits
    20

    Default Re: Deploying a Qt app

    Here's your problem:
    Quote Originally Posted by drave View Post
    Prefix = c:\Program Files\MyApp
    But I don't know how you can solve it, after looking in the documentation, it doesn't say how you can escape spaces.
    Did you try putting the path between quotes?

  3. #3
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Deploying a Qt app

    I find you can use quotes and that you need to double up on the slashes, but I've not actually tried with spaces.

    eg.
    Qt Code:
    1. [Paths]
    2. Prefix = "c:\\Qt\\2009.03-vstudio-static\\qt\\"
    To copy to clipboard, switch view to plain text mode 

    (Without the double slashing, it seems to concat all the seperate path parts together)

  4. #4
    Join Date
    Dec 2009
    Posts
    21
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Deploying a Qt app

    well i tried that but it still didnt work (double backslash and quotes)

    ive now found the "qApp->addLibraryPath" call which seems to do the trick, but the qt.conf way would be better

  5. #5
    Join Date
    Jul 2008
    Location
    Norway
    Posts
    12
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60

    Default Re: Deploying a Qt app

    From the QDir doc:
    Qt uses "/" as a universal directory separator in the same way that "/" is used as a path separator in URLs. If you always use "/" as a directory separator, Qt will translate your paths to conform to the underlying operating system.
    Maybe this applies to qt.conf too? Try
    Qt Code:
    1. Prefix = c:/Program Files/MyApp
    To copy to clipboard, switch view to plain text mode 
    or
    Qt Code:
    1. Prefix = "c:/Program Files/MyApp"
    To copy to clipboard, switch view to plain text mode 
    !sirius

  6. #6
    Join Date
    Jul 2008
    Location
    Norway
    Posts
    12
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60

    Default Re: Deploying a Qt app

    Btw, have you read doc:qt-conf.html?

    On Windows and X11, the Prefix is relative to the directory containing the application executable (QCoreApplication::applicationDirPath()). On Mac OS X, the Prefix is relative to the Contents in the application bundle. For example, application.app/Contents/plugins/ is the default location for loading Qt plugins.
    When I deploy applications on Windows I put the Qt DLLs in the same directory as the app, and the plugin DLLs in a subfolder called plugins. No qt.conf needed. How's your directory structure?
    !sirius

  7. #7
    Join Date
    Dec 2009
    Posts
    21
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Deploying a Qt app

    Hi apologies for the delay but i had to be away, anyway ....

    My current setup has exe,dlls and qt.conf in "c:\myapp" with a subfolder called plugins,as you say. if i do not use qt.conf (i previously had a stupid syntax error) or qApp->addLibraryPath then the app cannot find the sqlite driver in plugins\sqldrivers and
    QLibraryInfo::location(QLibraryInfo::PrefixPath) has a value of "c:\qt\2010\qt"
    QLibraryInfo::location(QLibraryInfo::PluginsPath) has a value of "c:\qt\2010\qt\plugins"

    how do you get away without a qt.conf ?

  8. #8
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Deploying a Qt app

    By default the plugins path is just "Plugins". So the Plugins directory is a sub-dir of wherever the application is and so a qt.conf is not required.

    Unless you modified the default when you rebuilt the library.

    Regardless, you can always use something like setLibraryPaths() (or addLibraryPath())
    Last edited by squidge; 21st June 2010 at 18:00.

Similar Threads

  1. Deploying
    By Svalorzen in forum Newbie
    Replies: 8
    Last Post: 10th June 2010, 00:48
  2. Deploying on Windows
    By GianMarco in forum Installation and Deployment
    Replies: 6
    Last Post: 18th November 2009, 07:13
  3. Deploying sqlite app
    By codeman in forum Installation and Deployment
    Replies: 7
    Last Post: 21st October 2009, 11:13
  4. Deploying with MySQL and FTP
    By josepvr in forum Qt Programming
    Replies: 2
    Last Post: 9th April 2009, 08:16
  5. deploying my qt application
    By arunredi in forum Installation and Deployment
    Replies: 1
    Last Post: 22nd May 2008, 11:34

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.