You are not logged in.

1

Friday, June 16th 2017, 9:35am

pushButton->setIcon(ButtonIcon) not working on different machines

Hey guys

I am using the following code for modification of a button icon at runtime:

Source code

1
2
3
4
5
6
7
8
9
void MainWindow::on_pushButton_7_clicked(){
    QString fileName = QFileDialog::getOpenFileName(this, "Bildquelle wählen", QDir::currentPath(), "Images (*.jpg)");
    QPixmap pixmap(fileName);
    if (!pixmap){
        meldung("Could not load picture!");
    }
    QIcon ButtonIcon(pixmap);
    ui->pushButton_5->setIcon(ButtonIcon);
}


On my developing computer it works fine. But when I install the app on another computer, the picture is not displayed. My error message (meldung()) is kicked.
On the original machine the picture loads and there is no message.
What am I doing wrong?

Thomas