QPointF point(0, 0); if(point.isNull()){ qDebug() << "The point is null"; } else { qDebug() << "The point is not null"; }
QPointF point(10, 20); if(point.isNull()){ qDebug() << "The point is null"; } else { qDebug() << "The point is not null"; }This code creates a QPointF object with x and y coordinates set to 10 and 20 respectively. It then checks whether the object is null or not using the isNull() function. Since both coordinates are non-zero, the object is considered not null and the code outputs "The point is not null". Package library: Qt.