PDA

View Full Version : QUrl with user-defined structure



csoler
5th April 2010, 11:29
I use in my application internal links to copy/paste information about files (my app is a file exchange client). My links have this format:

retroshare://file|foo.jpg|437893|4ee098abf...ea00

...which should be read as name|size|md5 hash.
Such links are written in html in my QTextBrowser widgets, under the following form:

<a href="retroshare://file|foo.jpg|437893|4ee098abf...ea00">foo.jpg (420 Kb)</a>

Now, in the QTextBrowser widgets, I have connected the anchorClicked(QUrl&) signal to a slot handleMyUrl(QUrl&). the slot reads the url.toString() and parses it to get the info. This slot then transfers the files, or does whatever is needed.

This works like a charm in Qt4.5: the links appear in blue, and when I click on them, the slot receives the correct url, parses it, and does the thing.

But in Qt 4.6, the slot connected to anchorClicked(QUrl&) receives the truncated chain "retroshare:" as an url. Which obviously cannot be further interpreted.

Is this a bug of Qt 4.6 ?? Or am I missing something ?

Any advice is appreciated.
Thanks!!
Cyril