Active Topics

 


Reply
Thread Tools
Venemo's Avatar
Posts: 1,296 | Thanked: 1,773 times | Joined on Aug 2009 @ Budapest, Hungary
#1
Hi Everyone,

I set up MADDE and followed all the steps about its integration with Qt Creator on Windows.
I now have a very nice environment and I'm able to develop basic applications with it. (It uses Qt 4.5.3.)

I am also able to run these applications on my N900 with the single press of the "Run" button.

I'd like to create a homescreen widget, and I downloaded the example from the Qt blog. It consists of a class named QMaemo5HomescreenAdaptor, and a widget derived from QLabel. The code is very simple.

However, I noticed that it has a very strange behaviour. After I install the sample application, it doesn't appear in the widget list, you have to start the application from the menu and then the widget appears.
I thought this would be a good method to add a widget progmatically from a Qt application.

I added the QMaemo5HomescreenAdaptor class taken from the example to my Qt Creator project, and created a widget almost identical to the TestWidget.
Then, I duplicated the code which is responsible for putting the widget on the desktop, put it in a menu item's click slot, but the problem is, that it isn't working.

Then, I removed every other code from main.cpp and put the widget creation there, in the hope that I can replicate the behavior of the original sample. However, instead of creating a widget, it displayed the widget in a separate window.

I'm no Qt expert, so if there is anyone who knows how to do it, I appreciate any advice.

I also tried to run the original sample, but it didn't compile.

Last edited by Venemo; 2010-06-14 at 02:14.
 
mikec's Avatar
Posts: 1,366 | Thanked: 1,185 times | Joined on Jan 2006
#2
Did you install the homescreen loader?

"Desktop widgets require a two step approach. First, a special loader is required in order to load Qt based home screen widgets. This loader only has to be installed once, and usually, the Debian packaging system should be used to make sure it is installed.

In your home screen widget's Debian package, make sure you depend on the package qt4-homescreen-loader. An example "Depends" line could look like:

Depends: libqt4-core (>= 4.6.1), libqt4-gui (>= 4.6.1), qt4-homescreen-loader"
__________________
N900_Email_Options Wiki Page

Last edited by mikec; 2010-04-07 at 18:06.
 

The Following 2 Users Say Thank You to mikec For This Useful Post:
Venemo's Avatar
Posts: 1,296 | Thanked: 1,773 times | Joined on Aug 2009 @ Budapest, Hungary
#3
Yes, it is installed.
It doesn't work.
 
Venemo's Avatar
Posts: 1,296 | Thanked: 1,773 times | Joined on Aug 2009 @ Budapest, Hungary
#4
 
Venemo's Avatar
Posts: 1,296 | Thanked: 1,773 times | Joined on Aug 2009 @ Budapest, Hungary
#5
Bump.
I don't believe that noone cares about this issue...
 
Posts: 15 | Thanked: 8 times | Joined on May 2010 @ Finland
#6
You need to use the libqt4-maemo5 packages from extras-devel to run your code on the device until the firmware update is out. The homescreen examples don't work with the QT version that is in extras(4.5).

Follow these steps:
1. add extras-devel repository in scratchbox:
Code:
echo "deb http://repository.maemo.org/extras-devel fremantle free non-free" >/etc/apt/sources.list
2. Install QT4.6 libraries from extras-devel:
Code:
fakeroot apt-get install libqt4-maemo5-dev qt4-maemo5 homescreen-loader
3. Use the correct qmake binary with your project:
Code:
/opt/qt4-maemo5/bin/qmake
This is not necessary once the next firmware update is out, has the correct QT version by default. I don't really know how to use those with Qt Creator, I'm running compilation in the console.

HTH.

Last edited by jkyro; 2010-05-10 at 20:55.
 

The Following User Says Thank You to jkyro For This Useful Post:
mikec's Avatar
Posts: 1,366 | Thanked: 1,185 times | Joined on Jan 2006
#7
Any news for a lib version of loader so the Python guys can build a binding?
__________________
N900_Email_Options Wiki Page
 
Posts: 15 | Thanked: 8 times | Joined on May 2010 @ Finland
#8
I can't see why the example couldn't be built as a lib, just make a qmake project file for it. I would wait until PR1.2 is out though.
 

The Following User Says Thank You to jkyro For This Useful Post:
Venemo's Avatar
Posts: 1,296 | Thanked: 1,773 times | Joined on Aug 2009 @ Budapest, Hungary
#9
Originally Posted by jkyro View Post
3. Use the correct qmake binary with your project:
Code:
/opt/qt4-maemo5/bin/qmake
Qt creator says:
"Qt version is not installed, please run make install"

and I can't find any resources on the net to see how I could get it to work.
 
Posts: 15 | Thanked: 8 times | Joined on May 2010 @ Finland
#10
Originally Posted by Venemo View Post
Qt creator says:
"Qt version is not installed, please run make install"

and I can't find any resources on the net to see how I could get it to work.
Ok, this is the problem. You need to run the command in a
Scratchbox session, not from the QT Creator. I didn't realize this since I'm always using the terminal to do building myself, somehow I don't trust the IDEs to do thei right things there You can call me old fashioned.

There was a tutorial on how to make QT Creator support building inside scratchbox but I cannot find it now. Anyway the problem will go away soon with PR1.2.
 
Reply


 
Forum Jump


All times are GMT. The time now is 14:19.