Skip to content
Snippets Groups Projects
Select Git revision
  • 9f533f0dc90fb3f36db48b486b4aa4d61b1add4d
  • main default protected
  • renovate/lock-file-maintenance
  • demo protected
  • person-select-custom
  • dbp-translation-component
  • icon-set-mapping
  • port-i18next-parser
  • remove-sentry
  • favorites-and-recent-files
  • revert-6c632dc6
  • lit2
  • advertisement
  • wc-part
  • automagic
  • publish
  • wip-cleanup
  • demo-file-handling
18 results

dbp-file-source.js

Blame
  • example3.py 1.87 KiB
    # -*- coding: utf-8 -*-
    """
    Author(s): Christoph Schmidt <christoph.schmidt@tugraz.at>
    Created: 2023-10-19 12:35
    Package Version:
    """
    import logging
    import signal
    import sys
    from multiprocessing import Process, Queue, Pipe
    from threading import Thread
    
    from PySide6.QtCore import QObject, Signal, SIGNAL
    from PySide6.QtWidgets import QDialog, QApplication, QTextBrowser, QLineEdit, QVBoxLayout, QMainWindow, QMessageBox
    
    sys.path.append('./src')
    from ChildProcessControl3 import ChildProcessControl3
    
    
    
    class Form(QDialog):
        on_text_converted = Signal(str)
    
        def __init__(self, parent=None):
            super().__init__(parent)
    
            child_con = ChildProcessControl3(self, internal_log=False, internal_log_level=logging.INFO)
            child_con.set_internal_log_level(logging.CRITICAL)
            child_con.mp_finished.connect(self.updateUI)
    
    
            self.browser = QTextBrowser()
            self.lineedit = QLineEdit('Type text and press <Enter>')
            self.lineedit.selectAll()
            layout = QVBoxLayout()
            layout.addWidget(self.browser)
            layout.addWidget(self.lineedit)
            self.setLayout(layout)
            self.lineedit.setFocus()
            self.setWindowTitle('Upper')
            # self.lineedit.returnPressed.connect(lambda: child_con.call_without_mp(1, 2, c=3))
            self.lineedit.returnPressed.connect(lambda: child_con.exception_call(1))
    
    
        def updateUI(self, text):
            #print("updateUI: ", text)
            self.browser.append("->" + str(text))
    
        def updateUI2(self, text):
            #print("updateUI: ", text)
            self.browser.append("->" + str(text))
    
        def closeEvent(self, arg__1):
            self.destroyed.emit()
            #print("Form destroyed.")
    
    
    if __name__ == '__main__':
    
        try:
            app = QApplication(sys.argv)
            form = Form()
            form.show()
            app.exec()
        except KeyboardInterrupt:
            print("KeyboardInterrupt")
            sys.exit(0)