PDA

View Full Version : how to define a new tyle of Qt::BrushStyle,



xiongxiongchuan
24th August 2013, 01:58
i need to define a new style of QT::BrushStyle ,because i need to change the color of the brushstyle at runtime ,so i can't use the Qt::TexturePattern.
how to define a new style ,anyone can help me?

Santosh Reddy
24th August 2013, 04:27
You can create a brush with a texture by providing the pixmap when the brush is created or by using setTexture().

karankumar1609
24th August 2013, 07:12
you need not to define a new QBrush style, just create a QBrush member variable in your class.

So, whenever you want to change its texture you can set it to your brush.
Painter will then use your newly updated brush style for drawing.