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
qhelp_global.cpp
Go to the documentation of this file.
1
// Copyright (C) 2016 The Qt Company Ltd.
2
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
// Qt-Security score:critical reason:data-parser
4
5
#
include
"qhelp_global.h"
6
#
include
<
QtTools
/
qttools
-
config
.
h
>
7
8
#
include
<
QtCore
/
qcoreapplication
.
h
>
9
#
include
<
QtCore
/
qhash
.
h
>
10
#
include
<
QtCore
/
qmutex
.
h
>
11
#
if
QT_CONFIG
(
fullqthelp
)
12
#
include
<
QtGui
/
qtextdocument
.
h
>
13
#
endif
14
15
QT_BEGIN_NAMESPACE
16
17
using
namespace
Qt::StringLiterals;
18
19
QString QHelpGlobal::uniquifyConnectionName(
const
QString &name,
void
*pointer)
20
{
21
static
QMutex mutex;
22
QMutexLocker locker(&mutex);
23
static
QHash<QString, quint16> idHash;
24
return
QString::asprintf(
"%ls-%p-%d"
, qUtf16Printable(name), pointer, ++idHash[name]);
25
}
26
27
QString QHelpGlobal::documentTitle(
const
QString &content)
28
{
29
#
if
QT_CONFIG
(
fullqthelp
)
30
QString title = QCoreApplication::translate(
"QHelp"
,
"Untitled"
);
31
if
(!content.isEmpty()) {
32
const
int
start = content.indexOf(
"<title>"_L1
, 0, Qt::CaseInsensitive) + 7;
33
const
int
end = content.indexOf(
"</title>"_L1
, 0, Qt::CaseInsensitive);
34
if
((end - start) > 0) {
35
title = content.mid(start, end - start);
36
#
if
QT_CONFIG
(
texthtmlparser
)
37
if
(Qt::mightBeRichText(title) || title.contains(u'&')) {
38
QTextDocument doc;
39
doc.setHtml(title);
40
title = doc.toPlainText();
41
}
42
#
endif
43
}
44
}
45
return
title;
46
#
else
47
Q_UNUSED(content);
48
return
{};
49
#
endif
50
}
51
52
QT_END_NAMESPACE
QT_BEGIN_NAMESPACE
Combined button and popup list for selecting options.
Definition
qsequentialanimationgroup.cpp:47
qttools
src
assistant
help
qhelp_global.cpp
Generated on
for Qt by
1.18.0