Active Topics

 


Reply
Thread Tools
Copernicus's Avatar
Posts: 1,986 | Thanked: 7,698 times | Joined on Dec 2010 @ Dayton, Ohio
#1
Well, I've gotta say that the Qt project has been leading me through waves of joy and despair in the last few days. I've decided to try to port Pierogi to Android -- and, amazingly, after only a few days of messing around, I've already been able to bring up the app on an Android device and start talking to the IR hardware. All the keyset classes, protocol code, signals & slots, and threading run just fine!

Unfortunately, the user interface is another story. I've been using the good old "Qt Widgets" library, which has indeed been ported to Android, so my UI does come up (more or less). Unfortunately, beyond being "ported", it really doesn't have a lot of support -- none of the native Android navigation controls are available, nor is Android's theming mechanism (so, the default Qt Widgets UI looks just terrible).

I've started investigating whether to switch to using QML, but there are significant downsides here, too; while that has lots of support for touch controls (with "flickability", etc), it doesn't have nearly the kind of support for classic UI controls (like pushbuttons!) that Qt Widgets has. (In the current Qt Quick Controls implementation for a button, I don't even see an option to "enable" or "disable" them.) So, I'd probably have to recreate some of the functionality I've been taking for granted with Qt Widgets. Oh, and also -- none of the native Android navigation controls are available, nor apparently is Android's theming mechanism (so, the default Qt Quick UI looks just terrible). (Also, I have no idea how much trouble it'd be to make Pierogi use QML on the N900... I'd like to avoid even thinking about that, if I can.)

No matter what, it looks like I'm going to have to get my hands dirty and learn how to manually create a style for Qt Widgets / Qt Quick Controls. I thought it'd be kind of cool to use the "Hildon Style" on Android, but it looks like anything associated with Nokia has been expunged from Qt at this point. How much work would it take to create a vaguely Hildon-like style for Qt5? (And would it be possible to apply Marxian's Hildonized Qt Components to make Android look like Maemo? )

Last edited by Copernicus; 2014-04-22 at 22:05.
 

The Following 3 Users Say Thank You to Copernicus For This Useful Post:
marxian's Avatar
Posts: 2,448 | Thanked: 9,523 times | Joined on Aug 2010 @ Wigan, UK
#2
Well, it seems that Qt Components is already available for Android as part of the Necessitas project, so that is one option. I haven't used them myself (see signature ), but I'm sure they work OK. The APIs are pretty straightforward.

As for using the Hildonized Qt Components, you would need to ship all the theme images. Presumably, this would rule out use of the Nokia alpha/beta themes due to licensing issues.

So, I would say that the realistic options are:
  1. Use Qt Components for Android. This will require some additional macros and such in your backend code to expose it to the Qt MetaObject system (can seem labourious if you are used to widgets, where your C++ code 'just works').
  2. Use plain QML and design your own components. As above, plus you'll need to build your own QML components from scratch.
  3. Use Qt Widgets and style the widgets using stylesheets or by reimplementing paintEvent(). This might not be that much work if you use stylesheets.

A quick comment regarding the Qt Quick Controls Button component: I haven't used Qt Quick Controls, but I will say that QDeclarativeItem (from which all QML items are derived) has an enabled property, so all QML items inherit this property (along with visible, x, y, width, height etc).
__________________
'Men of high position are allowed, by a special act of grace, to accomodate their reasoning to the answer they need. Logic is only required in those of lesser rank.' - J K Galbraith

My website

GitHub
 

The Following 5 Users Say Thank You to marxian For This Useful Post:
Copernicus's Avatar
Posts: 1,986 | Thanked: 7,698 times | Joined on Dec 2010 @ Dayton, Ohio
#3
Originally Posted by marxian View Post
  1. Use Qt Components for Android. This will require some additional macros and such in your backend code to expose it to the Qt MetaObject system (can seem labourious if you are used to widgets, where your C++ code 'just works').
  2. Use plain QML and design your own components. As above, plus you'll need to build your own QML components from scratch.
  3. Use Qt Widgets and style the widgets using stylesheets or by reimplementing paintEvent(). This might not be that much work if you use stylesheets.
Thanks! After checking around a bit, I've decided to give option #3 a try. I've never really worked with stylesheets before, but yeah, they do seem to be pretty easy to use. I've been making some progress, and the UI is looking much better. (I'll append a screenshot to the post.)

Things are somewhat better on the navigation side, too; at least a little bit. It turns out that Qt can recognize the Android "back" button; and, given that Android uses it in a manner almost identical to how Maemo uses "Stacked Windows", that makes my life a lot easier. Everything in Pierogi that was a Maemo stacked window has become an Android fullscreen window that can be closed by pressing that key.

So, it looks like Pierogi on Android may just be doable.
Attached Images
 

Last edited by Copernicus; 2014-04-24 at 04:52.
 

The Following 2 Users Say Thank You to Copernicus For This Useful Post:
Posts: 1,397 | Thanked: 2,126 times | Joined on Nov 2009 @ Dublin, Ireland
#4
Good work, would be nice to see more Qt applications in Android.

If you plan to publish the Android version, give F-Droid a try. Google Play is just for malware...
 

The Following User Says Thank You to ivgalvez For This Useful Post:
Copernicus's Avatar
Posts: 1,986 | Thanked: 7,698 times | Joined on Dec 2010 @ Dayton, Ohio
#5
Originally Posted by ivgalvez View Post
If you plan to publish the Android version, give F-Droid a try. Google Play is just for malware...
Ok, Android newbie question here: are you only supposed to publish in one app store? I had kind of assumed that every app creator was trying to push their apps into every app store...
 
Estel's Avatar
Posts: 5,028 | Thanked: 8,613 times | Joined on Mar 2011
#6
You can publish where you want, although, the difference between F-Droid and google play is (supposed to be) just like between Maemo's repos and Ovi Store (with respect to scale). IE power users are looking at GP with barely hidden disdain

/Estel
__________________
N900's aluminum backcover / body replacement
-
N900's HDMI-Out
-
Camera cover MOD
-
Measure battery's real capacity on-device
-
TrueCrypt 7.1 | ereswap | bnf
-
Hardware's mods research is costly. To support my work, please consider donating. Thank You!
 

The Following 2 Users Say Thank You to Estel For This Useful Post:
Reply

Thread Tools

 
Forum Jump


All times are GMT. The time now is 02:03.