Qt QPixmap QPainter problem -
i have piece of code has lines of code:
int dsize = 100; qpainter *painter; qpixmap *img; qlabel *l_img; painter = new qpainter; img = new qpixmap(dsize, dsize); l_img = new qlabel; l_img->setpixmap(*img); painter->begin(img); painter->fillrect(img->rect(), qt::white); qpen pen(qt::black, 12); painter->setpen(pen); painter->drawline(40, 40, 40, 100); painter->end(); l_img->show();
how ever when run code, don't see white image black rectangle on it. in fact see title of window written in big fonts. nothing seems work, image that. doing wrong?
thank you!
got it!!
it has line:
l_img->setpixmap(*img);
it should after
painter->end();
thank you, xd.
Comments
Post a Comment