How to Reduce Your SQLite Database File Size Using Qt

Below is what I do for clearing and compressing my SQLite database files in Qt. Usually when you delete some entries from a SQLite database, it does not get deleted physically but instead it just gets marked as deleted and is not retrieved in queries. The good thing about this is that it works fast. But the obvious downside is the fact that the free space is not released. To release the space occupied by deleted files you need to do the following:

Continue reading “How to Reduce Your SQLite Database File Size Using Qt”

How to Split a QString by White Spaces

You need to use a QRegExp to achieve this. “\s” means any white space character and “+” means any number of that pattern. So you can use the following line to find any number of consecutive white spaces and split you string:

line.split(QRegExp("\s+"))


How to Build for Windows XP Using MSVC 2015/2013/2012

To make your Qt application compatible with Windows XP (32-bit) you have to add the following line to your PRO file. Note that this will enable targeting for Windows XP without disrupting the application’s behavior in higher Windows versions.

QMAKE_LFLAGS_WINDOWS = /SUBSYSTEM:WINDOWS,5.01

You also need to install Visual C++ Redistributable for Visual Studio 2015. You can find Microsoft official link below:

https://www.microsoft.com/en-us/download/details.aspx?id=48145