1

I'm using Python and Qt to design a GUI. It saves images to a location on my network. When an image is saved, I'd like to set a QLabel's text to show a link to the file. This works, but nothing happens when I click the link.

self.lblOverlayFileName.setText('<a href="file://///server/share/file.txt">link</a>')

I've set the setOpenExternalLinks property of the QLabel to True, and links to local files work as well as links to internet URLs. But not URLs of this form. Any idea why?

benshepherd
  • 635
  • 7
  • 18
  • Bind the OnClick of the label to a function and open the browser from it? – Thomas Ayoub Oct 06 '15 at 08:28
  • Yes, I can do that. (A better way would be to detect the linkActivated signal, as I found [here](http://stackoverflow.com/questions/16581425/insert-clickable-link-in-qlabel-and-detect-click-on-this-link-to-provoke-an-acti).) But if there's a way to do it by just inserting some HTML, that would be nice. – benshepherd Oct 06 '15 at 08:31

0 Answers0