[Android-development] Look of widgets on Android

Rutledge Shawn Shawn.Rutledge at digia.com
Tue Jun 3 09:52:07 CEST 2014


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.




More information about the Android-development mailing list