Merge pull request #1533 from pijyoi/kill_qt4_shim
Remove scale rotate translate Qt4 shims
This commit is contained in:
commit
f5a823bf38
@ -41,7 +41,7 @@ v.addItem(im1)
|
||||
v.addItem(im2)
|
||||
im2.moveBy(110, 20)
|
||||
v.setRange(QtCore.QRectF(0, 0, 200, 120))
|
||||
im1.scale(0.8, 0.5)
|
||||
im1.setTransform(QtGui.QTransform.fromScale(0.8, 0.5))
|
||||
|
||||
im3 = pg.ImageItem()
|
||||
v2 = w.addViewBox(1,0)
|
||||
|
@ -17,7 +17,7 @@ vb.setAspectLocked()
|
||||
|
||||
img = pg.ImageItem()
|
||||
img.setImage(np.random.normal(size=(100,100)))
|
||||
img.scale(0.01, 0.01)
|
||||
img.setScale(0.01)
|
||||
vb.addItem(img)
|
||||
|
||||
scale = pg.ScaleBar(size=0.1)
|
||||
|
@ -133,7 +133,7 @@ view.addItem(box1)
|
||||
box2 = MenuBox("Menu Box #2")
|
||||
box2.setParentItem(box1)
|
||||
box2.setPos(5, 5)
|
||||
box2.scale(0.2, 0.2)
|
||||
box2.setScale(0.2)
|
||||
|
||||
## Start Qt event loop unless running in interactive mode or using pyside.
|
||||
if __name__ == '__main__':
|
||||
|
@ -71,8 +71,8 @@ hist.setLevels(data.min(), data.max())
|
||||
iso.setData(pg.gaussianFilter(data, (2, 2)))
|
||||
|
||||
# set position and scale of image
|
||||
img.scale(0.2, 0.2)
|
||||
img.translate(-50, 0)
|
||||
tr = QtGui.QTransform()
|
||||
img.setTransform(tr.scale(0.2, 0.2).translate(-50, 0))
|
||||
|
||||
# zoom to fit imageo
|
||||
p1.autoRange()
|
||||
|
@ -147,10 +147,9 @@ class Optic(pg.GraphicsObject, ParamObj):
|
||||
self.setParams(**defaults)
|
||||
|
||||
def updateTransform(self):
|
||||
self.resetTransform()
|
||||
self.setPos(0, 0)
|
||||
self.translate(Point(self['pos']))
|
||||
self.rotate(self['angle'])
|
||||
tr = QtGui.QTransform()
|
||||
self.setTransform(tr.translate(Point(self['pos'])).rotate(self['angle']))
|
||||
|
||||
def setParam(self, param, val):
|
||||
ParamObj.setParam(self, param, val)
|
||||
@ -160,7 +159,7 @@ class Optic(pg.GraphicsObject, ParamObj):
|
||||
# Move graphics item
|
||||
self.gitem.setPos(Point(self['pos']))
|
||||
self.gitem.resetTransform()
|
||||
self.gitem.rotate(self['angle'])
|
||||
self.gitem.setRotation(self['angle'])
|
||||
|
||||
# Move ROI to match
|
||||
try:
|
||||
@ -179,7 +178,7 @@ class Optic(pg.GraphicsObject, ParamObj):
|
||||
pos = self.roi.pos()
|
||||
# rotate gitem temporarily so we can decide where it will need to move
|
||||
self.gitem.resetTransform()
|
||||
self.gitem.rotate(self.roi.angle())
|
||||
self.gitem.setRotation(self.roi.angle())
|
||||
br = self.gitem.boundingRect()
|
||||
o1 = self.gitem.mapToParent(br.topLeft())
|
||||
self.setParams(angle=self.roi.angle(), pos=pos + (self.gitem.pos() - o1))
|
||||
|
@ -678,7 +678,8 @@ class ClockItem(pg.ItemGroup):
|
||||
pg.ItemGroup.__init__(self)
|
||||
self.size = clock.size
|
||||
self.item = QtGui.QGraphicsEllipseItem(QtCore.QRectF(0, 0, self.size, self.size))
|
||||
self.item.translate(-self.size*0.5, -self.size*0.5)
|
||||
tr = QtGui.QTransform.fromTranslate(-self.size*0.5, -self.size*0.5)
|
||||
self.item.setTransform(tr)
|
||||
self.item.setPen(pg.mkPen(100,100,100))
|
||||
self.item.setBrush(clock.brush)
|
||||
self.hand = QtGui.QGraphicsLineItem(0, 0, 0, self.size*0.5)
|
||||
@ -722,19 +723,19 @@ class ClockItem(pg.ItemGroup):
|
||||
t = data['pt'][self.i]
|
||||
self.hand.setRotation(-0.25 * t * 360.)
|
||||
|
||||
self.resetTransform()
|
||||
v = data['v'][self.i]
|
||||
gam = (1.0 - v**2)**0.5
|
||||
self.scale(gam, 1.0)
|
||||
self.setTransform(QtGui.QTransform.fromScale(gam, 1.0))
|
||||
|
||||
f = data['f'][self.i]
|
||||
self.flare.resetTransform()
|
||||
tr = QtGui.QTransform()
|
||||
if f < 0:
|
||||
self.flare.translate(self.size*0.4, 0)
|
||||
tr.translate(self.size*0.4, 0)
|
||||
else:
|
||||
self.flare.translate(-self.size*0.4, 0)
|
||||
tr.translate(-self.size*0.4, 0)
|
||||
|
||||
self.flare.scale(-f * (0.5+np.random.random()*0.1), 1.0)
|
||||
tr.scale(-f * (0.5+np.random.random()*0.1), 1.0)
|
||||
self.flare.setTransform(tr)
|
||||
|
||||
if self._spaceline is not None:
|
||||
self._spaceline.setPos(pg.Point(data['x'][self.i], data['t'][self.i]))
|
||||
|
@ -295,52 +295,13 @@ if QT_LIB in [PYQT5, PYQT6, PYSIDE2, PYSIDE6]:
|
||||
# We're using Qt5 which has a different structure so we're going to use a shim to
|
||||
# recreate the Qt4 structure
|
||||
|
||||
__QGraphicsItem_scale = QtWidgets.QGraphicsItem.scale
|
||||
|
||||
def scale(self, *args):
|
||||
if args:
|
||||
sx, sy = args
|
||||
tr = self.transform()
|
||||
tr.scale(sx, sy)
|
||||
self.setTransform(tr)
|
||||
else:
|
||||
return __QGraphicsItem_scale(self)
|
||||
|
||||
QtWidgets.QGraphicsItem.scale = scale
|
||||
|
||||
def rotate(self, angle):
|
||||
tr = self.transform()
|
||||
tr.rotate(angle)
|
||||
self.setTransform(tr)
|
||||
QtWidgets.QGraphicsItem.rotate = rotate
|
||||
|
||||
def translate(self, dx, dy):
|
||||
tr = self.transform()
|
||||
tr.translate(dx, dy)
|
||||
self.setTransform(tr)
|
||||
QtWidgets.QGraphicsItem.translate = translate
|
||||
|
||||
def setMargin(self, i):
|
||||
self.setContentsMargins(i, i, i, i)
|
||||
QtWidgets.QGridLayout.setMargin = setMargin
|
||||
|
||||
def setResizeMode(self, *args):
|
||||
self.setSectionResizeMode(*args)
|
||||
QtWidgets.QHeaderView.setResizeMode = setResizeMode
|
||||
|
||||
|
||||
QtGui.QApplication = QtWidgets.QApplication
|
||||
QtGui.QGraphicsScene = QtWidgets.QGraphicsScene
|
||||
QtGui.QGraphicsObject = QtWidgets.QGraphicsObject
|
||||
QtGui.QGraphicsWidget = QtWidgets.QGraphicsWidget
|
||||
|
||||
QtGui.QApplication.setGraphicsSystem = None
|
||||
|
||||
# Import all QtWidgets objects into QtGui
|
||||
for o in dir(QtWidgets):
|
||||
if o.startswith('Q'):
|
||||
setattr(QtGui, o, getattr(QtWidgets,o) )
|
||||
|
||||
QtGui.QApplication.setGraphicsSystem = None
|
||||
|
||||
|
||||
if QT_LIB in [PYQT6, PYSIDE6]:
|
||||
# We're using Qt6 which has a different structure so we're going to use a shim to
|
||||
|
@ -1,127 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Form implementation generated from reading ui file 'pyqtgraph/console/template.ui'
|
||||
#
|
||||
# Created by: PyQt4 UI code generator 4.11.4
|
||||
#
|
||||
# WARNING! All changes made in this file will be lost!
|
||||
|
||||
from PyQt4 import QtCore, QtGui
|
||||
|
||||
try:
|
||||
_fromUtf8 = QtCore.QString.fromUtf8
|
||||
except AttributeError:
|
||||
def _fromUtf8(s):
|
||||
return s
|
||||
|
||||
try:
|
||||
_encoding = QtGui.QApplication.UnicodeUTF8
|
||||
def _translate(context, text, disambig):
|
||||
return QtGui.QApplication.translate(context, text, disambig, _encoding)
|
||||
except AttributeError:
|
||||
def _translate(context, text, disambig):
|
||||
return QtGui.QApplication.translate(context, text, disambig)
|
||||
|
||||
class Ui_Form(object):
|
||||
def setupUi(self, Form):
|
||||
Form.setObjectName(_fromUtf8("Form"))
|
||||
Form.resize(739, 497)
|
||||
self.gridLayout = QtGui.QGridLayout(Form)
|
||||
self.gridLayout.setMargin(0)
|
||||
self.gridLayout.setSpacing(0)
|
||||
self.gridLayout.setObjectName(_fromUtf8("gridLayout"))
|
||||
self.splitter = QtGui.QSplitter(Form)
|
||||
self.splitter.setOrientation(QtCore.Qt.Vertical)
|
||||
self.splitter.setObjectName(_fromUtf8("splitter"))
|
||||
self.layoutWidget = QtGui.QWidget(self.splitter)
|
||||
self.layoutWidget.setObjectName(_fromUtf8("layoutWidget"))
|
||||
self.verticalLayout = QtGui.QVBoxLayout(self.layoutWidget)
|
||||
self.verticalLayout.setObjectName(_fromUtf8("verticalLayout"))
|
||||
self.output = QtGui.QPlainTextEdit(self.layoutWidget)
|
||||
font = QtGui.QFont()
|
||||
font.setFamily(_fromUtf8("Monospace"))
|
||||
self.output.setFont(font)
|
||||
self.output.setReadOnly(True)
|
||||
self.output.setObjectName(_fromUtf8("output"))
|
||||
self.verticalLayout.addWidget(self.output)
|
||||
self.horizontalLayout = QtGui.QHBoxLayout()
|
||||
self.horizontalLayout.setObjectName(_fromUtf8("horizontalLayout"))
|
||||
self.input = CmdInput(self.layoutWidget)
|
||||
self.input.setObjectName(_fromUtf8("input"))
|
||||
self.horizontalLayout.addWidget(self.input)
|
||||
self.historyBtn = QtGui.QPushButton(self.layoutWidget)
|
||||
self.historyBtn.setCheckable(True)
|
||||
self.historyBtn.setObjectName(_fromUtf8("historyBtn"))
|
||||
self.horizontalLayout.addWidget(self.historyBtn)
|
||||
self.exceptionBtn = QtGui.QPushButton(self.layoutWidget)
|
||||
self.exceptionBtn.setCheckable(True)
|
||||
self.exceptionBtn.setObjectName(_fromUtf8("exceptionBtn"))
|
||||
self.horizontalLayout.addWidget(self.exceptionBtn)
|
||||
self.verticalLayout.addLayout(self.horizontalLayout)
|
||||
self.historyList = QtGui.QListWidget(self.splitter)
|
||||
font = QtGui.QFont()
|
||||
font.setFamily(_fromUtf8("Monospace"))
|
||||
self.historyList.setFont(font)
|
||||
self.historyList.setObjectName(_fromUtf8("historyList"))
|
||||
self.exceptionGroup = QtGui.QGroupBox(self.splitter)
|
||||
self.exceptionGroup.setObjectName(_fromUtf8("exceptionGroup"))
|
||||
self.gridLayout_2 = QtGui.QGridLayout(self.exceptionGroup)
|
||||
self.gridLayout_2.setContentsMargins(-1, 0, -1, 0)
|
||||
self.gridLayout_2.setHorizontalSpacing(2)
|
||||
self.gridLayout_2.setVerticalSpacing(0)
|
||||
self.gridLayout_2.setObjectName(_fromUtf8("gridLayout_2"))
|
||||
self.clearExceptionBtn = QtGui.QPushButton(self.exceptionGroup)
|
||||
self.clearExceptionBtn.setEnabled(False)
|
||||
self.clearExceptionBtn.setObjectName(_fromUtf8("clearExceptionBtn"))
|
||||
self.gridLayout_2.addWidget(self.clearExceptionBtn, 0, 6, 1, 1)
|
||||
self.catchAllExceptionsBtn = QtGui.QPushButton(self.exceptionGroup)
|
||||
self.catchAllExceptionsBtn.setCheckable(True)
|
||||
self.catchAllExceptionsBtn.setObjectName(_fromUtf8("catchAllExceptionsBtn"))
|
||||
self.gridLayout_2.addWidget(self.catchAllExceptionsBtn, 0, 1, 1, 1)
|
||||
self.catchNextExceptionBtn = QtGui.QPushButton(self.exceptionGroup)
|
||||
self.catchNextExceptionBtn.setCheckable(True)
|
||||
self.catchNextExceptionBtn.setObjectName(_fromUtf8("catchNextExceptionBtn"))
|
||||
self.gridLayout_2.addWidget(self.catchNextExceptionBtn, 0, 0, 1, 1)
|
||||
self.onlyUncaughtCheck = QtGui.QCheckBox(self.exceptionGroup)
|
||||
self.onlyUncaughtCheck.setChecked(True)
|
||||
self.onlyUncaughtCheck.setObjectName(_fromUtf8("onlyUncaughtCheck"))
|
||||
self.gridLayout_2.addWidget(self.onlyUncaughtCheck, 0, 4, 1, 1)
|
||||
self.exceptionStackList = QtGui.QListWidget(self.exceptionGroup)
|
||||
self.exceptionStackList.setAlternatingRowColors(True)
|
||||
self.exceptionStackList.setObjectName(_fromUtf8("exceptionStackList"))
|
||||
self.gridLayout_2.addWidget(self.exceptionStackList, 2, 0, 1, 7)
|
||||
self.runSelectedFrameCheck = QtGui.QCheckBox(self.exceptionGroup)
|
||||
self.runSelectedFrameCheck.setChecked(True)
|
||||
self.runSelectedFrameCheck.setObjectName(_fromUtf8("runSelectedFrameCheck"))
|
||||
self.gridLayout_2.addWidget(self.runSelectedFrameCheck, 3, 0, 1, 7)
|
||||
self.exceptionInfoLabel = QtGui.QLabel(self.exceptionGroup)
|
||||
self.exceptionInfoLabel.setWordWrap(True)
|
||||
self.exceptionInfoLabel.setObjectName(_fromUtf8("exceptionInfoLabel"))
|
||||
self.gridLayout_2.addWidget(self.exceptionInfoLabel, 1, 0, 1, 7)
|
||||
spacerItem = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
|
||||
self.gridLayout_2.addItem(spacerItem, 0, 5, 1, 1)
|
||||
self.label = QtGui.QLabel(self.exceptionGroup)
|
||||
self.label.setObjectName(_fromUtf8("label"))
|
||||
self.gridLayout_2.addWidget(self.label, 0, 2, 1, 1)
|
||||
self.filterText = QtGui.QLineEdit(self.exceptionGroup)
|
||||
self.filterText.setObjectName(_fromUtf8("filterText"))
|
||||
self.gridLayout_2.addWidget(self.filterText, 0, 3, 1, 1)
|
||||
self.gridLayout.addWidget(self.splitter, 0, 0, 1, 1)
|
||||
|
||||
self.retranslateUi(Form)
|
||||
QtCore.QMetaObject.connectSlotsByName(Form)
|
||||
|
||||
def retranslateUi(self, Form):
|
||||
Form.setWindowTitle(_translate("Form", "Console", None))
|
||||
self.historyBtn.setText(_translate("Form", "History..", None))
|
||||
self.exceptionBtn.setText(_translate("Form", "Exceptions..", None))
|
||||
self.exceptionGroup.setTitle(_translate("Form", "Exception Handling", None))
|
||||
self.clearExceptionBtn.setText(_translate("Form", "Clear Stack", None))
|
||||
self.catchAllExceptionsBtn.setText(_translate("Form", "Show All Exceptions", None))
|
||||
self.catchNextExceptionBtn.setText(_translate("Form", "Show Next Exception", None))
|
||||
self.onlyUncaughtCheck.setText(_translate("Form", "Only Uncaught Exceptions", None))
|
||||
self.runSelectedFrameCheck.setText(_translate("Form", "Run commands in selected stack frame", None))
|
||||
self.exceptionInfoLabel.setText(_translate("Form", "Stack Trace", None))
|
||||
self.label.setText(_translate("Form", "Filter (regex):", None))
|
||||
|
||||
from .CmdInput import CmdInput
|
@ -1,115 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Form implementation generated from reading ui file 'pyqtgraph/console/template.ui'
|
||||
#
|
||||
# Created: Tue Sep 19 09:45:18 2017
|
||||
# by: pyside-uic 0.2.15 running on PySide 1.2.2
|
||||
#
|
||||
# WARNING! All changes made in this file will be lost!
|
||||
|
||||
from PySide import QtCore, QtGui
|
||||
|
||||
class Ui_Form(object):
|
||||
def setupUi(self, Form):
|
||||
Form.setObjectName("Form")
|
||||
Form.resize(739, 497)
|
||||
self.gridLayout = QtGui.QGridLayout(Form)
|
||||
self.gridLayout.setContentsMargins(0, 0, 0, 0)
|
||||
self.gridLayout.setSpacing(0)
|
||||
self.gridLayout.setObjectName("gridLayout")
|
||||
self.splitter = QtGui.QSplitter(Form)
|
||||
self.splitter.setOrientation(QtCore.Qt.Vertical)
|
||||
self.splitter.setObjectName("splitter")
|
||||
self.layoutWidget = QtGui.QWidget(self.splitter)
|
||||
self.layoutWidget.setObjectName("layoutWidget")
|
||||
self.verticalLayout = QtGui.QVBoxLayout(self.layoutWidget)
|
||||
self.verticalLayout.setContentsMargins(0, 0, 0, 0)
|
||||
self.verticalLayout.setObjectName("verticalLayout")
|
||||
self.output = QtGui.QPlainTextEdit(self.layoutWidget)
|
||||
font = QtGui.QFont()
|
||||
font.setFamily("Monospace")
|
||||
self.output.setFont(font)
|
||||
self.output.setReadOnly(True)
|
||||
self.output.setObjectName("output")
|
||||
self.verticalLayout.addWidget(self.output)
|
||||
self.horizontalLayout = QtGui.QHBoxLayout()
|
||||
self.horizontalLayout.setObjectName("horizontalLayout")
|
||||
self.input = CmdInput(self.layoutWidget)
|
||||
self.input.setObjectName("input")
|
||||
self.horizontalLayout.addWidget(self.input)
|
||||
self.historyBtn = QtGui.QPushButton(self.layoutWidget)
|
||||
self.historyBtn.setCheckable(True)
|
||||
self.historyBtn.setObjectName("historyBtn")
|
||||
self.horizontalLayout.addWidget(self.historyBtn)
|
||||
self.exceptionBtn = QtGui.QPushButton(self.layoutWidget)
|
||||
self.exceptionBtn.setCheckable(True)
|
||||
self.exceptionBtn.setObjectName("exceptionBtn")
|
||||
self.horizontalLayout.addWidget(self.exceptionBtn)
|
||||
self.verticalLayout.addLayout(self.horizontalLayout)
|
||||
self.historyList = QtGui.QListWidget(self.splitter)
|
||||
font = QtGui.QFont()
|
||||
font.setFamily("Monospace")
|
||||
self.historyList.setFont(font)
|
||||
self.historyList.setObjectName("historyList")
|
||||
self.exceptionGroup = QtGui.QGroupBox(self.splitter)
|
||||
self.exceptionGroup.setObjectName("exceptionGroup")
|
||||
self.gridLayout_2 = QtGui.QGridLayout(self.exceptionGroup)
|
||||
self.gridLayout_2.setContentsMargins(-1, 0, -1, 0)
|
||||
self.gridLayout_2.setHorizontalSpacing(2)
|
||||
self.gridLayout_2.setVerticalSpacing(0)
|
||||
self.gridLayout_2.setObjectName("gridLayout_2")
|
||||
self.clearExceptionBtn = QtGui.QPushButton(self.exceptionGroup)
|
||||
self.clearExceptionBtn.setEnabled(False)
|
||||
self.clearExceptionBtn.setObjectName("clearExceptionBtn")
|
||||
self.gridLayout_2.addWidget(self.clearExceptionBtn, 0, 6, 1, 1)
|
||||
self.catchAllExceptionsBtn = QtGui.QPushButton(self.exceptionGroup)
|
||||
self.catchAllExceptionsBtn.setCheckable(True)
|
||||
self.catchAllExceptionsBtn.setObjectName("catchAllExceptionsBtn")
|
||||
self.gridLayout_2.addWidget(self.catchAllExceptionsBtn, 0, 1, 1, 1)
|
||||
self.catchNextExceptionBtn = QtGui.QPushButton(self.exceptionGroup)
|
||||
self.catchNextExceptionBtn.setCheckable(True)
|
||||
self.catchNextExceptionBtn.setObjectName("catchNextExceptionBtn")
|
||||
self.gridLayout_2.addWidget(self.catchNextExceptionBtn, 0, 0, 1, 1)
|
||||
self.onlyUncaughtCheck = QtGui.QCheckBox(self.exceptionGroup)
|
||||
self.onlyUncaughtCheck.setChecked(True)
|
||||
self.onlyUncaughtCheck.setObjectName("onlyUncaughtCheck")
|
||||
self.gridLayout_2.addWidget(self.onlyUncaughtCheck, 0, 4, 1, 1)
|
||||
self.exceptionStackList = QtGui.QListWidget(self.exceptionGroup)
|
||||
self.exceptionStackList.setAlternatingRowColors(True)
|
||||
self.exceptionStackList.setObjectName("exceptionStackList")
|
||||
self.gridLayout_2.addWidget(self.exceptionStackList, 2, 0, 1, 7)
|
||||
self.runSelectedFrameCheck = QtGui.QCheckBox(self.exceptionGroup)
|
||||
self.runSelectedFrameCheck.setChecked(True)
|
||||
self.runSelectedFrameCheck.setObjectName("runSelectedFrameCheck")
|
||||
self.gridLayout_2.addWidget(self.runSelectedFrameCheck, 3, 0, 1, 7)
|
||||
self.exceptionInfoLabel = QtGui.QLabel(self.exceptionGroup)
|
||||
self.exceptionInfoLabel.setWordWrap(True)
|
||||
self.exceptionInfoLabel.setObjectName("exceptionInfoLabel")
|
||||
self.gridLayout_2.addWidget(self.exceptionInfoLabel, 1, 0, 1, 7)
|
||||
spacerItem = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
|
||||
self.gridLayout_2.addItem(spacerItem, 0, 5, 1, 1)
|
||||
self.label = QtGui.QLabel(self.exceptionGroup)
|
||||
self.label.setObjectName("label")
|
||||
self.gridLayout_2.addWidget(self.label, 0, 2, 1, 1)
|
||||
self.filterText = QtGui.QLineEdit(self.exceptionGroup)
|
||||
self.filterText.setObjectName("filterText")
|
||||
self.gridLayout_2.addWidget(self.filterText, 0, 3, 1, 1)
|
||||
self.gridLayout.addWidget(self.splitter, 0, 0, 1, 1)
|
||||
|
||||
self.retranslateUi(Form)
|
||||
QtCore.QMetaObject.connectSlotsByName(Form)
|
||||
|
||||
def retranslateUi(self, Form):
|
||||
Form.setWindowTitle(QtGui.QApplication.translate("Form", "Console", None, QtGui.QApplication.UnicodeUTF8))
|
||||
self.historyBtn.setText(QtGui.QApplication.translate("Form", "History..", None, QtGui.QApplication.UnicodeUTF8))
|
||||
self.exceptionBtn.setText(QtGui.QApplication.translate("Form", "Exceptions..", None, QtGui.QApplication.UnicodeUTF8))
|
||||
self.exceptionGroup.setTitle(QtGui.QApplication.translate("Form", "Exception Handling", None, QtGui.QApplication.UnicodeUTF8))
|
||||
self.clearExceptionBtn.setText(QtGui.QApplication.translate("Form", "Clear Stack", None, QtGui.QApplication.UnicodeUTF8))
|
||||
self.catchAllExceptionsBtn.setText(QtGui.QApplication.translate("Form", "Show All Exceptions", None, QtGui.QApplication.UnicodeUTF8))
|
||||
self.catchNextExceptionBtn.setText(QtGui.QApplication.translate("Form", "Show Next Exception", None, QtGui.QApplication.UnicodeUTF8))
|
||||
self.onlyUncaughtCheck.setText(QtGui.QApplication.translate("Form", "Only Uncaught Exceptions", None, QtGui.QApplication.UnicodeUTF8))
|
||||
self.runSelectedFrameCheck.setText(QtGui.QApplication.translate("Form", "Run commands in selected stack frame", None, QtGui.QApplication.UnicodeUTF8))
|
||||
self.exceptionInfoLabel.setText(QtGui.QApplication.translate("Form", "Stack Trace", None, QtGui.QApplication.UnicodeUTF8))
|
||||
self.label.setText(QtGui.QApplication.translate("Form", "Filter (regex):", None, QtGui.QApplication.UnicodeUTF8))
|
||||
|
||||
from .CmdInput import CmdInput
|
@ -42,37 +42,36 @@ def test_simple():
|
||||
rect = pg.QtGui.QGraphicsRectItem(0, 0, 100, 100)
|
||||
scene.addItem(rect)
|
||||
rect.setPos(20,20)
|
||||
rect.translate(50, 50)
|
||||
rect.rotate(30)
|
||||
rect.scale(0.5, 0.5)
|
||||
tr = pg.QtGui.QTransform()
|
||||
rect.setTransform(tr.translate(50, 50).rotate(30).scale(0.5, 0.5))
|
||||
|
||||
rect1 = pg.QtGui.QGraphicsRectItem(0, 0, 100, 100)
|
||||
rect1.setParentItem(rect)
|
||||
rect1.setFlag(rect1.ItemIgnoresTransformations)
|
||||
rect1.setPos(20, 20)
|
||||
rect1.scale(2,2)
|
||||
rect1.setScale(2)
|
||||
|
||||
el1 = pg.QtGui.QGraphicsEllipseItem(0, 0, 100, 100)
|
||||
el1.setParentItem(rect1)
|
||||
grp = pg.ItemGroup()
|
||||
grp.setParentItem(rect)
|
||||
grp.translate(200,0)
|
||||
grp.rotate(30)
|
||||
tr = pg.QtGui.QTransform()
|
||||
grp.setTransform(tr.translate(200, 0).rotate(30))
|
||||
|
||||
rect2 = pg.QtGui.QGraphicsRectItem(0, 0, 100, 25)
|
||||
rect2.setFlag(rect2.ItemClipsChildrenToShape)
|
||||
rect2.setParentItem(grp)
|
||||
rect2.setPos(0,25)
|
||||
rect2.rotate(30)
|
||||
rect2.setRotation(30)
|
||||
el = pg.QtGui.QGraphicsEllipseItem(0, 0, 100, 50)
|
||||
el.translate(10,-5)
|
||||
el.scale(0.5,2)
|
||||
tr = pg.QtGui.QTransform()
|
||||
el.setTransform(tr.translate(10, -5).scale(0.5, 2))
|
||||
|
||||
el.setParentItem(rect2)
|
||||
|
||||
grp2 = pg.ItemGroup()
|
||||
scene.addItem(grp2)
|
||||
grp2.scale(100,100)
|
||||
grp2.setScale(100)
|
||||
|
||||
rect3 = pg.QtGui.QGraphicsRectItem(0,0,2,2)
|
||||
rect3.setPen(pg.mkPen(width=1, cosmetic=False))
|
||||
|
@ -616,10 +616,7 @@ class FlowchartCtrlWidget(QtGui.QWidget):
|
||||
self.cwWin.resize(1000,800)
|
||||
|
||||
h = self.ui.ctrlList.header()
|
||||
if QT_LIB in ['PyQt4', 'PySide']:
|
||||
h.setResizeMode(0, h.Stretch)
|
||||
else:
|
||||
h.setSectionResizeMode(0, h.Stretch)
|
||||
h.setSectionResizeMode(0, h.ResizeMode.Stretch)
|
||||
|
||||
self.ui.ctrlList.itemChanged.connect(self.itemChanged)
|
||||
self.ui.loadBtn.clicked.connect(self.loadClicked)
|
||||
|
@ -302,7 +302,7 @@ class TerminalGraphicsItem(GraphicsObject):
|
||||
self.box = QtGui.QGraphicsRectItem(0, 0, 10, 10, self)
|
||||
on_update = self.labelChanged if self.term.isRenamable() else None
|
||||
self.label = TextItem(self.term.name(), self, on_update)
|
||||
self.label.scale(0.7, 0.7)
|
||||
self.label.setScale(0.7)
|
||||
self.newConnection = None
|
||||
self.setFiltersChildEvents(True) ## to pick up mouse events on the rectitem
|
||||
if self.term.isRenamable():
|
||||
|
@ -50,7 +50,7 @@ class AxisItem(GraphicsWidget):
|
||||
if orientation not in ['left', 'right', 'top', 'bottom']:
|
||||
raise Exception("Orientation argument must be one of 'left', 'right', 'top', or 'bottom'.")
|
||||
if orientation in ['left', 'right']:
|
||||
self.label.rotate(-90)
|
||||
self.label.setRotation(-90)
|
||||
|
||||
self.style = {
|
||||
'tickTextOffset': [5, 2], ## (horizontal, vertical) spacing between text and axis
|
||||
|
@ -17,7 +17,7 @@ class ButtonItem(GraphicsObject):
|
||||
|
||||
if width is not None:
|
||||
s = float(width) / self.pixmap.width()
|
||||
self.scale(s, s)
|
||||
self.setScale(s)
|
||||
if parentItem is not None:
|
||||
self.setParentItem(parentItem)
|
||||
self.setOpacity(0.7)
|
||||
|
@ -80,7 +80,7 @@ class CurvePoint(GraphicsObject):
|
||||
ang = np.arctan2(p2.y()-p1.y(), p2.x()-p1.x()) ## returns radians
|
||||
self.resetTransform()
|
||||
if self._rotate:
|
||||
self.rotate(180+ ang * 180 / np.pi) ## takes degrees
|
||||
self.setRotation(180 + np.rad2deg(ang)) ## takes degrees
|
||||
QtGui.QGraphicsItem.setPos(self, *newPos)
|
||||
return True
|
||||
|
||||
|
@ -151,7 +151,8 @@ class TickSliderItem(GraphicsWidget):
|
||||
elif ort != 'bottom':
|
||||
raise Exception("%s is not a valid orientation. Options are 'left', 'right', 'top', and 'bottom'" %str(ort))
|
||||
|
||||
self.translate(self.tickSize/2., 0)
|
||||
tr = QtGui.QTransform.fromTranslate(self.tickSize/2., 0)
|
||||
self.setTransform(tr, True)
|
||||
|
||||
def addTick(self, x, color=None, movable=True, finish=True):
|
||||
## public
|
||||
@ -521,7 +522,8 @@ class GradientEditorItem(TickSliderItem):
|
||||
============== ===================================================================
|
||||
"""
|
||||
TickSliderItem.setOrientation(self, orientation)
|
||||
self.translate(0, self.rectSize)
|
||||
tr = QtGui.QTransform.fromTranslate(0, self.rectSize)
|
||||
self.setTransform(tr, True)
|
||||
|
||||
def showMenu(self, ev):
|
||||
#private
|
||||
|
@ -112,7 +112,7 @@ class HistogramLUTItem(GraphicsWidget):
|
||||
|
||||
self.plot = self.plots[0] # for backward compatibility.
|
||||
for plot in self.plots:
|
||||
plot.rotate(90)
|
||||
plot.setRotation(90)
|
||||
self.vb.addItem(plot)
|
||||
|
||||
self.fillHistogram(fillHistogram)
|
||||
|
@ -203,9 +203,10 @@ class ImageItem(GraphicsObject):
|
||||
|
||||
def setRect(self, rect):
|
||||
"""Scale and translate the image to fit within rect (must be a QRect or QRectF)."""
|
||||
self.resetTransform()
|
||||
self.translate(rect.left(), rect.top())
|
||||
self.scale(rect.width() / self.width(), rect.height() / self.height())
|
||||
tr = QtGui.QTransform()
|
||||
tr.translate(rect.left(), rect.top())
|
||||
tr.scale(rect.width() / self.width(), rect.height() / self.height())
|
||||
self.setTransform(tr)
|
||||
|
||||
def clear(self):
|
||||
self.image = None
|
||||
|
@ -220,7 +220,7 @@ class InfiniteLine(GraphicsObject):
|
||||
"""
|
||||
self.angle = angle #((angle+45) % 180) - 45 ## -45 <= angle < 135
|
||||
self.resetTransform()
|
||||
self.rotate(self.angle)
|
||||
self.setRotation(self.angle)
|
||||
self.update()
|
||||
|
||||
def setPos(self, pos):
|
||||
|
@ -109,7 +109,7 @@ class LabelItem(GraphicsWidget, GraphicsWidgetAnchor):
|
||||
def setAngle(self, angle):
|
||||
self.angle = angle
|
||||
self.item.resetTransform()
|
||||
self.item.rotate(angle)
|
||||
self.item.setRotation(angle)
|
||||
self.updateMin()
|
||||
|
||||
|
||||
|
@ -97,8 +97,9 @@ class LinearRegionItem(GraphicsObject):
|
||||
# and down in horizontal mode.
|
||||
InfiniteLine(QtCore.QPointF(0, values[0]), angle=0, **lineKwds),
|
||||
InfiniteLine(QtCore.QPointF(0, values[1]), angle=0, **lineKwds)]
|
||||
self.lines[0].scale(1, -1)
|
||||
self.lines[1].scale(1, -1)
|
||||
tr = QtGui.QTransform.fromScale(1, -1)
|
||||
self.lines[0].setTransform(tr, True)
|
||||
self.lines[1].setTransform(tr, True)
|
||||
elif orientation in ('vertical', LinearRegionItem.Vertical):
|
||||
self.lines = [
|
||||
InfiniteLine(QtCore.QPointF(values[0], 0), angle=90, **lineKwds),
|
||||
|
@ -1,14 +1,15 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Form implementation generated from reading ui file './pyqtgraph/graphicsItems/PlotItem/plotConfigTemplate.ui'
|
||||
# Form implementation generated from reading ui file 'plotConfigTemplate.ui'
|
||||
#
|
||||
# Created: Wed Mar 26 15:09:28 2014
|
||||
# by: PyQt5 UI code generator 5.0.1
|
||||
# Created by: PyQt5 UI code generator 5.12.3
|
||||
#
|
||||
# WARNING! All changes made in this file will be lost!
|
||||
|
||||
|
||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
|
||||
|
||||
class Ui_Form(object):
|
||||
def setupUi(self, Form):
|
||||
Form.setObjectName("Form")
|
||||
@ -73,24 +74,24 @@ class Ui_Form(object):
|
||||
self.transformGroup.setGeometry(QtCore.QRect(10, 10, 171, 101))
|
||||
self.transformGroup.setObjectName("transformGroup")
|
||||
self.gridLayout = QtWidgets.QGridLayout(self.transformGroup)
|
||||
self.gridLayout.setObjectName("gridLayout")
|
||||
self.gridLayout.setMargin(0)
|
||||
self.gridLayout.setContentsMargins(0, 0, 0, 0)
|
||||
self.gridLayout.setSpacing(0)
|
||||
self.logXCheck = QtGui.QCheckBox(self.transformGroup)
|
||||
self.logXCheck.setObjectName("logXCheck")
|
||||
self.gridLayout.addWidget(self.logXCheck, 1, 0, 1, 1)
|
||||
self.fftCheck = QtGui.QCheckBox(self.transformGroup)
|
||||
self.fftCheck.setObjectName("fftCheck")
|
||||
self.gridLayout.addWidget(self.fftCheck, 0, 0, 1, 1)
|
||||
self.derivativeCheck = QtGui.QCheckBox(self.transformGroup)
|
||||
self.derivativeCheck.setObjectName("derivativeCheck")
|
||||
self.gridLayout.addWidget(self.derivativeCheck, 3, 0, 1, 1)
|
||||
self.phasemapCheck = QtGui.QCheckBox(self.transformGroup)
|
||||
self.phasemapCheck.setObjectName("phasemapCheck")
|
||||
self.gridLayout.addWidget(self.phasemapCheck, 4, 0, 1, 1)
|
||||
self.gridLayout.setObjectName("gridLayout")
|
||||
self.logYCheck = QtWidgets.QCheckBox(self.transformGroup)
|
||||
self.logYCheck.setObjectName("logYCheck")
|
||||
self.gridLayout.addWidget(self.logYCheck, 2, 0, 1, 1)
|
||||
self.logXCheck = QtWidgets.QCheckBox(self.transformGroup)
|
||||
self.logXCheck.setObjectName("logXCheck")
|
||||
self.gridLayout.addWidget(self.logXCheck, 1, 0, 1, 1)
|
||||
self.fftCheck = QtWidgets.QCheckBox(self.transformGroup)
|
||||
self.fftCheck.setObjectName("fftCheck")
|
||||
self.gridLayout.addWidget(self.fftCheck, 0, 0, 1, 1)
|
||||
self.derivativeCheck = QtWidgets.QCheckBox(self.transformGroup)
|
||||
self.derivativeCheck.setObjectName("derivativeCheck")
|
||||
self.gridLayout.addWidget(self.derivativeCheck, 3, 0, 1, 1)
|
||||
self.phasemapCheck = QtWidgets.QCheckBox(self.transformGroup)
|
||||
self.phasemapCheck.setObjectName("phasemapCheck")
|
||||
self.gridLayout.addWidget(self.phasemapCheck, 4, 0, 1, 1)
|
||||
self.pointsGroup = QtWidgets.QGroupBox(Form)
|
||||
self.pointsGroup.setGeometry(QtCore.QRect(10, 550, 234, 58))
|
||||
self.pointsGroup.setCheckable(True)
|
||||
@ -164,11 +165,11 @@ class Ui_Form(object):
|
||||
self.autoDownsampleCheck.setText(_translate("Form", "Auto"))
|
||||
self.downsampleSpin.setToolTip(_translate("Form", "Downsample data before plotting. (plot every Nth sample)"))
|
||||
self.downsampleSpin.setSuffix(_translate("Form", "x"))
|
||||
self.logXCheck.setText(_translate("Form", "Log X", None))
|
||||
self.fftCheck.setText(_translate("Form", "Power Spectrum (FFT)", None))
|
||||
self.derivativeCheck.setText(_translate("Form", "dy/dx", None))
|
||||
self.phasemapCheck.setText(_translate("Form", "Y vs. Y\'", None))
|
||||
self.logYCheck.setText(_translate("Form", "Log Y"))
|
||||
self.logXCheck.setText(_translate("Form", "Log X"))
|
||||
self.fftCheck.setText(_translate("Form", "Power Spectrum (FFT)"))
|
||||
self.derivativeCheck.setText(_translate("Form", "dy/dx"))
|
||||
self.phasemapCheck.setText(_translate("Form", "Y vs. Y\'"))
|
||||
self.pointsGroup.setTitle(_translate("Form", "Points"))
|
||||
self.autoPointsCheck.setText(_translate("Form", "Auto"))
|
||||
self.xGridCheck.setText(_translate("Form", "Show X Grid"))
|
||||
@ -176,4 +177,3 @@ class Ui_Form(object):
|
||||
self.label.setText(_translate("Form", "Opacity"))
|
||||
self.alphaGroup.setTitle(_translate("Form", "Alpha"))
|
||||
self.autoAlphaCheck.setText(_translate("Form", "Auto"))
|
||||
|
||||
|
@ -1,9 +1,10 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Form implementation generated from reading ui file './pyqtgraph/graphicsItems/PlotItem/plotConfigTemplate.ui'
|
||||
# Form implementation generated from reading ui file 'plotConfigTemplate.ui',
|
||||
# licensing of 'plotConfigTemplate.ui' applies.
|
||||
#
|
||||
# Created: Wed Mar 26 15:09:28 2014
|
||||
# by: PyQt5 UI code generator 5.0.1
|
||||
# Created: Sun Jan 31 22:10:16 2021
|
||||
# by: pyside2-uic running on PySide2 5.12.6
|
||||
#
|
||||
# WARNING! All changes made in this file will be lost!
|
||||
|
||||
@ -73,24 +74,24 @@ class Ui_Form(object):
|
||||
self.transformGroup.setGeometry(QtCore.QRect(10, 10, 171, 101))
|
||||
self.transformGroup.setObjectName("transformGroup")
|
||||
self.gridLayout = QtWidgets.QGridLayout(self.transformGroup)
|
||||
self.gridLayout.setMargin(0)
|
||||
self.gridLayout.setContentsMargins(0, 0, 0, 0)
|
||||
self.gridLayout.setSpacing(0)
|
||||
self.gridLayout.setObjectName("gridLayout")
|
||||
self.logXCheck = QtGui.QCheckBox(self.transformGroup)
|
||||
self.logXCheck.setObjectName("logXCheck")
|
||||
self.gridLayout.addWidget(self.logXCheck, 1, 0, 1, 1)
|
||||
self.fftCheck = QtGui.QCheckBox(self.transformGroup)
|
||||
self.fftCheck.setObjectName("fftCheck")
|
||||
self.gridLayout.addWidget(self.fftCheck, 0, 0, 1, 1)
|
||||
self.derivativeCheck = QtGui.QCheckBox(self.transformGroup)
|
||||
self.derivativeCheck.setObjectName("derivativeCheck")
|
||||
self.gridLayout.addWidget(self.derivativeCheck, 3, 0, 1, 1)
|
||||
self.phasemapCheck = QtGui.QCheckBox(self.transformGroup)
|
||||
self.phasemapCheck.setObjectName("phasemapCheck")
|
||||
self.gridLayout.addWidget(self.phasemapCheck, 4, 0, 1, 1)
|
||||
self.logYCheck = QtWidgets.QCheckBox(self.transformGroup)
|
||||
self.logYCheck.setObjectName("logYCheck")
|
||||
self.gridLayout.addWidget(self.logYCheck, 2, 0, 1, 1)
|
||||
self.logXCheck = QtWidgets.QCheckBox(self.transformGroup)
|
||||
self.logXCheck.setObjectName("logXCheck")
|
||||
self.gridLayout.addWidget(self.logXCheck, 1, 0, 1, 1)
|
||||
self.fftCheck = QtWidgets.QCheckBox(self.transformGroup)
|
||||
self.fftCheck.setObjectName("fftCheck")
|
||||
self.gridLayout.addWidget(self.fftCheck, 0, 0, 1, 1)
|
||||
self.derivativeCheck = QtWidgets.QCheckBox(self.transformGroup)
|
||||
self.derivativeCheck.setObjectName("derivativeCheck")
|
||||
self.gridLayout.addWidget(self.derivativeCheck, 3, 0, 1, 1)
|
||||
self.phasemapCheck = QtWidgets.QCheckBox(self.transformGroup)
|
||||
self.phasemapCheck.setObjectName("phasemapCheck")
|
||||
self.gridLayout.addWidget(self.phasemapCheck, 4, 0, 1, 1)
|
||||
self.pointsGroup = QtWidgets.QGroupBox(Form)
|
||||
self.pointsGroup.setGeometry(QtCore.QRect(10, 550, 234, 58))
|
||||
self.pointsGroup.setCheckable(True)
|
||||
@ -142,38 +143,37 @@ class Ui_Form(object):
|
||||
QtCore.QMetaObject.connectSlotsByName(Form)
|
||||
|
||||
def retranslateUi(self, Form):
|
||||
_translate = QtCore.QCoreApplication.translate
|
||||
Form.setWindowTitle(_translate("Form", "Form"))
|
||||
self.averageGroup.setToolTip(_translate("Form", "Display averages of the curves displayed in this plot. The parameter list allows you to choose parameters to average over (if any are available)."))
|
||||
self.averageGroup.setTitle(_translate("Form", "Average"))
|
||||
self.clipToViewCheck.setToolTip(_translate("Form", "Plot only the portion of each curve that is visible. This assumes X values are uniformly spaced."))
|
||||
self.clipToViewCheck.setText(_translate("Form", "Clip to View"))
|
||||
self.maxTracesCheck.setToolTip(_translate("Form", "If multiple curves are displayed in this plot, check this box to limit the number of traces that are displayed."))
|
||||
self.maxTracesCheck.setText(_translate("Form", "Max Traces:"))
|
||||
self.downsampleCheck.setText(_translate("Form", "Downsample"))
|
||||
self.peakRadio.setToolTip(_translate("Form", "Downsample by drawing a saw wave that follows the min and max of the original data. This method produces the best visual representation of the data but is slower."))
|
||||
self.peakRadio.setText(_translate("Form", "Peak"))
|
||||
self.maxTracesSpin.setToolTip(_translate("Form", "If multiple curves are displayed in this plot, check \"Max Traces\" and set this value to limit the number of traces that are displayed."))
|
||||
self.forgetTracesCheck.setToolTip(_translate("Form", "If MaxTraces is checked, remove curves from memory after they are hidden (saves memory, but traces can not be un-hidden)."))
|
||||
self.forgetTracesCheck.setText(_translate("Form", "Forget hidden traces"))
|
||||
self.meanRadio.setToolTip(_translate("Form", "Downsample by taking the mean of N samples."))
|
||||
self.meanRadio.setText(_translate("Form", "Mean"))
|
||||
self.subsampleRadio.setToolTip(_translate("Form", "Downsample by taking the first of N samples. This method is fastest and least accurate."))
|
||||
self.subsampleRadio.setText(_translate("Form", "Subsample"))
|
||||
self.autoDownsampleCheck.setToolTip(_translate("Form", "Automatically downsample data based on the visible range. This assumes X values are uniformly spaced."))
|
||||
self.autoDownsampleCheck.setText(_translate("Form", "Auto"))
|
||||
self.downsampleSpin.setToolTip(_translate("Form", "Downsample data before plotting. (plot every Nth sample)"))
|
||||
self.downsampleSpin.setSuffix(_translate("Form", "x"))
|
||||
self.logXCheck.setText(_translate("Form", "Log X", None))
|
||||
self.fftCheck.setText(_translate("Form", "Power Spectrum (FFT)", None))
|
||||
self.derivativeCheck.setText(_translate("Form", "dy/dx", None))
|
||||
self.phasemapCheck.setText(_translate("Form", "Y vs. Y\'", None))
|
||||
self.logYCheck.setText(_translate("Form", "Log Y"))
|
||||
self.pointsGroup.setTitle(_translate("Form", "Points"))
|
||||
self.autoPointsCheck.setText(_translate("Form", "Auto"))
|
||||
self.xGridCheck.setText(_translate("Form", "Show X Grid"))
|
||||
self.yGridCheck.setText(_translate("Form", "Show Y Grid"))
|
||||
self.label.setText(_translate("Form", "Opacity"))
|
||||
self.alphaGroup.setTitle(_translate("Form", "Alpha"))
|
||||
self.autoAlphaCheck.setText(_translate("Form", "Auto"))
|
||||
Form.setWindowTitle(QtWidgets.QApplication.translate("Form", "PyQtGraph", None, -1))
|
||||
self.averageGroup.setToolTip(QtWidgets.QApplication.translate("Form", "Display averages of the curves displayed in this plot. The parameter list allows you to choose parameters to average over (if any are available).", None, -1))
|
||||
self.averageGroup.setTitle(QtWidgets.QApplication.translate("Form", "Average", None, -1))
|
||||
self.clipToViewCheck.setToolTip(QtWidgets.QApplication.translate("Form", "Plot only the portion of each curve that is visible. This assumes X values are uniformly spaced.", None, -1))
|
||||
self.clipToViewCheck.setText(QtWidgets.QApplication.translate("Form", "Clip to View", None, -1))
|
||||
self.maxTracesCheck.setToolTip(QtWidgets.QApplication.translate("Form", "If multiple curves are displayed in this plot, check this box to limit the number of traces that are displayed.", None, -1))
|
||||
self.maxTracesCheck.setText(QtWidgets.QApplication.translate("Form", "Max Traces:", None, -1))
|
||||
self.downsampleCheck.setText(QtWidgets.QApplication.translate("Form", "Downsample", None, -1))
|
||||
self.peakRadio.setToolTip(QtWidgets.QApplication.translate("Form", "Downsample by drawing a saw wave that follows the min and max of the original data. This method produces the best visual representation of the data but is slower.", None, -1))
|
||||
self.peakRadio.setText(QtWidgets.QApplication.translate("Form", "Peak", None, -1))
|
||||
self.maxTracesSpin.setToolTip(QtWidgets.QApplication.translate("Form", "If multiple curves are displayed in this plot, check \"Max Traces\" and set this value to limit the number of traces that are displayed.", None, -1))
|
||||
self.forgetTracesCheck.setToolTip(QtWidgets.QApplication.translate("Form", "If MaxTraces is checked, remove curves from memory after they are hidden (saves memory, but traces can not be un-hidden).", None, -1))
|
||||
self.forgetTracesCheck.setText(QtWidgets.QApplication.translate("Form", "Forget hidden traces", None, -1))
|
||||
self.meanRadio.setToolTip(QtWidgets.QApplication.translate("Form", "Downsample by taking the mean of N samples.", None, -1))
|
||||
self.meanRadio.setText(QtWidgets.QApplication.translate("Form", "Mean", None, -1))
|
||||
self.subsampleRadio.setToolTip(QtWidgets.QApplication.translate("Form", "Downsample by taking the first of N samples. This method is fastest and least accurate.", None, -1))
|
||||
self.subsampleRadio.setText(QtWidgets.QApplication.translate("Form", "Subsample", None, -1))
|
||||
self.autoDownsampleCheck.setToolTip(QtWidgets.QApplication.translate("Form", "Automatically downsample data based on the visible range. This assumes X values are uniformly spaced.", None, -1))
|
||||
self.autoDownsampleCheck.setText(QtWidgets.QApplication.translate("Form", "Auto", None, -1))
|
||||
self.downsampleSpin.setToolTip(QtWidgets.QApplication.translate("Form", "Downsample data before plotting. (plot every Nth sample)", None, -1))
|
||||
self.downsampleSpin.setSuffix(QtWidgets.QApplication.translate("Form", "x", None, -1))
|
||||
self.logYCheck.setText(QtWidgets.QApplication.translate("Form", "Log Y", None, -1))
|
||||
self.logXCheck.setText(QtWidgets.QApplication.translate("Form", "Log X", None, -1))
|
||||
self.fftCheck.setText(QtWidgets.QApplication.translate("Form", "Power Spectrum (FFT)", None, -1))
|
||||
self.derivativeCheck.setText(QtWidgets.QApplication.translate("Form", "dy/dx", None, -1))
|
||||
self.phasemapCheck.setText(QtWidgets.QApplication.translate("Form", "Y vs. Y\'", None, -1))
|
||||
self.pointsGroup.setTitle(QtWidgets.QApplication.translate("Form", "Points", None, -1))
|
||||
self.autoPointsCheck.setText(QtWidgets.QApplication.translate("Form", "Auto", None, -1))
|
||||
self.xGridCheck.setText(QtWidgets.QApplication.translate("Form", "Show X Grid", None, -1))
|
||||
self.yGridCheck.setText(QtWidgets.QApplication.translate("Form", "Show Y Grid", None, -1))
|
||||
self.label.setText(QtWidgets.QApplication.translate("Form", "Opacity", None, -1))
|
||||
self.alphaGroup.setTitle(QtWidgets.QApplication.translate("Form", "Alpha", None, -1))
|
||||
self.autoAlphaCheck.setText(QtWidgets.QApplication.translate("Form", "Auto", None, -1))
|
||||
|
||||
|
@ -1321,8 +1321,8 @@ class ViewBox(GraphicsWidget):
|
||||
r = QtCore.QRectF(p1, p2)
|
||||
r = self.childGroup.mapRectFromParent(r)
|
||||
self.rbScaleBox.setPos(r.topLeft())
|
||||
self.rbScaleBox.resetTransform()
|
||||
self.rbScaleBox.scale(r.width(), r.height())
|
||||
tr = QtGui.QTransform.fromScale(r.width(), r.height())
|
||||
self.rbScaleBox.setTransform(tr)
|
||||
self.rbScaleBox.show()
|
||||
|
||||
def showAxRect(self, ax, **kwargs):
|
||||
|
@ -92,7 +92,7 @@ def test_ImageItem(transpose=False):
|
||||
img2 = TransposedImageItem(transpose=transpose)
|
||||
img2.setImage(np.fromfunction(lambda x,y: (x+y)%2, (10, 10)), levels=[-1,2])
|
||||
view.addItem(img2)
|
||||
img2.scale(10, 10)
|
||||
img2.setScale(10)
|
||||
img2.setZValue(-10)
|
||||
|
||||
data[..., 0] *= 1e-9
|
||||
|
@ -3,7 +3,7 @@ import sys
|
||||
import numpy as np
|
||||
import pytest
|
||||
import pyqtgraph as pg
|
||||
from pyqtgraph.Qt import QtCore, QtTest
|
||||
from pyqtgraph.Qt import QtCore, QtGui, QtTest
|
||||
from pyqtgraph.tests import assertImageApproved, mouseMove, mouseDrag, mouseClick, TransposedImageItem, resizeWindow
|
||||
import pytest
|
||||
|
||||
@ -122,9 +122,8 @@ def check_getArrayRegion(roi, name, testResize=True, transpose=False):
|
||||
app.processEvents()
|
||||
assertImageApproved(win, name+'/roi_getarrayregion_resize', 'Simple ROI region selection, resized.')
|
||||
|
||||
img1.scale(1, -1)
|
||||
img1.setPos(0, img1.height())
|
||||
img1.rotate(20)
|
||||
img1.setTransform(QtGui.QTransform().scale(1, -1).rotate(20), True)
|
||||
rgn = roi.getArrayRegion(data, img1, axes=(1, 2))
|
||||
img2.setImage(rgn[0, ..., 0])
|
||||
app.processEvents()
|
||||
@ -142,9 +141,8 @@ def check_getArrayRegion(roi, name, testResize=True, transpose=False):
|
||||
assertImageApproved(win, name+'/roi_getarrayregion_inverty', 'Simple ROI region selection, view inverted.', pxCount=pxCount)
|
||||
|
||||
roi.setState(initState)
|
||||
img1.resetTransform()
|
||||
img1.setPos(0, 0)
|
||||
img1.scale(1, 0.5)
|
||||
img1.setTransform(QtGui.QTransform.fromScale(1, 0.5))
|
||||
rgn = roi.getArrayRegion(data, img1, axes=(1, 2))
|
||||
img2.setImage(rgn[0, ..., 0])
|
||||
app.processEvents()
|
||||
|
@ -1,4 +1,4 @@
|
||||
from ..Qt import QtCore, QtGui
|
||||
from ..Qt import QtCore, QtWidgets
|
||||
from ..widgets.TreeWidget import TreeWidget
|
||||
import os, weakref, re
|
||||
from .ParameterItem import ParameterItem
|
||||
@ -25,7 +25,7 @@ class ParameterTree(TreeWidget):
|
||||
self.setHeaderLabels(["Parameter", "Value"])
|
||||
self.setAlternatingRowColors(True)
|
||||
self.paramSet = None
|
||||
self.header().setResizeMode(QtGui.QHeaderView.ResizeToContents)
|
||||
self.header().setSectionResizeMode(QtWidgets.QHeaderView.ResizeMode.ResizeToContents)
|
||||
self.setHeaderHidden(not showHeader)
|
||||
self.itemChanged.connect(self.itemChangedEvent)
|
||||
self.itemExpanded.connect(self.itemExpandedEvent)
|
||||
|
Loading…
Reference in New Issue
Block a user