Hi,
Qt 4.7. Outside the thread of code works fine:
IMG.load("img.jpg");
PAINTER.begin(&IMG);
PEN.setColor("#ff0000");
PAINTER.setOpacity(0.30);
PAINTER.setPen(PEN);
PAINTER.drawText( 20, 20, "Test");
QImage IMG;
QPainter PAINTER;
QPen PEN;
IMG.load("img.jpg");
PAINTER.begin(&IMG);
PEN.setColor("#ff0000");
PAINTER.setOpacity(0.30);
PAINTER.setPen(PEN);
PAINTER.drawText( 20, 20, "Test");
To copy to clipboard, switch view to plain text mode
But when put into the thread drawText crash:
QObject::killTimers: timers cannot be stopped from another thread
QObject::killTimers: timers cannot be stopped from another thread
To copy to clipboard, switch view to plain text mode
If remove the method:
PAINTER.setOpacity(0.30);
PAINTER.setOpacity(0.30);
To copy to clipboard, switch view to plain text mode
or send it to 0 or 1 , starts to work fine.
Tried to change it to:
PEN.
setColor( QColor( clr.
red(), clr.
green(), clr.
blue(),
254 ) );
QColor clr = QColor("#ff0000");
PEN.setColor( QColor( clr.red(), clr.green(), clr.blue(), 254 ) );
To copy to clipboard, switch view to plain text mode
but not help
Any ideas?
Thanks in advance)
Bookmarks