Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Toggle main menu visibility
Loading...
Searching...
No Matches
hrefresolver.h
Go to the documentation of this file.
1
// Copyright (C) 2026 The Qt Company Ltd.
2
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
3
4
#
ifndef
QDOC_HREFRESOLVER_H
5
#
define
QDOC_HREFRESOLVER_H
6
7
#
ifdef
QDOC_TEMPLATE_GENERATOR_ENABLED
8
9
#
include
"inclusionpolicy.h"
10
11
#
include
<
QtCore
/
qstring
.
h
>
12
13
#
include
<
functional
>
14
#
include
<
variant
>
15
16
QT_BEGIN_NAMESPACE
17
18
class
LocationPlan;
19
class
LocationPlanSet;
20
class
Node;
21
class
QmlTypeNode;
22
struct
OutputContext;
23
24
enum
class
HrefSuppressReason {
25
NullNode,
26
NoFileBase,
27
ExcludedByPolicy,
28
InternalAbstractQml,
29
SameFileAnchor,
30
Unpublished,
31
};
32
33
using
HrefResult = std::variant<QString, HrefSuppressReason>;
34
35
struct
HrefResolverConfig
36
{
37
const
OutputContext *context{
nullptr
};
38
const
LocationPlan *plan{
nullptr
};
39
const
LocationPlanSet *publications{
nullptr
};
40
QString format;
41
InclusionPolicy inclusionPolicy;
42
std::function<
const
QmlTypeNode *()> qmlTypeContextFn;
43
};
44
45
class
HrefResolver
46
{
47
public
:
48
explicit
HrefResolver(
const
HrefResolverConfig &config);
49
50
[[nodiscard]] HrefResult hrefForNode(
const
Node *node,
const
Node *relative)
const
;
51
[[nodiscard]] QString anchorForNode(
const
Node *node)
const
;
52
[[nodiscard]] QString fileName(
const
Node *node)
const
;
53
54
private
:
55
[[nodiscard]] QString crossModulePrefix(
const
Node *target,
const
Node *source)
const
;
56
57
HrefResolverConfig m_config;
58
};
59
60
QT_END_NAMESPACE
61
62
#
endif
// QDOC_TEMPLATE_GENERATOR_ENABLED
63
64
#
endif
// QDOC_HREFRESOLVER_H
qttools
src
qdoc
qdoc
src
qdoc
hrefresolver.h
Generated on
for Qt by
1.18.0