mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
340a313fea
Show clickable links in the channel feed message. git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@4923 b45a01b8-16f6-495d-af2f-9b41ad6348cc
20 lines
500 B
C++
20 lines
500 B
C++
#include <QDesktopServices>
|
|
|
|
#include "LinkTextBrowser.h"
|
|
|
|
LinkTextBrowser::LinkTextBrowser(QWidget *parent) :
|
|
QTextBrowser(parent)
|
|
{
|
|
setOpenExternalLinks(true);
|
|
setOpenLinks(false);
|
|
|
|
connect(this, SIGNAL(anchorClicked(QUrl)), this, SLOT(linkClicked(QUrl)));
|
|
}
|
|
|
|
void LinkTextBrowser::linkClicked(const QUrl &url)
|
|
{
|
|
// some links are opened directly in the QTextBrowser with open external links set to true,
|
|
// so we handle links by our own
|
|
QDesktopServices::openUrl(url);
|
|
}
|