Active Topics

 


Reply
Thread Tools
Posts: 53 | Thanked: 51 times | Joined on Feb 2010
#1
Hello all.

After a long time of messing about with QT and scratchbox, I now have a zippy Qt creator (version 1.3.1 based on Qt 4.6.3) and scratchbox installed today (no idea how to check which version it is...).

Now I have loaded the SDK, and I get a nice screen with the blue background and what not... but it is very slow.... but that issue is for another day.

Now I want to create the customary hello world and I am kinda stuck.

I want to:
1. Design in Qt
2. Compile in Qt
3. Test in scratchbox
4. Package and deploy onto my N900

Then I want to try and create a a button which when you press a message pops up saying "Hello World", and then do steps 1 to 4 on it....

I have no idea where to begin. I have tried to see if Qt picked up scrachbox... it didnt and I cant find anything in the docs....

Anyway, once my hello world program is done, I intend to get a Qt book and just work through it all....

But frst I need a hello world!!

Any ideas or a could you point me somewhere?

Thanks.
 
Venemo's Avatar
Posts: 1,296 | Thanked: 1,773 times | Joined on Aug 2009 @ Budapest, Hungary
#2
  • Install the Nokia Qt SDK
  • Follow the steps on the maemo.org wiki about how to integrate it with Qt Creator
  • Follow the steps about how to make it work with your device
 
Posts: 42 | Thanked: 48 times | Joined on Feb 2010
#3
Instead of using scratchbox, you could go down the python Qt route instead. See, for example this thread and links within.

I've been using this to try and build a simple app and it works very nicely. And the beauty of python is that you don't compile it, so editing the code on the device is also an option.
 

The Following 2 Users Say Thank You to amh For This Useful Post:
Posts: 53 | Thanked: 51 times | Joined on Feb 2010
#4
Thanks for the reply, but I would rather go with C/C++.

I am currently writing instructions for getting a whole dev environment setup. So far, I am at scratchbox stage and compiling the hello world to test it.

So far, when I do the qmake -project, qmake and make, I get the following error:

Code:
> make
g++ -c -pipe -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/targets/FREMANTLE_X86/usr/share/qt4/mkspecs/linux-g++ -I. -I/targets/FREMANTLE_X86/usr/include/QtCore -I/targets/FREMANTLE_X86/usr/include/QtGui -I/targets/FREMANTLE_X86/usr/include -I. -I. -o HelloWorld.o HelloWorld.cpp
HelloWorld.cpp:6: error: stray '\342' in program
HelloWorld.cpp:6: error: stray '\200' in program
HelloWorld.cpp:6: error: stray '\234' in program
HelloWorld.cpp:6: error: stray '\342' in program
HelloWorld.cpp:6: error: stray '\200' in program
HelloWorld.cpp:6: error: stray '\235' in program
HelloWorld.cpp: In function 'int main(int, char**)':
HelloWorld.cpp:6: error: 'Hello' was not declared in this scope
make: *** [HelloWorld.o] Error 1
The Hello world is:

Code:
#include <QApplication>
#include <QLabel>
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QLabel *label = new QLabel(“Hello World”);
label->show();
return app.exec();
}
I have already updated the scratchbox and added the libqt4-gui and libqt4-dev.

Any help would be appreciated. Once I have it all setup il post the instructions which will hopefully save people hours/days of just running around in circles!

Thanks.
 
Posts: 726 | Thanked: 345 times | Joined on Apr 2010 @ Sweden
#5
Use ASCII for tokens that are to be parsed.

What editor are you using? It's fooling you. Teach it some manners.

(The problem is the citation marks.)
 

The Following User Says Thank You to Joorin For This Useful Post:
Posts: 53 | Thanked: 51 times | Joined on Feb 2010
#6
Originally Posted by Joorin View Post
Use ASCII for tokens that are to be parsed.

What editor are you using? It's fooling you. Teach it some manners.

(The problem is the citation marks.)
Thanks for the reply.

I just created that in GEdit. I assume you are referring to the save format???

Sorry, im a vb programmer so its not some i need to worry about!
 
Posts: 44 | Thanked: 186 times | Joined on Apr 2010 @ Worthing, West Sussex, England
#7
It looks like you're using the wrong characters for the quotes in this line:
Code:
QLabel *label = new QLabel(“Hello World”);
Change these to ASCII quotes and it should compile.

I'm not sure why gedit would have used the wrong quotes. Did you copy/paste the hello world code from somewhere?
 

The Following User Says Thank You to fieldofcows For This Useful Post:
Posts: 53 | Thanked: 51 times | Joined on Feb 2010
#8
Originally Posted by fieldofcows View Post
It looks like you're using the wrong characters for the quotes in this line:
Code:
QLabel *label = new QLabel(“Hello World”);
Change these to ASCII quotes and it should compile.

I'm not sure why gedit would have used the wrong quotes. Did you copy/paste the hello world code from somewhere?
Great thanks. I will give it a go later when I get home.

Yep, i copied it from the the web.... if this works, then its on to the next phase of getting it to run on the phone rather then scratchbox. The work on packaging it so you get a menu item then finally il have a step by step guide that everyone can follow which will help them setup their development environment without spending hours on the web!

Thanks.
 
Posts: 53 | Thanked: 51 times | Joined on Feb 2010
#9
Fantastic, thank you that worked!
 
Posts: 402 | Thanked: 229 times | Joined on Nov 2009 @ Missouri, USA
#10
Useful Links:
Using a Designer UI File in Your Application
Cross-Compiling Qt for Embedded Linux Applications (I think the Maemo Wiki might be more specific though. This is a bit general)
Packaging a Qt application
__________________
aspidites | blog | aspidites@inbox.com
 

The Following User Says Thank You to aspidites For This Useful Post:
Reply


 
Forum Jump


All times are GMT. The time now is 12:54.