better url handling
Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
This commit is contained in:
parent
f0aab541f8
commit
93870c315f
@ -46,7 +46,7 @@
|
|||||||
void setupLinkToolTip(QLabel* label)
|
void setupLinkToolTip(QLabel* label)
|
||||||
{
|
{
|
||||||
QObject::connect(label, &QLabel::linkHovered, [label](const QString& link) {
|
QObject::connect(label, &QLabel::linkHovered, [label](const QString& link) {
|
||||||
if (!link.isEmpty() && !link.startsWith("http"))
|
if (auto url = QUrl(link); !url.isValid() || (url.scheme() != "http" && url.scheme() != "https"))
|
||||||
return;
|
return;
|
||||||
label->setToolTip(link);
|
label->setToolTip(link);
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user