PDA

View Full Version : qmake persistent property (environment variables) on Linux systems



hwanud
18th August 2013, 03:56
Hello.

I'm trying to set the qmake persistent properties which is also called environment variables in order to use the older version of qt in qt creator.

Here is the relevant packages I have:
- Qt Creator 2.4.1 (Based on Qt 4.8.0 (32 bit))
- Qt 3.4.8b
- Qt 4.8.1

By default, Qt Creator uses Qt 4.8.1, but I need to change this to the older version of Qt (3.4.8b).
So I go to "Tools -> Options -> Build & Run -> Qt Versions" tab, and added qmake that is linked to the qmake-qt3.
(My system, Ubuntu 12.04, uses update-alternatives to maintain different versions of packages. So qmake is linked to the qmake-qt3.)

Anyway, that causes an error such as "Could not determine the path to the binaries of the Qt installation, maybe the qmake path is wrong?".
I googled the error message and found that this is because my qmake does not have its environment variables.
When I typed the command, '$ qmake -query', the result shows nothing while '$ qmake-qt4 -query' shows the below:

QT_INSTALL_PREFIX:/usr
QT_INSTALL_DATA:/usr/share/qt4
QT_INSTALL_DOCS:/usr/share/qt4/doc
QT_INSTALL_HEADERS:/usr/include/qt4
QT_INSTALL_LIBS:/usr/lib/i386-linux-gnu
QT_INSTALL_BINS:/usr/bin
QT_INSTALL_PLUGINS:/usr/lib/i386-linux-gnu/qt4/plugins
QT_INSTALL_IMPORTS:/usr/lib/qt4/imports
QT_INSTALL_TRANSLATIONS:/usr/share/qt4/translations
QT_INSTALL_CONFIGURATION:/etc/xdg
QT_INSTALL_EXAMPLES:/usr/lib/qt4/examples
QT_INSTALL_DEMOS:/usr/lib/qt4/demos
QMAKE_MKSPECS:/usr/share/qt4/mkspecs
QMAKE_VERSION:2.01a
QT_VERSION:4.8.1

Based on this, I tried to set the variables using 'qmake -set' command.
But... I made some typo... and resulted in adding wrong vaiables. My qmake (= qmake-qt3) persistent properties have the variables the below:

QT_INSTALL:
QT_INSTALL_PREFIX:
QT_NINSTALL_PREFIX:


I set the values as NULL using the command such as ' $ qmake -set QT_INSTALL "" '.
But I don't know how to remove those.

I tried to remove the package, qt3-dev-tools, from my system and install it agian, but it did not helped me.
I saw some postings about the qmake persistent properties, but I couldn't find any helpful articles till now.

So could anyone help me to remove these variables and start it over?

* Oh. I forgot telling that I installed my Qt3 and Qt4 via Ubuntu apt-get command.

ChrisW67
18th August 2013, 22:36
So could anyone help me to remove these variables and start it over?


$ qmake -unset VARIABLE

"qmake -h" is also useful

hwanud
19th August 2013, 01:34
Thank you for yor reply.
I have tried that command, qmake -unset, but it did not work for me unfortunately.
Also I tried qmake -remove and -clear, but same result.
qmake -h does not give me any helpful options, too.

Did I miss something?

wysota
19th August 2013, 08:01
Qt 3.4.8? Wasn't the last Qt3 version 3.3.8?

By the way, qmake -set does not operate on environment variables, these are internal qmake variables. I don't think Qt3 used those, by the way. We only had $QTDIR (which indeed was an environment variable) there, as far as I remember.

Since the qmake syntax and the whole development approach in Qt3 was much different than Qt4, I doubt you will be able to force QtCreator to help you with such projects in any meaningful way. You can still use it as a rich code editor but you should manage the project yourself (you can still ask Creator to build the project for you though).

hwanud
21st August 2013, 04:52
@wysota

Sorry, I made a mistake about the version. You're right. My Qt version is 3.3.8b.
Thank you.

For the use of Qt3 on Creator, your opinion looks right. Even though I force to set the all variables of qmake-qt3 to the values I have extracted from the result of 'qmake-qt4 -query', Creator does not work as I expected. Maybe it does not support lower version of Qt than Qt4.
As you told, it might be better to use the Creator as a rich code editor if I want to develop something using Qt3.

Thanks for your helpful advice!

ChrisW67
21st August 2013, 05:13
Actually you are much better off not developing anything in Qt3 at all.

hwanud
21st August 2013, 05:29
Thanks a lot.

Actually I am not developing my app from the beginning. I just want to use the simulator which is already developed based on Qt3.
With the Makefile provided for the simulator, I can compile and run the code without any problem, but the vi environment is not that comfortable for me yet.
This is why I want to use Creator.

I will use Qt4 when I make something for myself as you advised me.