Commit b1bd27e7 authored by Jameson Graef Rollins's avatar Jameson Graef Rollins
Browse files

scope: some Qt import cleanup

parent 32e52258
......@@ -7,12 +7,14 @@ import numpy as np
import pyqtgraph as pg
try:
from qtpy import QtGui, QtWidgets, QtCore
from qtpy import QtGui, QtWidgets
from qtpy.QtCore import Qt, QRegularExpression
from qtpy.QtWidgets import QStyle, QFileDialog, QFontDialog
from qtpy.QtGui import QFont, QColor
from qtpy import uic
except ImportError:
from PyQt5 import QtGui, QtWidgets, QtCore
from PyQt5 import QtGui, QtWidgets
from PyQt5.QtCore import Qt, QRegularExpression
from PyQt5.QtWidgets import QStyle, QFileDialog, QFontDialog
from PyQt5.QtGui import QFont, QColor
from PyQt5 import uic
......@@ -125,7 +127,7 @@ class NDScope(QMainWindow, Ui_MainWindow):
# window/range entry
def NonEmptyValidator():
return QtGui.QRegularExpressionValidator(QtCore.QRegularExpression('.+'))
return QtGui.QRegularExpressionValidator(QRegularExpression('.+'))
self.entryT0GPS.textEdited.connect(self.update_entryT0Greg)
self.entryT0GPS.setValidator(QtGui.QDoubleValidator())
......@@ -349,12 +351,12 @@ class NDScope(QMainWindow, Ui_MainWindow):
self.graphView.setBackground(QColor('white'))
self.referenceTimeLabel.setAttr('color', QColor('black'))
self.referenceTimeLabel.setText(self.referenceTimeLabel.text)
self.backgroundCheckBox.setCheckState(QtCore.Qt.Checked)
self.backgroundCheckBox.setCheckState(Qt.Checked)
elif color == 'k':
self.graphView.setBackground(QColor('black'))
self.referenceTimeLabel.setAttr('color', QColor('white'))
self.referenceTimeLabel.setText(self.referenceTimeLabel.text)
self.backgroundCheckBox.setCheckState(QtCore.Qt.Unchecked)
self.backgroundCheckBox.setCheckState(Qt.Unchecked)
else:
raise ValueError("background color value must be 'w' or 'k'.")
......@@ -609,7 +611,7 @@ class NDScope(QMainWindow, Ui_MainWindow):
self.data.request(trend, (start, end))
def _fetch(self, **kwargs):
if QtGui.QApplication.keyboardModifiers() == QtCore.Qt.ShiftModifier:
if QtGui.QApplication.keyboardModifiers() == Qt.ShiftModifier:
self.data.reset()
if 't0' in kwargs:
t0 = kwargs['t0']
......@@ -1173,7 +1175,7 @@ class NDScope(QMainWindow, Ui_MainWindow):
self.set_font(font)
def _background_select(self, state):
if state == QtCore.Qt.Checked:
if state == Qt.Checked:
self.set_background('w')
else:
self.set_background('k')
......@@ -1254,7 +1256,7 @@ class NDScope(QMainWindow, Ui_MainWindow):
path,
)
kwargs = dict(
bw=(self.backgroundCheckBox.checkState() == QtCore.Qt.Checked),
bw=(self.backgroundCheckBox.checkState() == Qt.Checked),
window_title=self.windowTitle().replace('ndscope: ', ''),
time_window=self.get_window(),
font_size=self.font.pointSize(),
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment