Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Language Bindings
  4. What is the best practice to use PyQt with non PyQt back-end code
Forum Updated to NodeBB v4.3 + New Features

What is the best practice to use PyQt with non PyQt back-end code

Scheduled Pinned Locked Moved Unsolved Language Bindings
3 Posts 2 Posters 879 Views
  • 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.
  • Q Offline
    Q Offline
    QtFranchise
    wrote on last edited by QtFranchise
    #1

    Hi, I am working on an application development where the UI part is to be coded using PyQt (front-end) and back-end should be coded using non PyQt coding (python). So before proceeding on the development I wanted to know the best practices.

    I can list the options as below

    1. Using Signal and Slot to connect PyQt and non PyQt (python)
    2. Using flag and threads on non PyQt (threading.Thread) to continuously monitor and update certain flag and take action accordingly on PyQt using Qthreads
    3. By importing the UI class object directly into the non PyQt (python) code, update the PyQt UI element.

    So, which among these is the best.

    JonBJ 1 Reply Last reply
    0
    • Q QtFranchise

      Hi, I am working on an application development where the UI part is to be coded using PyQt (front-end) and back-end should be coded using non PyQt coding (python). So before proceeding on the development I wanted to know the best practices.

      I can list the options as below

      1. Using Signal and Slot to connect PyQt and non PyQt (python)
      2. Using flag and threads on non PyQt (threading.Thread) to continuously monitor and update certain flag and take action accordingly on PyQt using Qthreads
      3. By importing the UI class object directly into the non PyQt (python) code, update the PyQt UI element.

      So, which among these is the best.

      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by
      #2

      @QtFranchise
      I do not like either #2 or #3.

      The best is #1. Depends which direction you want signals to be sent. You cannot emit signals in non-PyQt code; but I think you can actually connect() non-PyQt functions as slots without issue. Can't you write a "thin wrapper" with PyQt to allow signals/slots between your PyQt and non-PyQt code?

      1 Reply Last reply
      2
      • Q Offline
        Q Offline
        QtFranchise
        wrote on last edited by
        #3

        @JonB
        That sounds cool. Will follow your suggestion.

        1 Reply Last reply
        0

        • Login

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