maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Applications (https://talk.maemo.org/forumdisplay.php?f=41)
-   -   ( A tutorial ) Create your own first application for N900 using Qt. (https://talk.maemo.org/showthread.php?t=75725)

FlashInTheNight86 2014-04-03 23:27

Re: ( A tutorial ) Create your own first application for N900 using Qt.
 
I would like to develop a cross-platform application (some not very sophisticated maths with a lot of inputs both dropdown and updown-controlled, i.e. no need for virtual or physical keyboard input except filenames).

So far the project is written in older Delphi and is Windows-only. My targets are Windows, Android and iOS, but it would be great if I could also port this app to Maemo, to show some support. I will definitely rewrite interface from scratch, maybe optimize some math. However, I'm lazy and once it's done I am against rewriting most of the project for each environment. :D

My experience so far is limited to Delphi and ASM for x86. But I'm considering moving on and learning something new, for example, qt with all that nasty c++ syntax :D . I am not a professional coder, it is just a hobby that I sometimes come back to.

So, basically, how hard is it to port a qt project from Maemo to Android, iOS, Windows? (yes, I'd go that way)

Copernicus 2014-04-04 00:27

Re: ( A tutorial ) Create your own first application for N900 using Qt.
 
It might make more sense to create a new thread for this kind of question, as it doesn't seem to directly match what this thread is about. :) In any case,

Quote:

Originally Posted by FlashInTheNight86 (Post 1419814)
My experience so far is limited to Delphi and ASM for x86. But I'm considering moving on and learning something new, for example, qt with all that nasty c++ syntax :D . I am not a professional coder, it is just a hobby that I sometimes come back to.

So, basically, how hard is it to port a qt project from Maemo to Android, iOS, Windows? (yes, I'd go that way)

Ok, as I see it, you've got at least 3 significant hurdles to overcome here. :) First, you'll probably need to familiarize yourself with C and C++; every programming language has its own philosophy, and you'll want to at least be familiar with how one is structured before you dive in. C is a fairly minimalist language, and as such, is not hard to pick up; but you'll also have to learn the C macro preprocessor, which has essentially become part of the language (mostly to overcome some of the limitations of C's minimalism). C++ is an enhancement to C, mostly adding object-oriented features to the language.

Second, you'll need to become familiar with Qt. The majority of Qt is a large collection of libraries, so that isn't a big deal, but the heart of Qt is the Signals & Slots mechanism. It can take a little bit of effort to wrap your head around how that mechanism works, but once you've done that, Qt becomes yours -- pretty much all of Qt is built around Signals & Slots.

Third, you'll have to deal with the idiosyncrasies of each target platform. Qt does its best to smooth over the differences of each GUI, but there are aspects of Maemo that just will not exist in Android or iOS, and vice versa. (Let alone that only Qt 4.x supports Maemo, and only 5.x supports Android and iOS, so there may even be issues porting between versions of Qt.) And of course Windows is a desktop environment, so bringing an app over from a mobile environment is going to have even more issues...

But, as you say:

Quote:

I will definitely rewrite interface from scratch, maybe optimize some math. However, I'm lazy and once it's done I am against rewriting most of the project for each environment. :D
Qt is, at this point, probably the only way to keep from completely rewriting the app's UI for each environment. The widgets you build on Maemo can, more or less, be used as widgets in every other environment. :)

FlashInTheNight86 2014-04-04 19:46

Re: ( A tutorial ) Create your own first application for N900 using Qt.
 
Do I get it right that now I should download and install qt-4.6.4 library, latest qt-creator and either Visual Studio 2008 or MinGW, and after that get Maemo Toolchain via Qt-package manager?

pichlo 2014-04-04 20:25

Re: ( A tutorial ) Create your own first application for N900 using Qt.
 
I use the latest Qt Creator but be warned, it supports features not supported on Maemo so you might get compilation errors at the qmake or make stage. No big deal, just back to Creator and redesign the GUI without those features. Or get an older Creator.

Copernicus 2014-04-04 20:37

Re: ( A tutorial ) Create your own first application for N900 using Qt.
 
Quote:

Originally Posted by FlashInTheNight86 (Post 1419928)
Do I get it right that now I should download and install qt-4.6.4 library, latest qt-creator and either Visual Studio 2008 or MinGW, and after that get Maemo Toolchain via Qt-package manager?

I haven't done a fresh installation of Qt myself in quite some time, but I think it would probably be simpler to just download and install the full Qt 4.8.x SDK. I think the MinGW version of Qt comes with its own copy of MinGW, so that makes things easier; if you want to use visual studio, you'd probably have to install that yourself first.

(Hmm. I've gotta admit, I'm using an old Qt installation that I've continually updated via the maintenance tool; there are bits and pieces of it that have version numbers that match the 4.8 tools, but lots of 4.7 pieces seem to be hanging around too. I'm fairly sure that the 4.8.x SDK will build against the Maemo toolchain, but I can't swear that it will; if worse comes to worse, they've still got the 4.7 SDK available from an archive...)

But yeah, once everything is in place, you can then use the Qt maintenance tool (in package manager mode) to retrieve the Maemo toolchain. :)

EDIT: Pichlo beat me to it. 4.8.x should work fine. :)

yaliang 2014-04-05 01:40

Re: ( A tutorial ) Create your own first application for N900 using Qt.
 
SDK for N900 is not available.anyone have a copy?

Copernicus 2014-04-05 01:49

Re: ( A tutorial ) Create your own first application for N900 using Qt.
 
Quote:

Originally Posted by yaliang (Post 1419948)
SDK for N900 is not available.anyone have a copy?

Which SDK are you looking for? The Qt SDK is available right here (and as noted above, you'll probably want version 4.8):

http://qt-project.org/downloads

yaliang 2014-04-05 02:08

Re: ( A tutorial ) Create your own first application for N900 using Qt.
 
Quote:

Originally Posted by Copernicus (Post 1419949)
Which SDK are you looking for? The Qt SDK is available right here (and as noted above, you'll probably want version 4.8):

http://qt-project.org/downloads

i can hardly express myself.I want a Qt SDK with Maemo project that i can creat apps for Maemo and test it .

Copernicus 2014-04-05 02:34

Re: ( A tutorial ) Create your own first application for N900 using Qt.
 
Quote:

Originally Posted by yaliang (Post 1419951)
i can hardly express myself.I want a Qt SDK with Maemo project that i can creat apps for Maemo and test it .

Ok, then yes, I think "Qt SDK 4.8" is what you want. You can find it from the link above. After you install Qt SDK 4.8, you will need to install the Maemo toolchain. To do this, you will need to run the Qt Maintenance Tool; select "package manager", then in the next screen, you can find "Maemo Toolchain" underneath the "Development Tools" category (which is under the "Qt SDK" category). Check the box next to that, and it will download the tools needed to compile and build Qt apps for Maemo.

Unfortunately, I don't speak a bit of Chinese, and I don't know if there is a Chinese version of the SDK. There does seem to be a Chinese-language Qt forum which might help:

http://qt-project.org/forums/viewforum/39/

pichlo 2014-04-08 23:44

Re: ( A tutorial ) Create your own first application for N900 using Qt.
 
Call me what you want but I am totally confused. All I can see on http://qt-project.org/downloads is Qt libraries for various platforms, but nothing that refers to itself as "SDK". After a long search I've found an Installing Qt SDK page but that was not much help as it merely pointed back to http://qt-project.org/downloads and recommended to use the online installer. I did that but the installer only offers me to install Qt 5.x.

I had Qt 4.8.5 libraries and Qt Creator 2.8 installed but I wiped them off before starting the online installer. There was no Qt Maintenance Tool.

Looks like I will have to revert to my tried and trusted setup: Qt Creator on the PC for the GUI design and everything else on the phone.


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

vBulletin® Version 3.8.8