Skip to main content

A command palette widget for Qt applications

Project description

qt-command-palette

PyPI - Version PyPI - Python Version

A command palette widget for Qt applications. This module provides a Pythonic way to register command actions to any Qt widgets.

Installation

pip install qt-command-palette

Usage

  • Register functions using register function.

    from qt_command_palette import get_palette
    
    # create command palette instance (with optional app name as an argument)
    palette = get_palette("myapp")
    
    # prepare a command group
    group = palette("Command group 1")
    
    # This function will be shown as "Command group 1: run_something"
    @group.register
    def run_something():
        ...
    
    # This function will be shown as "Command group 1: Run some function"
    @group.register(desc="Run some function")
    def run_something():
        ...
    
  • Install command palette into Qt widget.

    # instantiate your own widget
    qwidget = MyWidget()
    
    # install command palette, with optional shortcut
    palette.install(qwidget, "Ctrl+Shift+P")
    
    qwidget.show()
    

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

qt_command_palette-0.0.8.tar.gz (164.8 kB view hashes)

Uploaded Source

Built Distribution

qt_command_palette-0.0.8-py3-none-any.whl (11.7 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page