QPushButton* my_button = new QPushButton("Click me!"); my_button->setObjectName("myButton");
QLabel* my_label = new QLabel("Hello, world!"); my_label->setObjectName("myLabel");This example creates a QLabel object with the text "Hello, world!" and sets its object name to "myLabel". Package library: Qt