本文整理汇总了Python中PyQt5.QtWidgets.QLCDNumber类的典型用法代码示例。如果您正苦于以下问题:Python QLCDNumber类的具体用法?Python QLCDNumber怎么用?Python QLCDNumber使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了QLCDNumber类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: createDisplay
def createDisplay(self):
self.displayLCD = QGroupBox("")
layout = QHBoxLayout()
paletteLosses = QPalette()
paletteVictory = QPalette()
paletteLosses.setColor(paletteLosses.WindowText, QColor(255, 000, 000))
paletteVictory.setColor(paletteVictory.WindowText, QColor(000, 255, 000))
self.lossesLcd = QLCDNumber(3)
self.lossesLcd.setSegmentStyle(QLCDNumber.Filled)
self.lossesLcd.setPalette(paletteLosses)
self.victoryLcd = QLCDNumber(3)
self.victoryLcd.setSegmentStyle(QLCDNumber.Filled)
self.victoryLcd.setPalette(paletteVictory)
self.lossesLcd.setMinimumHeight(100)
self.victoryLcd.setMinimumHeight(100)
self.lossesLcd.setMinimumWidth(150)
self.victoryLcd.setMinimumWidth(150)
layout.addWidget(self.victoryLcd)
layout.addWidget(self.lossesLcd)
self.displayLCD.setLayout(layout)
示例2: addNumbers
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: initUI
def initUI(self):
# self.setMinimumWidth(300)
self.mainLayout = QHBoxLayout(self)
# self.mainLayout.addStretch()
self.scoreLCD = QLCDNumber(self)
self.scoreLCD.setSegmentStyle(QLCDNumber.Flat)
self.mainLayout.addWidget(self.scoreLCD)
self.scoreLCD.setNumDigits(3)
self.scoreLCD.setFixedSize(100, 60)
self.scoreLCD.display(0)
css = "QLCDNumber {{ color:rgb({},{},{});}}"
self.scoreLCD.setStyleSheet(css.format(self.pcolour.red(),
self.pcolour.green(),
self.pcolour.blue()))
self.nameLabel = QLabel(self)
self.nameLabel.setText(self.player)
sh = ("QLabel {{ font-size: 32px; font-weight: "
"bold; color:rgb({},{},{});}}")
self.nameLabel.setStyleSheet(sh.format(self.pcolour.red(),
self.pcolour.green(),
self.pcolour.blue()))
self.mainLayout.addWidget(self.nameLabel)
self.dealerPixmap = QtGui.QPixmap('icons/cards.png')
self.nonDealerPixmap = QtGui.QPixmap()
self.winnerPixmap = QtGui.QPixmap('icons/winner.png')
self.iconlabel = IconLabel(self)
self.iconlabel.setFixedSize(50, 50)
self.iconlabel.setScaledContents(True)
self.mainLayout.insertWidget(0, self.iconlabel)
# self.mainLayout.addStretch()
self.unsetDealer()
示例4: createScoreLayout
def createScoreLayout(self):
self.playerScoreLcd = QLCDNumber(2)
self.playerScoreLcd.setSegmentStyle(QLCDNumber.Filled)
self.playerScoreLcd.setMinimumSize(75, 50)
self.playerScoreLcd.display(0)
self.opponentScoreLcd = QLCDNumber(2)
self.opponentScoreLcd.setSegmentStyle(QLCDNumber.Filled)
self.opponentScoreLcd.setMinimumSize(75, 50)
self.opponentScoreLcd.display(0)
layout = QHBoxLayout()
layout.addStretch(1)
layout.addWidget(self.createLabel('You: '))
layout.addWidget(self.playerScoreLcd)
layout.addStretch(1)
layout.addWidget(self.createLabel('Opponent: '))
layout.addWidget(self.opponentScoreLcd)
layout.addStretch(1)
return layout
示例5: _widgets
def _widgets(self):
self.shiverTimer = QTime(0, 0, 0)
self.timer = QTimer()
self.timerLCDNumber = QLCDNumber()
self.timerLCDNumber.setDigitCount(12)
self.timerLCDNumber.display("00:00:00.000")
self.stortPushButton = QPushButton(self._START)
self.resetPushButton = QPushButton(self._RESET)
示例6: initUI
def initUI(self):
self.lcd = QLCDNumber(self)
vbox = QVBoxLayout()
vbox.addWidget(self.lcd)
self.setLayout(vbox)
self.setGeometry(300, 300, 250, 150)
self.setWindowTitle('WordspPerMinute')
self.value = 0
self.show()
示例7: __init__
def __init__(self, cue, **kwargs):
super().__init__(**kwargs)
self.cue = None
self._selected = False
self._accurate_timing = False
self._show_dbmeter = False
self._countdown_mode = True
self._dbmeter_element = None
self._fade_element = None
self.setAttribute(Qt.WA_TranslucentBackground)
self.setLayout(QGridLayout())
self.layout().setContentsMargins(0, 0, 0, 0)
self.layout().setSpacing(2)
self.layout().setColumnStretch(0, 6)
self.layout().setRowStretch(0, 4)
self.nameButton = QClickLabel(self)
self.nameButton.setObjectName('ButtonCueWidget')
self.nameButton.setWordWrap(True)
self.nameButton.setAlignment(Qt.AlignCenter)
self.nameButton.setFocusPolicy(Qt.NoFocus)
self.nameButton.clicked.connect(self._clicked)
self.nameButton.setSizePolicy(QSizePolicy.Ignored, QSizePolicy.Ignored)
self.layout().addWidget(self.nameButton, 0, 0)
self.statusIcon = QLabel(self.nameButton)
self.statusIcon.setStyleSheet('background-color: transparent')
self.statusIcon.setPixmap(CueWidget.STOP.pixmap(CueWidget.ICON_SIZE,
CueWidget.ICON_SIZE))
self.seekSlider = QClickSlider(self.nameButton)
self.seekSlider.setOrientation(Qt.Horizontal)
self.seekSlider.setFocusPolicy(Qt.NoFocus)
self.seekSlider.setVisible(False)
self.dbMeter = QDbMeter(self)
self.dbMeter.setSizePolicy(QSizePolicy.Ignored, QSizePolicy.Ignored)
self.dbMeter.setVisible(False)
self.timeBar = QProgressBar(self)
self.timeBar.setTextVisible(False)
self.timeBar.setLayout(QHBoxLayout())
self.timeBar.layout().setContentsMargins(0, 0, 0, 0)
self.timeDisplay = QLCDNumber(self.timeBar)
self.timeDisplay.setStyleSheet('background-color: transparent')
self.timeDisplay.setSegmentStyle(QLCDNumber.Flat)
self.timeDisplay.setDigitCount(8)
self.timeDisplay.display('00:00:00')
self.timeBar.layout().addWidget(self.timeDisplay)
self.timeBar.setSizePolicy(QSizePolicy.Ignored, QSizePolicy.Ignored)
self.timeBar.setVisible(False)
self._set_cue(cue)
示例8: __init__
def __init__(self):
super(TetrixWindow, self).__init__()
self.board = TetrixBoard()
nextPieceLabel = QLabel()
nextPieceLabel.setFrameStyle(QFrame.Box | QFrame.Raised)
nextPieceLabel.setAlignment(Qt.AlignCenter)
self.board.setNextPieceLabel(nextPieceLabel)
scoreLcd = QLCDNumber(5)
scoreLcd.setSegmentStyle(QLCDNumber.Filled)
levelLcd = QLCDNumber(2)
levelLcd.setSegmentStyle(QLCDNumber.Filled)
linesLcd = QLCDNumber(5)
linesLcd.setSegmentStyle(QLCDNumber.Filled)
startButton = QPushButton("&Start")
startButton.setFocusPolicy(Qt.NoFocus)
quitButton = QPushButton("&Quit")
quitButton.setFocusPolicy(Qt.NoFocus)
pauseButton = QPushButton("&Pause")
pauseButton.setFocusPolicy(Qt.NoFocus)
startButton.clicked.connect(self.board.start)
pauseButton.clicked.connect(self.board.pause)
quitButton.clicked.connect(QApplication.instance().quit)
self.board.scoreChanged.connect(scoreLcd.display)
self.board.levelChanged.connect(levelLcd.display)
self.board.linesRemovedChanged.connect(linesLcd.display)
layout = QGridLayout()
layout.addWidget(self.createLabel("NEXT"), 0, 0)
layout.addWidget(nextPieceLabel, 1, 0)
layout.addWidget(self.createLabel("LEVEL"), 2, 0)
layout.addWidget(levelLcd, 3, 0)
layout.addWidget(startButton, 4, 0)
layout.addWidget(self.board, 0, 1, 6, 1)
layout.addWidget(self.createLabel("SCORE"), 0, 2)
layout.addWidget(scoreLcd, 1, 2)
layout.addWidget(self.createLabel("LINES REMOVED"), 2, 2)
layout.addWidget(linesLcd, 3, 2)
layout.addWidget(quitButton, 4, 2)
layout.addWidget(pauseButton, 5, 2)
self.setLayout(layout)
self.setWindowTitle("Tetrix")
self.resize(550, 370)
示例9: SpeedWidget
class SpeedWidget(QtWidgets.QWidget):
def __init__(self):
super(SpeedWidget, self).__init__()
self.initUI()
def initUI(self):
self.lcd = QLCDNumber(self)
vbox = QVBoxLayout()
vbox.addWidget(self.lcd)
self.setLayout(vbox)
self.setGeometry(300, 300, 250, 150)
self.setWindowTitle('WordspPerMinute')
self.value = 0
self.show()
# set lcd display value
def setValues(self, wpm):
complete = int(wpm)
self.lcd.display(complete)
示例10: __init__
def __init__(self):
super(DedeNimeur, self).__init__()
self.statusBar()
self.size, self.height, self.width, self.mines = 30, 10, 10, 10
self.lcd = QLCDNumber()
self.lcd.setFixedSize(300, 60)
self.board = Board(self.height, self.width, self.mines, self.size)
self.timer = QBasicTimer()
self.real_timer = QElapsedTimer()
vbox = QVBoxLayout()
vbox.addWidget(self.lcd)
vbox.addWidget(self.board)
central = QWidget()
central.setLayout(vbox)
self.setCentralWidget(central)
start = QAction('Start', self)
start.setStatusTip('Start')
start.setShortcut('Ctrl+N')
start.triggered.connect(self.init)
exit = QAction('Exit', self)
exit.setStatusTip('Exit')
exit.setShortcut('Ctrl+Q')
exit.triggered.connect(qApp.quit)
height = QAction('Height', self)
height.setStatusTip('Set board width')
height.triggered.connect(self.set_height)
width = QAction('Width', self)
width.setStatusTip('Set board height')
width.triggered.connect(self.set_width)
mines = QAction('Mines', self)
mines.setStatusTip('Set board mines')
mines.triggered.connect(self.set_mines)
size = QAction('Size', self)
size.setStatusTip('Set button size')
size.triggered.connect(self.set_size)
toolbar = self.addToolBar('Toolbar')
toolbar.addAction(start)
toolbar.addAction(width)
toolbar.addAction(height)
toolbar.addAction(mines)
toolbar.addAction(size)
toolbar.addAction(exit)
self.setWindowTitle(u'DédéNimeur')
self.show()
示例11: __init__
def __init__(self, time_allocation=15, parent=None):
super(CountDownTimer, self).__init__(parent)
self.time_allocation = time_allocation
self.time_value = self.time_allocation
# timer
self.timer = QTimer(self)
self.timer.timeout.connect(self.advance_time)
# LCD time display
self.lcd = QLCDNumber(self)
self.lcd.setDigitCount(3)
self.lcd.setSegmentStyle(QLCDNumber.Flat)
self.lcd.display(self.time_value)
示例12: addIncomeInfo
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())
示例13: addGoldInfo
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)
示例14: setup_ui
def setup_ui(self):
self.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding)
self.timer = QTimer(parent=self)
self.timer.setInterval(self.interval)
self.timer.timeout.connect(self.do_countdown)
self.lcd_number = QLCDNumber(parent=self)
self.lcd_number.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding)
self.lcd_number.setFrameStyle(QFrame.NoFrame)
self.lcd_number.setSegmentStyle(QLCDNumber.Flat)
self.lcd_number.setDigitCount(6)
layout = QVBoxLayout()
layout.addWidget(self.lcd_number)
self.setLayout(layout)
self.reset_count()
示例15: addMaintInfo
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])