[Android-development] QPushButton::setMask() not supported on Android

maitai at virtual-winds.org maitai at virtual-winds.org
Fri Mar 21 17:08:18 CET 2014


Le 21-03-2014 10:48, Paul Olav Tvete a écrit :
> On Thursday 20 March 2014 19:34:11 maitai at virtual-winds.org wrote:
>> Hello all,
>> 
>> When I try to use something like this on a QPushButton:
>> 
>> 
>> myPushButton->setMask(iconPixmap.createMaskFromColor(Qt::transparent,Qt::Mas
>> kInColor));
>> 
>> 
>> I get in the console:
>> 
>> kernel/qwidget_qpa.cpp:958 (void QWidgetPrivate::setMask_sys(const
>> QRegion&)): void QWidgetPrivate::setMask_sys(const QRegion&): Not
>> supported on android.
>> 
>> The same code works as expected on other platforms.
>> 
>> So the questions are: is it planned to support it in a future version?
>> Is there an alternative way to achieve this?
> 
> 
> Hi,
> 
> We do not currently have plans to fix this. I have not looked into it 
> in
> detail, but I guess it could involve a lot of work. The better way to
> implement a non-rectangular button in Qt 4.x and up is to draw the 
> required
> shape and leave the rest transparent.
> 
> - Paul

Ok, thanks.



More information about the Android-development mailing list