Andrew Dormi
Andrew Dormi

Reputation: 119

Qt does not show images

Problem show in the link below: http://postimg.org/image/sp9mm85qb/

I try to add this image in code

    QIcon iconmain("qrc:/img/main.png");
    ui->tabWidget->tabBar()->setTabIcon(1,iconmain);

Tried to add image from resourse file from disk. But it still invisible.

Upvotes: 0

Views: 340

Answers (2)

Andrew Dormi
Andrew Dormi

Reputation: 119

Solved by changing msvs compil to mingv

Upvotes: 0

TheDarkKnight
TheDarkKnight

Reputation: 27611

I assume the image is in the resource file with the prefix img, so you would access it without the qrc text prefix: -

QIcon iconmain(":/img/main.png");

Upvotes: 1

Related Questions