There are many cases in every cross-platform development framework that you want your source code to be built differently under different operating systems. For example you might want a method to to use platform specific functions in Windows, Linux and Mac OS X but you don’t want to have different projects for each one of them. If you are in a similar situation then you can use the following approach to have a single integrated project for all operating systems that you are developing for.
Continue reading “How to Configure a Single Qt Project for Different Operating Systems”How to Get the Topmost Window Title using Qt/C++ (for Windows)
In this article I am going to describe how to get the title of the window which has the focus, or in other word is currently active. To be able to achieve this in Qt/C++ you need to use the operating system API functions, in this case Win32 API.
Continue reading “How to Get the Topmost Window Title using Qt/C++ (for Windows)”How to Make Your Window Stay on Top in Qt
You can use the following snippet to make your MainWindow or any other window always on top:
setWindowFlags(windowFlags() | Qt::WindowStaysOnTopHint);
Just insert it in your window’s constructor function.
How to Create Custom Shaped Windows in Qt
By default every window you create has a rectangular shape but in case you want to have a window which is non-rectangular (such as ellipse or triangle or any shape you prefer) then you can use the approach below.
Continue reading “How to Create Custom Shaped Windows in Qt”