當前位置: 首頁>>代碼示例>>Python>>正文


Python QLCDNumber.resize方法代碼示例

本文整理匯總了Python中PyQt5.QtWidgets.QLCDNumber.resize方法的典型用法代碼示例。如果您正苦於以下問題:Python QLCDNumber.resize方法的具體用法?Python QLCDNumber.resize怎麽用?Python QLCDNumber.resize使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在PyQt5.QtWidgets.QLCDNumber的用法示例。


在下文中一共展示了QLCDNumber.resize方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: addLCDNumbers

# 需要導入模塊: from PyQt5.QtWidgets import QLCDNumber [as 別名]
# 或者: from PyQt5.QtWidgets.QLCDNumber import resize [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)
開發者ID:niksanaznc,項目名稱:territory-war-game,代碼行數:22,代碼來源:gui.py

示例2: addNumbers

# 需要導入模塊: from PyQt5.QtWidgets import QLCDNumber [as 別名]
# 或者: from PyQt5.QtWidgets.QLCDNumber import resize [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)
開發者ID:niksanaznc,項目名稱:territory-war-game,代碼行數:13,代碼來源:gui.py

示例3: addIncomeInfo

# 需要導入模塊: from PyQt5.QtWidgets import QLCDNumber [as 別名]
# 或者: from PyQt5.QtWidgets.QLCDNumber import resize [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())
開發者ID:niksanaznc,項目名稱:territory-war-game,代碼行數:15,代碼來源:gui.py

示例4: addGoldInfo

# 需要導入模塊: from PyQt5.QtWidgets import QLCDNumber [as 別名]
# 或者: from PyQt5.QtWidgets.QLCDNumber import resize [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)
開發者ID:niksanaznc,項目名稱:territory-war-game,代碼行數:15,代碼來源:gui.py

示例5: addMaintInfo

# 需要導入模塊: from PyQt5.QtWidgets import QLCDNumber [as 別名]
# 或者: from PyQt5.QtWidgets.QLCDNumber import resize [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])
開發者ID:niksanaznc,項目名稱:territory-war-game,代碼行數:16,代碼來源:gui.py

示例6: __init__

# 需要導入模塊: from PyQt5.QtWidgets import QLCDNumber [as 別名]
# 或者: from PyQt5.QtWidgets.QLCDNumber import resize [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()
開發者ID:niksanaznc,項目名稱:territory-war-game,代碼行數:42,代碼來源:gui.py


注:本文中的PyQt5.QtWidgets.QLCDNumber.resize方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。