obs-studio/frontend/components/UrlPushButton.cpp
PatTheMav 3bbda4803e
frontend: Add renamed Qt UI components
This commit only contains Qt UI components that are self-contained,
i.e. the translation units only contain code for a single class or
interface and don't mix implementations.
2025-01-08 15:36:54 +01:00

27 lines
426 B
C++

#include "UrlPushButton.hpp"
#include <QDesktopServices>
#include "moc_UrlPushButton.cpp"
void UrlPushButton::setTargetUrl(QUrl url)
{
setToolTip(url.toString());
m_targetUrl = url;
}
QUrl UrlPushButton::targetUrl()
{
return m_targetUrl;
}
void UrlPushButton::mousePressEvent(QMouseEvent *event)
{
Q_UNUSED(event)
QUrl openUrl = m_targetUrl;
if (openUrl.isEmpty())
return;
QDesktopServices::openUrl(openUrl);
}