Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
linkir.h
Go to the documentation of this file.
1// Copyright (C) 2025 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 LINKIR_H
5#define LINKIR_H
6
7#include <QJsonObject>
8#include <QString>
9
10QT_BEGIN_NAMESPACE
11
12struct LinkIR
13{
14 QString target; //! Pre-resolved URL or anchor
15 QString text; //! Display text for the link
16 QString title; //! Optional title/tooltip attribute
17
18 enum class State : unsigned char {
19 Resolved,
20 External,
21 Unresolved,
22 Broken
23 };
24
25 State state{State::Resolved};
26
27 QString originalTarget;
28
29 [[nodiscard]] QJsonObject toJson() const;
30
31 [[nodiscard]] bool isValid() const { return !target.isEmpty() || state == State::Unresolved; }
32 [[nodiscard]] bool isResolved() const { return state == State::Resolved; }
33 [[nodiscard]] bool isExternal() const { return state == State::External; }
34};
35
37
38#endif // LINKIR_H
Combined button and popup list for selecting options.