本文整理汇总了Python中PyQt5.QtWidgets.QLCDNumber.move方法的典型用法代码示例。如果您正苦于以下问题:Python QLCDNumber.move方法的具体用法?Python QLCDNumber.move怎么用?Python QLCDNumber.move使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt5.QtWidgets.QLCDNumber
的用法示例。
在下文中一共展示了QLCDNumber.move方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: addLCDNumbers
# 需要导入模块: from PyQt5.QtWidgets import QLCDNumber [as 别名]
# 或者: from PyQt5.QtWidgets.QLCDNumber import move [as 别名]
def addLCDNumbers(self):
fortLCD = QLCDNumber(1, self)
fortLCD.setFrameShape(QFrame.NoFrame)
fortLCD.move(125, 50)
fortLCD.resize(40, 40)
fortLCD.display(self.square.ter.buildings.fort_lvl)
incomeLCD = QLCDNumber(2, self)
incomeLCD.setFrameShape(QFrame.NoFrame)
incomeLCD.move(117, 10)
incomeLCD.resize(40, 40)
incomeLCD.display(self.square.ter.get_income())
marketLCD = QLCDNumber(1, self)
marketLCD.setFrameShape(QFrame.NoFrame)
marketLCD.move(125, 90)
marketLCD.resize(40, 40)
marketLCD.display(self.square.ter.buildings.market_lvl)
self.square.incomeChanged.connect(incomeLCD.display)
self.square.fortUpgr.connect(fortLCD.display)
self.square.marketUpgr.connect(marketLCD.display)
示例2: addNumbers
# 需要导入模块: from PyQt5.QtWidgets import QLCDNumber [as 别名]
# 或者: from PyQt5.QtWidgets.QLCDNumber import move [as 别名]
def addNumbers(self):
cavNum = QLCDNumber(2, self)
self.cavSld.valueChanged.connect(cavNum.display)
self.cavSld.setValue(99)
cavNum.resize(60, 40)
cavNum.move(150, 60)
infNum = QLCDNumber(2, self)
self.infSld.valueChanged.connect(infNum.display)
self.infSld.setValue(99)
infNum.resize(60, 40)
infNum.move(0, 60)
示例3: addIncomeInfo
# 需要导入模块: from PyQt5.QtWidgets import QLCDNumber [as 别名]
# 或者: from PyQt5.QtWidgets.QLCDNumber import move [as 别名]
def addIncomeInfo(self, font):
'''
Adds the income LCDNumber and connects it with the correct signals.
'''
incomeLbl = QLabel("Income:", self)
incomeLbl.setFont(font)
incomeLbl.move(460, 10)
incomeLcd = QLCDNumber(3, self)
incomeLcd.move(530, 0)
incomeLcd.setFrameShape(QFrame.NoFrame)
incomeLcd.resize(60, 40)
self.sig.incomeChanged.connect(incomeLcd.display)
self.sig.incomeChanged.emit(self.game.player.income())
示例4: addGoldInfo
# 需要导入模块: from PyQt5.QtWidgets import QLCDNumber [as 别名]
# 或者: from PyQt5.QtWidgets.QLCDNumber import move [as 别名]
def addGoldInfo(self, font):
'''
Adds gold LCDNumber and connects it with the correct signal.
'''
goldLbl = QLabel('Gold:', self)
goldLbl.move(300, 10)
goldLbl.setFont(font)
goldLcd = QLCDNumber(4, self)
goldLcd.move(360, 0)
goldLcd.setFrameShape(QFrame.NoFrame)
goldLcd.resize(65, 40)
self.sig.goldChanged.connect(goldLcd.display)
self.sig.goldChanged.emit(self.game.player.gold)
示例5: addMaintInfo
# 需要导入模块: from PyQt5.QtWidgets import QLCDNumber [as 别名]
# 或者: from PyQt5.QtWidgets.QLCDNumber import move [as 别名]
def addMaintInfo(self, font):
'''
Adds maintenance QLCDNumber and connects it with the correct signals.
'''
maintLbl = QLabel("Total maintenance:", self)
maintLbl.move(620, 10)
maintLbl.setFont(font)
maintLcd = QLCDNumber(3, self)
maintLcd.move(840, 7)
maintLcd.setFrameShape(QFrame.NoFrame)
maintLcd.resize(50, 30)
self.sig.maintChanged.connect(maintLcd.display)
maint = self.game.player.get_armies_maint()
self.sig.maintChanged.emit(maint[0] + maint[1])
示例6: __init__
# 需要导入模块: from PyQt5.QtWidgets import QLCDNumber [as 别名]
# 或者: from PyQt5.QtWidgets.QLCDNumber import move [as 别名]
def __init__(self):
super().__init__()
self.setAcceptDrops(True)
self.game = Game(4) # Make game with 4 players
self.sig = Signals()
endTurnButton = QPushButton("&EndTurn", self)
endTurnButton.clicked.connect(self.endTurn)
endTurnButton.move(1260, 720)
turnLcd = QLCDNumber(3, self)
turnLcd.move(90, 715)
turnLcd.setSegmentStyle(QLCDNumber.Filled)
turnLcd.resize(60, 40)
turnTxt = QLabel("Turn:", self)
turnFont = QFont()
turnFont.setPointSize(20)
turnTxt.setFont(turnFont)
turnTxt.move(20, 720)
self.sig.turnChanged.connect(turnLcd.display)
self.sig.turnChanged.emit(self.game.turn)
quitB = QPushButton("&Quit", self)
quitB.clicked.connect(self.quit)
quitB.move(1150, 720)
self.showPlayerInfo()
self.coords = []
self.setWindowTitle("Territory War")
n = self.game.map.dim
self.makeMap(1100 // n, 600 // n, n)
self.setWindowState(Qt.WindowFullScreen)
self.setFixedSize(self.size())
self.showArmies()
self.addDiplomacyLabels()
thread = threading.Thread(target=self.game.start, args=(0, ))
thread.start()