PDA

View Full Version : Qt 5.2.0 Releated Questions?



mp33919
17th February 2014, 16:21
Recently I installed Qt 5.2.0 in Windows 7 success (?) and tried to install in Centos 6.0 but failed. I just wonder is there anyone has successful stories about both machines?

1. In Windows 7, I installed qt-windows-opensource-5.2.0-mingw48_opengl-x86-offline.exe (my Windows 7 is set for 32 bits). It seems to me to use Qt Designer to create GUI and using its signal/slot tools did not work. (I have used Qt 3.3.6 in RedHat 5.X for years, to set for singal/slot worked very friendly and easily.) Does anyone has the same problem? I purchased two books: C++ GUI Programming with Qt 4 2nd edition by Jasmin Blanchette, and Advanced Qt Programing, Creating Great Sofware with C++ and Qt 4. Both books has talked very little about using Qt Designer to generate GUI, I wonder why? I knew the books are for Qt 4, but there is no Qt 5.2 book available ...)

2. I Centos 6.0, I tried to install from qtx11extras-opensource-src-5.2.0.tar.gz, it failed. Then, I tried to install from qt-linux-opensource-5.2.0-x86_64-offline.run, it failed, too. (my Centos 6.0 machine is set for 64 bits) Can anyone instruct me how to install Qt 5.2.0 into Centos 6.0?

Thanks

wysota
17th February 2014, 16:37
Please provide more details about your problems. It is hard to help you in any way knowing only that something "fails".

mp33919
17th February 2014, 18:12
Thanks for your reply. Yes, I understand to describe something with "fail" without details are not a good way for asking some helps. But, since I had tried many ways and eventually crashed my system unexpectedly, it is a little hard to write down exactlly what happeded. So, let me started with install qt-linux-opensource-5.2.0-x86_64-offline.run in my Centos 6.0 first:
1. run the .run program
2. installer starts normally; I select ALL; I agreed Qt installer LGPL Agreement.
3. Qt installer start to install components, such as Essentials, Qt Creator, Essential Modules, ...
4. After installing "Create uninstaller", I press the "Finish" button. The README.txt file pops up. I think the Qt creator installation is done.
5. I went to menu bar, under "Programming", I found two newly created "Qt Creator" and "Qt Creator (Opensource)" in it.
6. Double click on Qt Creator (Opensource) -- nothing happened.
7. Double click on Qt Creator: a message pops out: "Could not Launch Qt Creator": Failed to change directory /home/user_me/Qtcreator-3.0.0 (no such file or directory)
8. It is true, I could not find anything about Qtcreator-3.0.0 in my machine. (But, why Qtcreator-3.0.0? even I could find it, should I need somthing Qtcreator 5.2....?)
9. Anyway, at this moment, I think the installation of Qt5.2.0 from qt-linux-opensource-5.2.0-x86_64-offline.run failed. I could start to install Qt 5.2.0 from qtx11extras-opensource-src-5.2.0.tar.gz
10. Is there anyway I could fix it before I un-install the Qt5.2.0 at this point?

Thanks.

wysota
17th February 2014, 21:33
Did you run the installation as root or as a normal user? What directory did you choose for the installation? Did you have appropriate access rights there?

ChrisW67
17th February 2014, 22:00
You appear to have tried installing a standalone QtCreator 3 at some stage in the past: this is the source of the desktop icon "Qt Creator"

Qt Creator 3.0 is the version bundled with Qt5.2 in the binary download but that installer creates the other desktop icon pointing to ots bundles Qt Creator instance. The Qt bundle installer asks you for an install location and simply unpacks the entire installation under there. Apart from the desktop icons nothing goes outside that folder. The place to look for the install is where you told the installer to put it.

The Qt X11 Extras installer is not needed to get a basic Qt install working on Linux.

mp33919
17th February 2014, 23:02
It might have been all the problems I have: I use as regular user not the root. Should I un-install it and use root to try again?
I installed the Qt to /home/user_me/Qt5.2.0
PS: the /user_me is my personal directory when I use it as a regular user.

Added after 16 minutes:

Yes, you are correct. I have Qt3.X in my system and I am still using it. I use it to migrate my Qt3.X programs from my old RedHat 5 32 bits machine to this Centos 6 64 bits. I wanted to write new projects with this Qt5.2.0. if I could get the Qt5.2.0 works. At the mean time, I hope that I could use Qt5.2.0 in my Windows 7 machine(s) so that I could have all my machines used the same IDE.
So, I couldn't get rid of Qt3.X.

wysota
17th February 2014, 23:19
It might have been all the problems I have: I use as regular user not the root. Should I un-install it and use root to try again?
No, installing as regular user is ok.


I installed the Qt to /home/user_me/Qt5.2.0
Then look into /home/user_me/Qt5.2.0/Tools/QtCreator/bin. You should see QtCreator there.


So, I couldn't get rid of Qt3.X.
Qt3 can live alongside Qt5 just fine.

mp33919
18th February 2014, 15:26
Yes, I did use prompt:
/home/user_me/Qt5.2.0/Tools/QtCreator/bin]$ ./qtcreator

I got the errors as below:

Failed to load core: Can not load library /home/user_me/Qt5.2.0/Tools/QtCreator/lib/qtcreator/plugins/QtProject/libCore.so : Can not load library /home/user_me/Qt5.2.0/Tools/QtCreator/lib/qtcreator/plugins/QtProject/libCore.so : (usr/lib64/libstdc++.so 6: Version 'GLIBCXX_3.4.15' not found (required by /home/user_me/Qt5.2.0/Tools/QtCreator/lib/qtcreator/plugins/QtProject/../.././libQt5CLucene.so.5))

I have checked both files libCore.so and libstdc++.so.6 are all in the directory as the error message specified.
They are:
-rwxr-xr-x. 1 me me Dec 10 11:49 libCore.so
lrwxrwxrwx. 1 root root 19 Oct 2 2012 libstdc++.so.6 -> libstdc++.so.6.0.13

"me" is my user name

So the QtCreator can not be launched.

wysota
18th February 2014, 15:35
Try with qtcreator.sh

It seems you have an old system that doesn't have libstdc++6 installed.

mp33919
18th February 2014, 17:06
Same error messages!

ChrisW67
19th February 2014, 00:09
The error message plainly explains that the library it is finding is not " Version 'GLIBCXX_3.4.15' " and therefore too old to be used. This is probably because your GCC is older than 4.6, probably GCC 4.4 or older. You are five release behind the current CentOS, so this should not be a surprise (although the current version still ships GCC 4.4.7)

Update libstdc++. I do not know if it is a standalone package or part of GCC.

There is even a Qt Project wiki page on dealing with the dated nature of CentOS by installing a private GCC version:
http://qt-project.org/wiki/How-to-Install-Qt-5-and-Qwt-on-CentOS-6

mp33919
19th February 2014, 16:36
Thanks,

Now, I need to go to IT people to see how they could update my Centos.

ChrisW67
19th February 2014, 20:59
It can be done without IT by creating an entirely private instance of GCC 4.8.x, installed in say /home/you/gcc, and using the runtime environment (PATH and LD_LIBRARYPATH) to ensure the local gcc and libstdc++ is found first.

mp33919
28th February 2014, 17:50
I am back! The Qt 5.2.0 is working on my both Windows 7 stand alone machine and virtual machine. I will work on Centos later.

Back to my original programming questions:
1. I use QDialog to create a form. I drag Widgets onto the form. I wanted just use form's tools (I believed it is Qt Designer's tools) to configure every Widgets on the form. I found that change the QPushButton's icon did not work as I thought. The push button apperance changed during the design time but not in run time. Is there anything I can fix it?
2. I am working on plotting the data. I found an example "Simple Realtime Chart". According to the "Source Code Listing", this program needs something about QChartViewer. I can not find it in my Qt 5.2.0 directory any where. According to web document: "(chartDirector 5.1 (c++ edition)) QChartViewer is released in source code format in the QT sample programs that comes with ChartDirector. The source code serves as an example on how one can display charts and handle mouse interactions in general GUI framework." Do I need to install Qt5.1 in order to get this QChartViewer? If I do so, will the Qt5.1 "mess up" with Qt5.2.0?

Thanks

ChrisW67
28th February 2014, 22:05
1. If you selected an icon from the hard disk then the path in the UI file may be relative to the source folder. When you run the program the current working directory will be different and the icon not in the same relative location. This is what the Qt resource system is designed to address.

2. No, you need to install the ChartDirector software to get their example code. This is not part of Qt.

mp33919
4th March 2014, 17:29
ChrisW67,

Thanks a lot for your reply.

1. I did use Qt resource system. I follow the directions to add the png (run.png) into sub-directory /image under my source code directory (for example plot). I could use Qt "Open file" to open /plot/image/run.png. And from windows explorer, the png file is physically in /plot/image directory.

2. Addtion Questions about the GUI designer: dese "&" working for menu, pushbutton, and other widgets. For example: &File did not give me the "F" underlined.

3. Now I need to ChartDirector to download the examples. Will I get all the ChartDirector libraries after I download the example? Or maybe I should have asked: is ChartDirector free?

4. I also need to go back to work on installation gcc 4.8.2. As you may tell that I have never done any Linux/Centos installion before. To install Qt5.2.0 was my first attemp to do so. So, please allow me to ask this question: what is "runtime environment (PATH and LD_LIBRARYPATH) ?" When I first installed Qt5.2.0 using "run" version, it did not work (as I described previously in this thread), I un-installed it and try to use qtx11extras-opensource-src-5.2.0.tar version, and to the some points I did type PATH, then my "regular" PATH has changed or something. And later, my system crashed. After the system rebooted, I un-install the ".tar" version and re-install the ".run" version. This time, I just want to be sure that I do the PATH correctly: How can I do it? for my gcc?

Thanks for your time, I really appreciated.

Thanks again.

sulliwk06
4th March 2014, 17:50
To answer number 2, I believe the shortcut underline is a system setting. For example on windows it won't show the letter underline until I press alt.

mp33919
4th March 2014, 22:38
It can be done without IT by creating an entirely private instance of GCC 4.8.x, installed in say /home/you/gcc, and using the runtime environment (PATH and LD_LIBRARYPATH) to ensure the local gcc and libstdc++ is found first.

I downloaded gcc-4.8.2.tar.bz2. Should I go ahead to "install" it or I need have something else like Pre-requesties MPC, MPFR, GMP ...

ChrisW67
4th March 2014, 23:10
1. I did use Qt resource system. I follow the directions to add the png (run.png) into sub-directory /image under my source code directory (for example plot). I could use Qt "Open file" to open /plot/image/run.png. And from windows explorer, the png file is physically in /plot/image directory.

So your project has a resource file called "something.qrc" with entries like


<RCC>
<qresource prefix="/">
<file>plot/image/run.png</file>
</qresource>
</RCC>

And you have opened and used a file called ":/plot/image.run.png" (Note the colon ":" in the path) from the resources not the local file system.


Or maybe I should have asked: is ChartDirector free?
Maybe you should ask the creators of ChartDirector whether they want to be paid.


I downloaded gcc-4.8.2.tar.bz2. Should I go ahead to "install" it or I need have something else like Pre-requesties
You need to build it after configuring it with


./configure --prefix ${HOME}/gcc --enable-languages=c,c++

or similar. See http://gcc.gnu.org/install/ for prerequisites. It will not configure if they are missing.

mp33919
5th March 2014, 17:58
[QUOTE=ChrisW67;259988]So your project has a resource file called "something.qrc" with entries like


<RCC>
<qresource prefix="/">
<file>plot/image/run.png</file>
</qresource>
</RCC>

And you have opened and used a file called ":/plot/image.run.png" (Note the colon ":" in the path) from the resources not the local file system.

OK, I got it. The problem is not in the resource file. The problem is in the .ui file. From your tips, I went to look at the .ui file. I found the .png file has the </normaloff> header. Although I did not put in it when I specified the "icon" (I did not specify anything under sub-icon), ui properties put .png under "normal off" sub-icon. I delete .png from "normal off" up and put it in "normal on" sub-icon. It wokrs now. Thanks!!!

mp33919
7th July 2014, 18:53
It can be done without IT by creating an entirely private instance of GCC 4.8.x, installed in say /home/you/gcc, and using the runtime environment (PATH and LD_LIBRARYPATH) to ensure the local gcc and libstdc++ is found first.

I finally installed (I think) gcc 4.8.x into my private directory:/home/me/mygcc. But when I check my gcc version: "yum list install gcc", or "gcc --version", I still got "gcc.x86_64 4.4.7-4.el6". I tried to set LD_RUN_PATH=/home/me/mygcc/lib64, still the Centos6.5 can not find my gcc 4.8.2's path. What should I do next?

anda_skoa
7th July 2014, 19:39
When you run "gcc --version" have you set $PATH so that it points to your gcc installation's bin directory?

Try "which gcc" to check which gcc executable is found by the shell.

Cheers,
_

mp33919
7th July 2014, 21:10
When you run "gcc --version" have you set $PATH so that it points to your gcc installation's bin directory?

Try "which gcc" to check which gcc executable is found by the shell.

Cheers,
_

I did: LD_LIBRARY_PATH=/home/me/mygcc/4.8.2/lib64
still the "which gcc" came from /usr/bin/gcc

after I did PATH=/home/me/mygcc/4.8.2/bin
$ which gcc
~/mygcc/4.8.2/bin/gcc
but, I can no longer use the any "regular" Linux command such as:
$ ls
bash: ls: command not found

I think that I screwed up the system, didn't I?

stampede
7th July 2014, 21:22
PATH=/home/me/mygcc/4.8.2/bin
should be more like

PATH=$PATH:/home/me/mygcc/4.8.2/bin

I think that I screwed up the system, didn't I?
If it boots then it is ok :) where did you put this unfortunate PATH setting ?

anda_skoa
7th July 2014, 22:43
More like


PATH=home/me/mygcc/4.8.2/bin:$PATH

i.e. prepending the local path to the search list, so gcc from that location is found before the one from the system location

Cheers,
_

stampede
7th July 2014, 23:18
i.e. prepending the local path to the search list, so gcc from that location is found before the one from the system location
Exactly :) Few more years as windows developer and I'm gonna have to start with "Linux For Dummies" all over again :P

mp33919
8th July 2014, 16:23
Thanks both of you, anda_akoa and stampede. Since I used sh command line to put this unfortunate PATH, after re-boot the system, everything backs to "normal".
The whole purpose to install gcc4.8.2 is because I want to install Qt5.2.0 into my Centos6.5. After all these months, I finally can put the Qt5.2.1 into my machine. It was quite "ugly" what I did. I ended with copy libstdc++.so.6.0.18 into /usr/lib64 directory, and made a new link libstdc++.so.6 to libstdc++.so.6.0.18. After that, Qt5.2.1 did install "OK". Now, I do have a "new - small" problem, the Qt5.2.1 still goes to /usr/include to find the header files, but the Qt5.2.1's header files were installed in /usr/include/qt5. Will this set PATH re-direct the Qt5.2.1 to /usr/include/qt5? Or where else I can set the PATH in Qt5.2.1? And what commands should I use? PATH=/usr/include/qt5:$PATH?