本文整理汇总了Python中video.Video.setMinimumSize方法的典型用法代码示例。如果您正苦于以下问题:Python Video.setMinimumSize方法的具体用法?Python Video.setMinimumSize怎么用?Python Video.setMinimumSize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类video.Video
的用法示例。
在下文中一共展示了Video.setMinimumSize方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: GracePlay
# 需要导入模块: from video import Video [as 别名]
# 或者: from video.Video import setMinimumSize [as 别名]
class GracePlay(QtGui.QWidget):
''' The main window of the GracePlay.'''
def __init__(self, parent=None):
QtGui.QWidget.__init__(self, parent)
self.init_media()
self.init_ui()
self.setWindowIcon(QtGui.QIcon("icons/72px-video.png"))
# Set transparent window
#self.setWindowOpacity(1)
self.setMinimumSize(800, 450)
# set Frameless window
self.setWindowFlags(QtCore.Qt.FramelessWindowHint)
self.setAttribute(QtCore.Qt.WA_TranslucentBackground)
self.show()
def init_media(self):
self.media = Phonon.MediaObject(self)
self.video = Video(self)
self.audio = Phonon.AudioOutput(self)
def init_ui(self):
self.main_menu = MainMenu(self)
self.setting_dialog = SettingDialog(self)
self.title_widget = TitleWidget(self)
self.btn_mainmenu = self.title_widget.btn_mainmenu
self.btn_min = self.title_widget.btn_min
self.btn_max = self.title_widget.btn_max
self.btn_close = self.title_widget.btn_close
self.controlbar = ControlBar()
self.controlbar.setFixedHeight(48)
self.btn_open = self.controlbar.btn_open
self.btn_play = self.controlbar.btn_play
self.btn_pause = self.controlbar.btn_pause
self.btn_stop = self.controlbar.btn_stop
self.btn_fullscreen = self.controlbar.btn_fullscreen
self.btn_playlist = self.controlbar.btn_playlist
self.lab_time = self.controlbar.lab_time
self.seekslider = self.controlbar.seekslider
self.volumeslider = self.controlbar.volumeslider
self.video.setMinimumSize(650, 350)
#self.playlist = PlayList(_('PlayList'))
self.playlist = PlayList()
self.playlist.setFixedSize(150, 850)
# playlist is hidden by default
#self.playlist.hide()
title_layout = QtGui.QHBoxLayout()
title_layout.addWidget(self.title_widget)
center_layout = QtGui.QHBoxLayout()
center_layout.addWidget(self.video)
center_layout.setSpacing(0)
center_layout.addWidget(self.playlist)
bottom_layout = QtGui.QHBoxLayout()
bottom_layout.addWidget(self.controlbar)
main_layout = QtGui.QGridLayout(self)
main_layout.addLayout(title_layout, 0, 0)
main_layout.addLayout(center_layout, 1, 0)
main_layout.setSpacing(0)
main_layout.addLayout(bottom_layout, 2, 0, 1, 2)
# Fill the window with all contents, no gap in border.
main_layout.setContentsMargins(0, 0, 0, 0)
self.setLayout(main_layout)
# Set the drag property of the window -- For press event
def mousePressEvent(self, event):
if event.button() == QtCore.Qt.LeftButton:
self.dragPosition = event.globalPos() - self.frameGeometry().topLeft()
event.accept()
# Set the drag property of the window move -- For drag move event
def mouseMoveEvent(self, event):
if event.buttons() == QtCore.Qt.LeftButton:
self.move(event.globalPos() - self.dragPosition)
event.accept()