本文整理匯總了Python中PyQt4.QtGui.QGraphicsSimpleTextItem.move方法的典型用法代碼示例。如果您正苦於以下問題:Python QGraphicsSimpleTextItem.move方法的具體用法?Python QGraphicsSimpleTextItem.move怎麽用?Python QGraphicsSimpleTextItem.move使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類PyQt4.QtGui.QGraphicsSimpleTextItem
的用法示例。
在下文中一共展示了QGraphicsSimpleTextItem.move方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: display_answer
# 需要導入模塊: from PyQt4.QtGui import QGraphicsSimpleTextItem [as 別名]
# 或者: from PyQt4.QtGui.QGraphicsSimpleTextItem import move [as 別名]
def display_answer(self, question, answers, correct_answer, description, selected_index, correct):
x, y = self.display_question(question, answers, selected_index, correct) #TODO pass what to check and if right or wrong
y += 50
item = QGraphicsSimpleTextItem("Correct Answer: %s" % correct_answer)
item.setBrush(self.TEXT_COLOR)
font = QFont(self.BOLDISH)
font.setUnderline(True)
item.setFont(font)
item.setX(x)
item.setY(y)
self.qtscene.addItem(item)
self.references.append(item)
y += 60
item = QGraphicsSimpleTextItem(make_pretty(description, 55))
item.setBrush(self.TEXT_COLOR)
item.setFont(self.NORMALISH)
item.setX(x)
item.setY(y)
self.qtscene.addItem(item)
self.references.append(item)
item = QPushButton('Next')
item.clicked.connect(self.on_next)
item.setFont(self.BOLDISH)
item.move(x+700, y)
self.qtscene.addWidget(item)
self.references.append(item)