本文整理汇总了Python中PyQt4.QtGui.QGraphicsLineItem.setX方法的典型用法代码示例。如果您正苦于以下问题:Python QGraphicsLineItem.setX方法的具体用法?Python QGraphicsLineItem.setX怎么用?Python QGraphicsLineItem.setX使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt4.QtGui.QGraphicsLineItem
的用法示例。
在下文中一共展示了QGraphicsLineItem.setX方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: draw_errors
# 需要导入模块: from PyQt4.QtGui import QGraphicsLineItem [as 别名]
# 或者: from PyQt4.QtGui.QGraphicsLineItem import setX [as 别名]
def draw_errors(self, x, i):
lower = self.values[i]+self._dw_err[i]
upper = self.values[i]+self._up_err[i]
lineItem = QGraphicsLineItem(0, self.coordY(lower), 0,
self.coordY(upper), parent=self.item)
lineItem.setX(x)
lineItem.setPen(QPen(QColor('black'),1))
示例2: draw_curve
# 需要导入模块: from PyQt4.QtGui import QGraphicsLineItem [as 别名]
# 或者: from PyQt4.QtGui.QGraphicsLineItem import setX [as 别名]
def draw_curve(self, x, y, i):
# top line
lineItem = QGraphicsLineItem(0, self.coordY(y), 4,
self.coordY(y), parent=self.item)
lineItem.setX(x-2)
lineItem.setPen(QPen(QColor(self.colors[i]),2))
if i > 0:
prev = self.values[i-1] if i>0 else self.values[i]
lineItem = QGraphicsLineItem(0, self.coordY(prev), self.col_w-4,
self.coordY(y), parent=self.item)
lineItem.setX(x - self.col_w+2)
lineItem.setPen(QPen(QColor(self.colors[i]),2))
示例3: draw_stick
# 需要导入模块: from PyQt4.QtGui import QGraphicsLineItem [as 别名]
# 或者: from PyQt4.QtGui.QGraphicsLineItem import setX [as 别名]
def draw_stick(self, x, y, i):
lineItem = QGraphicsLineItem(0, self.coordY(self.ylim[0]),
0, self.coordY(y),
parent=self.item)
lineItem.setX(x)
lineItem.setPen(QPen(QColor(self.colors[i]),2))
示例4: draw_bar
# 需要导入模块: from PyQt4.QtGui import QGraphicsLineItem [as 别名]
# 或者: from PyQt4.QtGui.QGraphicsLineItem import setX [as 别名]
def draw_bar(self, x, y, i):
h = self.coordY(self.ylim[0])#self.height
coordY = self.coordY
item = self.item
# if value stands out of bound
if y < self.ylim[0]: return
if y < self.ylim[1]:
# left line
lineItem = QGraphicsLineItem(0, h, 0, coordY(y), parent=item)
lineItem.setX(x-3)
lineItem.setPen(QPen(QColor(self.colors[i]),2))
# right line
lineItem = QGraphicsLineItem(0, h, 0, coordY(y), parent=item)
lineItem.setX(x+3)
lineItem.setPen(QPen(QColor(self.colors[i]),2))
# top line
lineItem = QGraphicsLineItem(0, coordY(y), 6, coordY(y), parent=item)
lineItem.setX(x-3)
lineItem.setPen(QPen(QColor(self.colors[i]),2))
else:
# lower left line
lineItem = QGraphicsLineItem(0, h, 0, coordY(y), parent=item)
lineItem.setX(x-3)
lineItem.setPen(QPen(QColor(self.colors[i]),2))
# lower right line
lineItem = QGraphicsLineItem(0, h, 0, coordY(y), parent=item)
lineItem.setX(x+3)
lineItem.setPen(QPen(QColor(self.colors[i]),2))
# upper left line
lineItem = QGraphicsLineItem(0, coordY(y)-4, 0, coordY(y)-7, parent=item)
lineItem.setX(x-3)
lineItem.setPen(QPen(QColor(self.colors[i]),2))
# upper right line
lineItem = QGraphicsLineItem(0, coordY(y)-4, 0, coordY(y)-7, parent=item)
lineItem.setX(x+3)
lineItem.setPen(QPen(QColor(self.colors[i]),2))
# top line
lineItem = QGraphicsLineItem(0, coordY(y)-7, 6, coordY(y)-7, parent=item)
lineItem.setX(x-3)
lineItem.setPen(QPen(QColor(self.colors[i]),2))