FlatCAM.py 994 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. import sys
  2. from PyQt5 import sip
  3. from PyQt5 import QtGui, QtCore, QtWidgets
  4. from FlatCAMApp import App
  5. from multiprocessing import freeze_support
  6. import VisPyPatches
  7. import qtmodern.styles, qtmodern.windows
  8. if sys.platform == "win32":
  9. # cx_freeze 'module win32' workaround
  10. import OpenGL.platform.win32
  11. def debug_trace():
  12. """
  13. Set a tracepoint in the Python debugger that works with Qt
  14. :return: None
  15. """
  16. from PyQt5.QtCore import pyqtRemoveInputHook
  17. #from pdb import set_trace
  18. pyqtRemoveInputHook()
  19. #set_trace()
  20. # All X11 calling should be thread safe otherwise we have strange issues
  21. # QtCore.QCoreApplication.setAttribute(QtCore.Qt.AA_X11InitThreads)
  22. # NOTE: Never talk to the GUI from threads! This is why I commented the above.
  23. if __name__ == '__main__':
  24. freeze_support()
  25. debug_trace()
  26. VisPyPatches.apply_patches()
  27. app = QtWidgets.QApplication(sys.argv)
  28. fc = App()
  29. # qtmodern.styles.dark(app)
  30. sys.exit(app.exec_())