The example project that I am going to share in this post is the absolute beginner guide version of using OpenGL in Qt (Specially Qt5 and latest versions of OpenGL) which to my surprise I could not find anywhere. By checking the existing OpenGL examples in Qt I noticed they all make some assumptions about […]
In this article I am going to describe the required steps needed for accessing Android Camera (or Default Camera Interface) using Qt. Unfortunately OpenCV does not provide a reliable way of connecting to Camera in Android so you have go for a method like this if you intend to write an Android application which uses OpenCV […]
There are scenarios where you would need to find the sum or the average of all values in a QByteArray. This can specially happen if you are trying to send data using COM ports to devices that require the average or sum (or a similar combination) of all elements in order to check the integrity […]
You can convert QBuffer to QString using buffer function of the QBuffer. Here is how you can do it. QBuffer b; b.open(QBuffer::ReadWrite); b.write(“http://amin-ahmadi.com”); QString str = b.buffer(); qDebug() << str; // “http://amin-ahmadi.com” b.close();
Qt Framework includes a class called QBuffer that can be used to access a QByteArray (internal QByteArray to be precise) as if it is a file. So you can use Stream readers and writers to access data in it similar to a QFile.
In this post I am going to share the source code and explain a very simple example project that can be used as a starting point for anyone who wants to begin using OpenGL in Qt. As it is seen in the picture, this program draws a single place on the screen and allows you to […]
Qt provides QSplashScreen class in case you want to have a splash screen for your application without any efforts. You can use the approach below to add an splash screen image of your choice using QSplashScreen and QPixmap classes that stays for 1 second and then disappears.
This question comes up a lot and is sometimes very confusing but if you just pay attention for a few seconds you’ll get past this forever, I promise you.
Web developers are quite familiar with Base64 and its usage. To put it simply, whenever to want to store, transfer (send or receive) or do anything else with the contents of a binary file (in this example, an image file) you can use Base64 encoding to simplify things by converting unreadable binary contents to a readable […]
Qt does not have mouse hover, or mouse over (as some people call it) events in its widgets by default but it provides the means to do it quite easily if you just know how to inherit a class and add some protected functions to it. Here is an example that shows how to create […]