summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--generators/qtdoc/qtdocgenerator.cpp59
-rw-r--r--generators/qtdoc/qtdocgenerator.h1
2 files changed, 32 insertions, 28 deletions
diff --git a/generators/qtdoc/qtdocgenerator.cpp b/generators/qtdoc/qtdocgenerator.cpp
index 52a0bf9..91d2f2b 100644
--- a/generators/qtdoc/qtdocgenerator.cpp
+++ b/generators/qtdoc/qtdocgenerator.cpp
@@ -1007,6 +1007,9 @@ void QtDocGenerator::generateClass(QTextStream& s, const AbstractMetaClass* meta
void QtDocGenerator::writeFunctionList(QTextStream& s, const AbstractMetaClass* cppClass)
{
QStringList functionList;
+ QStringList virtualList;
+ QStringList signalList;
+ QStringList slotList;
QStringList staticFunctionList;
foreach (AbstractMetaFunction* func, cppClass->functions()) {
@@ -1020,7 +1023,6 @@ void QtDocGenerator::writeFunctionList(QTextStream& s, const AbstractMetaClass*
className = getClassTargetFullName(func->implementingClass()->enclosingClass()) + '.';
QString funcName = getFuncName(func);
- QStringList& list = func->isStatic() ? staticFunctionList : functionList;
QString str("def :meth:`");
str += funcName;
@@ -1032,7 +1034,16 @@ void QtDocGenerator::writeFunctionList(QTextStream& s, const AbstractMetaClass*
str += parseArgDocStyle(cppClass, func);
str += ')';
- list << str;
+ if (func->isStatic())
+ staticFunctionList << str;
+ else if (func->isVirtual())
+ virtualList << str;
+ else if (func->isSignal())
+ signalList << str;
+ else if (func->isSlot())
+ slotList << str;
+ else
+ functionList << str;
}
if ((functionList.size() > 0) || (staticFunctionList.size() > 0)) {
@@ -1042,36 +1053,28 @@ void QtDocGenerator::writeFunctionList(QTextStream& s, const AbstractMetaClass*
s << "Synopsis" << endl
<< "--------" << endl << endl;
- if (functionList.size() > 0) {
- s << "Functions" << endl
- << "^^^^^^^^^" << endl << endl;
-
- qSort(functionList);
- foreach (QString func, functionList) {
- row << func;
- functionTable << row;
- row.clear();
- }
+ writeFunctionBlock(s, "Functions", functionList);
+ writeFunctionBlock(s, "Virtual functions", virtualList);
+ writeFunctionBlock(s, "Slots", slotList);
+ writeFunctionBlock(s, "Signals", signalList);
+ writeFunctionBlock(s, "Static functions", staticFunctionList);
+ }
+}
- functionTable.normalize();
- s << functionTable << endl;
- functionTable.clear();
- }
+void QtDocGenerator::writeFunctionBlock(QTextStream& s, const QString& title, QStringList& functions)
+{
+ if (functions.size() > 0) {
+ s << title << endl
+ << QString('^').repeated(title.size()) << endl;
- if (staticFunctionList.size() > 0) {
- s << "Static functions" << endl
- << "^^^^^^^^^^^^^^^^" << endl;
+ qSort(functions);
- qSort(staticFunctionList);
- foreach (QString func, staticFunctionList) {
- row << func;
- functionTable << row;
- row.clear();
- }
+ s << ".. container:: function_list" << endl << endl;
+ Indentation indentation(INDENT);
+ foreach (QString func, functions)
+ s << '*' << INDENT << func << endl;
- functionTable.normalize();
- s << functionTable << endl;
- }
+ s << endl << endl;
}
}
diff --git a/generators/qtdoc/qtdocgenerator.h b/generators/qtdoc/qtdocgenerator.h
index f880557..fc8c82b 100644
--- a/generators/qtdoc/qtdocgenerator.h
+++ b/generators/qtdoc/qtdocgenerator.h
@@ -200,6 +200,7 @@ private:
void writeFunction(QTextStream& s, bool writeDoc, const AbstractMetaClass* cppClass, const AbstractMetaFunction* func);
void writeFunctionParametersType(QTextStream &s, const AbstractMetaClass *cppClass, const AbstractMetaFunction* func);
void writeFunctionList(QTextStream& s, const AbstractMetaClass* cppClass);
+ void writeFunctionBlock(QTextStream& s, const QString& title, QStringList& functions);
void writeParamerteType(QTextStream &s, const AbstractMetaClass *cppClass, const AbstractMetaArgument *arg);
void writeConstructors(QTextStream &s, const AbstractMetaClass *cppClass);