Hi, I wanna know how to get the installation directory of Qt4?
Which function can do this? Thanks a lot.
Hi, I wanna know how to get the installation directory of Qt4?
Which function can do this? Thanks a lot.
Hi,
It depends on your OS. On Windows you can check the system variable "QTDIR".
Qt Code:
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
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.
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
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.
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.
I understand what you want. Maybe you don't understood what I told youHmm... NyAw, I think you misunderstand my meaning
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
Thank you, NyAw. I got what you mean. Just as you said here:
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.
Hi, wysota:
Thank you very much. It works!
Bookmarks