diff options
author | Renato Araujo Oliveira Filho <renato.araujo@kdab.com> | 2020-04-16 10:24:07 -0300 |
---|---|---|
committer | Renato Araujo Oliveira Filho <renato.araujo@kdab.com> | 2020-09-02 10:48:12 -0300 |
commit | b3b9a9714c0f1199d547854be6d2d47a9268d444 (patch) | |
tree | 0ebfb4d3e069f4caa9f717c641414119d2f4b6c0 /sources/shiboken2/ApiExtractor/abstractmetalang.cpp | |
parent | 61d1a5af4e6f17da32e302023b8a4358bccf5863 (diff) |
Add support for briefdescription in doxygen parse
Extract briefdescription from doxygen files and make sure to
generate sphinx docs with it
Change-Id: Ibd2b104a2c85de6c3db1e8a48add061c804bd489
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'sources/shiboken2/ApiExtractor/abstractmetalang.cpp')
-rw-r--r-- | sources/shiboken2/ApiExtractor/abstractmetalang.cpp | 45 |
1 files changed, 44 insertions, 1 deletions
diff --git a/sources/shiboken2/ApiExtractor/abstractmetalang.cpp b/sources/shiboken2/ApiExtractor/abstractmetalang.cpp index 8e1f0d7e5..9d770284a 100644 --- a/sources/shiboken2/ApiExtractor/abstractmetalang.cpp +++ b/sources/shiboken2/ApiExtractor/abstractmetalang.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2019 The Qt Company Ltd. +** Copyright (C) 2020 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of Qt for Python. @@ -88,6 +88,49 @@ const AbstractMetaClass *recurseClassHierarchy(const AbstractMetaClass *klass, } /******************************************************************************* + * Documentation + */ + +Documentation::Documentation(const QString &value, Documentation::Type t, Documentation::Format fmt) +{ + setValue(value, t, fmt); +} + +bool Documentation::isEmpty() const +{ + for (int i = 0; i < Type::Last; i++) { + if (!m_data.value(static_cast<Type>(i)).isEmpty()) + return false; + } + return true; +} + +QString Documentation::value(Documentation::Type t) const +{ + return m_data.value(t); +} + +void Documentation::setValue(const QString &value, Documentation::Type t, Documentation::Format fmt) +{ + const QString v = value.trimmed(); + if (v.isEmpty()) + m_data.remove(t); + else + m_data[t] = value.trimmed(); + m_format = fmt; +} + +Documentation::Format Documentation::format() const +{ + return m_format; +} + +void Documentation::setFormat(Documentation::Format f) +{ + m_format = f; +} + +/******************************************************************************* * AbstractMetaVariable */ |