Jump to ID:
Qt

Project Home

Discussions

Wiki

Project Info
Forum Topic - Simple Qt UI example: Page 1 of 4 (32 Items)
   
 
 
Simple Qt UI example  
Attached is a simple UI using the Qt "Declarative" model.  Declarative Qt programs utilize a paradigm similar to web 
pages.

The tutorial includes complete instructions for building and running the the example on QNX hosted on x86.

Dennis
Attachment: Compressed file qtEasy.zip 1.59 MB
Re: Simple Qt UI example  
PDF version of the document
Attachment: PDF QtEasy.pdf 284.36 KB
Re: Simple Qt UI example  
Hello Dennis!
Great example, thank You!
These days, I am trying to include QT to QNX. 
Following the instruction sheet coming with Your example, I installed  qt_qnx_host_win32_x86.tar.gz and qt_qnx_targets.
tar.gz on my windows 7-machine in the qnx650-directory (p.6, Steps 1-3). While the code example works in the QT IDE, I 
always get the following error message when I try to compile the code in the qnx650 directory (p.7, Step 4). 

"make: *** No rule to make target `/usr/qnx650/target/qnx6/usr/share/qt4/mkspecs/
unsupported/qws/qnx-i386-g++/qmake.conf', needed by `Makefile'.  Stop."

The advice for the makefile given in the readme-file coming with qt_qnx_2011-02-24b.zip (s. Your post from 3/3/11 in 
this forum) does not seem to work either:

"In file included from ../easyData.cpp:1:
../easyData.h:11:36: error: QDeclarativeListProperty: No such file or directory
make[2]: *** [easyData.o] Error 1
make[2]: Leaving directory `C:/QNX650/target/qnx6/x86/usr/lib/qt4/examples/cEasy
/nto-x86-o'
make[1]: *** [all] Error 2
make[1]: Leaving directory `C:/QNX650/target/qnx6/x86/usr/lib/qt4/examples/cEasy
/nto-x86-o'
make: *** [all] Error 2".

May I ask for Your help?
Re: Simple Qt UI example  
Simon-

If I read your post correctly, the first error...

"make: *** No rule to make target `/usr/qnx650/target/qnx6/usr/share/qt4/mkspecs/
unsupported/qws/qnx-i386-g++/qmake.conf'

...was fixed by configuring according to the  readme-file coming with qt_qnx_2011-02-24b.zip ?

(You do need to configure the qt_qnx package by following its instructions.)

This changed the behavior to the second error?

"In file included from ../easyData.cpp:1:
../easyData.h:11:36: error: QDeclarativeListProperty: No such file or directory

Perhaps cEasy/Makefile was overwritten?  Note the one in the cEasy package has two comments at the top with initials "
dek".  You need that version of Makefile to resolve the include file issues for QtDeclarative.

Dennis


Re: Simple Qt UI example  
Hello Dennis, 
thank You for the incredibly fast answer!
The replacement of Your cEasy/Makefile by the Makefile in the readme.txt brought me to the second error message. Going 
further, I complemented the automatically generated makefile in the subdirectory \cEasy\nto-x86-o by hand with Your two 
comments on QtDeclarative. Another call of make then yields the error message   

"ntox86-g++ -Wl,-O1 -o cEasy easyData.o main.o mainwidget.o moc_easyData.o moc_ma
inwidget.o    -LC:/QNX650/target/qnx6/x86/usr/lib -lQtGui -lQtCore -lQtDeclarati
ve
C:/QNX650/target/qnx6/x86/usr/lib/libQtGui.so: file not recognized: File truncat
ed
collect2: ld returned 1 exit status
make[2]: *** [cEasy] Error 1
make[2]: Leaving directory `C:/QNX650/target/qnx6/x86/usr/lib/qt4/examples/cEasy
/nto-x86-o'
make[1]: *** [all] Error 2"

So it seems to be a problem with linking to the libraries, doesn't it?
Probably, the empty links libQtCore.so.4 etc. are not properly recognized by the windows system? How can I directly 
connect the relevant libraries libQtCore.so.4.7.1 etc. ? 
Thank You for any effort!
sk
Re: Simple Qt UI example  
Honestly, I did not understand how to implement p.6, step 4, since I did not find the profile-file in windows nor in the
 qnx650-directory.
Do well!
 sk
Re: Simple Qt UI example  
It finally registered that you are trying to build on Windows!  The pdf doc assumes "self-hosted".  But it sounds like 
you got pretty far.

>>>Probably, the empty links libQtCore.so.4 etc. are not properly recognized by the windows system?

You are correct - depending on which windows "tar" program you use, symbolic links are not always correct.  If you have 
zero-len *.so libraries, they are supposed to be symbolic links to the "latest" library.  So the remedy on Windows is to
 copy the CONTENTS of the latest library into the corresponding zero-len .so name. 

>>>I did not understand how to implement p.6, step 4, since I did not find the profile-file in windows nor in the qnx650
-directory.

You could try putting them in the system environment - control panel/System - but I think you will just keep running 
into more problems.  You really need to install the 6.5 development CD onto a PC or into vmware!

Dennis   

Re: Simple Qt UI example  
Hello Dennis,
since I was not able to copy the contents (there is no windows-program to view lib-file properly), I tried to simply 
rename the libraries.version with the label of their corresponding link-library, f.ex. libQtDeclarative.so.4.7.1 to 
libQtDeclarative.so.
When compiling, it produced several "undefined references". It would have been a truely elegant solution, but I finally 
gave up and worked around with compiling in a virtual QNX-machine according to Your instruction sheet. There it worked 
out perfectly. Now, I am going to try out different QT-samples.
Thanks a lot for Your help!
Do well!
 sk 
Re: Simple Qt UI example  
Hi,

I tried the example also to get it running on an IGEPv2 (ARM). I modified the makefile and created a dos application to 
work around the library issue. This post contains the dos script. The next one will contain a modified Makefile to make 
it build on a Win32 host.

Freddy
Attachment: Text _fix_libQt_libs.cmd 2.29 KB
Re: Simple Qt UI example  
And here is the modified makefile. I noticed a few things:

Sometimes, there is a reference to QNX650/target/armle/
There is also a reference to ***arm***
There are references to **x86**
And there are references to **i386**

I had to puzzle for a while to get the makefile as given by the attachment. The QT application now builds nicely on 
Windows.

I hope others can use it also.

Freddy
Attachment: Text Makefile 9.97 KB