c++ - QPainter crashed with QT 4.8.6 in iOS 10.6.8 -
as title, using qt4.8.6.
i design ui paint on qwidget in ios 10.6.8.
it works fine in ubuntu 14, same code crash in ios.
i got following error message:
wed nov 12 22:33:01 macbook1.local main[75787] <error>: cgcontextsetlinedash: invalid context 0x0 wed nov 12 22:33:01 macbook1.local main[75787] <error>: cgcontextsetstrokecolorwithcolor: invalid context 0x0 wed nov 12 22:33:01 macbook1.local main[75787] <error>: cgcontextsetfillcolorwithcolor: invalid context 0x0 wed nov 12 22:33:01 macbook1.local main[75787] <error>: cgcontextsetshouldantialias: invalid context 0x0 wed nov 12 22:33:01 macbook1.local main[75787] <error>: cgcontextsetfontsize: invalid context 0x0 wed nov 12 22:33:01 macbook1.local main[75787] <error>: cgcontextgettextmatrix: invalid context 0x0 wed nov 12 22:33:01 macbook1.local main[75787] <error>: cgcontextsettextmatrix: invalid context 0x0 wed nov 12 22:33:01 macbook1.local main[75787] <error>: cgcontextsettextdrawingmode: invalid context 0x0 wed nov 12 22:33:01 macbook1.local main[75787] <error>: cgcontextsetfont: invalid context 0x0 wed nov 12 22:33:01 macbook1.local main[75787] <error>: cgcontextsettextposition: invalid context 0x0 wed nov 12 22:33:01 macbook1.local main[75787] <error>: cgcontextshowglyphswithadvances: invalid context 0x0
and paintevent code:
void widget_captcha::paintevent(qpaintevent* e) { if(this->canroll) { this->showwidget->update(); rollchar_font(); this->canroll=false; } qpainter p(this->showwidget); // p.setbackgroundmode(qt::transparentmode ); qcolor color[11]= { qt::black, qt::darkred, qt::darkgreen, qt::darkblue, qt::darkcyan, qt::darkmagenta, qt::darkyellow, qt::darkgray, qt::cyan, qt::magenta, qt::gray }; qtransform trans[5]; trans[0].translate(0,0); trans[0].rotate(0); trans[0].scale(1.1,1); trans[1].translate(5, 0); trans[1].rotate(10); trans[1].scale(1, 0.5); trans[2].translate(5, 5); trans[2].rotate(-5); trans[2].scale(0.9, 1.1); trans[3].translate(0, 35); trans[3].rotate(0); trans[3].scale(0.9, 0.4); trans[4].translate(0, 5); trans[4].rotate(0); trans[4].scale(0.9, 0.4); for(int i=0;i<6;i++) { p.settransform(trans[this->itransform[i]]); p.setfont(this->font[i]); qpen pen(color[this->icolor[i]],5); p.setpen(pen); p.drawtext(38*i, 50,this->code[i]); } }
thank you.
Comments
Post a Comment