Qt Stylesheet for custom widget

I had a similar problem and it was solved using jecjackal’s comment. As sjwarner said, it would be much more noticeable in the form of an answer. So I’ll provide it. For the benefit of any future viewers. Again, it isn’t my answer! Appreciate jecjackal for it! As it is said in the Qt’s stylesheets … Read more

How to link opencv in QtCreator and use Qt library

Finally I am starting to be happy. When adjusting this question I had to try all the ways how to define LIBS. Listing them manually helped, at first I wrote them somehow wrong. This is how it works finally: LIBS += -LC:\\Programs\\opencv24\\opencv_bin2\\bin \ libopencv_core240d \ libopencv_highgui240d \ libopencv_imgproc240d \ libopencv_features2d240d \ libopencv_calib3d240d \

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

Application failed to start because it could not find or load the QT platform plugin “windows”

The error is caused because the program can’t find qwindows.dll qwindows.dll has to be in a folder named platforms so that the path from your executable to the dll is platforms/qwindows.dll Whereas this wasn’t enough in my case. I had also to add following line at the beginning of my main() QCoreApplication::addLibraryPath(“./”); Then everything worked.

Deploying Qt 5 App on Windows

Starting from Qt 5.2, there is windeployqt tool you can use. Just run it from command line to get help. But basic usage is, give it the .exe file, it will copy Qt dependencies to go with it. You will want to use –qmldir option to let the tool know where your QML files are, … Read more

How to use the Qt’s PIMPL idiom?

Introduction The PIMPL is a private class that contains all of the implementation-specific data of the parent class. Qt provides a PIMPL framework and a set of conventions that need to be followed when using that framework. Qt’s PIMPLs can be used in all classes, even those not derived from QObject. The PIMPL needs to … Read more