当前位置: 首页>>代码示例>>Python>>正文


Python QtCore.QBasicTimer方法代码示例

本文整理汇总了Python中PyQt5.QtCore.QBasicTimer方法的典型用法代码示例。如果您正苦于以下问题:Python QtCore.QBasicTimer方法的具体用法?Python QtCore.QBasicTimer怎么用?Python QtCore.QBasicTimer使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PyQt5.QtCore的用法示例。


在下文中一共展示了QtCore.QBasicTimer方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: initUI

# 需要导入模块: from PyQt5 import QtCore [as 别名]
# 或者: from PyQt5.QtCore import QBasicTimer [as 别名]
def initUI(self):
		# 块大小
		self.grid_size = 22
		# 游戏帧率
		self.fps = 200
		self.timer = QBasicTimer()
		# 焦点
		self.setFocusPolicy(Qt.StrongFocus)
		# 水平布局
		layout_horizontal = QHBoxLayout()
		self.inner_board = InnerBoard()
		self.external_board = ExternalBoard(self, self.grid_size, self.inner_board)
		layout_horizontal.addWidget(self.external_board)
		self.side_panel = SidePanel(self, self.grid_size, self.inner_board)
		layout_horizontal.addWidget(self.side_panel)
		self.status_bar = self.statusBar()
		self.external_board.score_signal[str].connect(self.status_bar.showMessage)
		self.start()
		self.center()
		self.setWindowTitle('Tetris-公众号:Charles的皮卡丘')
		self.show()
		self.setFixedSize(self.external_board.width() + self.side_panel.width(),
						  self.side_panel.height() + self.status_bar.height()) 
开发者ID:CharlesPikachu,项目名称:Games,代码行数:25,代码来源:Game11.py

示例2: initUI

# 需要导入模块: from PyQt5 import QtCore [as 别名]
# 或者: from PyQt5.QtCore import QBasicTimer [as 别名]
def initUI(self):
        self.gridSize = 22
        self.speed = 10

        self.timer = QBasicTimer()
        self.setFocusPolicy(Qt.StrongFocus)

        hLayout = QHBoxLayout()
        self.tboard = Board(self, self.gridSize)
        hLayout.addWidget(self.tboard)

        self.sidePanel = SidePanel(self, self.gridSize)
        hLayout.addWidget(self.sidePanel)

        self.statusbar = self.statusBar()
        self.tboard.msg2Statusbar[str].connect(self.statusbar.showMessage)

        self.start()

        self.center()
        self.setWindowTitle('Tetris')
        self.show()

        self.setFixedSize(self.tboard.width() + self.sidePanel.width(),
                          self.sidePanel.height() + self.statusbar.height()) 
开发者ID:LoveDaisy,项目名称:tetris_game,代码行数:27,代码来源:tetris_game.py

示例3: __init__

# 需要导入模块: from PyQt5 import QtCore [as 别名]
# 或者: from PyQt5.QtCore import QBasicTimer [as 别名]
def __init__(self, *args, **kwargs):
        super(WidgetCode, self).__init__(*args, **kwargs)
        self._sensitive = False  # 是否大小写敏感
        self.setAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.setBackgroundRole(QPalette.Midlight)
        self.setAutoFillBackground(True)
        # 字体
        newFont = self.font()
        newFont.setPointSize(16)
        newFont.setFamily("Kristen ITC")
        newFont.setBold(True)
        self.setFont(newFont)
        self.reset()
        # 定时器
        self.step = 0
        self.timer = QBasicTimer()
        self.timer.start(60, self) 
开发者ID:PyQt5,项目名称:PyQt,代码行数:19,代码来源:VerificationCode.py

示例4: __init__

# 需要导入模块: from PyQt5 import QtCore [as 别名]
# 或者: from PyQt5.QtCore import QBasicTimer [as 别名]
def __init__(self):
        super().__init__()
        self.tabs = QTabWidget()
        self.com = DeviceComms()
        self.setWindowTitle('ratctl - ' + self.com.getCurrentMouseName())
        self.pbar = QProgressBar()
        self.pbar.setFormat("Battery : %p%")
        self.grid = QGridLayout()

        self.setLayout(self.grid)
        self.grid.addWidget(self.pbar)
        self.grid.addWidget(self.tabs)

        self.dpi = DPI()
        self.t = []  # table of tabs
        for i in range(0, 4):
            self.t.append(DPIAdjustmentTab(i, self.dpi, self.com))
            self.tabs.addTab(self.t[i], "Mode " + str(i + 1))

        self.data = Data(self.pbar, self.tabs, self.dpi, self.com)
        for i in range(0, 4):
            self.t[i].sendButton.clicked.connect(self.data.sendDpi)
            self.t[i].resetButton.clicked.connect(self.com.resetDpi)
        self.timer = QBasicTimer()  # Timer to periodically update information
        self.timer.start(100, self.data)
        self.tabs.currentChanged.connect(self.com.sendMode)  # Changes the mode when changing tabs
        self.com.getDpi(self.dpi)
        self.dpi.dataHasBeenSent() 
开发者ID:MayeulC,项目名称:Saitek,代码行数:30,代码来源:ratctl.py

示例5: initUI

# 需要导入模块: from PyQt5 import QtCore [as 别名]
# 或者: from PyQt5.QtCore import QBasicTimer [as 别名]
def initUI(self):      

        self.pbar = QProgressBar(self)
        self.pbar.setGeometry(30, 40, 200, 25)

        self.btn = QPushButton('Start', self)
        self.btn.move(40, 80)
        self.btn.clicked.connect(self.doAction)

        self.timer = QBasicTimer()
        self.step = 0

        self.setGeometry(300, 300, 280, 170)
        self.setWindowTitle('QProgressBar')
        self.show() 
开发者ID:Yeah-Kun,项目名称:python,代码行数:17,代码来源:QProgressBar.py

示例6: __init__

# 需要导入模块: from PyQt5 import QtCore [as 别名]
# 或者: from PyQt5.QtCore import QBasicTimer [as 别名]
def __init__(self, camera_port=0, parent=None):
        super().__init__(parent)
        self.camera = cv2.VideoCapture(camera_port)

        self.timer = QtCore.QBasicTimer() 
开发者ID:stoic1979,项目名称:robovision,代码行数:7,代码来源:dashboard.py

示例7: __init__

# 需要导入模块: from PyQt5 import QtCore [as 别名]
# 或者: from PyQt5.QtCore import QBasicTimer [as 别名]
def __init__(self, camera_port=0, parent=None):
        super().__init__(parent)
        self.camera = cv2.VideoCapture(camera_port)
        self.timer = QBasicTimer() 
开发者ID:stoic1979,项目名称:robovision,代码行数:6,代码来源:video_capture.py

示例8: initUI

# 需要导入模块: from PyQt5 import QtCore [as 别名]
# 或者: from PyQt5.QtCore import QBasicTimer [as 别名]
def initUI(self):
		# 块大小
		self.grid_size = 22
		# 游戏帧率
		self.fps = 100
		self.timer = QBasicTimer()
		# 焦点
		self.setFocusPolicy(Qt.StrongFocus)
		# 水平布局
		layout_horizontal = QHBoxLayout()
		self.inner_board = InnerBoard()
		self.external_board = ExternalBoard(self, self.grid_size, self.inner_board)
		layout_horizontal.addWidget(self.external_board)
		self.side_panel = SidePanel(self, self.grid_size, self.inner_board)
		layout_horizontal.addWidget(self.side_panel)
		self.status_bar = self.statusBar()
		self.external_board.score_signal[str].connect(self.status_bar.showMessage)
		self.start()
		self.center()
		self.setWindowTitle('Tetris-公众号:Charles的皮卡丘')
		self.show()
		self.setFixedSize(self.external_board.width() + self.side_panel.width(),
						  self.side_panel.height() + self.status_bar.height())
		# AI控制
		self.tetris_ai = TetrisAI(self.inner_board)
		self.next_action = None
		self.pre_tetris = tetrisShape().shape_empty 
开发者ID:CharlesPikachu,项目名称:AIGames,代码行数:29,代码来源:Tetris.py

示例9: initBoard

# 需要导入模块: from PyQt5 import QtCore [as 别名]
# 或者: from PyQt5.QtCore import QBasicTimer [as 别名]
def initBoard(self):

        self.timer = QtCore.QBasicTimer()
        self.isWaitingAfterLine = False

        self.curX = 0
        self.curY = 0
        self.numLinesRemoved = 0
        self.board = []

        self.setFocusPolicy(QtCore.Qt.StrongFocus)
        self.isStarted = False
        self.isPaused = False
        self.clearBoard() 
开发者ID:birgander2,项目名称:PyRAT,代码行数:16,代码来源:egg.py


注:本文中的PyQt5.QtCore.QBasicTimer方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。