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.
This commit is contained in:
parent
3e32a9fcbf
commit
3bbda4803e
26 changed files with 74 additions and 62 deletions
26
frontend/components/UrlPushButton.cpp
Normal file
26
frontend/components/UrlPushButton.cpp
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
#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);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue