OMNI-CORE LogoOMNI-CORE
omni-mdxomni-3D (soon)Open SourceAbout
GitHubDocumentation
OMNI-CORE

Knowledge must flow freely to shape the future.

Ecosystem

  • omni-mdx
  • omni-3D

Resources

  • Documentation
  • Interactive Playground

Legal & Open Source

  • GitHub Organization
  • Notice

TOAQ GROUP © 2024 - 2026

Released under the MIT License.

Navigation

Getting Started

  • Introduction
    • Web & Next.js
    • Python Engine
    • Build from Source
  • Syntax Guide

Web Integration

  • Next.js Integration
  • Binary AST Transfer
  • Custom Components
  • Unified & Plugins Ecosystem Integration
    • Basic App Router
    • Advanced Rendering
    • Live Client Editor

Python

  • Introduction & Core Engine
    • Basic Parsing & Traversal
    • Advanced Analysis & RAG
    • Native Qt Rendering
    • HTML & Web Rendering
    • Basic Parsing
    • Advanced Analysis
    • HTML Rendering
    • Qt Rendering

Architecture & Core

    • Design Philosophy
    • The Rendering Pipeline
    • Lexing & Tokenization
    • AST Node Design
    • Math & JSX Handling
    • Protocol Specification
    • Zero-Copy Decoding
    • Memory Lifecycle
    • WASM Bindings (Browser)
    • Node.js Native Addons
    • Python Bindings (PyO3)
  • Security
    • Benchmarks
    • Fuzzing Results
Docs
Python
Examples
Qt Rendering

Example: Native Qt Rendering (Zero-HTML)

Last Updated March 27, 2026

The true strength of Omni-MDX for desktop developers is its complete decoupling from the web. Instead of embedding a heavy, memory-hungry Chromium browser (WebEngine) in your app, you can render MDX directly into native PyQt5 or PySide6 widgets.

ℹ️ Information
Full Source Code: Clone and test this environment directly from omni-mdx-sandbox/python/qt-desktop.

Mapping MDX to Native QWidgets

Imagine building an offline scientific editor. You want to render Markdown, JSX components, and LaTeX math directly into your native UI layout.

1. The Source MDX File

mdx
# Native Rendering
This interface does **not** use HTML. 



$$\int_0^\infty e^{-x^2} dx = \frac{\sqrt{\pi}}{2}$$

2. The PyQt5 Implementation

You can map the custom <InteractiveButton /> tag directly to a real QPushButton and bind native Python events to it.

python
import sys
from PyQt5.QtWidgets import QApplication, QWidget, QVBoxLayout, QPushButton, QMessageBox
import omni_mdx
from omni_mdx.qt_renderer import QtRenderer

# 1. Define the native widget mapping for your JSX component
def render_interactive_button(node, renderer_context):
    label_text = node.attributes.get("label", "Click Me")
    
    btn = QPushButton(label_text)
    btn.setStyleSheet("background-color: #7c3aed; color: white; padding: 8px;")
    
    # Bind native Python events directly from the MDX!
    btn.clicked.connect(lambda: QMessageBox.information(None, "Success", "MDX Button Clicked!"))
    
    return btn

def main():
    app = QApplication(sys.argv)
    
    # 2. Parse the AST natively
    ast = omni_mdx.parse(document_source)
    
    # 3. Configure the renderer
    renderer = QtRenderer()
    renderer.register("InteractiveButton", render_interactive_button)
    
    # 4. Render the AST into a single QWidget container
    main_window = QWidget()
    layout = QVBoxLayout(main_window)
    
    native_ui = renderer.render(ast.nodes, parent=main_window)
    layout.addWidget(native_ui)
    
    main_window.show()
    sys.exit(app.exec_())

Thanks to this architecture, your application remains lightweight, ultra-fast, and completely immune to XSS attacks, as no HTML is ever interpreted.

Boosted by omni-mdx native node

On this page

  • Mapping MDX to Native QWidgets
  • 1. The Source MDX File
  • 2. The PyQt5 Implementation
Edit this page on GitHub

Caught a typo or want to improve the docs? Submitting a PR is the best way to help!