qt

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 […]

QSqlDatabase: QMYSQL driver not loaded

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 […]