[Interest] setting a widget style for a particular widget class only?

Andy asmaloney at gmail.com
Sat Sep 10 15:11:02 CEST 2016


René:

I think you can just use QWidget::setStyle().  Haven't tried it for
QTabBar, but I use it on QButtons.

QStyle   *style = QStyleFactory::create( "fusion" );
QPushButton   *button = new QPushButton( "foo", this );
button->setStyle( style );



---
Andy Maloney  //  https://asmaloney.com
twitter ~ @asmaloney <https://twitter.com/asmaloney>


On Fri, Sep 9, 2016 at 10:59 AM, René J.V. Bertin <rjvbertin at gmail.com>
wrote:

> Hi,
>
> Is it possible to change the widget style for just a particular widget
> class? In stylesheet language,
>
> QTabBar { style : Fusion }
>
> This is also exactly what I'd like to accomplish, use the Fusion style for
> a QTabBar widget in a tabbed document editor, so it looks the same on all
> platforms, even on OS X with its QTabBar implementation that's appropriate
> only in dialogs with a few tabs.
>
> Alternatively
>
> Thanks,
> René
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20160910/447ce88d/attachment.html>


More information about the Interest mailing list