Using hyperlinks to files in CommandInputs gives a weird result. Expected?

Using hyperlinks to files in CommandInputs gives a weird result. Expected?

chris.monachanZWSCF
Enthusiast Enthusiast
284 Views
0 Replies
Message 1 of 1

Using hyperlinks to files in CommandInputs gives a weird result. Expected?

chris.monachanZWSCF
Enthusiast
Enthusiast

I'm trying to have a hyper link to a file in the UI of my add-in.

 

The idea being that the user will click on the displayed hyperlink and Fusion will pass onto the OS the filename and it will do the correct thing for the URL. This works fine if the protocol is HTTP, it launches my default browser. For FILE I would expect it to launch whatever the associated application is with the file, as it does in a simple HTML page. Fusion does something odd. It seems to load the file.

 

I'm using...  <href=\"file:///%s\">%s</a>  (where the first is the filename+path and the second is just the filename) (This is C++ hence, the extra \ and %s being a token)

 

ahref_input1.png

 

If I click on this I get:

 

ahref_input2.png

 

Which is the start of an Excel document.  Note, that if I Right Mouse Button and select "Copy Link Location" the link it gives me is correct and if I paste that into a Windows Explorer window it correctly launches Excel in this case.

 

Is this behaviour documented somewhere? Can anyone suggest a way of doing what I'm trying to do?

 

I had a quick look at the QLabel (which I assume is the underline class, and it suggests that it should work, but I don't know how Fusion implements it's hyperlink controls so it's just a guess.

0 Likes
285 Views
0 Replies
Replies (0)