How to convert a QJsonObject to QString

Remembering when I first needed to do this, the documentation can be a bit lacking and assumes you have knowledge of other QJson classes. To obtain a QString of a QJsonObject, you need to use the QJsonDocument class, like this: – QJsonObject jsonObj; // assume this has been populated with Json data QJsonDocument doc(jsonObj); QString … Read more

Set label text in QTabWidget tab

It sounds like you’re talking about Qt Designer, since it defaults to showing two tabs (called “Tab 1” and “Tab 2”) when you add a QTabWidget through the interface. If so, click on the tab you want to rename, then in the Property Editor (if you can’t find it make sure it’s visible by using … Read more

Inserting an image in GUI using QT Designer

You can start inserting a label. Next, you right click on it an then click “change rich text…”. A new window will pop-up. Click on the figure Icon “Insert figure”. Now, you have to create a resource file. Click on the Pencil button. Next, click on the “New resource file” button. Choose a name and … Read more

Dark theme for Qt widgets?

No, but you may use my fairly comprehensive stylesheets that should look excellent on most platforms (it’s inspired by KDE’s Breeze Theme, which is a dark theme that is quite elegant). This was (hard) forked from the excellent QDarkStylesheet, which I felt had theme issues in numerous areas, so I modified it extensively for my … Read more

How to install wkhtmltopdf with patched qt?

This straightforward solution (no need to install xvfb, neither compiling QT neither wkhtmltopdf) works like a charm on my Debian Jessie server : cd mytmpfolder wget https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.4/wkhtmltox-0.12.4_linux-generic-amd64.tar.xz sudo tar xvf wkhtmltox-0.12.4_linux-generic-amd64.tar.xz sudo mv wkhtmltox/bin/wkhtmlto* /usr/bin/ #create simple html test file echo “<html><body>test</body></html>” >> test.html #perform conversion sudo wkhtmltopdf –disable-smart-shrinking –lowquality –enable-external-links –enable-internal-links test.html test.pdf

Generating a MD5 Hash with Qt

PHP gives it to you in hex, Qt in binary. Convert it to hex using QByteArray::toHex. QString blah = QString(QCryptographicHash::hash((“myPassword”),QCryptographicHash::Md5).toHex())