W
W
WD_KMS2020-04-06 17:33:15
Python
WD_KMS, 2020-04-06 17:33:15

How to make rounded corners in QPixmap?

It is necessary to make a square image with rounded corners. There is a QPixmap object. You can either put it in a label, or in a QgraphicsView. What are the rounding options? StyleSheet, as I understand it, does not work in this case.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
F
fidlerdev, 2020-04-09
@fidlerdev

I can suggest using a stylesheet for the button.

btn.setStyleSheet("""
            color: grey;
            border-image: url(*Путь к вашему изображению*) 4 20 4 20;
            border-top: 3px transparent;
            border-bottom: 3px transparent;
            border-right: 10px transparent;
            border-left: 10px transparent;
        """)

I set the values ​​\u200b\u200bin my picture, they may not fit

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question