Download Template Project – Qt for Android (with OpenCV)

I start Qt for Android projects all the time and setting up all the required folders and including libraries can take some time, assuming that I don’t make any mistakes during the initialization of the project. Previously I had posted this about how to add OpenCV libraries to your Qt for Android project but it proved to be not enough and I also receive questions about how to create a correct project with OpenCV all the time.

Continue reading “Download Template Project – Qt for Android (with OpenCV)”

How to add Permissions to your Qt Android app

Whether you want to use GPS or Compass, Camera or the Internet, you will need to add permissions to your Qt app for Android because Android API uses a permission system for security reasons. It actually has other benefits such as helping with monitoring and app statistics and so on but I’m not going to discus that in this post.

If you need to add permissions to your Qt Android app then follow these steps.

Continue reading “How to add Permissions to your Qt Android app”

How to use VBScript in C++ (Using Qt)

In this article I’ll explain the process of combining C++ and VBScript codes together. There are many situations in which you find yourself in desperate need of some simple code that can handle what your program wants to do. An example that comes to my mind is using DDE Protocol in Windows. It can be heartbreaking to try and write a quick DDE handling program using C++. Well on the other hand it is extremely easy using VBScript. But I am not going to talk about DDE I this post. Search Google for “how to connect to DDE using VBScript” and combine that with what you learn from this post. So here it is:

Continue reading “How to use VBScript in C++ (Using Qt)”

How to make an application “Alway on Top” in C++ (For Qt and Win32)

I use the following method to make an application remain on top of other windows in Qt:

SetWindowPos
(
	(HWND)winId(),
	HWND_TOPMOST,
	window_top_pos,
	window_left_pos,
	window_width,
	window_height,
	SWP_SHOWWINDOW
);


Note that window_top_pos, window_left_pos, window_width and window_height are variables and you can replace them with your own.

Please be aware that this is a Win32 API function so it won’t work in Linux or MAC.

Don’t forget to add the include file to your code.

#include "windows.h"

And add the required library to your .PRO file.

LIBS += -luser32


How to use FTP in Qt (for Windows)

If you are in a situation that you want to upload a file to a FTP server or delete, rename, copy some files on a FTP server in your Qt programs there are no definite choices anywhere. At least that is the case with Qt 5.5. You usually have to use a platform dependent library. So here it is. I use this library when I need FTP access in Qt for Windows. It uses Windows API therefore you won’t be able to use this in Linux or MAC. Download from the link provided below (you may have to register at codeproject.com) and follow the steps to be able to use it in your Qt programs.

Continue reading “How to use FTP in Qt (for Windows)”