Home > other >  On the issue of the label shows the tif format images, help ah ~
On the issue of the label shows the tif format images, help ah ~

Time:04-20

I just contact with qt, when doing a project of the UI, need to load the tif format images, I use the label and the success of the load JPG, BMP file, such as, according to the label successfully but load the tif file, the label have no reaction, no display picture, picture part of the code is as follows: copying code openFileName=QFileDialog: : getOpenFileName (this, tr (" Open Image "), "/home/picture", the tr (" Image Files (*. PNG *. Tif *. JPG *. BMP) "));//open the file if (! OpenFileName. IsEmpty ()) label - & gt; SetText (" current file: "+ openFileName);//for a state of label label_2 - & gt; SetPixmap (QPixmap (openFileName));//is here, if is the tif image, will not be able to show that if the other format pictures can. ScrollArea - & gt; SetWidget (label_2);//the scrollbar scrollArea - & gt; Show (); New to qt, please comment ~ 3 q3q3q ~ ~

CodePudding user response:

The building Lord solved
  • Related