Rotate Screen, Font Too Small

nickjet
Hi,

I am running a Qt4 application on a mini2440 3.5". I successfully rotated
the screen by configuring the Qt libraries with the -qt-gfx-transformed
driver and putting these libraries on the mini. Then when I run my
application using:

./myapp -qws -display transformed:rot270

the screen of my application is turned 270 degrees. All of the buttons and
list widgets remained exactly how they were without the transformed driver
being used, but all of the text on these buttons and on the widgets are
very small. I've tried increasing the size of the text in qt creator but
this still does not work. How can I make the text the exact same size that
it was in portrait orientation?

bluscape
Have a look at this:

http://www.friendlyarm.net/forum/topic/2921

You also need to define your screen in Qt creator.

I'm busy with a compilation at the moment so I cant give you the steps for
defining your screen in Qt creator. Once the compilation is completed I
will give you the steps.

bluscape
Ok, what I'm about to tell you is only what I found that works and there
might be better ways to do it.

Firstly you must design your windows such that they fit your display
resolution. So if you have a 320x240 display you set set your window size
to 320x240 in QT creator.

Secondly, to allow Qt to determine the font ratio, Points/Display size, you
need to export the size of the actual viewing area. So, switch on the
display and measure the active area of the display with a ruler or get the
measurements from the datasheet. My 3.5" 320x240 display has an active area
of 69mm x 53mm. Now somewhere in an initialized script such as /etc/profile
or /etc/profile.environment, etc in your target rootfs. add the following
export:

export QWS_DISPLAY=LinuxFB:mmWidth=69:mmHeight=53

This will ensure that your fonts are the same at run time as at design
time.

This is usuall with your tslib exports. 

Let me know if it works for you.

bluscape
Oh, and I almost forgot. You need to set the display DPI in Qt creator too.
This has almost the same effect as setting the display size on the target.
The DPI is calculated as follows:

DPI Y = Y Resolution / (Active Area / 25.4)
DPI X = X Resolution / (Active Area / 25.4)

In my case:

DPI Y = 320 / (69 / 25.4) = 117.80 ~ 118 
DPI X = 240 / (53 / 25.4) = 115.02 ~ 115

therfore 

DPI: 118x115

Now in Qt creator close all projects and go to
Tools->Options->Designer->Embedded Design
and configure a profile with your display settings.
Save the profile and apply the profile.

Open your project and you will see the magic.

nickjet
Bluscape,

Thank you very much for helping me out. I followed the steps you provided
but for some reason when I export
QWS_DISPLAY=LinuxFB:mmWidth=69:mmHeight=53, the font remains much too
small. The way I'm running my application is by running qt4 on startup in
the /etc/init.d/rcS instead of Qtopia, then under /bin/qt4 I am running my
application with the following command: 

./myApp -qws -display transformed rot:270

Within /bin/qt4, I have included the above export so that it occurs when I
start up the mini2440. Are there any other steps that may put me in the
right direction?

bluscape
mmmmh, I see what you mean. My solution solves the problem for a
non-rotated display but when you rotate the display the problem returns.
It seems as if the rotation procedure initializes Qt to the default
settings.

Have a look at this link, there might be some useful information.

http://pepper.troll.no/s60prereleases/doc/qt-embedded-displaymanagement....

I will let you know when I find something else.

Laurent
did you tried this : 

export QWS_DISPLAY=Transformed:Rot90:mmWidth=85:mmHeight=145
./myapp -qws


(adapt to your need)

hth,

Laurent

nickjet
Laurent! You did it, thank you very much. 
For some reason putting:
export QWS_DISPLAY=Transformed:Rot90:mmWidth=85:mmHeight=145
on the same line, the text is formatted correctly.

Thank you both for your help!

bluscape
Cool stuff!

Gustavo Belisario
Nickjet,

I was working with X35 displays, and everything was going well, but then I
received some W35 displays. The geometry of the X35 is 240x320 while the
geometry of W35 is 320x240, so I need to rotate the screen 90 degrees. I've
been trying to do that since Monday, but it simply won't work.
Could you please explain to me how did you manage to do it?

nickjet
Gustavo,

I compiled QT with the transformed gfx driver flagged. I then moved those
compiled libraries over to the mini2440 via ftp. I then added:

export QWS_DISPLAY=Transformed:Rot90:mmWidth=85:mmHeight=145

to my /bin/qt4 file and then ran my application using ./myApp -qws
Perhaps all you need to do to adjust to the 320x240 is switch the
dimensions that I have for width and height? 

Let me know if that works or if you need me to explain in more detail.

*Baby*
I don't understand your problem.

If you have a 3.5" screen, just adjust the size to your screen.

And Normally it need to work.

Gustavo Belisario
Nickjet,

I was using this line to configure QT:

./configure -embedded arm -xplatform qws/linux-arm-g++ -prefix
/usr/local/Old/Qt -qt-mouse-tslib -little-endian -no-webkit -no-qt3support
-no-cups -no-largefile -nomake demos -nomake examples -release
-openssl-linked -I/home/gustavo/openssl/include -L/home/gustavo/openssl
-qt-gfx-transformed

But every time a error message about QMAKE_INCDIR and QMAKE_LIBDIR showed
up. Then I changed the flag -qt-mouse-tslib to -no-mouse-tslib, and I
started receiving a error message about -lssl.
Yesterday I changed -openssl-linked to -no-openssl, and I managed to rotate
the screen, but now the mouse doesn't work.
Did you compile QT using the flag -qt-mouse-tslib?


And *Baby*, the problem is that I need to use an application that was
developed for the other screen.

*Baby*
I configured Qt with :

yes | ./configure -opensource -embedded arm -xplatform qws/linux-arm-g++
-prefix /usr/local/QtArm -no-webkit -qt-gfx-transformed -qt-libtiff
-qt-libmng  -qt-mouse-tslib -qt-mouse-pc -no-mouse-linuxtp

And I'm able to rotate the screen.

Add just that before to run the app (adapt to your path) : 

export PATH=/opt/Qtopia/bin:$PATH
export LD_LIBRARY_PATH=/opt/Qtopia/lib:$LD_LIBRARY_PATH

export QTDIR=/usr/local/QtArm
export QPEDIR=/usr/local/QtArm
export PATH=$QTDIR/bin:$PATH
export LD_LIBRARY_PATH=$QTDIR/lib:/usr/local/lib:$LD_LIBRARY_PATH
export TSLIB_TSDEVICE=/dev/input/event0
export TSLIB_CONFFILE=/usr/local/etc/ts.conf
export TSLIB_PLUGINDIR=/usr/local/lib/ts
export TSLIB_CALIBFILE=/etc/pointercal
export QT_QWS_FONTDIR=/usr/local/QtArm/lib/fonts
export QWS_MOUSE_PROTO="TSLIB:/dev/input/event0 USB:/dev/input/mice"
export QWS_SIZE='320x240'


And add this line to rotate the screen and set the screen size :

export QWS_DISPLAY=Transformed:Rot90:mmWidth=85:mmHeight=145

Gustavo Belisario
I think I get it to work, but I have to go home right now...
I'll be back on Monday.
If what I did doesn't work, I'll try to do what you said.
Thanks!

Gustavo Belisario
I didn't quite understand why, but when I changed "-xplatform
qws/linux-arm-g++" to "-xplatform
home/gustavo/Qt/mkspecs/qws/linux-arm-g++" it worked... 
Now I'm trying to compile Qt using the flag -openssl-linked
(it's not working yet)

nickjet
Gustavo,

I compiled QT with the following:

./configure -embedded arm -xplatform qws/linux-arm-g++ -prefix usr/local/qt
-little-endian -webkit -no-qt3support -no-cups -no-largefile
-optimized-qmake -no-openssl -nomake tools -qt-mouse-tslib
-qt-kbd-linuxinput -qt-gfx-transformed

And everything seemed to work from that, hope that helps.

Saravana Kumar
Hello All,

  I had succeed the Rotation 90 degree , but the color which its rendered
on landscape mode not getting after rotation. Could you please any one
suggest what I have to do in the configuration.

hanta
saravana,
did you get a solution why the colors change after rotation with
qt-gfx-transformed ? I have the same issue

~hanta

smith
./hello -qws 
Then generate error:

Illegal instruction

davef
readelf -a hello

Tag_CPU_arch: v4T at the bottom of the output.

Is this for the mini2440?

aksingh
Hello,

Did anyone got the solution for the problem of colors change after the
rotation?
For my application color which it used to render without rotation is
changing after rotation.
Kindly help.