本文整理汇总了Python中PyQt5.QtWidgets.QGraphicsScene.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python QGraphicsScene.__init__方法的具体用法?Python QGraphicsScene.__init__怎么用?Python QGraphicsScene.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt5.QtWidgets.QGraphicsScene
的用法示例。
在下文中一共展示了QGraphicsScene.__init__方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from PyQt5.QtWidgets import QGraphicsScene [as 别名]
# 或者: from PyQt5.QtWidgets.QGraphicsScene import __init__ [as 别名]
def __init__(self, *args):
QGraphicsScene.__init__(self, *args)
# Add a graphic item, not responsive to gestures??
text = QGraphicsTextItem("Test")
text.setTextInteractionFlags(Qt.TextEditorInteraction)
self.addItem(text)
示例2: __init__
# 需要导入模块: from PyQt5.QtWidgets import QGraphicsScene [as 别名]
# 或者: from PyQt5.QtWidgets.QGraphicsScene import __init__ [as 别名]
def __init__(self):
QGraphicsScene.__init__(self)
self.jatkoPiste = QPointF(1,1)
self.jatkoKulma = 0.0
self.valittu = None
self.valittuVanha = None
示例3: __init__
# 需要导入模块: from PyQt5.QtWidgets import QGraphicsScene [as 别名]
# 或者: from PyQt5.QtWidgets.QGraphicsScene import __init__ [as 别名]
def __init__(self, time_sig = '4/4', num_measures = 4, quantize_val = '1/8'):
QGraphicsScene.__init__(self)
self.setBackgroundBrush(QColor(50, 50, 50))
self.mousePos = QPointF()
self.notes = []
self.selected_notes = []
self.piano_keys = []
self.marquee_select = False
self.insert_mode = False
self.velocity_mode = False
self.place_ghost = False
self.ghost_note = None
self.default_ghost_vel = 100
self.ghost_vel = self.default_ghost_vel
## dimensions
self.padding = 2
## piano dimensions
self.note_height = 10
self.start_octave = -2
self.end_octave = 8
self.notes_in_octave = 12
self.total_notes = (self.end_octave - self.start_octave) \
* self.notes_in_octave + 1
self.piano_height = self.note_height * self.total_notes
self.octave_height = self.notes_in_octave * self.note_height
self.piano_width = 34
## height
self.header_height = 20
self.total_height = self.piano_height - self.note_height + self.header_height
#not sure why note_height is subtracted
## width
self.full_note_width = 250 # i.e. a 4/4 note
self.snap_value = None
self.quantize_val = quantize_val
### dummy vars that will be changed
self.time_sig = 0
self.measure_width = 0
self.num_measures = 0
self.max_note_length = 0
self.grid_width = 0
self.value_width = 0
self.grid_div = 0
self.piano = None
self.header = None
self.play_head = None
self.setTimeSig(time_sig)
self.setMeasures(num_measures)
self.setGridDiv()
self.default_length = 1. / self.grid_div
示例4: __init__
# 需要导入模块: from PyQt5.QtWidgets import QGraphicsScene [as 别名]
# 或者: from PyQt5.QtWidgets.QGraphicsScene import __init__ [as 别名]
def __init__(self, _, lang, areaType):
QGraphicsScene.__init__(self)
self.language = lang
self.areaType = areaType
self.first = True
self.areas = []
self.ocrImage = None
self.isModified = None
示例5: __init__
# 需要导入模块: from PyQt5.QtWidgets import QGraphicsScene [as 别名]
# 或者: from PyQt5.QtWidgets.QGraphicsScene import __init__ [as 别名]
def __init__(self, parent):
QGraphicsScene.__init__(self, parent)
self.dirty = True
self.fbo = None
self.format = QGLFramebufferObjectFormat()
self.format.setAttachment(QGLFramebufferObject.CombinedDepthStencil)
self.pressedPos = QPoint()
self.changed.connect(self.slot_update)
self.sceneRectChanged.connect(self.slot_update)
示例6: __init__
# 需要导入模块: from PyQt5.QtWidgets import QGraphicsScene [as 别名]
# 或者: from PyQt5.QtWidgets.QGraphicsScene import __init__ [as 别名]
def __init__(self, *args, **kwargs):
QGraphicsScene.__init__(self, *args, **kwargs)
ellipse1 = GraphicsNode(label="lolilol")
ellipse1.setPos(QPointF(-200,100))
self.addItem(ellipse1)
ellipse2 = GraphicsNode(label="lolilol")
ellipse2.setPos(QPointF(200,100))
self.addItem(ellipse2)
edge = GraphicsEdge(ellipse1, ellipse2)
self.addItem(edge)
示例7: __init__
# 需要导入模块: from PyQt5.QtWidgets import QGraphicsScene [as 别名]
# 或者: from PyQt5.QtWidgets.QGraphicsScene import __init__ [as 别名]
def __init__(self):
QGraphicsScene.__init__(self)
self.shapes = []
self.wpzero = None
self.routearrows = []
self.routetext = []
self.expprv = None
self.expcol = None
self.expnr = 0
self.showDisabledPaths = False
self.topLeft = Point()
self.bottomRight = Point()
示例8: __init__
# 需要导入模块: from PyQt5.QtWidgets import QGraphicsScene [as 别名]
# 或者: from PyQt5.QtWidgets.QGraphicsScene import __init__ [as 别名]
def __init__(self, parent=None):
QGraphicsScene.__init__(self, parent)
示例9: __init__
# 需要导入模块: from PyQt5.QtWidgets import QGraphicsScene [as 别名]
# 或者: from PyQt5.QtWidgets.QGraphicsScene import __init__ [as 别名]
def __init__(self, parent):
QGraphicsScene.__init__(self, parent)
text = QGraphicsTextItem("Simulate pinch with middle mouse button pressed\n press Ctl key to ignore gesture")
self.addItem(text)