Questions tagged [qbrush]

7 questions
3
votes
1 answer

Can I customize own brushstyle?

Here are some predefined QbrushStyle for Qbrush, I am wondering is there any chance I can customize a style follow my own will. Thank you.
M conrey
  • 45
  • 5
0
votes
0 answers

How do I set the background color of a brush style

I tried the following code which gives me an orange crosspattern on white background and I would like it to be blue for example. brush = QtGui.QBrush() brush.setColor(QtGui.QColor('orange')) brush.setStyle(QtCore.Qt.CrossPattern) scene =…
Laeti
  • 1
  • 1
0
votes
0 answers

Inner shadow effect for Qt's QPainter::drawPolygon

I have a custom QWidget class with an extensive paintEvent function. It draws multiple nested polygons inside that widget using QPainter, setting its brush and pen, and calling its drawPolygon function. I want to add an inner shadow to these…
0
votes
0 answers

QGraphicsItem setBrush with some extra wrong lines

In Qt, I use a QGraphicsScene and add a QGraphicsPathItem to it. I set the item's outline color to blue and set fill color to solid red. Most of the time, it's normal, but when I zoom the item use mouse, occasionally some extra red lines appear. If…
0
votes
1 answer

QML: Create cusom brush style based on standard Qt one

I need custom brush style similar to Qt.BDiagPattern but with custom line width, let's say 10 or 20 px. Is there an easy way? onPaint: { var ctx = getContext("2d"); ... ctx.fillStyle = ctx.createPattern(Qt.rgba(1.0, 0, 0, 0.5), …
Aleksey Kontsevich
  • 4,671
  • 4
  • 46
  • 101
0
votes
0 answers

QBrush transformation ignored by QPrinter/QPdfWriter

I am using PyQt 5.15.2 (Qt 5.15.2) on macOs 10.15.7. I am trying to produce a PDF from a QGraphicsScene. I am drawing some paths with a brush that has a pixmap texture, and a scale transformation applied (with brush.setTransform). When I display the…
Bordaigorl
  • 121
  • 6
0
votes
0 answers

How to customize a Qbrushstyle with a blur effect

I am involving in a gaze-contingent display project, and need to customize a blur style Qbrush. I have tried using QGraphicsBlurEffect to achieve my purpose, However, when using QGraphicsBlurEffect to a huge QGraphicsEllipseItem (circle,…
M conrey
  • 45
  • 5