Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ endif ()
include(MicroTeXInstall.cmake)

add_subdirectory(lib)
add_subdirectory(doc)

file(COPY res DESTINATION .)

Expand Down
4 changes: 4 additions & 0 deletions doc/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
set(cwd ${CMAKE_CURRENT_LIST_DIR})
set(source_root ${microtex_SOURCE_DIR})
set(version ${microtex_VERSION})
configure_file(microtex.doxy.in microtex.doxy @ONLY)
2 changes: 1 addition & 1 deletion doc/mainpage.h
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@
* It is comercially developed by the QT company, while the KDE project
* ensures the free software nature of the library.
*
* To see how to use \f$\MicroTeX\f$ with QT see <a href="TODO">this page</a>.
* To see how to use \f$\MicroTeX\f$ with QT see \ref qt_doc.
*
* \subsection platform_win32 Win32
* Microsoft Windows's native user interface stacks allows drawing of
Expand Down
2 changes: 1 addition & 1 deletion doc/microtex.doxy.in
Original file line number Diff line number Diff line change
Expand Up @@ -874,7 +874,7 @@ WARN_LOGFILE =
# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING
# Note: If this tag is empty the current directory is searched.

INPUT = "@cwd@/mainpage.h" "@cwd@/cairodoc.h" "@cwd@/fontdoc.h" \
INPUT = "@cwd@/mainpage.h" "@cwd@/cairodoc.h" "@cwd@/qtdoc.h" "@cwd@/fontdoc.h" \
"@source_root@/lib" \
"@source_root@/platform/cairo" \
"@source_root@/platform/gdi_win/" \
Expand Down
54 changes: 54 additions & 0 deletions doc/qtdoc.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
/** \page qt_doc Qt Documentation
*
* \section qt_opts Build options
*
* \subsection Meson
* to build support for the Qt platform using meson, you need to
* invoke meson using <tt>-DQT=true</tt> as parameter.
*
* If you want to build the Qt demo too, you need to add the
* <tt>-DEXAMPLE_QT=true</tt> to the params too.
*
* \subsection CMake
*
* for cmake, you need to configure it, with <tt>-DQT=ON</tt>
* and optionally with <tt>-DBUILD_EXAMPLE_QT=ON</tt>.
*
* \section qt_usage Usage
*
* \subsection qt_init Initialization and PlatformFactory setup
* Refer to \ref index "the main page" for info about information about automatic
* font detection. The PlatformFactory setup is qt specific.
* @code
* microtex::InitFontSenseAuto autoinit;
* microtex::MicroTeX::init(autoinit);
* microtex::PlatformFactory::registerFactory("qt", std::make_unique<microtex::PlatformFactory_cairo>());
* microtex::PlatformFactory::activate("qt");
* @endcode
*
* \subsection qt_render Rendering
* You need to make use of microtex::Graphics2D_qt to render
* equations onto a QWidget with QPainter. Please note that the caller
* keeps the ownership of the cairo context.
*
* Before use microtex::Graphics2D_qt, the microtex::Render must be initialized.
* You can either use the convenience
* method microtex::MicroTeX::parse(), or construct it yourself using
* microtex::RenderBuilder if you need more customization.
*
* @code
* void MyWidget::init_render() {
* // _render is a field of MyWidget class
* // microtex::Render* _render;
* _render = microtex::MicroTeX::parse(args...);
* // or use microtex::RenderBuilder
* }
* void MyWidget::paintEvent(QPaintEvent* event) {
* QPainter painter(this);
* painter.setRenderHint(QPainter::Antialiasing, true);
* Graphics2D_qt g2(&painter);
* _render.draw(g2, 0, 0);
* }
* @endcode
*
*/