tabWidget" /> tabWidget" /> tabWidget"/>

Qt does not show images

330 views Asked by At

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.

2

There are 2 answers

0
Andrew Dormi On BEST ANSWER

Solved by changing msvs compil to mingv

0
TheDarkKnight On

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");