Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def __init__(self, halcomp, widgets, paths):
self.w = widgets
self.gcodes = GCodes(widgets)
# This validator precludes using comma as a decimal
self.valid = QtGui.QRegExpValidator(QtCore.QRegExp('-?[0-9]{0,6}[.][0-9]{0,3}'))
self.valid = QtGui.QRegularExpressionValidator(QtCore.QRegularExpression('-?[0-9]{0,6}[.][0-9]{0,3}'))
self.KEYBIND = KEYBIND
KEYBIND.add_call('Key_F11','on_keycall_F11')
KEYBIND.add_call('Key_F12','on_keycall_F12')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def __init__(self, halcomp, widgets, paths):
self.PATHS = paths
self.gcodes = GCodes(widgets)
self._last_count = 0
self.valid = QtGui.QRegExpValidator(QtCore.QRegExp('-?[0-9]{0,6}[.][0-9]{0,3}'))
self.valid = QtGui.QRegularExpressionValidator(QtCore.QRegularExpression('-?[0-9]{0,6}[.][0-9]{0,3}'))
self.styleeditor = SSE(widgets, paths)
KEYBIND.add_call('Key_F10','on_keycall_F10')
KEYBIND.add_call('Key_F11','on_keycall_F11')
Expand Down
2 changes: 1 addition & 1 deletion lib/python/qtvcp/lib/auto_height/auto_height.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,4 +231,4 @@ def __setitem__(self, item, value):
app = QtWidgets.QApplication(sys.argv)
w = Auto_Measure()
w.show()
sys.exit( app.exec_() )
sys.exit( app.exec() )
18 changes: 9 additions & 9 deletions lib/python/qtvcp/lib/gcode_utility/facing.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import shutil

from qtpy import QtGui, QtWidgets, uic
from qtpy.QtCore import QFile, QRegExp
from qtpy.QtCore import QFile, QRegularExpression
from qtpy.QtWidgets import QFileDialog, QMessageBox

from linuxcnc import OPERATOR_ERROR, NML_ERROR
Expand Down Expand Up @@ -107,15 +107,15 @@ def units_changed(self):
def set_validator(self):
# set valid input formats for lineEdits
if self.rbtn_inch.isChecked():
valid_size = QtGui.QRegExpValidator(QRegExp('[0-9]{0,6}[.][0-9]{0,4}'))
valid_step = QtGui.QRegExpValidator(QRegExp('[0-9]{0,6}[.][0-9]{0,2}'))
valid_feed = QtGui.QRegExpValidator(QRegExp('[0-9]{0,6}[.][0-9]{0,3}'))
valid_size = QtGui.QRegularExpressionValidator(QRegularExpression('[0-9]{0,6}[.][0-9]{0,4}'))
valid_step = QtGui.QRegularExpressionValidator(QRegularExpression('[0-9]{0,6}[.][0-9]{0,2}'))
valid_feed = QtGui.QRegularExpressionValidator(QRegularExpression('[0-9]{0,6}[.][0-9]{0,3}'))
else:
valid_size = QtGui.QRegExpValidator(QRegExp('[0-9]{0,6}[.][0-9]{0,3}'))
valid_step = QtGui.QRegExpValidator(QRegExp('[0-9]{0,5}[.][0-9]{0,1}'))
valid_feed = QtGui.QRegExpValidator(QRegExp('[0-9]{0,5}[.][0-9]{0,1}'))
valid_size = QtGui.QRegularExpressionValidator(QRegularExpression('[0-9]{0,6}[.][0-9]{0,3}'))
valid_step = QtGui.QRegularExpressionValidator(QRegularExpression('[0-9]{0,5}[.][0-9]{0,1}'))
valid_feed = QtGui.QRegularExpressionValidator(QRegularExpression('[0-9]{0,5}[.][0-9]{0,1}'))
self.lineEdit_tool.setValidator(valid_size)
self.lineEdit_spindle.setValidator(QtGui.QRegExpValidator(QRegExp('[0-9]{0,5}')))
self.lineEdit_spindle.setValidator(QtGui.QRegularExpressionValidator(QRegularExpression('[0-9]{0,5}')))
self.lineEdit_feedrate.setValidator(valid_feed)
self.lineEdit_stepover.setValidator(valid_step)
self.lineEdit_size_x.setValidator(valid_size)
Expand Down Expand Up @@ -462,5 +462,5 @@ def _mktemp(self):
app = QtWidgets.QApplication(sys.argv)
w = Facing()
w.show()
sys.exit( app.exec_() )
sys.exit( app.exec() )

20 changes: 10 additions & 10 deletions lib/python/qtvcp/lib/gcode_utility/hole_circle.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import shutil

from qtpy import QtGui, QtWidgets, uic
from qtpy.QtCore import QPoint, QPointF, QLine, QRect, QFile, Qt, QEvent, QRegExp
from qtpy.QtCore import QPoint, QPointF, QLine, QRect, QFile, Qt, QEvent, QRegularExpression
from qtpy.QtWidgets import QFileDialog, QMessageBox
from qtpy.QtGui import QPainter, QBrush, QPen, QColor

Expand Down Expand Up @@ -168,18 +168,18 @@ def units_changed(self):
def set_validator(self):
# set valid input formats for lineEdits
if self.btn_inch.isChecked():
valid_size = QtGui.QRegExpValidator(QRegExp(r'^((\d+(\.\d{,4})?)|(\.\d{,4}))$'))
valid_radius = QtGui.QRegExpValidator(QRegExp(r'^((\d{1,3}(\.\d{1,4})?)|(\.\d{1,4}))$'))
valid_feed = QtGui.QRegExpValidator(QRegExp('[0-9]{0,6}[.][0-9]{0,3}'))
valid_size = QtGui.QRegularExpressionValidator(QRegularExpression(r'^((\d+(\.\d{,4})?)|(\.\d{,4}))$'))
valid_radius = QtGui.QRegularExpressionValidator(QRegularExpression(r'^((\d{1,3}(\.\d{1,4})?)|(\.\d{1,4}))$'))
valid_feed = QtGui.QRegularExpressionValidator(QRegularExpression('[0-9]{0,6}[.][0-9]{0,3}'))
else:
valid_size = QtGui.QRegExpValidator(QRegExp(r'^((\d+(\.\d{,3})?)|(\.\d{,3}))$'))
valid_radius = QtGui.QRegExpValidator(QRegExp(r'^((\d{1,4}(\.\d{1,3})?)|(\.\d{1,3}))$'))
valid_feed = QtGui.QRegExpValidator(QRegExp(r'\d{0,5}[.]\d{0,1}'))
valid_size = QtGui.QRegularExpressionValidator(QRegularExpression(r'^((\d+(\.\d{,3})?)|(\.\d{,3}))$'))
valid_radius = QtGui.QRegularExpressionValidator(QRegularExpression(r'^((\d{1,4}(\.\d{1,3})?)|(\.\d{1,3}))$'))
valid_feed = QtGui.QRegularExpressionValidator(QRegularExpression(r'\d{0,5}[.]\d{0,1}'))

self.lineEdit_spindle.setValidator(QtGui.QRegExpValidator(QRegExp(r'\d{0,5}')))
self.lineEdit_spindle.setValidator(QtGui.QRegularExpressionValidator(QRegularExpression(r'\d{0,5}')))
self.lineEdit_num_holes.setValidator(QtGui.QDoubleValidator(0, 99, 0))
self.lineEdit_radius.setValidator(valid_radius)
self.lineEdit_first.setValidator(QtGui.QRegExpValidator(QRegExp(r'\d{0,3}[.]\d{0,2}')))
self.lineEdit_first.setValidator(QtGui.QRegularExpressionValidator(QRegularExpression(r'\d{0,3}[.]\d{0,2}')))
self.lineEdit_safe_z.setValidator(valid_size)
self.lineEdit_start_height.setValidator(valid_size)
self.lineEdit_depth.setValidator(valid_size)
Expand Down Expand Up @@ -396,5 +396,5 @@ def next_line(self, text):
w = Hole_Circle()

w.show()
sys.exit( app.exec_() )
sys.exit( app.exec() )

20 changes: 10 additions & 10 deletions lib/python/qtvcp/lib/gcode_utility/hole_enlarge.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,15 @@ def __init__(self, parent=None):
except AttributeError as e:
print("Error: ", e)

self.lineEdit_tool.setValidator(QtGui.QRegExpValidator(QtCore.QRegExp('[0-9]{0,5}')))
self.lineEdit_spindle.setValidator(QtGui.QRegExpValidator(QtCore.QRegExp('[0-9]{0,5}')))
self.lineEdit_feed.setValidator(QtGui.QRegExpValidator(QtCore.QRegExp('[0-9]{0,4}')))
self.lineEdit_tool_dia.setValidator(QtGui.QRegExpValidator(QtCore.QRegExp('[0-9]{0,3}[.][0-9]{0,4}')))
self.lineEdit_start_dia.setValidator(QtGui.QRegExpValidator(QtCore.QRegExp('[0-9]{0,5}[.][0-9]{0,4}')))
self.lineEdit_final_dia.setValidator(QtGui.QRegExpValidator(QtCore.QRegExp('[0-9]{0,5}[.][0-9]{0,4}')))
self.lineEdit_loops.setValidator(QtGui.QRegExpValidator(QtCore.QRegExp('[0-9]{0,2}')))
self.lineEdit_cut_depth.setValidator(QtGui.QRegExpValidator(QtCore.QRegExp('[0-9]{0,4}[.][0-9]{0,4}')))
self.lineEdit_z_safe.setValidator(QtGui.QRegExpValidator(QtCore.QRegExp('[0-9]{0,4}')))
self.lineEdit_tool.setValidator(QtGui.QRegularExpressionValidator(QtCore.QRegularExpression('[0-9]{0,5}')))
self.lineEdit_spindle.setValidator(QtGui.QRegularExpressionValidator(QtCore.QRegularExpression('[0-9]{0,5}')))
self.lineEdit_feed.setValidator(QtGui.QRegularExpressionValidator(QtCore.QRegularExpression('[0-9]{0,4}')))
self.lineEdit_tool_dia.setValidator(QtGui.QRegularExpressionValidator(QtCore.QRegularExpression('[0-9]{0,3}[.][0-9]{0,4}')))
self.lineEdit_start_dia.setValidator(QtGui.QRegularExpressionValidator(QtCore.QRegularExpression('[0-9]{0,5}[.][0-9]{0,4}')))
self.lineEdit_final_dia.setValidator(QtGui.QRegularExpressionValidator(QtCore.QRegularExpression('[0-9]{0,5}[.][0-9]{0,4}')))
self.lineEdit_loops.setValidator(QtGui.QRegularExpressionValidator(QtCore.QRegularExpression('[0-9]{0,2}')))
self.lineEdit_cut_depth.setValidator(QtGui.QRegularExpressionValidator(QtCore.QRegularExpression('[0-9]{0,4}[.][0-9]{0,4}')))
self.lineEdit_z_safe.setValidator(QtGui.QRegularExpressionValidator(QtCore.QRegularExpression('[0-9]{0,4}')))

self.red_border = "border: 2px solid red;"
self.black_border = "border: 2px solid black;"
Expand Down Expand Up @@ -381,5 +381,5 @@ def __setitem__(self, item, value):
app = QtWidgets.QApplication(sys.argv)
w = Hole_Enlarge()
w.show()
sys.exit( app.exec_() )
sys.exit( app.exec() )

2 changes: 1 addition & 1 deletion lib/python/qtvcp/lib/mdi_subprogram/mdi_command_process.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,5 +137,5 @@ def __setitem__(self, item, value):
w.show()


sys.exit( app.exec_() )
sys.exit( app.exec() )

2 changes: 1 addition & 1 deletion lib/python/qtvcp/lib/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -295,4 +295,4 @@ def callreturn(dialog, btn, pinname):
w.setWindowTitle("PyQt Dialog demo")
w.setGeometry(300, 300, 300, 150)
w.show()
sys.exit(app.exec_())
sys.exit(app.exec())
8 changes: 4 additions & 4 deletions lib/python/qtvcp/lib/qt_ngcgui/ngcgui.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import datetime
import shutil
from qtpy import QtGui, QtWidgets, QtCore, uic
from qtpy.QtCore import QRegExp
from qtpy.QtCore import QRegularExpression
from qtpy.QtWidgets import QFileDialog, QHBoxLayout, QVBoxLayout, QLabel, QWidget, QLineEdit, QMessageBox
from qtvcp.core import Action, Info, Path
from qtvcp import logger
Expand Down Expand Up @@ -150,8 +150,8 @@ def new_label(self, width, text):
return lbl

def new_lineedit(self, key, data):
# QRegExp('^[+-]?((\d+(\.\d{,4})?)|(\.\d{,4}))$' allows max 4 digits after the decimal
valid = QtGui.QRegExpValidator(QRegExp(r'^[+-]?((\d+(\.\d{,4})?)|(\.\d{,4}))$'))
# QRegularExpression('^[+-]?((\d+(\.\d{,4})?)|(\.\d{,4}))$' allows max 4 digits after the decimal
valid = QtGui.QRegularExpressionValidator(QRegularExpression(r'^[+-]?((\d+(\.\d{,4})?)|(\.\d{,4}))$'))
lineedit = QLineEdit(str(data))
lineedit.parm_no = key
lineedit.setMaxLength(10)
Expand Down Expand Up @@ -1011,5 +1011,5 @@ def save_a_copy(fname, archive_dir='/tmp/old_ngc'):
app = QtWidgets.QApplication(sys.argv)
w = NgcGui()
w.show()
sys.exit( app.exec_() )
sys.exit( app.exec() )

2 changes: 1 addition & 1 deletion lib/python/qtvcp/lib/qt_pdf/PDFViewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ def main():
filename = argv[-1]
view = pdf_view(filename)
view.show()
sys.exit(app.exec_())
sys.exit(app.exec())

if __name__ == '__main__':
main()
2 changes: 1 addition & 1 deletion lib/python/qtvcp/lib/qt_vismach/qt_vismach.py
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@ def main(model, tool, work, size=10, hud=None, rotation_vectors=None, lat=0, lon

window.setZoomRange(int(t.near),int(t.far))
window.show()
sys.exit(app.exec_())
sys.exit(app.exec())


if __name__ == '__main__':
Expand Down
2 changes: 1 addition & 1 deletion lib/python/qtvcp/lib/qtplasmac/conversational.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ def conv_save_pressed(P, W):
dlg.setDefaultSuffix('ngc')
dlg.setDirectory(P.programPrefix)
name = ''
if dlg.exec_():
if dlg.exec():
name = dlg.selectedFiles()[0]
if name:
COPY(P.fNgc, name)
Expand Down
2 changes: 1 addition & 1 deletion lib/python/qtvcp/lib/sys_notify.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,4 +283,4 @@ def onClose(n):
n.onClose(onClose)

n.show()
app.exec_()
app.exec()
4 changes: 2 additions & 2 deletions lib/python/qtvcp/lib/toolbar_actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ def actOnProperties(self, widget, state=None):
msg.setWindowTitle("Gcode Properties")
msg.setStandardButtons(QtWidgets.QMessageBox.Ok)
msg.show()
retval = msg.exec_()
retval = msg.exec()

def actOnRun(self, widget, state=None):
ACTION.RUN()
Expand Down Expand Up @@ -580,7 +580,7 @@ def actOnAbout(self, widget, state=None):
msg.setIcon(QtWidgets.QMessageBox.Information)
msg.setStandardButtons(QtWidgets.QMessageBox.Ok)
msg.show()
retval = msg.exec_()
retval = msg.exec()

def actOnRunFromLine(self, widget, state=False):
STATUS.emit('dialog-request', {'NAME': 'RUNFROMLINE', 'LINE':self.selected_line})
Expand Down
8 changes: 4 additions & 4 deletions lib/python/qtvcp/lib/writer/writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ def closeEvent(self, event):

popup.setDefaultButton(QtWidgets.QMessageBox.Save)

answer = popup.exec_()
answer = popup.exec()

if answer == QtWidgets.QMessageBox.Save:
self.save()
Expand Down Expand Up @@ -611,14 +611,14 @@ def preview(self):
# If a print is requested, open print dialog
preview.paintRequested.connect(lambda p: self.text.print_(p))

preview.exec_()
preview.exec()

def printHandler(self):

# Open printing dialog
dialog = QtPrintSupport.QPrintDialog()

if dialog.exec_() == QtWidgets.QDialog.Accepted:
if dialog.exec() == QtWidgets.QDialog.Accepted:
self.text.document().print_(dialog.printer())

def cursorPosition(self):
Expand Down Expand Up @@ -874,7 +874,7 @@ def main():
main = Main()
main.show()

sys.exit(app.exec_())
sys.exit(app.exec())


if __name__ == "__main__":
Expand Down
Loading
Loading