[Interest] Trouble setting stylesheet for widget

Mike Chinander chinander at gmail.com
Wed Sep 9 18:29:48 CEST 2015


For styling named widgets, I thought you needed to use
QWidgetType#Objectname::element { }

In your case:
QTabWidget#mainTabWidget::tab {

}

On Wed, Sep 9, 2015 at 11:14 AM, Shinnok <admin at shinnok.com> wrote:

> Hi list,
>
> I'm currently having a lot of trouble setting object specific stylesheet.
> I'm on Qt 5.4.2/OSX 10.10/Creator 3.5.0. The stylesheet is set from Creator
> -> Designer on the object property:
>
> #mainTabWidget::tab {
> ...
> }
>
>  #mainTabWidget::tab:selected
> {
> }
>
> However this:
> #mainTabWidget<whitespace here>::tab {
>
> Seems to apply. I don't remember this being the case with stylesheets
> syntax for selectors nor the documentation yields that. This is also not
> the first time I'm touching QSS. Full stylesheet in question
> https://github.com/Tarsnap/tarsnap-gui/blob/master/forms/mainwindow.ui#L76
> . None of those rules get applied for some reason.
>
> Maybe it's my setup or a Qt toolchain bug. Any idea as to what's going on
> here?
>
>
> Regards,
> Shinnok
> _______________________________________________
> 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/20150909/450d2758/attachment.html>


More information about the Interest mailing list