Hi, I am trying to get an image to display on a button. The code belows does the job
void Form1::init() {
pushButton1->setPixmap(QPixmap::fromMimeSource("ulquarter4.jpg "));
.
.
.
}
However, I'd like to be able to use a pixmap variable instead. After declaring QPixmap *Pixmap 1 as a private member, I tried the following:
void Form1::init() {
*Pixmap1 = QPixmap::fromMimeSource("ulquarter4.jpg);
pushButton1->setPixmap(*Pixmap1);
.
.
.
}
It compiled without errors in the command prompt, but when I tried to execute it, I got a popup dialog box declaring that there was an error trying to open the executable.
Can anyone help me?
Bookmarks