yolobs-studio/UI/url-push-button.hpp
2020-03-25 09:07:22 +01:00

20 lines
397 B
C++

#pragma once
#include <QPushButton>
#include <QUrl>
class UrlPushButton : public QPushButton {
Q_OBJECT
Q_PROPERTY(QUrl targetUrl READ targetUrl WRITE setTargetUrl)
public:
inline UrlPushButton(QWidget *parent = nullptr) : QPushButton(parent) {}
void setTargetUrl(QUrl url);
QUrl targetUrl();
protected:
void mousePressEvent(QMouseEvent *event) override;
private:
QUrl m_targetUrl;
};