Commit 796de2ba authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Allow to copy element

parent aa05988c
......@@ -100,6 +100,7 @@ void WebHitTestResultPrivate::init(const QVariantMap &map)
if (!m_mediaUrl.isEmpty()) {
m_mediaUrl = m_pageUrl.resolved(m_mediaUrl);
}
m_isNull = false;
}
WebHitTestResult::WebHitTestResult()
: d(new WebHitTestResultPrivate)
......@@ -107,8 +108,8 @@ WebHitTestResult::WebHitTestResult()
}
WebHitTestResult::WebHitTestResult(const QPoint &pos, const QUrl &url, const QVariant &result)
: d(new WebHitTestResultPrivate(pos, url, result))
WebHitTestResult::WebHitTestResult(const QPoint &pos, const QUrl &pageUrl, const QVariant &result)
: d(new WebHitTestResultPrivate(pos, pageUrl, result))
{
}
......@@ -117,6 +118,15 @@ WebHitTestResult::~WebHitTestResult()
delete d;
}
WebHitTestResult &WebHitTestResult::operator=(const WebHitTestResult &other)
{
if (this != &other) {
d = other.d;
}
return *this;
}
QString WebHitTestResult::alternateText() const
{
return d->m_alternateText;
......@@ -181,3 +191,8 @@ QString WebHitTestResult::tagName() const
{
return d->m_tagName;
}
QUrl WebHitTestResult::pageUrl() const
{
return d->m_pageUrl;
}
......@@ -48,7 +48,7 @@ class MESSAGEVIEWER_EXPORT WebHitTestResult
{
public:
WebHitTestResult();
WebHitTestResult(const QPoint &pos, const QUrl &url, const QVariant &result);
WebHitTestResult(const QPoint &pos, const QUrl &pageUrl, const QVariant &result);
~WebHitTestResult();
QString alternateText() const;
......@@ -64,9 +64,11 @@ public:
bool mediaMuted() const;
QPoint pos() const;
QString tagName() const;
QUrl pageUrl() const;
WebHitTestResult &operator=(const WebHitTestResult &webHit);
private:
WebHitTestResultPrivate *const d;
WebHitTestResultPrivate *d;
};
}
Q_DECLARE_METATYPE(MessageViewer::WebHitTestResult)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment