How to start/pause/resume/stop Qt thread?
If you’ve read my post Qt Thread, you should be able to run a task in a new thread now. But you may always want to do some controls on […]
If you’ve read my post Qt Thread, you should be able to run a task in a new thread now. But you may always want to do some controls on […]
An http request issued by firefox has the following headers. GET / HTTP/1.1\r\n Host: google.com\r\n User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:69.0) Gecko/20100101 Firefox/69.0\r\n Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\r\n Accept-Language: en-US,en;q=0.5\r\n Accept-Encoding: […]
Like other components of Qt, Qt Designer also proves the whole Qt stuff is developed by some amateurs. When you create a Qt widget project in Qt Creator, you are […]
The qDebug()<<“aaaaa” is working perfectly on Windows, but when I compile the same program on CentOS, it suddenly stops working. I cannot see anything displayed on the console. Why qDebug […]
The random number generation functions are always confusing. We often use the C rand() function to generate an integer number between 0 and RAND_MAX. We call it several times and […]
A null QString is an uninitialized QString while an empty QString is a QString initialized with an empty string(reference). QString s1; QString s2(“”); if(s1==s2) qDebug()<<“same”;//same else qDebug()<<“not same”; qDebug()<<s1.isNull();//true qDebug()<<s1.isEmpty();//true […]
QTexStream::readLine() function is a convenient function that can read a line from a file at a time. However, you must pay attention to so called new line. You may find […]
In this post, I talked about the best practice to use forward declaration or include file for a class: only include header files for base class and value member class […]
I used to putting all my code in one .cpp file. That is my style. Don’t be fooled by the “principles” and “theories” advocated by software engineering experts. Those “principles” […]
Today, I ran a program that connects to a database, then a window popped up: Meanwhile, the following error appeared on the console: QSqlDatabase: QMYSQL driver not loaded QSqlDatabase: available […]