This commit is contained in:
Chenwenxuan
2024-03-06 14:54:30 +08:00
commit edac2715f0
1525 changed files with 809982 additions and 0 deletions

25
ui/generic/linklist.cpp Normal file
View File

@@ -0,0 +1,25 @@
#include "linklist.h"
#include <QDesktopServices>
#include <QUrl>
LinkList::LinkList(QWidget* parent)
: QListWidget(parent)
{
connect(this, SIGNAL(itemActivated(QListWidgetItem*)),
this, SLOT(showWebPage(QListWidgetItem*)));
}
void LinkList::addLink(const QString& text, const QString& url)
{
auto item = new QListWidgetItem;
item->setText(text);
item->setToolTip(url);
addItem(item);
}
void LinkList::showWebPage(QListWidgetItem* item)
{
QDesktopServices::openUrl(QUrl(item->toolTip()));
}