File: url-push-button.cpp

package info (click to toggle)
obs-studio 30.2.3%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 47,852 kB
  • sloc: ansic: 202,137; cpp: 112,402; makefile: 868; python: 599; sh: 275; javascript: 19
file content (26 lines) | stat: -rw-r--r-- 433 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#include "url-push-button.hpp"

#include <QUrl>
#include <QMouseEvent>
#include <QDesktopServices>

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);
}