Running Qt application on device
Hi all,
I am writing a new Qt application which saves and reads files on application directory path, when I ran the app on simulator everything was ok but once I ran it on device (N8 and Maemo) it didn't work correctly...
and the other issue I faced is opacity when I change opacity of my widget it works on simulator and the widget becomes transparent but on device it does not...how can I ensure having the app working exactly as simulator??!!!...any help plzz....:confused:
Re: Running Qt application on device
Hi Maysoon88,
On Maemo:
- executables and data are in separate directories. So you have to read your data from /usr/share/apps/ or /opt/...
- Widget opacity is supported only for homescreen widgets.
Re: Running Qt application on device
[QUOTE=gnuton;796627]Hi Maysoon88,
On Maemo:
- executables and data are in separate directories. So you have to read your data from /usr/share/apps/ or /opt/...
- Widget opacity is supported only for homescreen widgets.[/QUOTE]
Hi gnuton
I do read and write on this path: ("qApp->applicationDirectoryPath()+QDir::separator()") isn't that working on device ?? should I determine the exact path /user/share/apps/ !!!
Re: Running Qt application on device
Hi,
Correct you should not use QCoreApplication::applicationDirPath() at all.
Maemo/MeeGo/Linux applications have:
- read only data, installed by the package during the installation, in /usr/share/apps/our_application or /opt/usr/share/apps/your_application
- read/write data in home/.your_application (the dot makes the directory hidden)
Note that if you have to read/save settings then you can use QSettings that is more convenient since you don't have to deal with paths (which are system specific!).
Re: Running Qt application on device
Its a little bit confusing :( .....I will try I hope it will work...
thanks so much...:)
Re: Running Qt application on device
hi gnuton again :)
Actually I tried something like this:
QDir *dir=new QDir("home/myAppName/dir");
QFile *file=new QFile("home/myAppName/file.txt");
but it didn't work!!! with qApp it was alittle bit better do you have any idea wher is my mistake??!!! knowing I need the data for read write not read only....
I did another thing just like in this link: [URL="http://wiki.forum.nokia.com/index.php/Get_private_path_in_Qt"]http://wiki.forum.nokia.com/index.php/Get_private_path_in_Qt[/URL]
didnt work too :(
I guess with qApp::applicationDirPath() it does read but not write or something like that!!!!
Re: Running Qt application on device
I don't know about Maemo, but in Symbian, when you use a relative path, it is by default relative to the home directory of the app.
Re: Running Qt application on device
Hi all,,
Am very sorry It is working now :) it was my fault from the beginning I forgot to make the directory am working in that was the main mistake qApp is working well on device it worked in simulator coz I made the directory manually, I just missed a very simple thing which is QDir().mkdir(qApp.applicationDirPath()+QDir::separator()+"myDirectory");
sorry again...:(