benlau/quickandroid

I REALLY NEED YOUR HELP, PLEASE RESPOND!!!

Closed this issue · 7 comments

Hi Benlau. You've done a great job but I have some serious issues with the library and this is because am totally new to this. Whenever I try to preview any of the components in the designer window, I don't see anything! Am sorry if this is a stupid complain but am addicted to you library already and I really need to use it on a project but I can't preview the components. I just see a very tiny red or blue dot. I'm a beginner with QML and that's why I depend heavily on the designer mode. Please is there something am doing wrong? Here for example is the ActionBar.qml in the design mode. Please respond!
capture1

Hi @ofuochi,

Thx

It is an issue with Qt Designer with Android component. Android do not use pixel to describe the size of component. Instead it use a measurement unit called DP (density-independent pixel ) . And Qt do not support DP / High DPI scaling in Android yet.

So QuickAndroid (and other Qt library for Android) scale size unit in pixel to DP by custom method. And those methods will not be recognized by Qt Designer. Since the size of component is not valid, and therefore it will just show a red/blue dot (width and height equal to zero).

You may make it works by making a dummydata model as described in the link below:

Prototyping with qmlscene | Qt 5.5

However, it is just very troublesome. So my suggestion is - Don't use Qt Designer to write Qt application for Android. Just type it in code.

p.s The title of an issue should be the summary of problem/question.

Thank you for your quick response Benlau. I've managed to hack my way through to some extent. But how do I use the textinput demo? You used something like QATextInput. Qt says it's an error. Is there any other way to use the textinput? As for the topic, I was honestly trying to get your attention as I needed it urgently

QATextInput is already removed already. I have forgotten to remove it from example program. It is replaced by TextField. Example code is available at examples/quickandroidexample/textField/TextFieldDemo.qml

Ok. Thank you. Can you just give me a code snippet to use the button component?

hmmm. I may include it in next release. And may happen in next week.

Thank you Sir. I'll keep checking

A demonstration of using Button component is now available in example program

https://github.com/benlau/quickandroid/blob/master/examples/quickandroidexample/button/ButtonDemo.qml