Quantcast
Channel: QtWebEngine
Viewing all articles
Browse latest Browse all 13965

[Solved] CSS on custom widget

$
0
0
Hi, I have a class that inherits from QPushButton. I want to customize it’s look and feel with CSS, but I don’t know how to access it from CSS. The widget is promoted on Qt Designer from QPushButton to the custom class. I tried MyClassName {whatever} But it’s not working. ui->myButton->metaObject()->className() returns QPushButton, not MyClassName. Is there a simple way to access all instances of that class? Using QPushButton[objectName|=“prefix”] might work for me, but my custom buttons are not named with a “prefix-”, they are named with a suffix (and withouht hyphens). Is there an equivalent selector for suffixes or is it possible to use wildcards? I would like to avoid changing the names to keep consistent with the naming style I’ve been using until now. Cheers

Viewing all articles
Browse latest Browse all 13965

Latest Images

Trending Articles



Latest Images