PDA

View Full Version : Merging to different QBrushPattern?



ashukla
10th January 2008, 07:47
Dear All!
Is it possible to merge different QBrushPattern?
If Yes!, How a way we can merge to different QBrush pattern in a single one?
I want to merge Qt::SolidPattern with Qt::CrossPattern.

If No! Any alternate way to acheive the output.

aamer4yu
11th January 2008, 14:29
One simple way would be to draw twice... one with the first pattern, and second with the second pattern :)

else you can use the different constructors of QBrush to create brush from images.
Refer QBrush::QBrush ( const QPixmap & pixmap ) , QBrush::QBrush ( const QImage & image )

Hope this helps :)

ashukla
12th January 2008, 04:32
One simple way would be to draw twice... one with the first pattern, and second with the second pattern
No, It is not well for me because when we set the second pattern the first one pattern is removed; however I have need both of them.

QBrush::QBrush ( const QPixmap & pixmap ) , QBrush::QBrush ( const QImage & image )
Hope this helps
And the second way consume to much memory according to my need. So, It is not helpful for me. Suppose I have a need of red Horizontal pattern with Blue (or different) base (background) colours. So By the use of image, I would create a horizontal pattern image with different colours. It is a tedious job.
So that, I am wanting to merge QBrush pattern or wanting to create own pattern with two colours without using texture pattern.