Setting default color for brush
-
I created that function:
void paint::setPenColor(const QColor &newColor)
//! [5] //! [6]
{
myPenColor = newColor;
}Parts declared in paint.h header file{
void setPenColor(const QColor &newColor);QColor myPenColor;}
These are the extra info. related to the function
-
QPainter::setPen(QColor) and QPainter::setBrush(QColor)
but i don't know what you actually are doing. :)
you defined the method as
@paint::setPenColor(const QColor &newColor)@
but using it as
@painter->setPenColor(255,255,255);@This can't work.
-
use the 2 QPainter methods i've posted.
and as i said, the code you've posted isn't clear to me, so i can't help you with the information you have posted so far.
-
hmm...okay...so like I have to choose the white color. How to use the setpen method?
what's the exact code for that...
(sorry for asking the exact thing...usually i would have worked it out, but i have to show this in half an hour...so, i think u can understand the desperation) :P -
@
painter; //your QPainter instancepainter->setPen( QColor(Qt::white) );
painter->setBrush( QColor(Qt::white) );
@good luck!
-
post the complete code please of the affected class/file.
-
good to hear.