maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Development (https://talk.maemo.org/forumdisplay.php?f=13)
-   -   How to compile Qt location example ? (https://talk.maemo.org/showthread.php?t=42679)

tmsha 2010-01-29 17:29

How to compile Qt location example ?
 
How can I compile the following example?
running these commands does not do it:
qmake -project
qmake
make

http://wiki.forum.nokia.com/index.ph...cation_Example

TNiga 2010-01-29 19:04

Re: How to compile Qt location example ?
 
I didn't check the example, but I suppose there is a .pro file already so you don't need to run "qmake -project". Try running:
qmake <filename>.pro
make

Replace <filename> with the actual name of the .pro file.

sjaensch 2010-01-29 22:01

Re: How to compile Qt location example ?
 
Unfortunately, there isn't. The example consists of a single C file containing GTK+ code. :( I would also really like to know how to get the location info in a Qt application.

kimitake 2010-02-01 06:22

Re: How to compile Qt location example ?
 
tmsha,
you can build the sample as follow.
gcc main.c `pkg-config --cflags --libs gtk+-2.0 hildon-1 liblocation`

kimitake 2010-02-01 06:24

Re: How to compile Qt location example ?
 
sjaensch,
How about this?
http://qt.gitorious.org/qt-mobility/location

danielwilms 2010-02-01 08:27

Re: How to compile Qt location example ?
 
Hi,

Quote:

Originally Posted by sjaensch (Post 501708)
Unfortunately, there isn't. The example consists of a single C file containing GTK+ code. :( I would also really like to know how to get the location info in a Qt application.

To understand how the liblocation works, please have a look at the developer guide and the liblocation API docs. Further the example is explained in the guide, which is linked on the wiki-page of the example as well. But please be aware, that the general information, you find there is a bit outdated. But the discription of the location example is quite ok.

And I've requested a better documentation on the example's page itself, and It will be improved soon.

Daniel

sjaensch 2010-02-01 09:07

Re: How to compile Qt location example ?
 
Quote:

Originally Posted by danielwilms (Post 504731)
To understand how the liblocation works, please have a look at the developer guide and the liblocation API docs. Further the example is explained in the guide, which is linked on the wiki-page of the example as well. But please be aware, that the general information, you find there is a bit outdated. But the discription of the location example is quite ok.

I did all of that already and I'm happy to report that I successfully added liblocation support to my Qt application. Still, I find the example lacking, especially considering that it describes itself as a Qt example when clearly it has nothing to do with it.

I have no experience with glib/GTK+ coding. Here are some pointers as to what could be improved:
  • Use Qt for the UI (obviously).
  • Show how to integrate the glib event loop into the Qt event loop. My use case: try to get a GPS fix, but show a dialog that allows the user to abort the operation.
  • How do I need to modify .pro files to make my project compile with liblocation?

As I said, I was able to solve all of these problems. But it also meant that I spent a weekend implementing a feature that could have taken just a few hours at most.

danielwilms 2010-02-01 11:36

Re: How to compile Qt location example ?
 
Quote:

Originally Posted by sjaensch (Post 504769)
  • Use Qt for the UI (obviously).
  • Show how to integrate the glib event loop into the Qt event loop. My use case: try to get a GPS fix, but show a dialog that allows the user to abort the operation.
  • How do I need to modify .pro files to make my project compile with liblocation?

As I said, I was able to solve all of these problems. But it also meant that I spent a weekend implementing a feature that could have taken just a few hours at most.

Thanks for the feedback, I will bring them up! Sorry if parts of the documentation weren't clear enough. We will try to improve that.

Daniel

brink 2010-02-23 22:45

Re: How to compile Qt location example ?
 
Quote:

Originally Posted by sjaensch (Post 504769)
I did all of that already and I'm happy to report that I successfully added liblocation support to my Qt application. Still, I find the example lacking, especially considering that it describes itself as a Qt example when clearly it has nothing to do with it.

I have no experience with glib/GTK+ coding. Here are some pointers as to what could be improved:
  • Use Qt for the UI (obviously).
  • Show how to integrate the glib event loop into the Qt event loop. My use case: try to get a GPS fix, but show a dialog that allows the user to abort the operation.
  • How do I need to modify .pro files to make my project compile with liblocation?

As I said, I was able to solve all of these problems. But it also meant that I spent a weekend implementing a feature that could have taken just a few hours at most.

Sounds good. Can you give some pointers on how to do it? Specifially how to integrate the glib event loop with Qt?

I just need to get some gps coordinates from time to time.

brink 2010-02-23 23:29

Re: How to compile Qt location example ?
 
Well, I figured it out also. I guess there was no documentation because it was so simple.

Liblocation (and any glib libs, as far as I understood) will run fine inside the Qt event loop. You basically just use the library as you would in a Gtk application.


All times are GMT. The time now is 16:56.

vBulletin® Version 3.8.8