Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt for Python
  4. Using PySide within a python plugin in a non-Qt environment
Forum Updated to NodeBB v4.3 + New Features

Using PySide within a python plugin in a non-Qt environment

Scheduled Pinned Locked Moved Unsolved Qt for Python
2 Posts 2 Posters 347 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • F Offline
    F Offline
    Frime
    wrote on last edited by Frime
    #1

    Hi all!

    I have already some experience with Qt in the C++ context but I'm a total beginner when it comes to Python. What I actually want to do is to write a python Plugin for Octoprint using PySide. Octoprint does not use Qt which means there is no QApplication instance running so far.
    My question is now: Do I need to start an extra thread for the app.exec_() call? Or are there any alternatives / best practices how to start QApplications from an external plugin in a non Qt environment? Thanks in advance!

    JKSHJ 1 Reply Last reply
    0
    • F Frime

      Hi all!

      I have already some experience with Qt in the C++ context but I'm a total beginner when it comes to Python. What I actually want to do is to write a python Plugin for Octoprint using PySide. Octoprint does not use Qt which means there is no QApplication instance running so far.
      My question is now: Do I need to start an extra thread for the app.exec_() call? Or are there any alternatives / best practices how to start QApplications from an external plugin in a non Qt environment? Thanks in advance!

      JKSHJ Offline
      JKSHJ Offline
      JKSH
      Moderators
      wrote on last edited by
      #2

      @Frime said in Using PySide within a python plugin in a non-Qt environment:

      Do I need to start an extra thread for the app.exec_() call?

      exec() blocks the calling thread permanently until you shut down Qt.

      I'm not familiar with how Octoprint loads and runs plugins. But if it runs your plugin script in the same thread as the core program, then yes you need to create an extra thread to call exec() and all other Qt GUI functions.

      Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

      1 Reply Last reply
      2

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved