diff options
-rw-r--r-- | sources/pyside2/doc/CMakeLists.txt | 1 | ||||
-rw-r--r-- | sources/pyside2/doc/additionaldocs.lst | 583 | ||||
-rw-r--r-- | sources/shiboken2/generator/qtdoc/qtdocgenerator.cpp | 96 | ||||
-rw-r--r-- | sources/shiboken2/generator/qtdoc/qtdocgenerator.h | 9 |
4 files changed, 685 insertions, 4 deletions
diff --git a/sources/pyside2/doc/CMakeLists.txt b/sources/pyside2/doc/CMakeLists.txt index e40602b97..5b2ab224e 100644 --- a/sources/pyside2/doc/CMakeLists.txt +++ b/sources/pyside2/doc/CMakeLists.txt @@ -94,6 +94,7 @@ add_custom_target("docrsts" --output-directory=${CMAKE_CURRENT_BINARY_DIR}/rst --documentation-code-snippets-dir=${CMAKE_CURRENT_SOURCE_DIR}/codesnippets/doc/src/snippets${PATH_SEP}${CMAKE_CURRENT_SOURCE_DIR}/codesnippets/examples --documentation-extra-sections-dir=${CMAKE_CURRENT_SOURCE_DIR}/extras + --additional-documentation=${CMAKE_CURRENT_LIST_DIR}/additionaldocs.lst ${CMAKE_CURRENT_BINARY_DIR}/typesystem_doc.xml WORKING_DIRECTORY ${${module}_SOURCE_DIR} COMMENT "Running generator to generate documentation..." diff --git a/sources/pyside2/doc/additionaldocs.lst b/sources/pyside2/doc/additionaldocs.lst new file mode 100644 index 000000000..057464df9 --- /dev/null +++ b/sources/pyside2/doc/additionaldocs.lst @@ -0,0 +1,583 @@ +############################################################################# +## +## Copyright (C) 2018 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the Qt for Python project. +## +## $QT_BEGIN_LICENSE:LGPL$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU Lesser General Public License Usage +## Alternatively, this file may be used under the terms of the GNU Lesser +## General Public License version 3 as published by the Free Software +## Foundation and appearing in the file LICENSE.LGPL3 included in the +## packaging of this file. Please review the following information to +## ensure the GNU Lesser General Public License version 3 requirements +## will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 2.0 or (at your option) the GNU General +## Public license version 3 or any later version approved by the KDE Free +## Qt Foundation. The licenses are as published by the Free Software +## Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-2.0.html and +## https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +# This is a list of additional documentation files created by the below script +# and some hand-editing. +# for F in *.webxml +# do +# echo "$F" | egrep '(-index)|(-module)|(-qmlmodule)\.webxml$' > /dev/null +# if [ $? -ne 0 ] +# then +# if fgrep '<para>' "$F" > /dev/null # Exclude reference only +# then +# egrep "(<class )|(<namespace )" $F > /dev/null || echo $F +# fi +# fi +# done + +animation-overview.webxml +animation.webxml +application-windows.webxml +audiooverview.webxml +bearer-management.webxml +cameraoverview.webxml +# changes.webxml +codec-big5.webxml +codec-big5hkscs.webxml +codec-eucjp.webxml +codec-euckr.webxml +codec-gbk.webxml +codec-sjis.webxml +codec-tscii.webxml +codecs-jis.webxml +compatmap.webxml +# containers.webxml +coordsys.webxml +creating-a-sensor-plugin.webxml +custom-types.webxml +datastreamformat.webxml +datavisualization-examples.webxml +determining-the-default-sensor-for-a-type.webxml +dialogs.webxml +dnd.webxml +dynamic-sensor-backend-registration.webxml +events.webxml +eventsandfilters.webxml +examples-desktop.webxml +examples-dialogs.webxml +examples-graphicsview.webxml +examples-itemviews.webxml +examples-mainwindow.webxml +examples-network.webxml +examples-painting.webxml +examples-qthelp.webxml +examples-qtuitools.webxml +examples-richtext.webxml +examples-widgets-opengl.webxml +examples-widgets.webxml +focus.webxml +gallery.webxml +genericbackend.webxml +gestures-overview.webxml +graphicsview.webxml +guibooks.webxml +helpsystem.webxml +implicit-sharing.webxml +io-functions.webxml +io.webxml +json.webxml +layout.webxml +location-cpp-qml.webxml +location-maps-cpp.webxml +location-maps-qml.webxml +location-places-backend.webxml +location-places-cpp.webxml +location-places-qml.webxml +location-plugin-esri.webxml +location-plugin-here.webxml +location-plugin-itemsoverlay.webxml +location-plugin-mapbox.webxml +location-plugin-mapboxgl.webxml +location-plugin-osm.webxml +location-positioning-cpp.webxml +location-positioning-qml.webxml +mainwindow.webxml +metaobjects.webxml +model-view-programming.webxml +modelview.webxml +multimedia-examples.webxml +multimediabackend.webxml +multimediaoverview.webxml +object.webxml +objecttrees.webxml +painting.webxml +paintsystem-devices.webxml +paintsystem-drawing.webxml +paintsystem-images.webxml +paintsystem.webxml +pdf-licensing.webxml +plugins.webxml +positioning-cpp-qml.webxml +properties.webxml +qfloat16.webxml +qml-advtutorial.webxml +qml-dynamicview-tutorial.webxml +qml-location5-maps.webxml +qml-multimedia.webxml +qml-qtlocation5-maps.webxml +qml-tutorial.webxml +qml-tutorial1.webxml +qml-tutorial2.webxml +qml-tutorial3.webxml +qmlexampletoggleswitch.webxml +qt3d-advancedcustommaterial-example.webxml +qt3d-audio-visualizer-qml-example.webxml +qt3d-basicshapes-cpp-example.webxml +qt3d-cpp.webxml +qt3d-examples.webxml +qt3d-multiviewport-example.webxml +qt3d-overview.webxml +qt3d-pbr-materials-example.webxml +qt3d-planets-qml-example.webxml +qt3d-qml.webxml +qt3d-scene2d-example.webxml +qt3d-scene3d-example.webxml +qt3d-shadow-map-qml-example.webxml +qt3d-simple-cpp-example.webxml +qt3d-simple-qml-example.webxml +qt3d-simplecustommaterial-example.webxml +qt3d-wave-example.webxml +qt3d-widgets-scene3d-example.webxml +qt3d-wireframe-example.webxml +qt3drender-framegraph.webxml +qt3drender-geometry.webxml +qt3drender-protips.webxml +qtalgorithms.webxml +qtconcurrent-imagescaling-example.webxml +qtconcurrent-map-example.webxml +qtconcurrent-progressdialog-example.webxml +qtconcurrent-runfunction-example.webxml +qtconcurrent-wordcount-example.webxml +qtconcurrentfilter.webxml +qtconcurrentmap.webxml +qtconcurrentrun.webxml +qtcore-ipc-localfortuneclient-example.webxml +qtcore-ipc-localfortuneserver-example.webxml +qtcore-ipc-sharedmemory-example.webxml +qtcore-mimetypes-mimetypebrowser-example.webxml +qtcore-serialization-savegame-example.webxml +qtcore-threads-mandelbrot-example.webxml +qtcore-threads-queuedcustomtype-example.webxml +qtcore-threads-semaphores-example.webxml +qtcore-threads-waitconditions-example.webxml +qtcore-tools-contiguouscache-example.webxml +qtcore-tools-customtype-example.webxml +qtdatavisualization-audiolevels-example.webxml +qtdatavisualization-bars-example.webxml +qtdatavisualization-custominput-example.webxml +qtdatavisualization-customitems-example.webxml +qtdatavisualization-customproxy-example.webxml +qtdatavisualization-data-handling.webxml +qtdatavisualization-draggableaxes-example.webxml +qtdatavisualization-interacting-with-data.webxml +qtdatavisualization-itemmodel-example.webxml +qtdatavisualization-known-issues.webxml +qtdatavisualization-overview.webxml +qtdatavisualization-qmlaxisdrag-example.webxml +qtdatavisualization-qmlaxisformatter-example.webxml +qtdatavisualization-qmlbars-example.webxml +qtdatavisualization-qmlcustominput-example.webxml +qtdatavisualization-qmllegend-example.webxml +qtdatavisualization-qmlmultigraph-example.webxml +qtdatavisualization-qmloscilloscope-example.webxml +qtdatavisualization-qmlscatter-example.webxml +qtdatavisualization-qmlspectrogram-example.webxml +qtdatavisualization-qmlsurface-example.webxml +qtdatavisualization-qmlsurfacelayers-example.webxml +qtdatavisualization-rotations-example.webxml +qtdatavisualization-scatter-example.webxml +qtdatavisualization-surface-example.webxml +qtdatavisualization-texturesurface-example.webxml +qtdatavisualization-volumetric-example.webxml +qtest-overview.webxml +qtest-tutorial.webxml +qtglobal.webxml +qtgui-analogclock-example.webxml +qtgui-hellovulkancubes-example.webxml +qtgui-hellovulkantexture-example.webxml +qtgui-hellovulkantriangle-example.webxml +qtgui-hellovulkanwidget-example.webxml +qtgui-hellovulkanwindow-example.webxml +qtgui-openglwindow-example.webxml +qtgui-rasterwindow-example.webxml +qthelp-framework.webxml +qthelpproject.webxml +qtlocation-changes.webxml +qtlocation-cpp.webxml +qtlocation-examples.webxml +qtlocation-geoservices.webxml +qtlocation-mapviewer-example.webxml +qtlocation-minimal-map-example.webxml +qtlocation-places-example.webxml +qtlocation-places-list-example.webxml +qtlocation-places-map-example.webxml +qtlocation-planespotter-example.webxml +qtmath.webxml +qtmultimedia-ios.webxml +qtmultimedia-multimedia-audiodevices-example.webxml +qtmultimedia-multimedia-audioengine-example.webxml +qtmultimedia-multimedia-audioinput-example.webxml +qtmultimedia-multimedia-audiooutput-example.webxml +qtmultimedia-multimedia-audiorecorder-example.webxml +qtmultimedia-multimedia-declarative-camera-example.webxml +qtmultimedia-multimedia-declarative-radio-example.webxml +qtmultimedia-multimedia-spectrum-example.webxml +qtmultimedia-multimedia-video-qmlvideo-example.webxml +qtmultimedia-multimedia-video-qmlvideofx-example.webxml +qtmultimedia-multimediawidgets-camera-example.webxml +qtmultimedia-multimediawidgets-player-example.webxml +qtmultimedia-multimediawidgets-videographicsitem-example.webxml +qtmultimedia-multimediawidgets-videowidget-example.webxml +qtmultimedia-windows.webxml +qtnetwork-blockingfortuneclient-example.webxml +qtnetwork-broadcastreceiver-example.webxml +qtnetwork-broadcastsender-example.webxml +qtnetwork-download-example.webxml +qtnetwork-downloadmanager-example.webxml +qtnetwork-fortuneclient-example.webxml +qtnetwork-fortuneserver-example.webxml +qtnetwork-googlesuggest-example.webxml +qtnetwork-http-example.webxml +qtnetwork-loopback-example.webxml +qtnetwork-multicastreceiver-example.webxml +qtnetwork-multicastsender-example.webxml +qtnetwork-network-chat-example.webxml +qtnetwork-programming.webxml +qtnetwork-securesocketclient-example.webxml +qtnetwork-threadedfortuneserver-example.webxml +qtnetwork-torrent-example.webxml +qtopengl-2dpainting-example.webxml +qtopengl-cube-example.webxml +qtopengl-hellogl2-example.webxml +qtpositioning-examples.webxml +qtpositioning-geoflickr-example.webxml +qtpositioning-logfilepositionsource-example.webxml +qtpositioning-plugins.webxml +qtpositioning-satelliteinfo-example.webxml +qtpositioning-weatherinfo-example.webxml +qtquick-animation-example.webxml +qtquick-bestpractices.webxml +qtquick-canvas-example.webxml +qtquick-codesamples.webxml +qtquick-convenience-topic.webxml +qtquick-cppextensionpoints.webxml +qtquick-customitems-dialcontrol-example.webxml +qtquick-customitems-flipable-example.webxml +qtquick-customitems-painteditem-example.webxml +qtquick-customitems-scrollbar-example.webxml +qtquick-customitems-tabwidget-example.webxml +qtquick-demos-calqlatr-example.webxml +qtquick-demos-clocks-example.webxml +qtquick-demos-maroon-example.webxml +qtquick-demos-photosurface-example.webxml +qtquick-demos-photoviewer-example.webxml +qtquick-demos-rssnews-example.webxml +qtquick-demos-samegame-example.webxml +qtquick-demos-stocqt-example.webxml +qtquick-demos-tweetsearch-example.webxml +qtquick-draganddrop-example.webxml +qtquick-effects-particles.webxml +qtquick-effects-sprites.webxml +qtquick-effects-topic.webxml +qtquick-effects-transformations.webxml +qtquick-externaldraganddrop-example.webxml +qtquick-imageelements-example.webxml +qtquick-imageprovider-example.webxml +qtquick-imageresponseprovider-example.webxml +qtquick-input-focus.webxml +qtquick-input-mouseevents.webxml +qtquick-input-textinput.webxml +qtquick-input-topic.webxml +qtquick-keyinteraction-example.webxml +qtquick-layouts-example.webxml +qtquick-localstorage-example.webxml +qtquick-modelviewsdata-cppmodels.webxml +qtquick-modelviewsdata-modelview.webxml +qtquick-modelviewsdata-topic.webxml +qtquick-mousearea-example.webxml +qtquick-particles-affectors-example.webxml +qtquick-particles-customparticle-example.webxml +qtquick-particles-emitters-example.webxml +qtquick-particles-imageparticle-example.webxml +qtquick-particles-performance.webxml +qtquick-particles-system-example.webxml +qtquick-positioners-example.webxml +qtquick-positioning-anchors.webxml +qtquick-positioning-layouts.webxml +qtquick-positioning-righttoleft.webxml +qtquick-positioning-topic.webxml +qtquick-quick-accessibility-example.webxml +qtquick-righttoleft-example.webxml +qtquick-scenegraph-customgeometry-example.webxml +qtquick-scenegraph-materials.webxml +qtquick-scenegraph-nodes.webxml +qtquick-scenegraph-openglunderqml-example.webxml +qtquick-scenegraph-simplematerial-example.webxml +qtquick-shadereffects-example.webxml +qtquick-shapes-example.webxml +qtquick-statesanimations-animations.webxml +qtquick-statesanimations-behaviors.webxml +qtquick-statesanimations-states.webxml +qtquick-statesanimations-topic.webxml +qtquick-text-example.webxml +qtquick-text-validator.webxml +qtquick-threading-example.webxml +qtquick-threading-threadedlistmodel-example.webxml +qtquick-tools-and-utilities.webxml +qtquick-touchinteraction-example.webxml +qtquick-tutorials-dynamicview-dynamicview1-example.webxml +qtquick-tutorials-dynamicview-dynamicview2-example.webxml +qtquick-tutorials-dynamicview-dynamicview3-example.webxml +qtquick-tutorials-dynamicview-dynamicview4-example.webxml +qtquick-tutorials-samegame-samegame1-example.webxml +qtquick-tutorials-samegame-samegame2-example.webxml +qtquick-tutorials-samegame-samegame3-example.webxml +qtquick-tutorials-samegame-samegame4-example.webxml +qtquick-views-example.webxml +qtquick-visualcanvas-adaptations-d3d12.webxml +qtquick-visualcanvas-adaptations-openvg.webxml +qtquick-visualcanvas-adaptations-software.webxml +qtquick-visualcanvas-adaptations.webxml +qtquick-visualcanvas-coordinates.webxml +qtquick-visualcanvas-scenegraph-renderer.webxml +qtquick-visualcanvas-scenegraph.webxml +qtquick-visualcanvas-topic.webxml +qtquick-visualcanvas-visualparent.webxml +qtquick-visualtypes-topic.webxml +qtquick-window-example.webxml +qtquicklayouts-overview.webxml +qtsensorgestures-cpp.webxml +qtsensors-accelbubble-example.webxml +qtsensors-cpp.webxml +qtsensors-examples.webxml +qtsensors-grue-example.webxml +qtsensors-maze-example.webxml +qtsensors-porting.webxml +qtsensors-qmlqtsensors-example.webxml +qtsensors-qmlsensorgestures-example.webxml +qtsensors-sensor-explorer-example.webxml +qtsensors-sensorgestures-example.webxml +qtsensors-shakeit-example.webxml +qtsql-books-example.webxml +qtsql-cachedtable-example.webxml +qtsql-drilldown-example.webxml +qtsql-masterdetail-example.webxml +qtsql-sqlwidgetmapper-example.webxml +qtsvg-richtext-textobject-example.webxml +qtsvg-svggenerator-example.webxml +qtsvg-svgviewer-example.webxml +qttestlib-tutorial1-example.webxml +qttestlib-tutorial2-example.webxml +qttestlib-tutorial3-example.webxml +qttestlib-tutorial4-example.webxml +qttestlib-tutorial5-example.webxml +qttestlib-tutorial6.webxml +qtuitools-multipleinheritance-example.webxml +qtuitools-textfinder-example.webxml +qtwidgets-animation-easing-example.webxml +qtwidgets-animation-moveblocks-example.webxml +qtwidgets-animation-stickman-example.webxml +qtwidgets-animation-sub-attaq-example.webxml +qtwidgets-desktop-screenshot-example.webxml +qtwidgets-desktop-systray-example.webxml +qtwidgets-dialogs-classwizard-example.webxml +qtwidgets-dialogs-extension-example.webxml +qtwidgets-dialogs-findfiles-example.webxml +qtwidgets-dialogs-licensewizard-example.webxml +qtwidgets-dialogs-tabdialog-example.webxml +qtwidgets-dialogs-trivialwizard-example.webxml +qtwidgets-draganddrop-draggableicons-example.webxml +qtwidgets-draganddrop-dropsite-example.webxml +qtwidgets-draganddrop-fridgemagnets-example.webxml +qtwidgets-draganddrop-puzzle-example.webxml +qtwidgets-effects-blurpicker-example.webxml +qtwidgets-effects-fademessage-example.webxml +qtwidgets-gestures-imagegestures-example.webxml +qtwidgets-graphicsview-anchorlayout-example.webxml +qtwidgets-graphicsview-basicgraphicslayouts-example.webxml +qtwidgets-graphicsview-boxes-example.webxml +qtwidgets-graphicsview-chip-example.webxml +qtwidgets-graphicsview-collidingmice-example.webxml +qtwidgets-graphicsview-diagramscene-example.webxml +qtwidgets-graphicsview-dragdroprobot-example.webxml +qtwidgets-graphicsview-elasticnodes-example.webxml +qtwidgets-graphicsview-embeddeddialogs-example.webxml +qtwidgets-graphicsview-flowlayout-example.webxml +qtwidgets-graphicsview-padnavigator-example.webxml +qtwidgets-graphicsview-simpleanchorlayout-example.webxml +qtwidgets-graphicsview-weatheranchorlayout-example.webxml +qtwidgets-itemviews-addressbook-example.webxml +qtwidgets-itemviews-chart-example.webxml +qtwidgets-itemviews-coloreditorfactory-example.webxml +qtwidgets-itemviews-combowidgetmapper-example.webxml +qtwidgets-itemviews-customsortfiltermodel-example.webxml +qtwidgets-itemviews-dirview-example.webxml +qtwidgets-itemviews-editabletreemodel-example.webxml +qtwidgets-itemviews-fetchmore-example.webxml +qtwidgets-itemviews-frozencolumn-example.webxml +qtwidgets-itemviews-pixelator-example.webxml +qtwidgets-itemviews-puzzle-example.webxml +qtwidgets-itemviews-simpledommodel-example.webxml +qtwidgets-itemviews-simpletreemodel-example.webxml +qtwidgets-itemviews-simplewidgetmapper-example.webxml +qtwidgets-itemviews-spinboxdelegate-example.webxml +qtwidgets-itemviews-stardelegate-example.webxml +qtwidgets-layouts-basiclayouts-example.webxml +qtwidgets-layouts-borderlayout-example.webxml +qtwidgets-layouts-dynamiclayouts-example.webxml +qtwidgets-layouts-flowlayout-example.webxml +qtwidgets-mainwindows-application-example.webxml +qtwidgets-mainwindows-dockwidgets-example.webxml +qtwidgets-mainwindows-menus-example.webxml +qtwidgets-painting-affine-example.webxml +qtwidgets-painting-basicdrawing-example.webxml +qtwidgets-painting-composition-example.webxml +qtwidgets-painting-concentriccircles-example.webxml +qtwidgets-painting-deform-example.webxml +qtwidgets-painting-fontsampler-example.webxml +qtwidgets-painting-gradients-example.webxml +qtwidgets-painting-imagecomposition-example.webxml +qtwidgets-painting-painterpaths-example.webxml +qtwidgets-painting-pathstroke-example.webxml +qtwidgets-painting-transformations-example.webxml +qtwidgets-richtext-calendar-example.webxml +qtwidgets-richtext-orderform-example.webxml +qtwidgets-richtext-syntaxhighlighter-example.webxml +qtwidgets-statemachine-eventtransitions-example.webxml +qtwidgets-statemachine-factorial-example.webxml +qtwidgets-statemachine-pingpong-example.webxml +qtwidgets-statemachine-rogue-example.webxml +qtwidgets-statemachine-trafficlight-example.webxml +qtwidgets-statemachine-twowaybutton-example.webxml +qtwidgets-tools-codecs-example.webxml +qtwidgets-tools-completer-example.webxml +qtwidgets-tools-customcompleter-example.webxml +qtwidgets-tools-echoplugin-example.webxml +qtwidgets-tools-plugandpaint-app-example.webxml +qtwidgets-tools-plugandpaint-plugins-basictools-example.webxml +qtwidgets-tools-plugandpaint-plugins-extrafilters-example.webxml +qtwidgets-tools-regularexpression-example.webxml +qtwidgets-tools-styleplugin-example.webxml +qtwidgets-tools-treemodelcompleter-example.webxml +qtwidgets-tools-undo-example.webxml +qtwidgets-tools-undoframework-example.webxml +qtwidgets-tutorials-addressbook-part1-example.webxml +qtwidgets-tutorials-addressbook-part2-example.webxml +qtwidgets-tutorials-addressbook-part3-example.webxml +qtwidgets-tutorials-addressbook-part4-example.webxml +qtwidgets-tutorials-addressbook-part5-example.webxml +qtwidgets-tutorials-addressbook-part6-example.webxml +qtwidgets-tutorials-addressbook-part7-example.webxml +qtwidgets-tutorials-notepad-example.webxml +qtwidgets-tutorials-widgets-childwidget-example.webxml +qtwidgets-tutorials-widgets-nestedlayouts-example.webxml +qtwidgets-tutorials-widgets-toplevel-example.webxml +qtwidgets-tutorials-widgets-windowlayout-example.webxml +qtwidgets-widgets-analogclock-example.webxml +qtwidgets-widgets-calculator-example.webxml +qtwidgets-widgets-calendarwidget-example.webxml +qtwidgets-widgets-charactermap-example.webxml +qtwidgets-widgets-codeeditor-example.webxml +qtwidgets-widgets-digitalclock-example.webxml +qtwidgets-widgets-elidedlabel-example.webxml +qtwidgets-widgets-groupbox-example.webxml +qtwidgets-widgets-icons-example.webxml +qtwidgets-widgets-imageviewer-example.webxml +qtwidgets-widgets-lineedits-example.webxml +qtwidgets-widgets-mousebuttons-example.webxml +qtwidgets-widgets-movie-example.webxml +qtwidgets-widgets-scribble-example.webxml +qtwidgets-widgets-shapedclock-example.webxml +qtwidgets-widgets-sliders-example.webxml +qtwidgets-widgets-spinboxes-example.webxml +qtwidgets-widgets-styles-example.webxml +qtwidgets-widgets-stylesheet-example.webxml +qtwidgets-widgets-tablet-example.webxml +qtwidgets-widgets-tetrix-example.webxml +qtwidgets-widgets-tooltips-example.webxml +qtwidgets-widgets-wiggly-example.webxml +qtwidgets-widgets-windowflags-example.webxml +qtxml-dombookmarks-example.webxml +qtxml-saxbookmarks-example.webxml +qtxml-streambookmarks-example.webxml +qtxml-xmlstreamlint-example.webxml +qtxmlpatterns-filetree-example.webxml +qtxmlpatterns-recipes-example.webxml +qtxmlpatterns-schema-example.webxml +qtxmlpatterns-xquery-example.webxml +qwidget-styling.webxml +radiooverview.webxml +resources.webxml +richtext-advanced-processing.webxml +richtext-common-tasks.webxml +richtext-cursor.webxml +richtext-html-subset.webxml +richtext-layouts.webxml +richtext-structure.webxml +richtext.webxml +senorfwbackend.webxml +sensorgesture-emulator-topics.webxml +sensorgesture-plugins-topics.webxml +sensors-backend-topics.webxml +shared.webxml +signalsandslots.webxml +sql-connecting.webxml +sql-driver.webxml +sql-forms.webxml +sql-model.webxml +sql-presenting.webxml +sql-programming.webxml +sql-sqlstatements.webxml +sql-types.webxml +ssl.webxml +statemachine-api.webxml +statemachine.webxml +style-reference.webxml +stylesheet-customizing.webxml +stylesheet-designer.webxml +stylesheet-examples.webxml +stylesheet-reference.webxml +stylesheet-syntax.webxml +stylesheet.webxml +svgrendering.webxml +textedit-example.webxml +timers.webxml +tutorials-addressbook.webxml +videooverview.webxml +widget-classes.webxml +widgets-tutorial.webxml +xml-dom-tml.webxml +xml-namespaces.webxml +xml-processing.webxml +xml-sax.webxml +xml-streaming.webxml +xml-tools.webxml +xmlpattern-examples.webxml +xmlprocessing.webxml +xquery-introduction.webxml diff --git a/sources/shiboken2/generator/qtdoc/qtdocgenerator.cpp b/sources/shiboken2/generator/qtdoc/qtdocgenerator.cpp index cefce32fa..7b9f25369 100644 --- a/sources/shiboken2/generator/qtdoc/qtdocgenerator.cpp +++ b/sources/shiboken2/generator/qtdoc/qtdocgenerator.cpp @@ -45,6 +45,8 @@ static Indentor INDENT; +static inline QString additionalDocumentationOption() { return QStringLiteral("additional-documentation"); } + static bool shouldSkip(const AbstractMetaFunction* func) { // Constructors go to separate section @@ -1119,6 +1121,26 @@ void QtXmlToSphinx::handleQuoteFileTag(QXmlStreamReader& reader) } } +bool QtXmlToSphinx::convertToRst(QtDocGenerator *generator, + const QString &sourceFileName, + const QString &targetFileName, + const QString &context, QString *errorMessage) +{ + QFile sourceFile(sourceFileName); + if (!sourceFile.open(QIODevice::ReadOnly | QIODevice::Text)) { + if (errorMessage) + *errorMessage = FileOut::msgCannotOpenForReading(sourceFile); + return false; + } + const QString doc = QString::fromUtf8(sourceFile.readAll()); + sourceFile.close(); + + FileOut targetFile(targetFileName); + QtXmlToSphinx x(generator, doc, context); + targetFile.stream << x; + return targetFile.done(errorMessage) != FileOut::Failure; +} + void QtXmlToSphinx::Table::normalize() { if (m_normalized || isEmpty()) @@ -1910,9 +1932,15 @@ static void writeFancyToc(QTextStream& s, const QStringList& items, int cols = 4 bool QtDocGenerator::finishGeneration() { - if (classes().isEmpty()) - return true; + if (!classes().isEmpty()) + writeModuleDocumentation(); + if (!m_additionalDocumentationList.isEmpty()) + writeAdditionalDocumentation(); + return true; +} +void QtDocGenerator::writeModuleDocumentation() +{ QMap<QString, QStringList>::iterator it = m_packages.begin(); for (; it != m_packages.end(); ++it) { QString key = it.key(); @@ -1984,7 +2012,63 @@ bool QtDocGenerator::finishGeneration() } } } - return true; +} + +static inline QString msgNonExistentAdditionalDocFile(const QString &dir, + const QString &fileName) +{ + const QString result = QLatin1Char('"') + fileName + + QLatin1String("\" does not exist in ") + + QDir::toNativeSeparators(dir) + QLatin1Char('.'); + return result; +} + +void QtDocGenerator::writeAdditionalDocumentation() +{ + QFile additionalDocumentationFile(m_additionalDocumentationList); + if (!additionalDocumentationFile.open(QIODevice::ReadOnly | QIODevice::Text)) { + qCWarning(lcShiboken, "%s", + qPrintable(FileOut::msgCannotOpenForReading(additionalDocumentationFile))); + return; + } + const QByteArray contents = additionalDocumentationFile.readAll(); + const QStringList lines = QFile::decodeName(contents).split(QLatin1Char('\n')); + QFileInfoList additionalDocFiles; + additionalDocFiles.reserve(lines.size()); + for (const QString &lineIn : lines) { + const QString line = lineIn.trimmed(); + if (!line.isEmpty() && !line.startsWith(QLatin1Char('#'))) { + QFileInfo fi(m_docDataDir + QLatin1Char('/') + line); + if (fi.isFile()) { + additionalDocFiles.append(fi); + } else { + qCWarning(lcShiboken, "%s", + qPrintable(msgNonExistentAdditionalDocFile(m_docDataDir, line))); + } + } + } + additionalDocumentationFile.close(); + + const QString rstPrefix = outputDirectory() + QLatin1Char('/'); + const QString rstSuffix = fileNameSuffix(); + + QString errorMessage; + int successCount = 0; + for (const QFileInfo &additionalDocFile : additionalDocFiles) { + const QString rstFileName = additionalDocFile.baseName() + rstSuffix; + const QString rstFile = rstPrefix + rstFileName; + if (QtXmlToSphinx::convertToRst(this, additionalDocFile.absoluteFilePath(), + rstFile, QString(), &errorMessage)) { + ++successCount; + qCDebug(lcShiboken).nospace().noquote() << __FUNCTION__ + << " converted " << additionalDocFile.fileName() + << ' ' << rstFileName; + } else { + qCWarning(lcShiboken, "%s", qPrintable(errorMessage)); + } + } + qCInfo(lcShiboken, "Created %d/%d additional documentation files.", + successCount, additionalDocFiles.size()); } bool QtDocGenerator::doSetup(const QMap<QString, QString>& args) @@ -2012,6 +2096,7 @@ bool QtDocGenerator::doSetup(const QMap<QString, QString>& args) m_docParser->setDocumentationDataDirectory(m_docDataDir); m_docParser->setLibrarySourceDirectory(m_libSourceDir); } + m_additionalDocumentationList = args.value(additionalDocumentationOption()); return true; } @@ -2029,6 +2114,9 @@ Generator::OptionDescriptions QtDocGenerator::options() const << qMakePair(QLatin1String("documentation-extra-sections-dir"), QLatin1String("Directory used to search for extra documentation sections")) << qMakePair(QLatin1String("library-source-dir"), - QLatin1String("Directory where library source code is located")); + QLatin1String("Directory where library source code is located")) + << qMakePair(additionalDocumentationOption(), + QLatin1String("List of additional XML files to be converted to .rst files\n" + "(for example, tutorials).")); } diff --git a/sources/shiboken2/generator/qtdoc/qtdocgenerator.h b/sources/shiboken2/generator/qtdoc/qtdocgenerator.h index f7a627127..04d3a3e62 100644 --- a/sources/shiboken2/generator/qtdoc/qtdocgenerator.h +++ b/sources/shiboken2/generator/qtdoc/qtdocgenerator.h @@ -102,6 +102,12 @@ public: QtXmlToSphinx(QtDocGenerator* generator, const QString& doc, const QString& context = QString()); + static bool convertToRst(QtDocGenerator *generator, + const QString &sourceFileName, + const QString &targetFileName, + const QString &context = QString(), + QString *errorMessage = nullptr); + QString result() const { return m_result; @@ -254,6 +260,8 @@ private: bool writeInjectDocumentation(QTextStream& s, TypeSystem::DocModificationMode mode, const AbstractMetaClass* cppClass, const AbstractMetaFunction* func); void writeDocSnips(QTextStream &s, const CodeSnipList &codeSnips, TypeSystem::CodeSnipPosition position, TypeSystem::Language language); + void writeModuleDocumentation(); + void writeAdditionalDocumentation(); QString parseArgDocStyle(const AbstractMetaClass *cppClass, const AbstractMetaFunction *func); QString translateToPythonType(const AbstractMetaType *type, const AbstractMetaClass *cppClass); @@ -265,6 +273,7 @@ private: QStringList m_functionList; QMap<QString, QStringList> m_packages; DocParser* m_docParser; + QString m_additionalDocumentationList; }; #endif // DOCGENERATOR_H |