Project Home
Project Home
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - How to build a UI project in QtCreator like the demo Speedo or cEasy?: Page 1 of 2 (39 Items)
   
How to build a UI project in QtCreator like the demo Speedo or cEasy?  
Hi, Dennis

I have downloaded your demo speedo and cEasy, I ran qmake_qnx and make from windows command line, the binary is built 
successfully, while when I try to build other project in Qt examples, the project is not structured like your demo. I 
copied all the .h .cpp and.pro to a folder and the make failed. I wonder what kind of project can be made by qmake_qnx 
and make? What kind of project should I create in QtCreator? By the way if I want to migrate a web browser from Qt 
platform to QNX, is it possible by your method?

Many thanks.
Re: How to build a UI project in QtCreator like the demo Speedo or cEasy?  
>>> What kind of project should I create in QtCreator?
With the latest Qt Creator, I would start with QtQuick Project/QtQuick Application... "contains both QML and C++ code 
and includes a QtDeclarative view."

This will give you a dummy QML file - where you put your script, and you can add additional C++ files for your "data" 
handler (signals and slots).   It will not have the "exact" structure of cEasy but should be a valid starting point for 
a new app.

>>>r? By the way if I want to migrate a web browser from Qt 
platform to QNX, is it possible by your method?
This would NOT likely be a Qt Quick project.  But QNX qmake should still handle it.  

Sorry, I have not tested qmqke_qnx.bat with anything but Qi Quick examples.

>>>I copied all the .h .cpp and.pro to a folder and the make failed.
Don't copy .pro - it needs to be built for qnx via qmake.
Re: How to build a UI project in QtCreator like the demo Speedo or cEasy?  
Hi,Dennis

Thank you for your quick reply. I have another question.

>>>This will give you a dummy QML file - where you put your script, and >>>you can add additional C++ files for your "
data" 
>>>handler (signals and slots).   It will not have the "exact" structure of >>>cEasy but should be a valid starting 
point for a new app.

I removed the folder "content" from my project folder, this folder contains .qml file and some images. The build is 
still successful, the binary is the same. So, what's the function of qml if I can make the project without it? 
Re: How to build a UI project in QtCreator like the demo Speedo or cEasy?  
The binary is indeed the same.  The QML seems not to be processed in anyway during the build.  In fact, "content" (the 
arbitrary subdir location for this example) does not appear in the  .pro file!

But it IS specified in the C++ sources...
File mainwidget.h:
const QString contentPath = "content/";
File mainwidget.cpp:
QString filename(contentPath + "easyQML.qml");

The content folder is used at RUNTIME since the "MainWidget" is subclassed to a QtDeclarativeView.  This view (also 
referred to as "Qt Quick") starts a runtime object which reads and displays the QML content/easyQML.qml - almost like a 
browser starts index.html.

Since the QML specifies "Connections", a runtime linkage is established with the target instance "easyData" (in C++).  
This linkage allows easyData to "emit" a signal recognized by QML and for QML to call a "slot" in easyData.

Note, if no "Connection" is specified, the QML willl still load and function - i.e. you can make a QML-only Qt program! 
  (However, for device control this is not very useful.)
Re: How to build a UI project in QtCreator like the demo Speedo or cEasy?  
>>>The content folder is used at RUNTIME
Does it mean I have to copy both the binary and content folder to my target when I want to run an application on the 
target? 
Re: How to build a UI project in QtCreator like the demo Speedo or cEasy?  
Absolutely!  That is in the documentation for the examples.  
Re: How to build a UI project in QtCreator like the demo Speedo or cEasy?  
By the way,I opened some makefile in your demo and found "Generated by qmake (2.01a) (Qt 4.8.0)", while in my makefile 
it is "Generated by qmake (2.01a) (Qt 4.7.1)", is there any difference? Do I have to update my qmake tool? 
Re: How to build a UI project in QtCreator like the demo Speedo or cEasy?  
>>> (2.01a) (Qt 4.8.0)
The second version number is the version of the .so liibraries it expects to link to at runtime.
Re: How to build a UI project in QtCreator like the demo Speedo or cEasy?  
Hi,Dennis

I have another problem. When I want to run the UI on my target, I found the following message:
# /fs/speedo -qws
Fatal: Cannot create Qt for Embedded Linux data directory: /qtembedded-0
Abort 

What's the problem?
Re: How to build a UI project in QtCreator like the demo Speedo or cEasy?  
The solution is in this post: 

http://community.qnx.com/sf/discussion/do/listPosts/projects.qt/discussion.general.topc20245

Basically you need to create a qnx4fs ramdisk mounted at /fs/ram and
export TMPDIR=/fs/ram

Re: How to build a UI project in QtCreator like the demo Speedo or cEasy?  
Hi, Dennis,

You mean I have to create another QNX4 file system on my SD card? I have already built a FAT32 system on my SD card by 
the following command in buildfile:
devb-mmcsd-beagle dos exe=all lfn=show sfn=windows &
waitfor /dev/hd0 5 &
mount -t dos /dev/hd0t12 /fs
 
I can't create a qnx4 filesystem by using fdisk since the SD card is already occupied by FAT32 filesystem.

How can I mount a qnx4 filesystem on the SD card? In RAM?
Re: How to build a UI project in QtCreator like the demo Speedo or cEasy?  
#######################################################################
## create /ramdisk for qtembedded-0
#######################################################################
display_msg Starting filesystems...
# create 4M ramdisk /dev/hd1t77 for /qtembedded-0
# must 'dinit -h' and mount
devb-ram ram capacity=8192 &
waitfor /dev/hd1
dinit -hq /dev/hd1t77
mount /dev/hd1t77 /ramdisk

#######################################################################
## set Qt environment vars 
#######################################################################
# Qt must make qtembbedded-0 in $TMPDIR
TMPDIR=/ramdisk
QWS_DISPLAY=qnx
QWS_KEYBOARD=qnx
QWS_MOUSE_PROTO=qnx
Re: How to build a UI project in QtCreator like the demo Speedo or cEasy?  
I have mounted a ramdisk and added TMPDIR variable, unfortunately the following message appeared :
# /tmp/speedo -qws
QWSServerSocket::init: Address family not supported by protocol family
Warning: QWSServerSocket: unable to create socket.
QWSServerPrivate::initServer: server socket not listening: No such process
Fatal: Failed to bind to /fs/ram/qtembedded-0/QtEmbedded-0

Always a lot of difficulties. I wonder if it is possible to embed Qt apps on TI Beagle board OMAP 3530.
Re: How to build a UI project in QtCreator like the demo Speedo or cEasy?  
Sounds like it wants a network to be started.  I guess I never built a runtime without a network present.  Try starting 
io-pkt-v4.  On 3530 beagle, no interface is present, but maybe it will allow Qt to start.
Re: How to build a UI project in QtCreator like the demo Speedo or cEasy?  
Hi,Dennis:
Thank you for your support. The Qt UI runs partly. It shows the following message:
# /fs/speedo/speedo -qws
Debug: QQnxScreen: Attached to Device, number of displays: 1
Debug: QQnxScreen: Attached to Display 0, resolution 720x400, refresh 60 Hz
Critical: QQnxMouseHandler: Unable to open mouse device (No such file or directory)
Critical: QWSQnxKeyboardHandler: Unable to open device (No such file or directory)
Warning: file:content/speedo.qml: File not found 
Debug: program starting

I have already put the content file in the sd card, but it can't recognize it. Do I have to set other environment 
variables? 

Thank you very much.
Re: How to build a UI project in QtCreator like the demo Speedo or cEasy?  
>>> # /fs/speedo/speedo -qws

export QWS_DISPLAY=qnx
export QWS_KEYBOARD=qnx
export QWS_MOUSE_PROTO=qnx
cd /fs/speedo
./speedo -qws

You must have started the following to attach to keyboard or mouse: 
devi-hid -Pr kbd mouse

Re: How to build a UI project in QtCreator like the demo Speedo or cEasy?  
Hi,Dennis

Very happy that the application is running on Beagle board. I have connected mouse and keyboard and it works well. BTW, 
I wonder if touchscreen control is possible for the Qt application?
Re: How to build a UI project in QtCreator like the demo Speedo or cEasy?  
Touchscreen is fully supported for Qt on the i.mx53 qsb w/lcd image posted on this forum.

You must have a driver loaded to use touch.  For example for an hid-compliant usb touchscreen...

io-hid -d usb
devi-hid -Pr touch


For Qt, you would change the QWS_MOUSE_PROTO line to something like...

export QWS_MOUSE_PROTO=qnx:/dev/devi/touch0
Re: How to build a UI project in QtCreator like the demo Speedo or cEasy?  
Hi, Dennis:

Do you have any idea about egalax touch controller? 
I can't make it work properly. I start the device by the following command:

io-hid -d egalax
devi-hid -Pr touch

With the QNX system driver devh-egalax, the X-Y axis are reversed and the touch point is not precise. Configuring calib 
file seems useless, or I don't know how to configure calib file properly.

The driver shipped with the touchscreen is a RS232 serial driver which may not work for a USB touch controller interface
.

On the other hand, the QNX car application runs very well on this touchscreen, I wonder is there any way to let egalax 
touch controller works properly?


 
Re: How to build a UI project in QtCreator like the demo Speedo or cEasy?  
One more question:
I have created a Hello World app in Qt QuickUI and compiled it. When I run it, I found that it requires the directory 
QFontDatabase: /usr/photon/font_repository.
Can I redirect it to other path by setting ENVIRONMENT VAR? Because my photon directory has been shifted to my SD card. 
Including them in image will lead to a very large image.

BTW it shows a message like following:
file:///fs/NewQt/qml/NewQt/main.qml:2:1: module "QtQuick" version 1.1 is not installed 
import QtQuick 1.1 
^
I opened your armv7-runtime-4.8.0 package, and I saw a Trolltech directory which contains a lot of font, how to use them
?
Re: How to build a UI project in QtCreator like the demo Speedo or cEasy?  
This problem has already been solved by myself by creating a symbolic link.
The Qt4.8 .so runs well.
Thank you all the same, Dennis.
Re: How to build a UI project in QtCreator like the demo Speedo or cEasy?  
>>>file:///fs/NewQt/qml/NewQt/main.qml:2:1: module "QtQuick" version 1.1 is not installed 
>>>import QtQuick 1.1

You must change this to "QtQuick 1.0" to resolve the error.
Re: How to build a UI project in QtCreator like the demo Speedo or cEasy?  
>>>my photon directory has been shifted to my SD card. 
Hint - mount the SDcard at "/".  Then directories will appear at normal locations.
Re: How to build a UI project in QtCreator like the demo Speedo or cEasy?  
Hi, Dennis
I am debugging a Qt application and I have met with a problem which might concerns the compile process of my application
.

The error message is like the following:

file:///fs/MMI/qml/Browser/BrowserView.qml:37:1: plugin cannot be loaded for module "QtWebK it": The plugin '/fs/MMI/
QtWebKit/libqmlwebkitplugin.so' uses incompatible Qt library. Expected build key "arm qws/qnx g++-4 no-pkg-config", got 
"armv6 qws/qnx g++-4 full-config"

What kind of change should I make to make the build key as expected?

Thanks
Re: How to build a UI project in QtCreator like the demo Speedo or cEasy?  
The file libqmlwebkitplugin.so is from the qt_qnx_2011-02-24b.zip package. It is a Qt4.7 patch, on the other hand, the 
Qtlib I used in my target is from armv7-runtime-4.8.0.zip Is this the reason that causes Qtlib incompatible issue? I 
have to revert to 4.7lib or would it be possible that I get a 4.8 lib?