More fixes, some reversions

brokers_config
Conrad Steenberg 2021-07-21 13:16:06 -07:00
parent 3912b22b41
commit c830183073
5 changed files with 10 additions and 11 deletions

View File

@ -351,7 +351,7 @@ class XAxisLabel(AxisLabel):
def _draw_arrow_path(self):
y_offset = self._parent.style['tickTextOffset'][1]
path = QtWidgets.QPainterPath()
path = QtGui.QPainterPath()
h, w = self.rect.height(), self.rect.width()
middle = w/2 - 0.5
aw = h/2
@ -453,7 +453,7 @@ class YAxisLabel(AxisLabel):
def _draw_arrow_path(self):
x_offset = self._parent.style['tickTextOffset'][0]
path = QtWidgets.QPainterPath()
path = QtGui.QPainterPath()
h = self.rect.height()
path.moveTo(0, 0)
path.lineTo(-x_offset - h/4, h/2.)

View File

@ -103,7 +103,7 @@ class LineDot(pg.CurvePoint):
i = index - x[0]
if i > 0 and i < len(y):
newPos = (index, y[i])
QtGui.QGraphicsItem.setPos(self, *newPos)
QtWidgets.QGraphicsItem.setPos(self, *newPos)
return True
return False

View File

@ -101,7 +101,7 @@ class FastAppendCurve(pg.PlotCurveItem):
# XXX: pretty annoying but, without this there's little
# artefacts on the append updates to the curve...
self.setCacheMode(QtGui.QGraphicsItem.NoCache)
self.setCacheMode(QtWidgets.QGraphicsItem.NoCache)
self.prepareGeometryChange()
flip_cache = True
@ -121,7 +121,7 @@ class FastAppendCurve(pg.PlotCurveItem):
self.update()
if flip_cache:
self.setCacheMode(QtGui.QGraphicsItem.DeviceCoordinateCache)
self.setCacheMode(QtWidgets.QGraphicsItem.DeviceCoordinateCache)
def boundingRect(self):
if self.path is None:

View File

@ -22,7 +22,6 @@ from typing import List, Optional, Tuple
import numpy as np
import pyqtgraph as pg
from numba import njit, float64, int64 # , optional
import PyQt5
from PyQt5 import QtCore, QtGui, QtWidgets
from PyQt5.QtCore import QLineF, QPointF
# from numba import types as ntypes
@ -315,7 +314,7 @@ class BarItems(pg.GraphicsObject):
# trigger redraw despite caching
self.prepareGeometryChange()
self.setCacheMode(QtGui.QGraphicsItem.NoCache)
self.setCacheMode(QtWidgets.QGraphicsItem.NoCache)
flip_cache = True
self._xrange = first_index, last_index
@ -353,7 +352,7 @@ class BarItems(pg.GraphicsObject):
self.update()
if flip_cache:
self.setCacheMode(QtGui.QGraphicsItem.DeviceCoordinateCache)
self.setCacheMode(QtWidgets.QGraphicsItem.DeviceCoordinateCache)
def paint(
self,

View File

@ -23,7 +23,7 @@ WARNING: this code likely doesn't work at all (yet)
"""
import numpy as np
import pyqtgraph as pg
from PyQt5 import QtCore, QtGui
from PyQt5 import QtCore, QtGui, QtWidgets
from .quantdom.charts import CenteredTextItem
from .quantdom.base import Quotes
@ -57,8 +57,8 @@ class SignallingApi(object):
self.signals_visible = False
def add_signals(self):
self.signals_group_text = QtGui.QGraphicsItemGroup()
self.signals_group_arrow = QtGui.QGraphicsItemGroup()
self.signals_group_text = QtWidgets.QGraphicsItemGroup()
self.signals_group_arrow = QtWidgets.QGraphicsItemGroup()
self.signals_text_items = np.empty(len(Quotes), dtype=object)
for p in Portfolio.positions: