Skip to main content


Project description

mopyx utilities when working with PySide2 (the official Qt5 python bindings)


pip install mopyx_pyside2


  • create_qt_application() → create a Qt5 application.

  • create_qt_tray_icon() → create a systray icon.

  • ui_thread_call(f, args, kw) → invoke a function on the Qt’s UI thread.

  • ui_thread(f) → make the function invokable on the Qt’s UI thread.

  • show_notification(title: str, message: str, icon: QIcon, delay: int = 4000) → shows a notification on the systray.

  • clear_layout(layout: QLayout) → clear the layout.

  • _(f) → create a callable that ignores all its parameters, and invokes the callable given as an argument.


How to call functions from a different thread, still accessing the UI:

def update_failed_count(job, successful: bool) -> None:
    # ...

def update_results(job, result) -> None:
    # ...

class JobMonitorThread(threading.Thread):
    def run(self) -> None:
            # do something
        except Exception:
            update_failed_count(job, False)
            update_results(job, ...)


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

mopyx_pyside2-1.0.0.tar.gz (2.6 kB view hashes)

Uploaded Source

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