QLabel pixmap not affected by CSS property: border
-
What do you actually do? I mean - how should we know what's wrong when you don't tell us what you're trying to achieve with what code...
Also note that Qt doesn't support use CSS for styling but QSS which is only a minor subset of CSS. -
The frame is painted before the pixmap so you have no other chance then doing the painting by yourself.
-
Hi,
Create a subclass of QLabel and overload the paintEvent method. There you call the base class implementation and after that, do your custom drawing on top of your image.
-
That's what I figure, but can I use that class in qt designer after?
Also I don't want to draw on top of the image, I want to draw the image with a bevel effect.@diniamo said in QLabel pixmap not affected by CSS property: border:
That's what I figure, but can I use that class in qt designer after?
See https://doc.qt.io/qt-5/designer-using-custom-widgets.html
Also I don't want to draw on top of the image, I want to draw the image with a bevel effect.
Since you do the drawing on your own then you can draw whatever you want.
-
Try to add padding to see if it helps.
padding is added between border and contents.
https://doc.qt.io/archives/qt-4.8/stylesheet-customizing.html -
Try to add padding to see if it helps.
padding is added between border and contents.
https://doc.qt.io/archives/qt-4.8/stylesheet-customizing.html -
@diniamo said in QLabel pixmap not affected by CSS property: border:
That's what I figure, but can I use that class in qt designer after?
See https://doc.qt.io/qt-5/designer-using-custom-widgets.html
Also I don't want to draw on top of the image, I want to draw the image with a bevel effect.
Since you do the drawing on your own then you can draw whatever you want.
@Christian-Ehrlicher Do I have access to the standard label paint event, to look at as an example? As well as qframe's probably.


