FlatCAM.py 920 B

12345678910111213141516171819202122232425262728293031323334353637
  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. if sys.platform == "win32":
  8. # cx_freeze 'module win32' workaround
  9. import OpenGL.platform.win32
  10. def debug_trace():
  11. """
  12. Set a tracepoint in the Python debugger that works with Qt
  13. :return: None
  14. """
  15. from PyQt5.QtCore import pyqtRemoveInputHook
  16. #from pdb import set_trace
  17. pyqtRemoveInputHook()
  18. #set_trace()
  19. # All X11 calling should be thread safe otherwise we have strange issues
  20. # QtCore.QCoreApplication.setAttribute(QtCore.Qt.AA_X11InitThreads)
  21. # NOTE: Never talk to the GUI from threads! This is why I commented the above.
  22. if __name__ == '__main__':
  23. freeze_support()
  24. debug_trace()
  25. VisPyPatches.apply_patches()
  26. app = QtWidgets.QApplication(sys.argv)
  27. fc = App()
  28. sys.exit(app.exec_())