11import os , time
2- from PyQt5 import QtCore , QtWidgets , QtGui
2+ from PyQt6 import QtCore , QtWidgets , QtGui
33from qtvcp .widgets .gcode_editor import GcodeEditor as GCODE
44from qtvcp .widgets .gcode_graphics import GCodeGraphics as GRAPHICS
55from qtvcp .widgets .mdi_line import MDILine as MDI_WIDGET
2828QHAL = Qhal ()
2929
3030try :
31- from PyQt5 .QtWebEngineWidgets import QWebEnginePage
31+ from PyQt6 .QtWebEngineWidgets import QWebEnginePage
3232except :
33- LOG .warning ('QtDragon Warning with loading QtWebEngineWidget - is python3-pyqt5 .qtwebengine installed?' )
33+ LOG .warning ('QtDragon Warning with loading QtWebEngineWidget - is python3-pyqt6 .qtwebengine installed?' )
3434
3535# constants for tab pages
3636TAB_MAIN = 0
@@ -66,7 +66,7 @@ def __init__(self, halcomp, widgets, paths):
6666 self .w = widgets
6767 self .gcodes = GCodes (widgets )
6868 # This validator precludes using comma as a decimal
69- self .valid = QtGui .QRegExpValidator (QtCore .QRegExp ('-?[0-9]{0,6}[.][0-9]{0,3}' ))
69+ self .valid = QtGui .QRegularExpressionValidator (QtCore .QRegularExpression ('-?[0-9]{0,6}[.][0-9]{0,3}' ))
7070 self .KEYBIND = KEYBIND
7171 KEYBIND .add_call ('Key_F11' ,'on_keycall_F11' )
7272 KEYBIND .add_call ('Key_F12' ,'on_keycall_F12' )
@@ -478,7 +478,7 @@ def init_probe(self):
478478 self .probe .setObjectName ('versaprobe' )
479479 # only use cycle start button to start probing
480480 self .probe .setProperty ('runImmediately' ,False )
481- self .probe .setFocusPolicy (QtCore .Qt .ClickFocus )
481+ self .probe .setFocusPolicy (QtCore .Qt .FocusPolicy . ClickFocus )
482482
483483 elif probe == 'basicprobe' :
484484 LOG .info ("Using Basic Probe" )
@@ -488,7 +488,7 @@ def init_probe(self):
488488 self .probe .setObjectName ('basicprobe' )
489489 # only use cycle start button to start probing
490490 self .probe .setProperty ('runImmediately' ,False )
491- self .probe .setFocusPolicy (QtCore .Qt .ClickFocus )
491+ self .probe .setFocusPolicy (QtCore .Qt .FocusPolicy . ClickFocus )
492492
493493 else :
494494 LOG .info ("No valid probe widget specified" )
@@ -603,8 +603,8 @@ def processed_key_event__(self,receiver,event,is_pressed,key,code,shift,cntrl):
603603 # when typing in MDI, we don't want keybinding to call functions
604604 # so we catch and process the events directly.
605605 # We do want ESC, F1 and F2 to call keybinding functions though
606- if code not in (QtCore .Qt .Key_Escape ,QtCore .Qt .Key_F1 ,QtCore .Qt .Key_F2 ):
607- # QtCore.Qt.Key_F3,QtCore.Qt.Key_F4,QtCore.Qt.Key_F5):
606+ if code not in (QtCore .Qt .Key . Key_Escape ,QtCore .Qt .Key . Key_F1 ,QtCore .Qt . Key .Key_F2 ):
607+ # QtCore.Qt.Key. Key_F3,QtCore.Qt.Key. Key_F4,QtCore.Qt.Key .Key_F5):
608608
609609 # search for the top widget of whatever widget received the event
610610 # then check if it's one we want the keypress events to go to
@@ -1390,12 +1390,12 @@ def update_gcode_properties(self, props ):
13901390 return
13911391 # pop a dialog of the properties
13921392 msg = QtWidgets .QMessageBox ()
1393- msg .setIcon (QtWidgets .QMessageBox .Information )
1393+ msg .setIcon (QtWidgets .QMessageBox .Icon . Information )
13941394 msg .setText (smallmess )
13951395 msg .setWindowTitle ("Gcode Properties" )
1396- msg .setStandardButtons (QtWidgets .QMessageBox .Ok )
1396+ msg .setStandardButtons (QtWidgets .QMessageBox .StandardButton . Ok )
13971397 msg .show ()
1398- retval = msg .exec_ ()
1398+ retval = msg .exec ()
13991399
14001400 def touchoff (self , selector ):
14011401 if selector == 'touchplate' :
@@ -1702,7 +1702,7 @@ def adjust_stacked_widgets(self,requestedIndex,mode_change=False):
17021702 #print ('CURRENT:',name)
17031703 # record current qsplitter settings
17041704 self .w .settings .beginGroup ("qtdragon-{}" .format (self .w .splitter_h .objectName ()))
1705- self .w .settings .setValue (name , QtCore .QVariant ( self .w .splitter_h .saveState () .data ()))
1705+ self .w .settings .setValue (name , QtCore .self .w .splitter_h .saveState (.data ()))
17061706 self .w .settings .endGroup ()
17071707
17081708 # ignore, show or hide jog controls
0 commit comments