Qt application perfomance

sagar
hello,

  i have created qt application for mini2440 board which contains more than
40 tabs pages of single tab widget.In this application i observed that the
application performance degrades (slow down) after some time.
board touch screen takes more time to seance click events.

i am glad to knew what the problem is ? and any of you facing the same
thing?

??

thanks!!!!!!

Luc
Memory leaks ?

Regards
Luc

sagar
ya..i thought memory leaks may be the issue but its really not as i cross
checked all my code for leaks.

i think it is related to the serial port (TTL) buffers as i am
communicating with it but not very much sure can you suggest some regarding
this.

or any other issue??


Regards,

sagar

open-nandra
Please post your c++ code for checking. If not then you're on your own
sorry.

marek

sagar
Here it is 



unsigned char Ackment[4000];
.....
......

memset(Ackment, 0xAA, sizeof(Ackment));

........
........
while(read(fd,&buf1,1)>0)
  {
    if(......some codition...)
    {
      Ackment[i] = 0x11;
      i++;
    }      
  //printf("%d - %u  %02x \n",i,(int)buf1, (int)buf1);
    Ackment[i] = (int)buf1;
    i++;
  }

........
.......

free(Ackment);


the general syntax of code is like this .....where i am reading the serial
port

open-nandra
Or subclass QIODevice class
http://doc.qt.nokia.com/4.7/qiodevice.html#details

sagar
no i am not using any subclass QIODevice class in my code.

as m using that free() is it right there.

or can i free(buf1) in my code

open-nandra
Why you free Ackment array which is statically defined? Fix your code and
as I said use proper classes to get data from serial port.

sagar
ok ..i will make the use of that classes to get serial data and then let
you know what happen ...

ya  one more thing can you plz provide some sample code for that classes.

open-nandra
http://qextserialport.cvs.sourceforge.net/viewvc/qextserialport/qextseri...

is full of examples. Google is your friend ;)

marek

sagar
according to ur suggestion i made changes in code and now the performance
of Qt application is superb .........

really thanks for information and guidance provided by you "marek"


thanks 

regards
 sagar

u2bpavankumar
Hi Sagar,

I have developed an application for Mini2440 using qt creator and cross
compiled using qt4.6.3 and loaded into the kit which is working from
terminal by giving

./myapp -qws

It is running well. But now I want to launch the application from desktop
by creating an icon on clicking it.

Please help me how to run the app via icon from desktop

hdak
you must write qtopia app. not qt app.
http://farm2440.blogspot.com/2010/07/hello-world-with-gui-application-fo...

sagar
hi,
pavankumar

just change the permission of you executable file and copy the file into
the /bin/ directory 

you can easily run the application by clicking the icon.



regards,

sagar

u2bpavankumar
Hi sagar,

Thanks for your reply. 

For launching the application from desktop by creating icon, I have
followed the tutorial http://farm2440.blogspot.com/ by creating
desktop file, icon and executable and placed the respective files in
respective locations. After that I have changed the permissions of my
executable available at /opt/Qtopia/bin. But still I could n't run it.

When I touch my icon on Mini2440 screen nothing happens. No error on the
terminal. If I hold the icon for longer time I can see the properties of
the application. But for other applications by single touch I could run
them. 

Here is my ex1.desktop file

[Desktop Entry]
Version=1.0
Encoding=UTF-8
Name=ex1
Comment=An Example Program
Exec=ex1
Icon=ex1
Type=Application
GenericName[en_US]=


Please let me know the exact procedure for how to run qt applications from
desktop in Mini2440.

sagar
hi,

copy your file to the linux /bin dir not in /opt/Qtopia/bin

use cp /opt/Qtopia/bin/filename /bin/

and then change permission as chmod +x /bin/filename 

try this it will work  

regards,

sagar

u2bpavankumar
Hi Sagar,

"copy your file to the linux /bin dir not in /opt/Qtopia/bin"

I have done the same. But still i could n't launch my application

Please help me out

sagar
hello,

have you copied your ex1.Desktop file to this path
  
           /opt/Qtopia/apps/Applications/ 

if not you need to copy it and also keep it in the /bin/ directory

u2bpavankumar
Hi,

my exe is at /bin/ex1
my ex1.desktop is at /opt/Qtopia/apps/Applications/
my ex1 icon is at /opt/Qtopia/pics

In my .desktop file

[Desktop Entry]
Version=1.0
Encoding=UTF-8
Name=ex1
Comment=An Example Program
Exec=ex1
Icon=ex1
Type=Application
GenericName[en_US]=

if I change Name, the same name is appearing on Desktop on mini2440 and
even Icon also appeared on the Desktop. But I cannot start my app from
screen. Same app I could run from terminal as mentioned previously by
giving

./ex1 -qws

Please let me know what went wrong

sagar
[Desktop Entry]
Version=1.0
Encoding=UTF-8
Name=your_program_name
Comment=An Example Program
Exec=your_program_name_in/opt/Qtopia/bin
Icon=your_icon_name_in/opt/Qtopia/images
Type=Application
GenericName[en_US]=your_program_name

also copy ex1 to all opt/Qtopia/bin and /opt/Qtopia/images

u2bpavankumar
Hi Sagar,

Thanks verymuch. It is working.Now I can run my apps from desktop by
clicking icon

But now I have got another problem.

When my application is started and i touch the screen,application in the
background or desktop icons are activated (slowly one after another for
every tap). Is there a way to prevent the background apps from activating
when running Qt application?

Thanks a lot for your support

sagar
hi,

i am not getting the exact thing that you are facing .....


if dont need other application remove them from the
opt/qtopia/apps/Applications folder and only keep your your one

u2bpavankumar
Immediately after startup, I am running my app from desktop by clicking the
icon. When I click some buttons in GUI of my app, icons on desktop are
clicked and they start running on the top of my GUI screen and for every
touch on the GUI some other icon on the screen is activated and it starts
running. On every touch screen event, background on the desktop is
activated.

Please let me know what could be the problem

sagar
in your Qt designer check the properties of your application mainly the
focus one and background properties

raj
hi pavan . 
i think u r trying to run a application which is developed in QT creator.
and u copied that binary file to "2440". and you are launching the
application. because of qtopia you unable to access touch screen in your
application. qtopia is taking control over that. first disable qtopia in
/etc/init.d/rcS file and and configure touch screen. and even launch your
application from the rcS file only.

Best Regards
 Raj

*Baby*
Hi,

I have excatly the same.

Events from touch screen are sent to the Qt app and to Qtopia, so when we
touch the app, it also touch the desktop of Qtopia.


Please, someone can post the full rcS file to launch the Qt app directly
after that Linux is loaded.

Thanks