Skip to main content

pyside6-native-titlebar

Native Windows title bar integration for PySide6 applications.

  • Native minimize, maximize, and close buttons managed by Windows
  • Interactive Qt widgets in the title bar
  • Caption colors that follow the Qt palette
  • Window classes based on both QWidget and QMainWindow

Qt draws the window icon and title. Windows manages the caption buttons on the same window.

Installation

Requires Windows, Python 3.11–3.14, and Windows App Runtime 1.7. Install the runtime for your Python architecture using Microsoft's installer. Other runtime versions can coexist, but do not replace 1.7.

python -m pip install pyside6-native-titlebar

Quick start

from PySide6 import QtWidgets

import native_titlebar


def main() -> int:
    """Runs a window with an interactive title bar button."""
    app = QtWidgets.QApplication([])
    window = native_titlebar.NativeWindow()
    window.setWindowTitle("My application")

    action = QtWidgets.QPushButton("Action")
    window.titleBar().addWidget(action)
    window.setCentralWidget(QtWidgets.QLabel("Window content"))
    window.resize(1000, 600)
    window.show()
    return app.exec()


if __name__ == "__main__":
    raise SystemExit(main())

Use NativeWindow for a simple widget window. Use NativeMainWindow when your application needs Qt menus, toolbars, dock widgets, or a status bar. Both classes provide the same titleBar() API.

Both window classes use setCentralWidget(), centralWidget(), and takeCentralWidget() for content. Public methods and signals follow Qt's camelCase convention. Read state through getter methods such as window.titleBar(), window.titleBar().widgets(), and window.lastError().

QMainWindow

NativeMainWindow inherits directly from QMainWindow. Use it in place of NativeWindow in the example above, or subclass it in your application:

class MainWindow(native_titlebar.NativeMainWindow):
    """An application window with standard Qt menus and central content."""

    def __init__(self) -> None:
        """Creates the editor and its menu."""
        super().__init__()
        self.setWindowTitle("My editor")
        self.setCentralWidget(QtWidgets.QTextEdit())
        file_menu = self.menuBar().addMenu("&File")
        close_action = file_menu.addAction("Close")
        close_action.triggered.connect(self.close)
        self.statusBar().showMessage("Ready")

The title bar sits above the menu and toolbar areas. Standard methods such as addDockWidget(), addToolBar(), saveState(), and restoreState() remain available.

Title bar controls

Add controls with window.titleBar().addWidget(widget). They receive normal Qt mouse, keyboard, and focus events. Free space remains available for dragging the window. removeWidget(widget) hides a control without deleting it; it stays owned by the title bar until reparented.

Use setWindowTitle() and setWindowIcon() to update the caption, window.titleBar().setTitleVisible(False) or setIconVisible(False) to hide either element, and window.setTallTitleBar(True) for a taller caption area. Button colors follow QPalette.Window and QPalette.WindowText; Windows controls the close-button hover color.

Create and modify widgets on the QApplication GUI thread. Keep the standard window frame enabled; do not combine the library with frameless flags or another title bar integration. API details and ownership rules are documented in the docstrings.

Examples

Run the examples from a local checkout after uv sync --locked:

uv run python examples/demo.py
uv run python examples/demo.py --extended
uv run python examples/main_window.py
uv run python examples/gallery.py

The basic demo shows interactive title bar controls. The main-window demo includes an editor, menus, a toolbar, a dock, and a status bar. The gallery lets you explore themes and caption settings.

Troubleshooting

Check the installed dependencies and Windows App Runtime without opening a window:

python -m native_titlebar
python -m native_titlebar --json

Window creation raises a NativeTitleBarError subclass if initialization fails. Later integration errors are logged and emitted through window.integrationError. Use window.diagnostics() for a structured snapshot of native geometry and the last error. Report problems through GitHub Issues.

License

MIT — Copyright (c) 2026 Modding Forge.

Metadata

Release files for pyside6-native-titlebar 3.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyside6-native-titlebar 3.0.0
File Size Uploaded Provenance Actions
pyside6_native_titlebar-3.0.0.tar.gz 128.9 kB With provenance Details for pyside6_native_titlebar-3.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pyside6-native-titlebar 3.0.0
File Interpreter ABI Platform Actions
pyside6_native_titlebar-3.0.0-py3-none-any.whl Python 3 none any Details for pyside6_native_titlebar-3.0.0-py3-none-any.whl

Total release size: 158.5 kB

Release files / pyside6_native_titlebar-3.0.0.tar.gz

Download URL pyside6_native_titlebar-3.0.0.tar.gz
Size 128.9 kB
Tags Source
SHA-256 checksum
How to use checksums
565d9d16d87184144bd65fe0d0e991806fd02fd2fff31449070eec4d94cd7c8f
BLAKE2b-256 checksum
How to use checksums
a2483dbadd43c1760068ed4ff2fcfad5a7de61452b8293820990f6f9bb8b2bce
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 29, 2026.

Transparency log

Release files / pyside6_native_titlebar-3.0.0-py3-none-any.whl

Download URL pyside6_native_titlebar-3.0.0-py3-none-any.whl
Size 29.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2d2b9e1d9bd7996128ba5f8683465d4ccd3b64fe41e9849839d095c524b41225
BLAKE2b-256 checksum
How to use checksums
d516c17b6faf9790ebc523359a28adc2aec2f97c521954a70f5ba1b94b1efa87
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 29, 2026.

Transparency log

Security for pyside6-native-titlebar 3.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for pyside6_native_titlebar-3.0.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 29, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page