Qt链接网站SLOT

void BottomToolWidget::openLink()
{
    QString link = "http://www.baidu.com";//在.h中添加slot声明,在此更改链接网址
#ifdef Q_OS_WIN
    wchar_t *cmd = L"open";
    wchar_t w_link[512];
    memset(w_link, 0, sizeof(wchar_t)*512);
    link.toWCharArray(w_link);
    ShellExecute(NULL, cmd, w_link, NULL,NULL, SW_SHOW);
#endif
}
posted @ 2015-01-07 14:39  田陌允  阅读(190)  评论(0)    收藏  举报