@@ -59,6 +59,7 @@ struct DocClassEntry
59
59
QString name;
60
60
QString fullName;
61
61
QString file;
62
+ bool nested = false ;
62
63
};
63
64
64
65
static bool classEntryLessThan (const DocClassEntry &e1 , const DocClassEntry &e2 )
@@ -255,7 +256,7 @@ static void readExtraDoc(const QFileInfo &fi,
255
256
auto dot = name.lastIndexOf (u' .' );
256
257
if (dot != -1 )
257
258
name.remove (0 , dot + 1 );
258
- docPackage->classPages .append ({name, fullClassName, newFileName});
259
+ docPackage->classPages .append ({name, fullClassName, newFileName, false });
259
260
}
260
261
extraTocEntries->append (fileNameToTocEntry (newFileName));
261
262
}
@@ -468,8 +469,9 @@ void QtDocGenerator::generateClassRecursion(TextStream &s, const QString &target
468
469
469
470
qCDebug (lcShibokenDoc, " Generating Documentation for %s" , qPrintable (metaClass->fullName ()));
470
471
472
+ const bool nested = metaClass->enclosingClass () != nullptr ;
471
473
m_packages[metaClass->package ()].classPages .append ({metaClass->name (), metaClass->fullName (),
472
- fileNameForContext (classContext)});
474
+ fileNameForContext (classContext), nested });
473
475
474
476
doGenerateClass (s, targetDir, metaClass);
475
477
@@ -1242,6 +1244,10 @@ void QtDocGenerator::writeModuleDocumentation()
1242
1244
QtXmlToSphinxImages parsedImages;
1243
1245
TextStream& s = output.stream ;
1244
1246
1247
+ TypeSystemTypeEntryCPtr typeSystemEntry = typeDb->findTypeSystemType (it.key ());
1248
+ Q_ASSERT (typeSystemEntry);
1249
+ const auto docMode = typeSystemEntry->docMode ();
1250
+
1245
1251
const QString &title = it.key ();
1246
1252
s << " .. module:: " << title << " \n\n " << headline (title, ' *' );
1247
1253
@@ -1281,8 +1287,10 @@ void QtDocGenerator::writeModuleDocumentation()
1281
1287
<< " :maxdepth: 1\n\n " ;
1282
1288
if (hasGlobals)
1283
1289
s << globalsPage << ' \n ' ;
1284
- for (const auto &e : std::as_const (docPackage.classPages ))
1285
- s << e.file << ' \n ' ;
1290
+ for (const auto &e : std::as_const (docPackage.classPages )) {
1291
+ if (!e.nested || docMode == TypeSystem::DocMode::Flat)
1292
+ s << e.file << ' \n ' ;
1293
+ }
1286
1294
s << " \n\n " << outdent << outdent << headline (" Detailed Description" );
1287
1295
1288
1296
// module doc is always wrong and C++istic, so go straight to the extra directory!
@@ -1324,10 +1332,7 @@ void QtDocGenerator::writeModuleDocumentation()
1324
1332
<< moduleDocumentation.qmlTypesUrl << " >`_\n\n " ;
1325
1333
}
1326
1334
1327
- TypeSystemTypeEntryCPtr typeSystemEntry = typeDb->findTypeSystemType (it.key ());
1328
- Q_ASSERT (typeSystemEntry);
1329
- writeFancyToc (s, " List of Classes" , classEntryListToToc (docPackage.classPages ,
1330
- typeSystemEntry->docMode ()),
1335
+ writeFancyToc (s, " List of Classes" , classEntryListToToc (docPackage.classPages , docMode),
1331
1336
" class" _L1);
1332
1337
writeFancyToc (s, " List of Decorators" , fileListToToc (docPackage.decoratorPages ),
1333
1338
" deco" _L1);
0 commit comments