试了一下在QT中真是非常方便地就实现了,只要几条语句
QLabel*openfilelabel=newQLabel(this);
//这句很关键啊,否则就只能通过linkActivated信号,连接到自定义槽函数中打开了
openfilelabel->setOpenExternalLinks(true);
openfilelabel->setText(tr("<a href=\"http://www.youkuaiyun.com/\">打开优快云"));
openfilelabel.show();
去掉 链接下面的下划线:
setText(QString::fromLocal8Bit("<style> a {text-decoration: none} </style> <a href =www.youkuaiyun.com> 更换头像</a>"));