Display QImage with QtGui

Simple, but complete example showing how to display QImage might look like this: #include <QtGui/QApplication> #include <QLabel> int main(int argc, char *argv[]) { QApplication a(argc, argv); QImage myImage; myImage.load(“test.png”); QLabel myLabel; myLabel.setPixmap(QPixmap::fromImage(myImage)); myLabel.show(); return a.exec(); }

How to convert an OpenCV cv::Mat to QImage

Michal Kottman’s answer is valid and give expected result for some images but it’ll fail on some cases. Here is a solution i found to that problem. QImage imgIn= QImage((uchar*) img.data, img.cols, img.rows, img.step, QImage::Format_RGB888); Difference is adding img.step part. qt won’t complain without it but some images won’t show properly without it. Hope this … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)