I'm trying to create a QLabel icon with qpixmap. This is my function:
void myClass::myFunction()
{
QPixmap on_icon(":/path");
ui.label_1.setPixmap(on_icon);
}
My problem is I can use on_icon only in myFunction. How can I use it on different functions like :
void myClass::myOtherFunction()
{
ui.label_2.setPixmap(on_icon);
}