label->setText("Here's some HTML with <a href='abc'>a couple</a> of <a href='def'>links</a>");
connect(label, SIGNAL(linkActivated(const QString&)), receiver, SLOT(doSomething(const QString&)));
void Receiver::doSomething(const QString& link)
{
// do something with 'link' which is either "abc" or "def"
}
label->setText("Here's some HTML with <a href='abc'>a couple</a> of <a href='def'>links</a>");
connect(label, SIGNAL(linkActivated(const QString&)), receiver, SLOT(doSomething(const QString&)));
void Receiver::doSomething(const QString& link)
{
// do something with 'link' which is either "abc" or "def"
}
To copy to clipboard, switch view to plain text mode
Bookmarks