First of all you can check this link if you don’t know what hybrid applications are and what the difference between Hybrid and Native application is. In this article I am sharing the source code of a simple application that uses Qt with a combination of C++ and QML to run Hybrid applications (written using Framework7, Ionic or Famo.us) on the Operating Systems of your choice (Android, iOS, WP, Windows, Mac OS X and Linux).
Continue reading “How to Use Qt to Create Hybrid Applications”How to Check Internet Connection Availability Using Qt/C++
The one and only correct answer is, you have to check if you can access some famous (like Google or Facebook) server on the internet. This question comes up a lot and surprisingly enough there is no clear answer for it because being connected to the internet can have different meanings in different countries. For example in my home country of Iran (and in China and some other countries too), Facebook and some other popular websites are forbidden under the law, so being connected to the Internet does not mean being connected to Facebook, and vice versa. So, you have to use a website which is not forbidden in the country your app is going to be used, and then use the simple approach below:
Continue reading “How to Check Internet Connection Availability Using Qt/C++”How to Take Screenshots Using Qt
Qt allows you to easily grab an screenshot and save it using grabWindow function implemented in QScreen. Here is how you can use it:
Continue reading “How to Take Screenshots Using Qt”How to Record Videos Using OpenCV
In this post I am going to share a very simple but crucial parts of my QRecorder program which is recording images into videos. At the time of writing this article, Qt doesn’t allow recording of video files and OpenCV with its multi-platform support seems to be the best solution.
Continue reading “How to Record Videos Using OpenCV”How to Compress Files/Data Using Qt
File and data compression using Qt is extremely easy. There are many cases where you’d possibly like your data to be compressed (for example before sending it over network to a remote host) and in such cases you can use the approach below:
Continue reading “How to Compress Files/Data Using Qt”Use QGraphicsSepiaEffect to Add Sepia Effect Widgets
In this post I’m sharing a class called QGraphicsSepiaEffect that you can use to add Sepia effect to your Qt Widgets. It inherits QGraphicsEffect, which means you can easily add it to your project and use a single line of code to have Sepia effect on any widget or image (i.e. on a QLabel).
Continue reading “Use QGraphicsSepiaEffect to Add Sepia Effect Widgets”How to Apply Sepia Filter to Images Using OpenCV
You can use OpenCV to easily and quickly apply a Sepia filter to your images, as seen in these pictures. Here is how:
Continue reading “How to Apply Sepia Filter to Images Using OpenCV”How to Get the List of COM / ActiveX Controls
You can use ActiveX Control List application to get a complete list of currently installed and registered ActiveX (and COM of course) components that are available on the system.
Continue reading “How to Get the List of COM / ActiveX Controls”
How to Find a Website’s IP Address Using Qt/C++
QHostInfo class provides an static function (lookupHost) that you can use to get any host’s (including a website’s) IP address quickly and efficiently.
Here is an example of how you can get Google’s IP Address using Qt/C++:
Continue reading “How to Find a Website’s IP Address Using Qt/C++”How to Find Local IP Addresses in Qt
Below is the approach I use to get all of the IP addresses for the local computer. Note that this method also gives you all Subnet Masks which you can then use to find all IP addresses in a subnet, say for scanning a Home Network or any similar purpose.
Continue reading “How to Find Local IP Addresses in Qt”