QLabel *label = new QLabel("Hello World!",this); label->setGeometry(10,10,100,20);
QPixmap pixmap("This code creates a QPixmap object from an image file specified by the path. It then creates a new QLabel object and sets its pixmap to the image. It adds the QLabel object to the current window. Both of these examples demonstrate the basic usage of QLabel in a Qt application. The package library that contains the QLabel class is the Qt Widgets module."); QLabel *label = new QLabel(this); label->setPixmap(pixmap);