Messagelib

webengineaccesskeyanchor.cpp
1/*
2 SPDX-FileCopyrightText: 2016-2024 Laurent Montel <montel@kde.org>
3
4 SPDX-License-Identifier: LGPL-2.0-or-later
5*/
6
7#include "webengineaccesskeyanchor.h"
8
9using namespace WebEngineViewer;
10
11WebEngineAccessKeyAnchor::WebEngineAccessKeyAnchor(const QVariant &result)
12{
13 initialize(result);
14}
15
16WebEngineAccessKeyAnchor::WebEngineAccessKeyAnchor() = default;
17
18void WebEngineAccessKeyAnchor::initialize(const QVariant &result)
19{
20 if (result.isValid()) {
21 const QVariantMap map = result.toMap();
22 const QVariantList &rect = map.value(QStringLiteral("boundingRect")).toList();
23 if (rect.size() == 4) {
24 mBoundingRect = QRect(rect.at(0).toInt(), rect.at(1).toInt(), rect.at(2).toInt(), rect.at(3).toInt());
25 }
26 mHref = map.value(QStringLiteral("src")).toString();
27 mAccessKey = map.value(QStringLiteral("accessKey")).toString();
28 mTarget = map.value(QStringLiteral("target")).toString();
29 mTagName = map.value(QStringLiteral("tagName")).toString();
30 mInnerText = map.value(QStringLiteral("text")).toString();
31 }
32}
33
34QString WebEngineAccessKeyAnchor::innerText() const
35{
36 return mInnerText;
37}
38
39QString WebEngineAccessKeyAnchor::tagName() const
40{
41 return mTagName;
42}
43
44QString WebEngineAccessKeyAnchor::target() const
45{
46 return mTarget;
47}
48
49QString WebEngineAccessKeyAnchor::href() const
50{
51 return mHref;
52}
53
54QString WebEngineAccessKeyAnchor::accessKey() const
55{
56 return mAccessKey;
57}
58
59QRect WebEngineAccessKeyAnchor::boundingRect() const
60{
61 return mBoundingRect;
62}
QFuture< void > map(Iterator begin, Iterator end, MapFunctor &&function)
bool isValid() const const
QMap< QString, QVariant > toMap() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 16:59:13 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.