Results 1 to 9 of 9

Thread: How to get the installation directory of Qt 4?

  1. #1

    Default How to get the installation directory of Qt 4?

    Hi, I wanna know how to get the installation directory of Qt4?
    Which function can do this? Thanks a lot.

  2. #2
    Join Date
    Jan 2006
    Location
    Sta. Eugènia de Berga (Vic - Barcelona - Spain)
    Posts
    869
    Thanks
    70
    Thanked 59 Times in 57 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: How to get the installation directory of Qt 4?

    Hi,
    It depends on your OS. On Windows you can check the system variable "QTDIR".
    Qt Code:
    1. char* qtdir = getenv("QTDIR");
    To copy to clipboard, switch view to plain text mode 

    I don't know if Linux have "getenv" function but there will be a similar one.
    Òscar Llarch i Galán

  3. #3

    Default Re: How to get the installation directory of Qt 4?

    Hi, NyAw. Thank you for your response.
    But seems the method you mentioned doesn't work.
    I'm using Ubuntu 9.10 here and I tried the command:
    echo $QTDIR

    It's empty. No environment variable named QTDIR defined.

  4. #4
    Join Date
    Jan 2006
    Location
    Sta. Eugènia de Berga (Vic - Barcelona - Spain)
    Posts
    869
    Thanks
    70
    Thanked 59 Times in 57 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: How to get the installation directory of Qt 4?

    Hi,

    Ok, i doesn't exists but you can create it. Use your favorite search engine to find hot to define environment variables on Linux
    Òscar Llarch i Galán

  5. #5

    Default Re: How to get the installation directory of Qt 4?

    Hmm... NyAw, I think you misunderstand my meaning. Suppose we'll install our Qt program into a computer. How can I suppose there is a QTDIR environment variable is available?
    Right now what I want is, in a computer which installed Qt 4, to get the installation directory of Qt. So how can I set this QTDIR myself? I don't know where the Qt is.

  6. #6
    Join Date
    Jan 2006
    Location
    Sta. Eugènia de Berga (Vic - Barcelona - Spain)
    Posts
    869
    Thanks
    70
    Thanked 59 Times in 57 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: How to get the installation directory of Qt 4?

    Hi,

    The installation on Windows will create the variable for you. On Linux I don't know if it is created. I'm telling you that you can create the variable when you install the application on another system. It's so easy.
    Hmm... NyAw, I think you misunderstand my meaning
    I understand what you want. Maybe you don't understood what I told you

    PD: Check Qt on Linux installation guide that will tell you if the variable is created or you have to define it.
    But, I think that this is not a Qt programming related question.
    Òscar Llarch i Galán

  7. #7

    Default Re: How to get the installation directory of Qt 4?

    Thank you, NyAw. I got what you mean. Just as you said here:

    Quote Originally Posted by ^NyAw^ View Post
    I'm telling you that you can create the variable when you install the application on another system. It's so easy.
    .
    I can create the env variable to save the Qt's installation directory in my installation program, but the key point is: how to find out where the Qt installed?

    My original meaning is, whether Qt provides a class/function to make it possible to check out the Qt's installation directory directly. If the answer is no, yes, this is not a Qt programming related problem.

  8. #8
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,365
    Thanks
    3
    Thanked 5,014 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: How to get the installation directory of Qt 4?

    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  9. #9

    Default Re: How to get the installation directory of Qt 4?

    Hi, wysota:
    Thank you very much. It works!

Similar Threads

  1. Qt 4.6.1 Installation
    By JulioCastro in forum Newbie
    Replies: 2
    Last Post: 5th February 2010, 07:36
  2. Qt for s60 installation
    By addu in forum Installation and Deployment
    Replies: 2
    Last Post: 26th August 2009, 11:37
  3. help me with the installation of QT 4.4.1
    By kernel19 in forum Installation and Deployment
    Replies: 1
    Last Post: 14th September 2008, 15:13
  4. Installation
    By sanwar in forum Installation and Deployment
    Replies: 4
    Last Post: 11th October 2006, 16:11
  5. Qt 4 installation on SFU
    By boss_bhat in forum Installation and Deployment
    Replies: 0
    Last Post: 11th July 2006, 16:40

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.