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

WordPress image attachment is a little complicated thing. In a post that is inserted an image attachment, you can edit some attributes like alt text, height, width of the inserted […]

We usually use the following function to bind an event handler to a jQuery object on some event: $( “button” ).on(“click”, function(event){}); The .on method actually has another form: $( […]

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

We know an ordinary member function can not be defined multiple times. Suppose you have the following 3 files a.h, a.cpp, and main.cpp: //a.h #ifndef A_H #define A_H #include <iostream> […]

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