cupersuper
9th April 2015, 14:11
Hi,
Qt 4.7. Outside the thread of code works fine:
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");
But when put into the thread drawText crash:
QObject::killTimers: timers cannot be stopped from another thread
If remove the method:
PAINTER.setOpacity(0.30);
or send it to 0 or 1 , starts to work fine.
Tried to change it to:
QColor clr = QColor("#ff0000");
PEN.setColor( QColor( clr.red(), clr.green(), clr.blue(), 254 ) );
but not help
Any ideas?
Thanks in advance)
Qt 4.7. Outside the thread of code works fine:
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");
But when put into the thread drawText crash:
QObject::killTimers: timers cannot be stopped from another thread
If remove the method:
PAINTER.setOpacity(0.30);
or send it to 0 or 1 , starts to work fine.
Tried to change it to:
QColor clr = QColor("#ff0000");
PEN.setColor( QColor( clr.red(), clr.green(), clr.blue(), 254 ) );
but not help
Any ideas?
Thanks in advance)