qt - drawText() on a QImage crashes program -
i have image in uint8_t buffer , trying use qimage wrapper write text on image. have used drawline() no issues, drawtext() crashes program. below code part of boost thread in want write text unto each image iterates through function. there bugs in qt unaware of?
uint8_t *framebuffer; // contains image pixels qimage img(framebuffer, sizex, m_sizey, qimage::format_rgb888); qpainter p(&img); p.setpen(qpen(qt::green)); p.setfont(qfont("times", 10, qfont::bold)); p.drawline(img.rect().bottomleft().x(), img.rect().bottomleft().y()-10, img.rect().bottomright().x(), img.rect().bottomright().y()-10); //works! p.drawtext(img.rect(), qt::aligncenter, "help"); //crashes program
my project set qcoreapplication (i had no gui). changing qapplication did trick!
Comments
Post a Comment