how can I make a QLabel to behave like a link? What I mean is that I'd like to be able to click on it and then this would invoke some command on it.
See Question&Answers more detail:oshow can I make a QLabel to behave like a link? What I mean is that I'd like to be able to click on it and then this would invoke some command on it.
See Question&Answers more detail:osQLabel does this already.
Sample code:
myLabel->setText("<a href="http://example.com/">Click Here!</a>");
myLabel->setTextFormat(Qt::RichText);
myLabel->setTextInteractionFlags(Qt::TextBrowserInteraction);
myLabel->setOpenExternalLinks(true);