当前位置: 动力学知识库 > 问答 > 编程问答 >

linux - How do I set a styleSheet for a custom titleBarWidget (for DockWidget) with global css

问题描述:

I have a global file.css for ma Qt application

He works fine !

but I have a Custom widget for my titleBars of DockWidget

myDockWidget.setTitleBarWidget(myWidgetTitleBar(myDockWidget))

I don't find how to change styleSheet of this widget in my file.css

if I write in my class :

myWidgetTitleBar.setStyleSheet("Border:2px solid green; background-color:red;")

it doesn't works.

I tried :

file.css :

myWidgetTitleBar { Border:2px solid green; background-color:red; }

or, after have set in my class setObjectName("toto")

Widget#toto { Border:2px solid green; background-color:red; }

that's strange because all other widget with toto name works (green border and red bg), but this specific widget in my titlebar doesnt't.

(is the same when floating or not)

I tried this but same, doesn't work.

myDockWidget::title { Border:2px solid green; background-color:red; }

any Idea ? a Qt bug ?

I work with pyqt 4 on linux opensuse

分享给朋友:
您可能感兴趣的文章:
随机阅读: