[Android-development] Look of widgets on Android
maitai at virtual-winds.org
maitai at virtual-winds.org
Tue Jun 3 16:02:48 CEST 2014
Le 03-06-2014 09:52, Rutledge Shawn a écrit :
> On 3 Jun 2014, at 07:58, <maitai at virtual-winds.org>
> <maitai at virtual-winds.org> wrote:
>
>> The bad look of QFileDialog is already reported:
>> https://bugreports.qt-project.org/browse/QTBUG-37439
>>
>> BTW the same need exists for QColorDialog and QFontDialog...
>>
>> I don't think you can change anything in a QFileDialog
>>
>> P. Lelong
>>
>> Le 03-06-2014 07:32, A. Savelov a écrit :
>>
>>>
>>> WIdgets from libraries imported with Ministro look really better
>>> (added screenshot with QFileDialog).
>>>
>>> Can I calibrate size of lifts and buttons?
>
> QtQuick.Dialogs has its own FileDialog. It’s intended to be more
> suitable on Android and other touch devices than QFileDialog is
> (various bugs and missing features notwithstanding… but I will try to
> keep making it better).
>
> If you insist on using widgets instead of Qt Quick, you can poke
> around with custom style sheets; I tried that once:
>
> * {
> font: 24px
> }
>
> QPushButton
> {
> background: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0
> rgba(200,200,200,60%), stop:1 rgba(0,0,0,60%) );
> border-color: black;
> border-style: solid;
> border-width: 1px;
> border-radius: 1ex;
> min-width: 9ex;
> min-height: 2.5ex;
> }
>
> QPushButton:pressed
> {
> background: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0
> rgba(0,0,0,60%), stop:1 rgba(150,150,150,60%) );
> }
>
> (caveats: that was for Harmattan, I haven’t tried it lately on
> Android; and you should of course read the docs and modify this for
> your purposes if you want to take this approach.) Of course custom
> style sheet support is not maintained well, therefore bug-prone, and
> you are asking the raster engine to do more work on the CPU, not using
> the GPU at all. That’s a shame when Android devices have such nice
> GPUs, which is one big reason to use QtQuick.
>
> We might have better native styling of widgets at some point, but even
> if the buttons and icons all end up at reasonable size by default
> (which I can’t promise yet), it will still be the same
> desktop-oriented QFileDialog, not really designed for touch
> interaction.
Very interesting, thanks.
I will try and see If I can call a qml qquick filedialog from inside a
widget based application. Probably there is the same thing for picking
up a color or a font?
Concerning styles and stylesheets, it's of course possible to build one
that will look perfect on one particular device... the problem being to
adjust to all different screen formats and resolutions, not even
speaking about different android themes for a particular device. In this
respect Ministro is doing a great job, we really hope it will continue
to improve and to fix the existing issues.
On a more general basis although of course it's good to use the GPU and
also the fact that qml appears to be more flexible especially concerning
transitions, it's not really clear to us whether migrating our QDialogs
(around 50 objects) to QML would be so beneficial (our application being
heavily based on QGraphicsScene/mainwindow/centralwidget)... Our main
concern today is the look and feel of QDialogs under IOS or Android, the
rest of the application being now working more or less correctly. It's
still not distribute-able just because of that (especially this one
concerning QSpinBoxes:
https://bugreports.qt-project.org/browse/QTBUG-38325).
Philippe LELONG
More information about the Android-development
mailing list