You can use the following approach to get a Window‘s Handle in Qt. This can be useful in case you need to call a Windows API (Win32 API) function that is not implemented in Qt or for any other purposes.
Continue reading “How to Get Window Handle (HWND) in Qt”What you need to know about LPCTSTR in Windows API (Specially for Qt users)
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.
Continue reading “What you need to know about LPCTSTR in Windows API (Specially for Qt users)”How to Convert QString to Wide C String (wchar_t *)
The same as standard C String, for this also you can go through standard C++ as shown below:
Let’s say you have a QString, like this:
QString s = "www.amin-ahmadi.com";
First convert it to std::wstring and then use its c_str method, like this:
s.toStdWString().c_str()
How to convert QString to C String (char *)
The best solution for this would be to go through standard C++ and it means this:
Let’s say you have a QString, like this:
QString s = "www.amin-ahmadi.com";
First convert it to std::string and then use its c_str method, like this:
s.toStdString().c_str()
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”How to make QScroller grabGesture work with QDialog
If you have tried this then you have definitely noticed that it becomes very annoying when you want to use QScroller::grabGesture with QDialogs that are opened using exec and have used QScroller::grabGesture in the calling (parent) window or dialog.
Continue reading “How to make QScroller grabGesture work with QDialog”
Which programming language should I learn?
This question comes up all the time and to be honest there is no definite answer to this question. To be able to point out in a direction for anyone who is asking “Which programming language should I learn?” , “Which one is the best programming language?” or so one has to understand the types of programming languages.
Continue reading “Which programming language should I learn?”
Cardiograph v1.0 Released!
Today I released the first version of Cardiograph program. It is a program that allows you to measure (monitor) your heart rate using your computer’s webcam. It is designed to be simple and accurate. Currently only Windows is supported but hopefully more operating systems will be supported in the future.
Head to Cardiograph Official Page to download and try it for yourself.
Below are screenshots of Cardiograph in action:
Let me know if you face any issues.
How to Get Windows 10 Product Key from Command Prompt
You can use the following method to get your Windows 10 Product Key. This can be useful specially if you are dealing with a pre-installed Windows or you have upgraded to Windows 10 from Windows 7, 8 or 8.1 and for any reason you need to know the product key.
Continue reading “How to Get Windows 10 Product Key from Command Prompt”How to Convert Unreadable Binary to Readable QString
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 string.
Continue reading “How to Convert Unreadable Binary to Readable QString”