Instead of drawing the lines try p.fillRect( rect(), Qt::red ) ;
See if anything is being painted now. Perhaps you need to set a width for the pen.
regards
Instead of drawing the lines try p.fillRect( rect(), Qt::red ) ;
See if anything is being painted now. Perhaps you need to set a width for the pen.
regards
Marcel,
p.fillRect( rect(), Qt::red ) ;
filled pbs with a bright red.
The pen width is set to 0, so a 1 pixel width line should be drawn.
I removed the background from pbs, but still no line.
Thus far the only thing I've been able to display on pbs is your fillRect suggestion.
I also tried
p.fillRect(4,115,34,6,Qt::red);
which should have filled a small rectangle, but nothing happened.
It's probably late in your area, but do you have any last suggestions for today?
Thanks again.
Cheers,
Mel
OK.
A painter draws in paint device (widget in this case ) local coordinates.
Meaning that when you used my previous suggestion, something got filled, but not the right thing.
Thus, everything must be drawn relative to (0,0).
Calling p.fillRect( 0, 0, size().width(), size().height(), Qt:red ) will fill the ENTIRE widget.
For what you were trying to achieve call p.fillRect( 0, 0, 30, 6, Qt:red ). This will fill a small rect in the top left corner of the widget.
To be sure just do a drawRect( 0, 0, size().width(), size().height() ) - draw a frame around the widget.
If this works ( and it will), draw everything relative to (0, 0 ) - lines, etc.
It's 11 PM, not so late.It's probably late in your area, but do you have any last suggestions for today?
Regards
Sigh ... Of course it's relative! I knew there was some fundamental point I was missing! I adjusted my numbers, and painted the rectangle and the line I was trying to paint.
I can't thank you enough for your help, Marcel. I have a lot of work still ahead, but your help has removed a big roadblock. I put my question out to this group, because they had advertised a 95% success rate in solving users' problems. Mine can certainly be added to the success list thanks to your efforts.
Thanks again for your time and patience.
Cheers,
Mel
Happy to be of some help!
Regards
Bookmarks