Building Qt5 with Visual Studio 2012 / Visual Studio 2013, and integrating with the IDE

This method is tested to work on Visual Studio 2013. Pre-built binaries using Visual Studio 2012 and 2013 are available here, including OpenGL versions. Step 1: The Setup Download and install RapidEE here. RapidEE is a windows environment variables editor. It is extremely useful for the rest of this process (and just in general). Install … Read more

Qt5 – setting background color to QPushButton and QCheckBox

I had the same issue, but finally got this to work. I’m using Qt 5 with the Fusion color theme: QPalette pal = button->palette(); pal.setColor(QPalette::Button, QColor(Qt::blue)); button->setAutoFillBackground(true); button->setPalette(pal); button->update(); Try these commands in the exact order as above, and if that still doesn’t work, set your theme to Fusion and try again. Good luck!

How to build Qt 4.8/5.2 statically under VS2012, using the static MSVC runtime, with Windows XP support?

Qt 5.2 Assuming that the environment was prepared for XP targeting, and relevant XP-targeting qt5xp.patch and the bug fix qt5fixes.patch available – both from my other answer, we have to do the following: Create a separate win32-msvc2012-static and win32-msvc2012-static-xp qmake specs by copying them from qtbase/mkspecs/win32-msvc2012 and qtbase/mkspecs/win32-msvc2012-xp, respectively. Modify the qmake specs. Teach configure … Read more

Building Qt 5 on Linux, for Windows

Here are the full instructions: Get it: git clone https://github.com/mxe/mxe.git Install build dependencies Build Qt 5 for Windows: cd mxe && make qtbase This will first build its dependencies and the cross-build tools; It should take less than an hour on a fast machine with decent internet access. Due to the new modular nature of … Read more

Qt5. Embed QWidget object in QML

Qt Quick 2 uses a scene graph for efficient rendering on the GPU. Unfortunately this makes it impossible to embed classic widgets into the scene. The old approach to embed such widgets with the help of QGraphicsProxyWidget works only with Qt Quick 1, because internally it uses a QGraphicsView for all the heavy lifting and … Read more

Qt5 Static Build yields Failed to load platform plugin “windows”

For dynamic build only: Make sure you move the qwindows.dll to the following directory: yourapp.exe Qt5Core.dll … platforms/qwindows.dll … Note that the plugins directory is missing! You put all the needed folders from QT_BASE/…/plugins/* directly together with your binaries. BTW: I did not need libEGL.dll, but my application almost has no GUI. My source: http://qt-project.org/forums/viewthread/27056/#122588

Connecting overloaded signals and slots in Qt 5

The problem here is that there are two signals with that name: QSpinBox::valueChanged(int) and QSpinBox::valueChanged(QString). From Qt 5.7, there are helper functions provided to select the desired overload, so you can write connect(spinbox, qOverload<int>(&QSpinBox::valueChanged), slider, &QSlider::setValue); For Qt 5.6 and earlier, you need to tell Qt which one you want to pick, by casting it … Read more