def __init__(self, sys_argv): super().__init__(sys_argv) # Show main window self.view = QMainWindow() self.centralWidget = QWidget(self.view) self.gridLayout = QGridLayout(self.centralWidget) self.gridLayout.setContentsMargins(0, 0, 0, 0) self.gridLayout.setSpacing(0) self.video_item = QVideoWidget() self.gridLayout.addWidget(self.video_item) self.view.setCentralWidget(self.centralWidget) self.mediaPlayer = QMediaPlayer(None, QMediaPlayer.VideoSurface) self.grabber = VideoFrameGrabber(self.video_item, self) self.mediaPlayer.setVideoOutput(self.grabber) self.grabber.frameAvailable.connect(self.process_frame) self.mediaPlayer.durationChanged.connect(self.update_duration) self.mediaPlayer.positionChanged.connect(self.update_slider_position) local = QUrl.fromLocalFile('D:\\SampleData\\albamonSample.mp4') media = QMediaContent(local) self.mediaPlayer.setMedia(media) self.mediaPlayer.play() self.view.show()
def __init__(self): QMainWindow.__init__(self) Ui_MainWindow.__init__(self) self.setupUi(self) self.videoWidget = QVideoWidget() self.mediaPlayer = QMediaPlayer() self.mediaPlaylist = QMediaPlaylist() # Add the video file path self.mediaPlaylist.addMedia(QUrl.fromLocalFile(os.path.abspath("./sample_data/sampleVideo.mp4"))) # Set the video to played in a loop once it ends. self.mediaPlaylist.setPlaybackMode(QMediaPlaylist.CurrentItemInLoop) # Set the QMediaPlaylist for the QMediaPlayer. self.mediaPlayer.setPlaylist(self.mediaPlaylist) # Add the QVideoWidget in the GridLayout. self.playerLayout.addWidget(self.videoWidget) # Set the video output from the QMediaPlayer to the QVideoWidget. self.mediaPlayer.setVideoOutput(self.videoWidget) # Set the QPushButtons to play, pause and stop the video in the QVideoWidget. self.playButton.clicked.connect(self.play_video) self.pauseButton.clicked.connect(self.pause_video) self.stopButton.clicked.connect(self.stop_video) # Set the total range for the QSlider. self.mediaPlayer.durationChanged.connect(self.change_duration) # Set the current value for the QSlider. self.mediaPlayer.positionChanged.connect(self.change_position) # Set the video position in QMediaPlayer based on the QSlider position. self.horizontalSlider.sliderMoved.connect(self.video_position)
def test2(): url = QUrl.fromLocalFile("D:/test/2.mp4") content = QMediaContent(url) player = QMediaPlayer() vw = QVideoWidget() vw.show() player.play() player.setVideoOutput(vw) player.setMedia(content)
def __init__(self): QWidget.__init__(self) layout = QVBoxLayout(self) layout.addWidget(QVideoWidget()) graphicsScene = QGraphicsScene() graphicsView = QGraphicsView(graphicsScene) graphicsScene.addItem(QGraphicsVideoItem()) layout.addWidget(graphicsView)
def __init__(self, media, parent): super(VideoMediaView_, self).__init__(media, parent) self.widget = QVideoWidget(parent) self.player = QMediaPlayer() self.playlist = QMediaPlaylist() self.player.setPlaylist(self.playlist) self.player.setVideoOutput(self.widget) self.widget.setGeometry(media['geometry']) self.set_default_widget_prop() self.widget.setDisabled(True)
def __init__(self, parent=None): super(VideoPlayer, self).__init__(parent=parent) """ 需要安装媒体解码器才可以正常使用QMediaPlayer 作者使用 LAVFilters 来解码视频和音频。 URL:https://github.com/Nevcairiel/LAVFilters """ self.video_player = QMediaPlayer() self.video_widget = QVideoWidget() self.video_player.setVideoOutput(self.video_widget) self.video_player.setVolume(50) # 信号连接 self.video_player.durationChanged.connect(self.__dur_changed) self.video_player.positionChanged.connect(self.__pos_changed) self.video_player.stateChanged.connect(self.__state_changed)
def __init__(self, url: str): super(VideoPlayer, self).__init__() self.player = QMediaPlayer() QApplication.setOverrideCursor(QCursor(Qt.WaitCursor)) self.playlist = QMediaPlaylist(self.player) self.playlist.addMedia(QUrl(url)) self.video_widget = QVideoWidget() self.player.setVideoOutput(self.video_widget) self.playlist.setCurrentIndex(0) self.player.setPlaylist(self.playlist) self.layout = QtWidgets.QVBoxLayout() self.layout.addWidget(self.video_widget) self.setLayout(self.layout) self.player.play() QApplication.restoreOverrideCursor()
def setupUi(self, MainWindow): if not MainWindow.objectName(): MainWindow.setObjectName(u"MainWindow") MainWindow.resize(926, 600) self.actionQuitar = QAction(MainWindow) self.actionQuitar.setObjectName(u"actionQuitar") self.actionConfiguracion = QAction(MainWindow) self.actionConfiguracion.setObjectName(u"actionConfiguracion") self.centralwidget = QWidget(MainWindow) self.centralwidget.setObjectName(u"centralwidget") self.horizontalLayout = QHBoxLayout(self.centralwidget) self.horizontalLayout.setObjectName(u"horizontalLayout") self.splitter = QSplitter(self.centralwidget) self.splitter.setObjectName(u"splitter") self.splitter.setOrientation(Qt.Horizontal) self.groupBox = QGroupBox(self.splitter) self.groupBox.setObjectName(u"groupBox") self.verticalLayout = QVBoxLayout(self.groupBox) self.verticalLayout.setObjectName(u"verticalLayout") self.titlesListView = QListView(self.groupBox) self.titlesListView.setObjectName(u"titlesListView") self.verticalLayout.addWidget(self.titlesListView) self.splitter.addWidget(self.groupBox) self.groupBox_2 = QGroupBox(self.splitter) self.groupBox_2.setObjectName(u"groupBox_2") self.verticalLayout_2 = QVBoxLayout(self.groupBox_2) self.verticalLayout_2.setObjectName(u"verticalLayout_2") self.gridLayout_2 = QGridLayout() self.gridLayout_2.setObjectName(u"gridLayout_2") self.label = QLabel(self.groupBox_2) self.label.setObjectName(u"label") self.gridLayout_2.addWidget(self.label, 0, 0, 1, 1) self.tituloLineEdit = QLineEdit(self.groupBox_2) self.tituloLineEdit.setObjectName(u"tituloLineEdit") self.gridLayout_2.addWidget(self.tituloLineEdit, 0, 1, 1, 1) self.label_2 = QLabel(self.groupBox_2) self.label_2.setObjectName(u"label_2") self.gridLayout_2.addWidget(self.label_2, 1, 0, 1, 1) self.grupoLineEdit = QLineEdit(self.groupBox_2) self.grupoLineEdit.setObjectName(u"grupoLineEdit") self.gridLayout_2.addWidget(self.grupoLineEdit, 1, 1, 1, 1) self.label_3 = QLabel(self.groupBox_2) self.label_3.setObjectName(u"label_3") self.gridLayout_2.addWidget(self.label_3, 2, 0, 1, 1) self.yearLineEdit = QLineEdit(self.groupBox_2) self.yearLineEdit.setObjectName(u"yearLineEdit") self.gridLayout_2.addWidget(self.yearLineEdit, 2, 1, 1, 1) self.verticalLayout_2.addLayout(self.gridLayout_2) self.label_6 = QLabel(self.groupBox_2) self.label_6.setObjectName(u"label_6") sizePolicy = QSizePolicy(QSizePolicy.Preferred, QSizePolicy.Minimum) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.label_6.sizePolicy().hasHeightForWidth()) self.label_6.setSizePolicy(sizePolicy) self.verticalLayout_2.addWidget(self.label_6) self.videoPlayerWidget = QVideoWidget(self.groupBox_2) self.videoPlayerWidget.setObjectName(u"videoPlayerWidget") sizePolicy1 = QSizePolicy(QSizePolicy.Preferred, QSizePolicy.Expanding) sizePolicy1.setHorizontalStretch(0) sizePolicy1.setVerticalStretch(0) sizePolicy1.setHeightForWidth( self.videoPlayerWidget.sizePolicy().hasHeightForWidth()) self.videoPlayerWidget.setSizePolicy(sizePolicy1) self.verticalLayout_2.addWidget(self.videoPlayerWidget) self.horizontalLayout_2 = QHBoxLayout() self.horizontalLayout_2.setObjectName(u"horizontalLayout_2") self.stopButton = QPushButton(self.groupBox_2) self.stopButton.setObjectName(u"stopButton") self.horizontalLayout_2.addWidget(self.stopButton) self.pauseButton = QPushButton(self.groupBox_2) self.pauseButton.setObjectName(u"pauseButton") self.horizontalLayout_2.addWidget(self.pauseButton) self.playButton = QPushButton(self.groupBox_2) self.playButton.setObjectName(u"playButton") self.horizontalLayout_2.addWidget(self.playButton) self.verticalLayout_2.addLayout(self.horizontalLayout_2) self.splitter.addWidget(self.groupBox_2) self.horizontalLayout.addWidget(self.splitter) MainWindow.setCentralWidget(self.centralwidget) self.menubar = QMenuBar(MainWindow) self.menubar.setObjectName(u"menubar") self.menubar.setGeometry(QRect(0, 0, 926, 22)) self.menuArchivo = QMenu(self.menubar) self.menuArchivo.setObjectName(u"menuArchivo") MainWindow.setMenuBar(self.menubar) self.statusbar = QStatusBar(MainWindow) self.statusbar.setObjectName(u"statusbar") MainWindow.setStatusBar(self.statusbar) self.menubar.addAction(self.menuArchivo.menuAction()) self.menuArchivo.addSeparator() self.menuArchivo.addAction(self.actionConfiguracion) self.menuArchivo.addSeparator() self.menuArchivo.addAction(self.actionQuitar) self.retranslateUi(MainWindow) self.actionQuitar.triggered.connect(MainWindow.close) QMetaObject.connectSlotsByName(MainWindow)
def setupUi(self, MainWindow): MainWindow.setObjectName("MainWindow") MainWindow.resize(1027, 648) icon = QtGui.QIcon() icon.addPixmap(QtGui.QPixmap(":/imgs/white Icons/video.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off) MainWindow.setWindowIcon(icon) MainWindow.setStyleSheet("#startTime, #endTime{\n" " color: #fff;\n" "}") self.centralwidget = QtWidgets.QWidget(MainWindow) self.centralwidget.setObjectName("centralwidget") self.horizontalLayout = QtWidgets.QHBoxLayout(self.centralwidget) self.horizontalLayout.setObjectName("horizontalLayout") self.frame = QtWidgets.QFrame(self.centralwidget) self.frame.setStyleSheet("#frame{\n" "background-color:rgb(0, 13, 20);\n" "}\n" "\n" "QPushButton{\n" "background: transparent;\n" "text-align: center;\n" "font: 75 15pt \"Comic Sans MS\";\n" "color: rgb(58, 180, 204);\n" "border-radius: 30px;\n" "}\n" "") self.frame.setFrameShape(QtWidgets.QFrame.StyledPanel) self.frame.setFrameShadow(QtWidgets.QFrame.Raised) self.frame.setObjectName("frame") self.verticalLayout_3 = QtWidgets.QVBoxLayout(self.frame) self.verticalLayout_3.setObjectName("verticalLayout_3") self.verticalLayout_4 = QtWidgets.QVBoxLayout() self.verticalLayout_4.setObjectName("verticalLayout_4") self.videoWidget = QVideoWidget(self.frame) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.videoWidget.sizePolicy().hasHeightForWidth()) self.videoWidget.setSizePolicy(sizePolicy) self.videoWidget.setMinimumSize(QtCore.QSize(700, 200)) ## self.videoWidget.setStyleSheet("background-color: #43549C") self.videoWidget.setStyleSheet("background-color: #e33a0b") self.videoWidget.setObjectName("videoWidget") self.verticalLayout_4.addWidget(self.videoWidget) self.verticalLayout_3.addLayout(self.verticalLayout_4) self.horizontalLayout_2 = QtWidgets.QHBoxLayout() self.horizontalLayout_2.setObjectName("horizontalLayout_2") self.startTime = QtWidgets.QLabel(self.frame) self.startTime.setObjectName("startTime") self.horizontalLayout_2.addWidget(self.startTime) self.duration = QtWidgets.QSlider(self.frame) self.duration.setMouseTracking(False) self.duration.setTabletTracking(False) self.duration.setFocusPolicy(QtCore.Qt.StrongFocus) self.duration.setAcceptDrops(False) self.duration.setLayoutDirection(QtCore.Qt.LeftToRight) self.duration.setAutoFillBackground(False) self.duration.setStyleSheet("background: transparent;\n" "-webkit-appearance:round;\n" "border-radius: 5px;\n" "color: rgb(0, 255, 204);\n" "") self.duration.setInputMethodHints(QtCore.Qt.ImhNone) self.duration.setSingleStep(1) self.duration.setProperty("value", 0) self.duration.setSliderPosition(0) self.duration.setTracking(True) self.duration.setOrientation(QtCore.Qt.Horizontal) self.duration.setInvertedAppearance(False) self.duration.setInvertedControls(False) self.duration.setObjectName("duration") self.horizontalLayout_2.addWidget(self.duration) self.endTime = QtWidgets.QLabel(self.frame) self.endTime.setObjectName("endTime") self.horizontalLayout_2.addWidget(self.endTime) self.verticalLayout_3.addLayout(self.horizontalLayout_2) self.horizontalLayout_5 = QtWidgets.QHBoxLayout() self.horizontalLayout_5.setObjectName("horizontalLayout_5") self.frame_2 = QtWidgets.QFrame(self.frame) self.frame_2.setStyleSheet("QPushButoon{\n" "border-radius: 20px;\n" "}") self.frame_2.setFrameShape(QtWidgets.QFrame.StyledPanel) self.frame_2.setFrameShadow(QtWidgets.QFrame.Raised) self.frame_2.setObjectName("frame_2") self.horizontalLayout_6 = QtWidgets.QHBoxLayout(self.frame_2) self.horizontalLayout_6.setContentsMargins(0, 0, 0, 0) self.horizontalLayout_6.setSpacing(7) self.horizontalLayout_6.setObjectName("horizontalLayout_6") self.volume = QtWidgets.QPushButton(self.frame_2) font = QtGui.QFont() font.setFamily("Comic Sans MS") font.setPointSize(15) font.setBold(False) font.setItalic(False) font.setWeight(9) self.volume.setFont(font) self.volume.setStyleSheet("#volume:hover{\n" "icon: url(:/buttons/white Icons/mute-hover.svg);\n" "cursor: pointer;\n" "}") self.volume.setText("") self.volumeMute = QtGui.QIcon() self.volumeMute.addPixmap(QtGui.QPixmap(":/buttons/white Icons/mute1.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off) self.volumeDown = QtGui.QIcon() self.volumeDown.addPixmap(QtGui.QPixmap(":/buttons/white Icons/volume-down.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off) self.volumeMed = QtGui.QIcon() self.volumeMed.addPixmap(QtGui.QPixmap(":/buttons/white Icons/volume-medium.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off) self.volumeUp = QtGui.QIcon() self.volumeUp.addPixmap(QtGui.QPixmap(":/buttons/white Icons/volume-up.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off) self.volume.setIcon(self.volumeUp) self.volume.setIconSize(QtCore.QSize(35, 35)) self.volume.setFlat(False) self.volume.setObjectName("volume") self.horizontalLayout_6.addWidget(self.volume) self.volume_2 = QtWidgets.QSlider(self.frame_2) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.volume_2.sizePolicy().hasHeightForWidth()) self.volume_2.setSizePolicy(sizePolicy) font = QtGui.QFont() font.setPointSize(1) self.volume_2.setFont(font) self.volume_2.setMaximum(26) self.volume_2.setPageStep(6) self.volume_2.setOrientation(QtCore.Qt.Horizontal) self.volume_2.setObjectName("volume_2") self.horizontalLayout_6.addWidget(self.volume_2) self.prev = QtWidgets.QPushButton(self.frame_2) self.prev.setStyleSheet("#prev:hover{\n" "icon: url(:/buttons/cyan icons/previous.svg);\n" "}") self.prev.setText("") icon2 = QtGui.QIcon() icon2.addPixmap(QtGui.QPixmap(":/buttons/white Icons/previous (1).svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off) self.prev.setIcon(icon2) self.prev.setIconSize(QtCore.QSize(35, 35)) self.prev.setObjectName("prev") self.horizontalLayout_6.addWidget(self.prev) self.play = QtWidgets.QPushButton(self.frame_2) self.play.setToolTip("") self.play.setStyleSheet("border-radius: 38px;") self.play.setText("") self.playIcon = QtGui.QIcon() self.playIcon.addPixmap(QtGui.QPixmap(":/imgs/cyan icons/play.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off) self.pauseIcon = QtGui.QIcon() self.pauseIcon.addPixmap(QtGui.QPixmap(":/imgs/cyan icons/pause.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off) self.play.setIcon(self.playIcon) self.play.setIconSize(QtCore.QSize(70, 70)) self.play.setObjectName("play") self.horizontalLayout_6.addWidget(self.play) self.next = QtWidgets.QPushButton(self.frame_2) self.next.setStyleSheet("#next:hover{\n" "icon: url(:/buttons/cyan icons/next (1).svg);\n" "}") self.next.setText("") icon4 = QtGui.QIcon() icon4.addPixmap(QtGui.QPixmap(":/buttons/white Icons/next.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off) self.next.setIcon(icon4) self.next.setIconSize(QtCore.QSize(35, 35)) self.next.setObjectName("next") self.horizontalLayout_6.addWidget(self.next) self.repeat = QtWidgets.QPushButton(self.frame_2) self.repeat.setWhatsThis("") self.repeat.setAccessibleName("") self.repeat.setAccessibleDescription("") self.repeat.setStyleSheet("#repeat{\n" "border-radius: 10px;\n" "}\n" "#repeat:hover{\n" "icon: url(:/buttons/cyan icons/repeat (1).svg);\n" "}") self.repeat.setText("") self.repeatDeactive = QtGui.QIcon() self.repeatDeactive.addPixmap(QtGui.QPixmap(":/buttons/white Icons/repeat.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off) self.repeatActive = QtGui.QIcon() self.repeatActive.addPixmap(QtGui.QPixmap(":/buttons/cyan icons/repeat (1).svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off) self.repeat.setIcon(self.repeatDeactive) self.repeat.setIconSize(QtCore.QSize(35, 35)) self.repeat.setObjectName("repeat") self.horizontalLayout_6.addWidget(self.repeat) self.playlist = QtWidgets.QPushButton(self.frame_2) self.playlist.setText("") icon6 = QtGui.QIcon() icon6.addPixmap(QtGui.QPixmap(":/imgs/cyan icons/playlist.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off) self.playlist.setIcon(icon6) self.playlist.setIconSize(QtCore.QSize(40, 40)) self.playlist.setObjectName("playlist") self.horizontalLayout_6.addWidget(self.playlist) self.horizontalLayout_5.addWidget(self.frame_2) self.verticalLayout_3.addLayout(self.horizontalLayout_5) self.horizontalLayout.addWidget(self.frame) MainWindow.setCentralWidget(self.centralwidget) self.menuBar = QtWidgets.QMenuBar(MainWindow) self.menuBar.setGeometry(QtCore.QRect(0, 0, 1027, 21)) self.menuBar.setObjectName("menuBar") self.menuFile = QtWidgets.QMenu(self.menuBar) self.menuFile.setObjectName("menuFile") MainWindow.setMenuBar(self.menuBar) self.actionOpen_File = QtWidgets.QAction(MainWindow) self.actionOpen_File.setObjectName("actionOpen_File") self.actionPlaylist = QtWidgets.QAction(MainWindow) self.actionPlaylist.setObjectName("actionPlaylist") self.actionQuit = QtWidgets.QAction(MainWindow) self.actionQuit.setObjectName("actionQuit") self.menuFile.addAction(self.actionOpen_File) self.menuFile.addAction(self.actionPlaylist) self.menuFile.addSeparator() self.menuFile.addAction(self.actionQuit) self.menuBar.addAction(self.menuFile.menuAction()) self.retranslateUi(MainWindow) QtCore.QMetaObject.connectSlotsByName(MainWindow) ################### Video Widget ################ self.mediaPlayer.setVideoOutput(self.videoWidget) ################################################# ################### Video Slider ################# self.duration.setRange(0,0) self.duration.sliderMoved.connect(self.vidPosition) self.mediaPlayer.positionChanged.connect(self.locationChanged) self.mediaPlayer.durationChanged.connect(self.durationChanged) ################################################## ################### Play Button ################## self.play.clicked.connect(self.browseFile) ################################################## ################### Repeat Button ################ self.repeat.clicked.connect(self.loopMedia) ################################################## ################### Volume Icon ################## self.volume.clicked.connect(self.muteVolume) ################################################## ################### Volume Slider ################ self.volume_2.setRange(0,100) self.volume_2.setValue(100) self.volume_2.valueChanged.connect(self.volumeControl) ################################################## ################### Open Button ################## self.actionOpen_File.triggered.connect(self.openFile) ################################################## ################### Close Button ################# self.actionQuit.triggered.connect(self.closeFile)
import sys import PySide2 from PySide2.QtCore import QUrl from PySide2.QtWidgets import QApplication from PySide2.QtMultimedia import QMediaPlayer from PySide2.QtMultimediaWidgets import QVideoWidget if __name__ == '__main__': DATA_DIR = 'C:/Users/Noah/Documents/se_data' VIDEO_PATH = DATA_DIR + '/videos/Thundercats/sword_in_a_hole.avi' app = QApplication(sys.argv) video = QVideoWidget() player = QMediaPlayer() player.setMedia(QUrl.fromLocalFile(VIDEO_PATH)) player.setVideoOutput(video) def video_available_changed(available): if available: video.updateGeometry() video.adjustSize() player.mediaStatusChanged.connect(video_available_changed) video.show() player.play() app.exec_() player.stop()
def setupUi(self, MainWindow): MainWindow.setObjectName("MainWindow") MainWindow.resize(1066, 806) self.centralwidget = QtWidgets.QWidget(MainWindow) self.centralwidget.setObjectName("centralwidget") self.horizontalLayout_5 = QtWidgets.QHBoxLayout(self.centralwidget) self.horizontalLayout_5.setObjectName("horizontalLayout_5") self.verticalLayout = QtWidgets.QVBoxLayout() self.verticalLayout.setObjectName("verticalLayout") self.ecran = QVideoWidget(self.centralwidget) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.ecran.sizePolicy().hasHeightForWidth()) self.ecran.setSizePolicy(sizePolicy) self.ecran.setObjectName("ecran") self.verticalLayout.addWidget(self.ecran) self.horizontalLayout_2 = QtWidgets.QHBoxLayout() self.horizontalLayout_2.setContentsMargins(10, 5, 10, 5) self.horizontalLayout_2.setObjectName("horizontalLayout_2") self.debut = QtWidgets.QLabel(self.centralwidget) font = QtGui.QFont() font.setPointSize(12) self.debut.setFont(font) self.debut.setObjectName("debut") self.horizontalLayout_2.addWidget(self.debut) self.timeline = QtWidgets.QSlider(self.centralwidget) self.timeline.setMinimumSize(QtCore.QSize(5, 40)) self.timeline.setOrientation(QtCore.Qt.Horizontal) self.timeline.setObjectName("timeline") self.horizontalLayout_2.addWidget(self.timeline) self.fin = QtWidgets.QLabel(self.centralwidget) font = QtGui.QFont() font.setPointSize(12) self.fin.setFont(font) self.fin.setObjectName("fin") self.horizontalLayout_2.addWidget(self.fin) self.verticalLayout.addLayout(self.horizontalLayout_2) self.horizontalLayout = QtWidgets.QHBoxLayout() self.horizontalLayout.setSpacing(30) self.horizontalLayout.setContentsMargins(-1, 20, -1, 20) self.horizontalLayout.setObjectName("horizontalLayout") self.pblecture = QtWidgets.QPushButton(self.centralwidget) self.pblecture.setObjectName("pblecture") self.horizontalLayout.addWidget(self.pblecture) self.pbpause = QtWidgets.QPushButton(self.centralwidget) self.pbpause.setObjectName("pbpause") self.horizontalLayout.addWidget(self.pbpause) self.pbstop = QtWidgets.QPushButton(self.centralwidget) self.pbstop.setMinimumSize(QtCore.QSize(0, 20)) self.pbstop.setObjectName("pbstop") self.horizontalLayout.addWidget(self.pbstop) self.pbsuivant = QtWidgets.QPushButton(self.centralwidget) self.pbsuivant.setObjectName("pbsuivant") self.horizontalLayout.addWidget(self.pbsuivant) self.pbprecedent = QtWidgets.QPushButton(self.centralwidget) self.pbprecedent.setObjectName("pbprecedent") self.horizontalLayout.addWidget(self.pbprecedent) self.verticalLayout.addLayout(self.horizontalLayout) self.horizontalLayout_5.addLayout(self.verticalLayout) self.verticalLayout_2 = QtWidgets.QVBoxLayout() self.verticalLayout_2.setObjectName("verticalLayout_2") self.line = QtWidgets.QFrame(self.centralwidget) self.line.setFrameShape(QtWidgets.QFrame.VLine) self.line.setFrameShadow(QtWidgets.QFrame.Sunken) self.line.setObjectName("line") self.verticalLayout_2.addWidget(self.line) spacerItem = QtWidgets.QSpacerItem(10, 60, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Fixed) self.verticalLayout_2.addItem(spacerItem) self.horizontalLayout_5.addLayout(self.verticalLayout_2) self.verticalLayout_3 = QtWidgets.QVBoxLayout() self.verticalLayout_3.setObjectName("verticalLayout_3") self.label_5 = QtWidgets.QLabel(self.centralwidget) font = QtGui.QFont() font.setPointSize(12) self.label_5.setFont(font) self.label_5.setObjectName("label_5") self.verticalLayout_3.addWidget(self.label_5) self.listWidget = QtWidgets.QListWidget(self.centralwidget) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.listWidget.sizePolicy().hasHeightForWidth()) self.listWidget.setSizePolicy(sizePolicy) self.listWidget.setObjectName("listWidget") self.verticalLayout_3.addWidget(self.listWidget) self.horizontalLayout_3 = QtWidgets.QHBoxLayout() self.horizontalLayout_3.setObjectName("horizontalLayout_3") spacerItem1 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Minimum) self.horizontalLayout_3.addItem(spacerItem1) self.pbplus = QtWidgets.QPushButton(self.centralwidget) self.pbplus.setObjectName("pbplus") self.horizontalLayout_3.addWidget(self.pbplus) self.pbmoins = QtWidgets.QPushButton(self.centralwidget) self.pbmoins.setObjectName("pbmoins") self.horizontalLayout_3.addWidget(self.pbmoins) self.verticalLayout_3.addLayout(self.horizontalLayout_3) self.horizontalLayout_4 = QtWidgets.QHBoxLayout() self.horizontalLayout_4.setObjectName("horizontalLayout_4") spacerItem2 = QtWidgets.QSpacerItem(100, 20, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Minimum) self.horizontalLayout_4.addItem(spacerItem2) self.label_3 = QtWidgets.QLabel(self.centralwidget) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Preferred) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.label_3.sizePolicy().hasHeightForWidth()) self.label_3.setSizePolicy(sizePolicy) font = QtGui.QFont() font.setPointSize(10) self.label_3.setFont(font) self.label_3.setObjectName("label_3") self.horizontalLayout_4.addWidget(self.label_3) self.dialVolume = QtWidgets.QDial(self.centralwidget) self.dialVolume.setMaximumSize(QtCore.QSize(80, 80)) self.dialVolume.setMaximum(100) self.dialVolume.setProperty("value", 100) self.dialVolume.setObjectName("dialVolume") self.horizontalLayout_4.addWidget(self.dialVolume) self.labelVol = QtWidgets.QLabel(self.centralwidget) self.labelVol.setMinimumSize(QtCore.QSize(50, 0)) font = QtGui.QFont() font.setPointSize(11) self.labelVol.setFont(font) self.labelVol.setObjectName("labelVol") self.horizontalLayout_4.addWidget(self.labelVol) self.verticalLayout_3.addLayout(self.horizontalLayout_4) self.horizontalLayout_5.addLayout(self.verticalLayout_3) MainWindow.setCentralWidget(self.centralwidget) self.menubar = QtWidgets.QMenuBar(MainWindow) self.menubar.setGeometry(QtCore.QRect(0, 0, 1066, 21)) self.menubar.setObjectName("menubar") MainWindow.setMenuBar(self.menubar) self.statusbar = QtWidgets.QStatusBar(MainWindow) self.statusbar.setObjectName("statusbar") MainWindow.setStatusBar(self.statusbar) self.retranslateUi(MainWindow) QtCore.QMetaObject.connectSlotsByName(MainWindow)
def setupUi(self, MainWindow): MainWindow.setObjectName("MainWindow") MainWindow.resize(757, 817) self.centralwidget = QtWidgets.QWidget(MainWindow) self.centralwidget.setObjectName("centralwidget") self.horizontalLayout_3 = QtWidgets.QHBoxLayout(self.centralwidget) self.horizontalLayout_3.setObjectName("horizontalLayout_3") self.verticalLayout_2 = QtWidgets.QVBoxLayout() self.verticalLayout_2.setObjectName("verticalLayout_2") self.ecranWidget = QVideoWidget(self.centralwidget) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.ecranWidget.sizePolicy().hasHeightForWidth()) self.ecranWidget.setSizePolicy(sizePolicy) self.ecranWidget.setObjectName("ecranWidget") self.verticalLayout_2.addWidget(self.ecranWidget) self.horizontalLayout_5 = QtWidgets.QHBoxLayout() self.horizontalLayout_5.setObjectName("horizontalLayout_5") self.tempLecture = QtWidgets.QLabel(self.centralwidget) self.tempLecture.setObjectName("tempLecture") self.horizontalLayout_5.addWidget(self.tempLecture) self.barreLect = QtWidgets.QSlider(self.centralwidget) self.barreLect.setOrientation(QtCore.Qt.Horizontal) self.barreLect.setObjectName("barreLect") self.horizontalLayout_5.addWidget(self.barreLect) self.tempRestant = QtWidgets.QLabel(self.centralwidget) self.tempRestant.setObjectName("tempRestant") self.horizontalLayout_5.addWidget(self.tempRestant) self.verticalLayout_2.addLayout(self.horizontalLayout_5) self.horizontalLayout_2 = QtWidgets.QHBoxLayout() self.horizontalLayout_2.setSizeConstraint( QtWidgets.QLayout.SetNoConstraint) self.horizontalLayout_2.setObjectName("horizontalLayout_2") self.pbLecture = QtWidgets.QPushButton(self.centralwidget) self.pbLecture.setObjectName("pbLecture") self.horizontalLayout_2.addWidget(self.pbLecture) self.pbPause = QtWidgets.QPushButton(self.centralwidget) self.pbPause.setObjectName("pbPause") self.horizontalLayout_2.addWidget(self.pbPause) self.pbStop = QtWidgets.QPushButton(self.centralwidget) self.pbStop.setObjectName("pbStop") self.horizontalLayout_2.addWidget(self.pbStop) self.pbPrecedent = QtWidgets.QPushButton(self.centralwidget) self.pbPrecedent.setObjectName("pbPrecedent") self.horizontalLayout_2.addWidget(self.pbPrecedent) self.pbSuivant = QtWidgets.QPushButton(self.centralwidget) self.pbSuivant.setObjectName("pbSuivant") self.horizontalLayout_2.addWidget(self.pbSuivant) self.verticalLayout_2.addLayout(self.horizontalLayout_2) self.horizontalLayout_3.addLayout(self.verticalLayout_2) self.verticalLayout_3 = QtWidgets.QVBoxLayout() self.verticalLayout_3.setSpacing(6) self.verticalLayout_3.setObjectName("verticalLayout_3") self.line = QtWidgets.QFrame(self.centralwidget) self.line.setEnabled(True) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Preferred) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(1) sizePolicy.setHeightForWidth( self.line.sizePolicy().hasHeightForWidth()) self.line.setSizePolicy(sizePolicy) self.line.setFrameShape(QtWidgets.QFrame.VLine) self.line.setFrameShadow(QtWidgets.QFrame.Sunken) self.line.setObjectName("line") self.verticalLayout_3.addWidget(self.line) spacerItem = QtWidgets.QSpacerItem(20, 100, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Fixed) self.verticalLayout_3.addItem(spacerItem) self.horizontalLayout_3.addLayout(self.verticalLayout_3) self.verticalLayout = QtWidgets.QVBoxLayout() self.verticalLayout.setObjectName("verticalLayout") self.label = QtWidgets.QLabel(self.centralwidget) self.label.setObjectName("label") self.verticalLayout.addWidget(self.label) self.listWidget = QtWidgets.QListWidget(self.centralwidget) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.listWidget.sizePolicy().hasHeightForWidth()) self.listWidget.setSizePolicy(sizePolicy) self.listWidget.setObjectName("listWidget") self.verticalLayout.addWidget(self.listWidget) self.horizontalLayout = QtWidgets.QHBoxLayout() self.horizontalLayout.setObjectName("horizontalLayout") spacerItem1 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Minimum) self.horizontalLayout.addItem(spacerItem1) self.pbPlus = QtWidgets.QPushButton(self.centralwidget) self.pbPlus.setObjectName("pbPlus") self.horizontalLayout.addWidget(self.pbPlus) self.pbMoins = QtWidgets.QPushButton(self.centralwidget) self.pbMoins.setObjectName("pbMoins") self.horizontalLayout.addWidget(self.pbMoins) self.verticalLayout.addLayout(self.horizontalLayout) self.horizontalLayout_4 = QtWidgets.QHBoxLayout() self.horizontalLayout_4.setObjectName("horizontalLayout_4") spacerItem2 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Minimum) self.horizontalLayout_4.addItem(spacerItem2) self.label_2 = QtWidgets.QLabel(self.centralwidget) self.label_2.setObjectName("label_2") self.horizontalLayout_4.addWidget(self.label_2) self.dialVolume = QtWidgets.QDial(self.centralwidget) self.dialVolume.setObjectName("dialVolume") self.horizontalLayout_4.addWidget(self.dialVolume) self.nivoVolume = QtWidgets.QLabel(self.centralwidget) self.nivoVolume.setObjectName("nivoVolume") self.horizontalLayout_4.addWidget(self.nivoVolume) self.verticalLayout.addLayout(self.horizontalLayout_4) self.horizontalLayout_3.addLayout(self.verticalLayout) MainWindow.setCentralWidget(self.centralwidget) self.menubar = QtWidgets.QMenuBar(MainWindow) self.menubar.setGeometry(QtCore.QRect(0, 0, 757, 21)) self.menubar.setObjectName("menubar") MainWindow.setMenuBar(self.menubar) self.statusbar = QtWidgets.QStatusBar(MainWindow) self.statusbar.setObjectName("statusbar") MainWindow.setStatusBar(self.statusbar) self.retranslateUi(MainWindow) QtCore.QMetaObject.connectSlotsByName(MainWindow)
def setupUi(self, AddNewRecord): if not AddNewRecord.objectName(): AddNewRecord.setObjectName(u"AddNewRecord") AddNewRecord.resize(1724, 1243) self.horizontalLayout = QHBoxLayout(AddNewRecord) self.horizontalLayout.setObjectName(u"horizontalLayout") self.groupBox = QGroupBox(AddNewRecord) self.groupBox.setObjectName(u"groupBox") self.groupBox.setFlat(True) self.tbl_assets = QTableWidget(self.groupBox) if (self.tbl_assets.columnCount() < 12): self.tbl_assets.setColumnCount(12) self.tbl_assets.setObjectName(u"tbl_assets") self.tbl_assets.setGeometry(QRect(15, 31, 1161, 1191)) self.tbl_assets.setColumnCount(12) self.tbl_assets.horizontalHeader().setVisible(True) self.tbl_assets.verticalHeader().setVisible(True) self.horizontalLayout.addWidget(self.groupBox) self.groupBox_2 = QGroupBox(AddNewRecord) self.groupBox_2.setObjectName(u"groupBox_2") sizePolicy = QSizePolicy(QSizePolicy.Fixed, QSizePolicy.Preferred) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.groupBox_2.sizePolicy().hasHeightForWidth()) self.groupBox_2.setSizePolicy(sizePolicy) self.groupBox_2.setMinimumSize(QSize(500, 0)) self.groupBox_2.setFlat(True) self.layoutWidget = QWidget(self.groupBox_2) self.layoutWidget.setObjectName(u"layoutWidget") self.layoutWidget.setGeometry(QRect(20, 30, 461, 1186)) self.verticalLayout = QVBoxLayout(self.layoutWidget) self.verticalLayout.setObjectName(u"verticalLayout") self.verticalLayout.setContentsMargins(0, 0, 0, 0) self.prv_media_player = QVideoWidget(self.layoutWidget) self.prv_media_player.setObjectName(u"prv_media_player") sizePolicy1 = QSizePolicy(QSizePolicy.Preferred, QSizePolicy.Fixed) sizePolicy1.setHorizontalStretch(0) sizePolicy1.setVerticalStretch(0) sizePolicy1.setHeightForWidth( self.prv_media_player.sizePolicy().hasHeightForWidth()) self.prv_media_player.setSizePolicy(sizePolicy1) self.prv_media_player.setMinimumSize(QSize(0, 300)) self.verticalLayout.addWidget(self.prv_media_player) self.horizontalLayout_2 = QHBoxLayout() self.horizontalLayout_2.setObjectName(u"horizontalLayout_2") self.btn_play = QToolButton(self.layoutWidget) self.btn_play.setObjectName(u"btn_play") sizePolicy2 = QSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed) sizePolicy2.setHorizontalStretch(0) sizePolicy2.setVerticalStretch(0) sizePolicy2.setHeightForWidth( self.btn_play.sizePolicy().hasHeightForWidth()) self.btn_play.setSizePolicy(sizePolicy2) self.horizontalLayout_2.addWidget(self.btn_play) self.sld_progress = QSlider(self.layoutWidget) self.sld_progress.setObjectName(u"sld_progress") sizePolicy3 = QSizePolicy(QSizePolicy.Expanding, QSizePolicy.Fixed) sizePolicy3.setHorizontalStretch(0) sizePolicy3.setVerticalStretch(0) sizePolicy3.setHeightForWidth( self.sld_progress.sizePolicy().hasHeightForWidth()) self.sld_progress.setSizePolicy(sizePolicy3) self.sld_progress.setOrientation(Qt.Horizontal) self.horizontalLayout_2.addWidget(self.sld_progress) self.label = QLabel(self.layoutWidget) self.label.setObjectName(u"label") sizePolicy1.setHeightForWidth( self.label.sizePolicy().hasHeightForWidth()) self.label.setSizePolicy(sizePolicy1) self.horizontalLayout_2.addWidget(self.label) self.verticalLayout.addLayout(self.horizontalLayout_2) self.groupBox_3 = QGroupBox(self.layoutWidget) self.groupBox_3.setObjectName(u"groupBox_3") sizePolicy4 = QSizePolicy(QSizePolicy.Preferred, QSizePolicy.Expanding) sizePolicy4.setHorizontalStretch(0) sizePolicy4.setVerticalStretch(0) sizePolicy4.setHeightForWidth( self.groupBox_3.sizePolicy().hasHeightForWidth()) self.groupBox_3.setSizePolicy(sizePolicy4) self.groupBox_3.setMinimumSize(QSize(0, 800)) self.groupBox_3.setMaximumSize(QSize(16777215, 750)) self.groupBox_3.setFlat(False) self.lbl_file_info = QLabel(self.groupBox_3) self.lbl_file_info.setObjectName(u"lbl_file_info") self.lbl_file_info.setGeometry(QRect(10, 30, 441, 721)) self.verticalLayout.addWidget(self.groupBox_3) self.horizontalLayout.addWidget(self.groupBox_2) self.retranslateUi(AddNewRecord) QMetaObject.connectSlotsByName(AddNewRecord)
def __init__(self, aPath, parent=None): super(VideoPlayer, self).__init__(parent) self.setAttribute(Qt.WA_NoSystemBackground, True) self.setAcceptDrops(True) self.mediaPlayer = QMediaPlayer(None, QMediaPlayer.StreamPlayback) self.mediaPlayer.mediaStatusChanged.connect(self.printMediaData) self.mediaPlayer.setVolume(80) self.videoWidget = QVideoWidget(self) self.lbl = QLineEdit('00:00:00') self.lbl.setReadOnly(True) self.lbl.setFixedWidth(70) self.lbl.setUpdatesEnabled(True) self.lbl.setStyleSheet(stylesheet(self)) self.lbl.selectionChanged.connect(lambda: self.lbl.setSelection(0, 0)) self.elbl = QLineEdit('00:00:00') self.elbl.setReadOnly(True) self.elbl.setFixedWidth(70) self.elbl.setUpdatesEnabled(True) self.elbl.setStyleSheet(stylesheet(self)) self.elbl.selectionChanged.connect( lambda: self.elbl.setSelection(0, 0)) self.playButton = QPushButton() self.playButton.setEnabled(False) self.playButton.setFixedWidth(32) self.playButton.setStyleSheet("background-color: black") self.playButton.setIcon(self.style().standardIcon(QStyle.SP_MediaPlay)) self.playButton.clicked.connect(self.play) self.positionSlider = QSlider(Qt.Horizontal, self) self.positionSlider.setStyleSheet(stylesheet(self)) self.positionSlider.setRange(0, 100) self.positionSlider.sliderMoved.connect(self.setPosition) self.positionSlider.setSingleStep(2) self.positionSlider.setPageStep(20) self.positionSlider.setAttribute(Qt.WA_TranslucentBackground, True) self.clip = QApplication.clipboard() self.process = QProcess(self) self.process.readyRead.connect(self.dataReady) self.process.finished.connect(self.playFromURL) self.myurl = "" controlLayout = QHBoxLayout() controlLayout.setContentsMargins(5, 0, 5, 0) controlLayout.addWidget(self.playButton) controlLayout.addWidget(self.lbl) controlLayout.addWidget(self.positionSlider) controlLayout.addWidget(self.elbl) layout = QVBoxLayout() layout.setContentsMargins(0, 0, 0, 0) layout.addWidget(self.videoWidget) layout.addLayout(controlLayout) self.setLayout(layout) self.myinfo = "©2016\nAxel Schneider\n\nMouse Wheel = Zoom\nUP = Volume Up\nDOWN = Volume Down\n" + \ "LEFT = < 1 Minute\nRIGHT = > 1 Minute\n" + \ "SHIFT+LEFT = < 10 Minutes\nSHIFT+RIGHT = > 10 Minutes" self.widescreen = True #### shortcuts #### self.shortcut = QShortcut(QKeySequence("q"), self) self.shortcut.activated.connect(self.handleQuit) self.shortcut = QShortcut(QKeySequence("u"), self) self.shortcut.activated.connect(self.playFromURL) self.shortcut = QShortcut(QKeySequence("y"), self) self.shortcut.activated.connect(self.getYTUrl) self.shortcut = QShortcut(QKeySequence("o"), self) self.shortcut.activated.connect(self.openFile) self.shortcut = QShortcut(QKeySequence(" "), self) self.shortcut.activated.connect(self.play) self.shortcut = QShortcut(QKeySequence("f"), self) self.shortcut.activated.connect(self.handleFullscreen) self.shortcut = QShortcut(QKeySequence("i"), self) self.shortcut.activated.connect(self.handleInfo) self.shortcut = QShortcut(QKeySequence("s"), self) self.shortcut.activated.connect(self.toggleSlider) self.shortcut = QShortcut(QKeySequence(Qt.Key_Right), self) self.shortcut.activated.connect(self.forwardSlider) self.shortcut = QShortcut(QKeySequence(Qt.Key_Left), self) self.shortcut.activated.connect(self.backSlider) self.shortcut = QShortcut(QKeySequence(Qt.Key_Up), self) self.shortcut.activated.connect(self.volumeUp) self.shortcut = QShortcut(QKeySequence(Qt.Key_Down), self) self.shortcut.activated.connect(self.volumeDown) self.shortcut = QShortcut( QKeySequence(Qt.ShiftModifier + Qt.Key_Right), self) self.shortcut.activated.connect(self.forwardSlider10) self.shortcut = QShortcut(QKeySequence(Qt.ShiftModifier + Qt.Key_Left), self) self.shortcut.activated.connect(self.backSlider10) self.mediaPlayer.setVideoOutput(self.videoWidget) self.mediaPlayer.stateChanged.connect(self.mediaStateChanged) self.mediaPlayer.positionChanged.connect(self.positionChanged) self.mediaPlayer.durationChanged.connect(self.durationChanged) self.mediaPlayer.error.connect(self.handleError) print("QT5 Player started") print("press 'o' to open file (see context menu for more)") self.suspend_screensaver()
def setupUi(self, MainWindow): MainWindow.setObjectName("MainWindow") MainWindow.resize(941, 709) self.centralwidget = QtWidgets.QWidget(MainWindow) self.centralwidget.setObjectName("centralwidget") self.horizontalLayout_2 = QtWidgets.QHBoxLayout(self.centralwidget) self.horizontalLayout_2.setObjectName("horizontalLayout_2") self.verticalLayout_3 = QtWidgets.QVBoxLayout() self.verticalLayout_3.setObjectName("verticalLayout_3") self.widget = QVideoWidget(self.centralwidget) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.widget.sizePolicy().hasHeightForWidth()) self.widget.setSizePolicy(sizePolicy) self.widget.setObjectName("widget") self.verticalLayout_3.addWidget(self.widget) self.horizontalLayout_6 = QtWidgets.QHBoxLayout() self.horizontalLayout_6.setObjectName("horizontalLayout_6") self.time1 = QtWidgets.QLabel(self.centralwidget) self.time1.setTextFormat(QtCore.Qt.PlainText) self.time1.setObjectName("time1") self.horizontalLayout_6.addWidget(self.time1) self.sliderTime = QtWidgets.QSlider(self.centralwidget) self.sliderTime.setOrientation(QtCore.Qt.Horizontal) self.sliderTime.setObjectName("sliderTime") self.horizontalLayout_6.addWidget(self.sliderTime) self.time2 = QtWidgets.QLabel(self.centralwidget) self.time2.setObjectName("time2") self.horizontalLayout_6.addWidget(self.time2) self.verticalLayout_3.addLayout(self.horizontalLayout_6) self.buttons_layout = QtWidgets.QHBoxLayout() self.buttons_layout.setObjectName("buttons_layout") self.PLAY_Button = QtWidgets.QPushButton(self.centralwidget) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Minimum) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.PLAY_Button.sizePolicy().hasHeightForWidth()) self.PLAY_Button.setSizePolicy(sizePolicy) self.PLAY_Button.setObjectName("PLAY_Button") self.buttons_layout.addWidget(self.PLAY_Button) self.PAUSE_Button = QtWidgets.QPushButton(self.centralwidget) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Minimum) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.PAUSE_Button.sizePolicy().hasHeightForWidth()) self.PAUSE_Button.setSizePolicy(sizePolicy) self.PAUSE_Button.setObjectName("PAUSE_Button") self.buttons_layout.addWidget(self.PAUSE_Button) self.STOP_Button = QtWidgets.QPushButton(self.centralwidget) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Minimum) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.STOP_Button.sizePolicy().hasHeightForWidth()) self.STOP_Button.setSizePolicy(sizePolicy) self.STOP_Button.setObjectName("STOP_Button") self.buttons_layout.addWidget(self.STOP_Button) self.REW_Button = QtWidgets.QPushButton(self.centralwidget) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Minimum) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.REW_Button.sizePolicy().hasHeightForWidth()) self.REW_Button.setSizePolicy(sizePolicy) self.REW_Button.setObjectName("REW_Button") self.buttons_layout.addWidget(self.REW_Button) self.FFW_Button = QtWidgets.QPushButton(self.centralwidget) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Minimum) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.FFW_Button.sizePolicy().hasHeightForWidth()) self.FFW_Button.setSizePolicy(sizePolicy) self.FFW_Button.setObjectName("FFW_Button") self.buttons_layout.addWidget(self.FFW_Button) self.verticalLayout_3.addLayout(self.buttons_layout) self.horizontalLayout_2.addLayout(self.verticalLayout_3) self.verticalLayout = QtWidgets.QVBoxLayout() self.verticalLayout.setObjectName("verticalLayout") self.line = QtWidgets.QFrame(self.centralwidget) self.line.setFrameShape(QtWidgets.QFrame.VLine) self.line.setFrameShadow(QtWidgets.QFrame.Sunken) self.line.setObjectName("line") self.verticalLayout.addWidget(self.line) spacerItem = QtWidgets.QSpacerItem(20, 100, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Fixed) self.verticalLayout.addItem(spacerItem) self.horizontalLayout_2.addLayout(self.verticalLayout) self.verticalLayout_2 = QtWidgets.QVBoxLayout() self.verticalLayout_2.setObjectName("verticalLayout_2") self.label_3 = QtWidgets.QLabel(self.centralwidget) self.label_3.setObjectName("label_3") self.verticalLayout_2.addWidget(self.label_3) self.file_list = QtWidgets.QListView(self.centralwidget) self.file_list.setObjectName("file_list") self.verticalLayout_2.addWidget(self.file_list) self.horizontalLayout_4 = QtWidgets.QHBoxLayout() self.horizontalLayout_4.setObjectName("horizontalLayout_4") spacerItem1 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) self.horizontalLayout_4.addItem(spacerItem1) self.next_file_button = QtWidgets.QPushButton(self.centralwidget) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Minimum) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.next_file_button.sizePolicy().hasHeightForWidth()) self.next_file_button.setSizePolicy(sizePolicy) self.next_file_button.setIconSize(QtCore.QSize(8, 16)) self.next_file_button.setObjectName("next_file_button") self.horizontalLayout_4.addWidget(self.next_file_button) self.prev_file_button = QtWidgets.QPushButton(self.centralwidget) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Minimum) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.prev_file_button.sizePolicy().hasHeightForWidth()) self.prev_file_button.setSizePolicy(sizePolicy) self.prev_file_button.setIconSize(QtCore.QSize(8, 8)) self.prev_file_button.setObjectName("prev_file_button") self.horizontalLayout_4.addWidget(self.prev_file_button) self.verticalLayout_2.addLayout(self.horizontalLayout_4) self.horizontalLayout_3 = QtWidgets.QHBoxLayout() self.horizontalLayout_3.setObjectName("horizontalLayout_3") spacerItem2 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) self.horizontalLayout_3.addItem(spacerItem2) self.label_Volumen = QtWidgets.QLabel(self.centralwidget) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Minimum) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.label_Volumen.sizePolicy().hasHeightForWidth()) self.label_Volumen.setSizePolicy(sizePolicy) self.label_Volumen.setObjectName("label_Volumen") self.horizontalLayout_3.addWidget(self.label_Volumen) self.dial_volumen = QtWidgets.QDial(self.centralwidget) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Minimum) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.dial_volumen.sizePolicy().hasHeightForWidth()) self.dial_volumen.setSizePolicy(sizePolicy) self.dial_volumen.setObjectName("dial_volumen") self.horizontalLayout_3.addWidget(self.dial_volumen) self.volumen_level = QtWidgets.QLabel(self.centralwidget) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Minimum) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.volumen_level.sizePolicy().hasHeightForWidth()) self.volumen_level.setSizePolicy(sizePolicy) self.volumen_level.setObjectName("volumen_level") self.horizontalLayout_3.addWidget(self.volumen_level) self.verticalLayout_2.addLayout(self.horizontalLayout_3) self.horizontalLayout_2.addLayout(self.verticalLayout_2) MainWindow.setCentralWidget(self.centralwidget) self.menubar = QtWidgets.QMenuBar(MainWindow) self.menubar.setGeometry(QtCore.QRect(0, 0, 941, 21)) self.menubar.setObjectName("menubar") MainWindow.setMenuBar(self.menubar) self.statusbar = QtWidgets.QStatusBar(MainWindow) self.statusbar.setObjectName("statusbar") MainWindow.setStatusBar(self.statusbar) self.retranslateUi(MainWindow) QtCore.QMetaObject.connectSlotsByName(MainWindow)
def __init__(self, parent=None): super(VideoWindow, self).__init__(parent) self.setWindowTitle( "PyQt Video Player Widget Example - pythonprogramminglanguage.com") self.mediaPlayer = QMediaPlayer(None, QMediaPlayer.VideoSurface) videoWidget = QVideoWidget() self.playButton = QPushButton() self.playButton.setEnabled(False) self.playButton.setIcon(self.style().standardIcon(QStyle.SP_MediaPlay)) self.playButton.clicked.connect(self.play) self.positionSlider = QSlider(Qt.Horizontal) self.positionSlider.setRange(0, 0) self.positionSlider.sliderMoved.connect(self.setPosition) self.errorLabel = QLabel() self.errorLabel.setSizePolicy(QSizePolicy.Preferred, QSizePolicy.Maximum) # Create new action openAction = QAction(QIcon('open.png'), '&Open', self) openAction.setShortcut('Ctrl+O') openAction.setStatusTip('Open movie') openAction.triggered.connect(self.openFile) # Create exit action exitAction = QAction(QIcon('exit.png'), '&Exit', self) exitAction.setShortcut('Ctrl+Q') exitAction.setStatusTip('Exit application') exitAction.triggered.connect(self.exitCall) # Create menu bar and add action menuBar = self.menuBar() fileMenu = menuBar.addMenu('&File') #fileMenu.addAction(newAction) fileMenu.addAction(openAction) fileMenu.addAction(exitAction) # Create a widget for window contents wid = QWidget(self) self.setCentralWidget(wid) # Create layouts to place inside widget controlLayout = QHBoxLayout() controlLayout.setContentsMargins(0, 0, 0, 0) controlLayout.addWidget(self.playButton) controlLayout.addWidget(self.positionSlider) layout = QVBoxLayout() layout.addWidget(videoWidget) layout.addLayout(controlLayout) layout.addWidget(self.errorLabel) # Set widget to contain window contents wid.setLayout(layout) self.mediaPlayer.setVideoOutput(videoWidget) self.mediaPlayer.stateChanged.connect(self.mediaStateChanged) self.mediaPlayer.positionChanged.connect(self.positionChanged) self.mediaPlayer.durationChanged.connect(self.durationChanged) self.mediaPlayer.error.connect(self.handleError)
def __init__(self, plugin_manager): super(EditorWidget, self).__init__() os.environ[ 'QT_MULTIMEDIA_PREFERRED_PLUGINS'] = 'windowsmediafoundation' self.plugin_manager = plugin_manager #parent layout self.v_box = QVBoxLayout() self.h_box = QHBoxLayout() # parent splitter for the text and numbers self.text_h_box = QSplitter(Qt.Horizontal) self.text_h_box.splitterMoved.connect(self.on_text_changed) self.settings = QSettings(c.SETTINGS_PATH, QSettings.IniFormat) self.keyboard_settings = QSettings(c.KEYBOARD_SETTINGS_PATH, QSettings.IniFormat) self.theme = self.settings.value(c.THEME, defaultValue=c.THEME_D) # font settings self.font = QFont( self.settings.value(c.FONT, defaultValue="Arial", type=str)) self.font.setPointSize( self.settings.value(c.FONT_SIZE, defaultValue=16, type=int)) # the text widget itself self.text = QPlainTextEdit() self.text.setFont(self.font) self.text.textChanged.connect(self.on_text_changed) self.text.setFocusPolicy(Qt.StrongFocus) # the number text widget to show the row numbers self.numbers = QPlainTextEdit() self.numbers.setFont(self.font) self.numbers.setReadOnly(True) self.numbers.setMinimumWidth(20) self.numbers.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOff) self.numbers.setVerticalScrollBarPolicy(Qt.ScrollBarAlwaysOff) self.numbers.setLineWrapMode(QPlainTextEdit.NoWrap) self.numbers.setFocusPolicy(Qt.NoFocus) self.numbers.setFrameStyle(QFrame.NoFrame) self.numbers.setStyleSheet("background-color: rgba(0,0,0,0%)") # sync the text widget and number widget self.text_bar = self.text.verticalScrollBar() self.number_bar = self.numbers.verticalScrollBar() #self.number_bar.valueChanged.connect(self.text_bar.setValue) self.text_bar.valueChanged.connect(self.number_bar.setValue) # add them into their layout self.text_h_box.addWidget(self.numbers) self.text_h_box.addWidget(self.text) self.text_h_box.setSizes([10, 700]) # layout which holds the media controls in the bottom self.media_controls = QHBoxLayout() self.media_controls_settings = QVBoxLayout() self.media_controls_slider_h_box = QHBoxLayout() # direct player controls self.btn_size = 75 self.play_icon = QIcon( os.path.join(c.ICON_PATH, self.theme, "play.png")) self.pause_icon = QIcon( os.path.join(c.ICON_PATH, self.theme, "pause.png")) self.play_btn = QPushButton(icon=self.play_icon) self.play_btn.clicked.connect(self.on_play) self.play_btn.setFixedSize(self.btn_size, self.btn_size) self.play_btn.setIconSize(QSize(self.btn_size, self.btn_size)) self.play_btn.setFlat(True) self.play_btn.setShortcut(QKeySequence().fromString( self.keyboard_settings.value(c.PLAY_PAUSE_KEY, defaultValue=""))) self.forward_btn = QPushButton( icon=QIcon(os.path.join(c.ICON_PATH, self.theme, "forward.png"))) self.forward_btn.clicked.connect(self.on_forward) self.forward_btn.setFixedSize(self.btn_size, self.btn_size) self.forward_btn.setIconSize(QSize(self.btn_size, self.btn_size)) self.forward_btn.setFlat(True) self.forward_btn.setShortcut(QKeySequence().fromString( self.keyboard_settings.value(c.FORWARD_KEY, defaultValue=""))) self.backward_btn = QPushButton( icon=QIcon(os.path.join(c.ICON_PATH, self.theme, "backward.png"))) self.backward_btn.clicked.connect(self.on_backward) self.backward_btn.setFixedSize(self.btn_size, self.btn_size) self.backward_btn.setIconSize(QSize(self.btn_size, self.btn_size)) self.backward_btn.setFlat(True) self.backward_btn.setShortcut(QKeySequence().fromString( self.keyboard_settings.value(c.BACKWARDS_KEY, defaultValue=""))) # add them to the layout self.media_controls.addStretch() self.media_controls.addWidget(self.backward_btn) self.media_controls.addWidget(self.play_btn) self.media_controls.addWidget(self.forward_btn) self.media_controls.addStretch(4) # slider which shows the current time self.time_slider = QSlider(Qt.Horizontal) self.time_slider.sliderMoved.connect(self.on_time_slider_moved) # label on the right of the slider, which shows the current time self.time_label = QLabel("00:00/00:00") self.media_controls_slider_h_box.addWidget(self.time_slider) self.media_controls_slider_h_box.addWidget(self.time_label) # icons for the other sliders self.vol_icon = QIcon( os.path.join(c.ICON_PATH, self.theme, "volume.png")).pixmap(QSize(32, 32)) self.rate_icon = QIcon( os.path.join(c.ICON_PATH, self.theme, "playbackrate.png")).pixmap(QSize(32, 32)) self.rewind_icon = QIcon( os.path.join(c.ICON_PATH, self.theme, "time.png")).pixmap(QSize(32, 32)) # display the icons through labels self.vol_icon_label = QLabel() self.vol_icon_label.setPixmap(self.vol_icon) self.rate_icon_label = QLabel() self.rate_icon_label.setPixmap(self.rate_icon) self.rewind_rewind_label = QLabel() self.rewind_rewind_label.setPixmap(self.rewind_icon) # init of the other sliders self.vol_slider = QSlider(Qt.Horizontal) self.vol_slider.sliderMoved.connect(self.on_vol_slider_moved) self.vol_slider.setFixedWidth(250) self.vol_slider.setRange(1, 100) self.rate_slider = QSlider(Qt.Horizontal) self.rate_slider.sliderMoved.connect(self.on_rate_slider_moved) self.rate_slider.setFixedWidth(250) self.rate_slider.setRange(1, 20) self.rewind_time = 10 self.rewind_slider = QSlider(Qt.Horizontal) self.rewind_slider.sliderMoved.connect(self.on_rewind_slider_moved) self.rewind_slider.setFixedWidth(250) self.rewind_slider.setRange(1, 60) self.rewind_slider.setValue(self.rewind_time) # labels for the values self.vol_label = QLabel() self.rate_label = QLabel() self.rewind_label = QLabel() # create hbox for each of the three sliders self.vol_h_box = QHBoxLayout() self.vol_h_box.addWidget(self.vol_label) self.vol_h_box.addWidget(self.vol_slider) self.vol_h_box.addWidget(self.vol_icon_label) self.rate_h_box = QHBoxLayout() self.rate_h_box.addWidget(self.rate_label) self.rate_h_box.addWidget(self.rate_slider) self.rate_h_box.addWidget(self.rate_icon_label) self.rewind_h_box = QHBoxLayout() self.rewind_h_box.addWidget(self.rewind_label) self.rewind_h_box.addWidget(self.rewind_slider) self.rewind_h_box.addWidget(self.rewind_rewind_label) # group them together in a vlayout self.media_controls_settings.addLayout(self.vol_h_box) self.media_controls_settings.addLayout(self.rewind_h_box) self.media_controls_settings.addLayout(self.rate_h_box) # add this layout to the layout which already contains the buttons self.media_controls.addLayout(self.media_controls_settings) self.word_by_word_actions = QListWidget() self.word_by_word_actions.setMaximumWidth(150) self.h_box.addWidget(self.text_h_box) self.h_box.addWidget(self.word_by_word_actions) # group all ungrouped layouts and widgets to the parent layout self.v_box.addLayout(self.h_box, 10) self.v_box.addLayout(self.media_controls_slider_h_box, 1) self.v_box.addLayout(self.media_controls, 1) # set parent layout self.setLayout(self.v_box) # init media_player self.media_player = QMediaPlayer() self.video_widget = QVideoWidget() self.video_widget.setGeometry(200, 200, 500, 300) self.video_widget.setWindowTitle("Output") self.media_player.setVideoOutput(self.video_widget) self.media_player.positionChanged.connect(self.on_position_change) self.media_player.durationChanged.connect(self.on_duration_change) self.vol_slider.setValue(self.media_player.volume()) self.rate_slider.setValue(int(self.media_player.playbackRate() * 10)) self.on_vol_slider_moved(self.media_player.volume()) self.on_rate_slider_moved(self.media_player.playbackRate() * 10) self.on_rewind_slider_moved(self.rewind_time) self.activate_text_modules = False self.get_text_modules() self.text_option_on = QTextOption() self.text_option_on.setFlags( QTextOption.ShowTabsAndSpaces | QTextOption.ShowLineAndParagraphSeparators) self.text_option_off = QTextOption() self.transcription_meta_data = None self.word_pos = -1 self.word_start_time = None self.word_end_time = None self.tcf_highlight = QTextCharFormat() self.tcf_highlight.setBackground(Qt.red) self.tcf_normal = QTextCharFormat() self.tcf_normal.setBackground(Qt.transparent) self.show_empty_buttons = self.settings.value(c.SHOW_EMPTY_BUTTONS, defaultValue=True, type=bool)
def __init__(self, parent=None): super().__init__(parent) self.resize(600, 400) self.media_player = QMediaPlayer(self, QMediaPlayer.VideoSurface) self.video_widget = QVideoWidget(self) self.setCentralWidget(self.video_widget)
def setupUi(self, ImportSlipDlg): if not ImportSlipDlg.objectName(): ImportSlipDlg.setObjectName(u"ImportSlipDlg") ImportSlipDlg.resize(850, 587) self.verticalLayout = QVBoxLayout(ImportSlipDlg) self.verticalLayout.setSpacing(6) self.verticalLayout.setObjectName(u"verticalLayout") self.verticalLayout.setContentsMargins(2, 2, 2, 2) self.InputFrame = QFrame(ImportSlipDlg) self.InputFrame.setObjectName(u"InputFrame") sizePolicy = QSizePolicy(QSizePolicy.Preferred, QSizePolicy.Maximum) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.InputFrame.sizePolicy().hasHeightForWidth()) self.InputFrame.setSizePolicy(sizePolicy) self.InputFrame.setFrameShape(QFrame.NoFrame) self.InputFrame.setFrameShadow(QFrame.Plain) self.horizontalLayout_3 = QHBoxLayout(self.InputFrame) self.horizontalLayout_3.setSpacing(2) self.horizontalLayout_3.setObjectName(u"horizontalLayout_3") self.horizontalLayout_3.setContentsMargins(0, 0, 0, 0) self.QRGroup = QGroupBox(self.InputFrame) self.QRGroup.setObjectName(u"QRGroup") sizePolicy1 = QSizePolicy(QSizePolicy.Preferred, QSizePolicy.Preferred) sizePolicy1.setHorizontalStretch(0) sizePolicy1.setVerticalStretch(0) sizePolicy1.setHeightForWidth(self.QRGroup.sizePolicy().hasHeightForWidth()) self.QRGroup.setSizePolicy(sizePolicy1) self.QRGroup.setAlignment(Qt.AlignLeading|Qt.AlignLeft|Qt.AlignVCenter) self.verticalLayout_3 = QVBoxLayout(self.QRGroup) self.verticalLayout_3.setSpacing(6) self.verticalLayout_3.setObjectName(u"verticalLayout_3") self.verticalLayout_3.setContentsMargins(2, 2, 2, 2) self.GetQRfromCameraBtn = QPushButton(self.QRGroup) self.GetQRfromCameraBtn.setObjectName(u"GetQRfromCameraBtn") self.verticalLayout_3.addWidget(self.GetQRfromCameraBtn) self.LoadQRfromFileBtn = QPushButton(self.QRGroup) self.LoadQRfromFileBtn.setObjectName(u"LoadQRfromFileBtn") self.verticalLayout_3.addWidget(self.LoadQRfromFileBtn) self.GetQRfromClipboardBtn = QPushButton(self.QRGroup) self.GetQRfromClipboardBtn.setObjectName(u"GetQRfromClipboardBtn") self.verticalLayout_3.addWidget(self.GetQRfromClipboardBtn) self.verticalSpacer = QSpacerItem(20, 40, QSizePolicy.Minimum, QSizePolicy.Expanding) self.verticalLayout_3.addItem(self.verticalSpacer) self.horizontalLayout_3.addWidget(self.QRGroup) self.SlipDataGroup = QGroupBox(self.InputFrame) self.SlipDataGroup.setObjectName(u"SlipDataGroup") sizePolicy1.setHeightForWidth(self.SlipDataGroup.sizePolicy().hasHeightForWidth()) self.SlipDataGroup.setSizePolicy(sizePolicy1) self.gridLayout_2 = QGridLayout(self.SlipDataGroup) self.gridLayout_2.setObjectName(u"gridLayout_2") self.gridLayout_2.setContentsMargins(2, 2, 2, 2) self.GetSlipBtn = QPushButton(self.SlipDataGroup) self.GetSlipBtn.setObjectName(u"GetSlipBtn") self.gridLayout_2.addWidget(self.GetSlipBtn, 7, 1, 1, 1) self.AmountLbl = QLabel(self.SlipDataGroup) self.AmountLbl.setObjectName(u"AmountLbl") self.gridLayout_2.addWidget(self.AmountLbl, 0, 2, 1, 1) self.SlipType = QLineEdit(self.SlipDataGroup) self.SlipType.setObjectName(u"SlipType") self.gridLayout_2.addWidget(self.SlipType, 4, 3, 1, 1) self.SlipTimstamp = QDateTimeEdit(self.SlipDataGroup) self.SlipTimstamp.setObjectName(u"SlipTimstamp") self.gridLayout_2.addWidget(self.SlipTimstamp, 0, 1, 1, 1) self.TimestampLbl = QLabel(self.SlipDataGroup) self.TimestampLbl.setObjectName(u"TimestampLbl") self.gridLayout_2.addWidget(self.TimestampLbl, 0, 0, 1, 1) self.FDlbl = QLabel(self.SlipDataGroup) self.FDlbl.setObjectName(u"FDlbl") self.gridLayout_2.addWidget(self.FDlbl, 2, 0, 1, 1) self.SlipAmount = QLineEdit(self.SlipDataGroup) self.SlipAmount.setObjectName(u"SlipAmount") self.gridLayout_2.addWidget(self.SlipAmount, 0, 3, 1, 1) self.FP = QLineEdit(self.SlipDataGroup) self.FP.setObjectName(u"FP") self.gridLayout_2.addWidget(self.FP, 2, 3, 1, 1) self.FD = QLineEdit(self.SlipDataGroup) self.FD.setObjectName(u"FD") self.gridLayout_2.addWidget(self.FD, 2, 1, 1, 1) self.FNlbl = QLabel(self.SlipDataGroup) self.FNlbl.setObjectName(u"FNlbl") self.gridLayout_2.addWidget(self.FNlbl, 4, 0, 1, 1) self.DummyLbl = QLabel(self.SlipDataGroup) self.DummyLbl.setObjectName(u"DummyLbl") self.gridLayout_2.addWidget(self.DummyLbl, 7, 0, 1, 1) self.SlipTypeLbl = QLabel(self.SlipDataGroup) self.SlipTypeLbl.setObjectName(u"SlipTypeLbl") self.gridLayout_2.addWidget(self.SlipTypeLbl, 4, 2, 1, 1) self.FN = QLineEdit(self.SlipDataGroup) self.FN.setObjectName(u"FN") self.gridLayout_2.addWidget(self.FN, 4, 1, 1, 1) self.LoadJSONfromFileBtn = QPushButton(self.SlipDataGroup) self.LoadJSONfromFileBtn.setObjectName(u"LoadJSONfromFileBtn") self.gridLayout_2.addWidget(self.LoadJSONfromFileBtn, 7, 3, 1, 1) self.FPlbl = QLabel(self.SlipDataGroup) self.FPlbl.setObjectName(u"FPlbl") self.gridLayout_2.addWidget(self.FPlbl, 2, 2, 1, 1) self.line = QFrame(self.SlipDataGroup) self.line.setObjectName(u"line") self.line.setFrameShape(QFrame.HLine) self.line.setFrameShadow(QFrame.Sunken) self.gridLayout_2.addWidget(self.line, 5, 0, 1, 4) self.horizontalLayout_3.addWidget(self.SlipDataGroup) self.CameraGroup = QGroupBox(self.InputFrame) self.CameraGroup.setObjectName(u"CameraGroup") self.verticalLayout_2 = QVBoxLayout(self.CameraGroup) self.verticalLayout_2.setSpacing(2) self.verticalLayout_2.setObjectName(u"verticalLayout_2") self.verticalLayout_2.setContentsMargins(2, 2, 2, 2) self.Viewfinder = QVideoWidget(self.CameraGroup) self.Viewfinder.setObjectName(u"Viewfinder") sizePolicy2 = QSizePolicy(QSizePolicy.Preferred, QSizePolicy.Expanding) sizePolicy2.setHorizontalStretch(0) sizePolicy2.setVerticalStretch(0) sizePolicy2.setHeightForWidth(self.Viewfinder.sizePolicy().hasHeightForWidth()) self.Viewfinder.setSizePolicy(sizePolicy2) self.verticalLayout_2.addWidget(self.Viewfinder) self.CameraBtnFrame = QFrame(self.CameraGroup) self.CameraBtnFrame.setObjectName(u"CameraBtnFrame") sizePolicy3 = QSizePolicy(QSizePolicy.Preferred, QSizePolicy.Minimum) sizePolicy3.setHorizontalStretch(0) sizePolicy3.setVerticalStretch(0) sizePolicy3.setHeightForWidth(self.CameraBtnFrame.sizePolicy().hasHeightForWidth()) self.CameraBtnFrame.setSizePolicy(sizePolicy3) self.CameraBtnFrame.setFrameShape(QFrame.NoFrame) self.CameraBtnFrame.setFrameShadow(QFrame.Plain) self.horizontalLayout_5 = QHBoxLayout(self.CameraBtnFrame) self.horizontalLayout_5.setSpacing(2) self.horizontalLayout_5.setObjectName(u"horizontalLayout_5") self.horizontalLayout_5.setContentsMargins(0, 0, 0, 0) self.StopCameraBtn = QPushButton(self.CameraBtnFrame) self.StopCameraBtn.setObjectName(u"StopCameraBtn") self.horizontalLayout_5.addWidget(self.StopCameraBtn) self.verticalLayout_2.addWidget(self.CameraBtnFrame) self.horizontalLayout_3.addWidget(self.CameraGroup) self.verticalLayout.addWidget(self.InputFrame) self.SlipGroup = QGroupBox(ImportSlipDlg) self.SlipGroup.setObjectName(u"SlipGroup") sizePolicy2.setHeightForWidth(self.SlipGroup.sizePolicy().hasHeightForWidth()) self.SlipGroup.setSizePolicy(sizePolicy2) self.gridLayout = QGridLayout(self.SlipGroup) self.gridLayout.setObjectName(u"gridLayout") self.gridLayout.setContentsMargins(2, 2, 2, 2) self.PeerLbl = QLabel(self.SlipGroup) self.PeerLbl.setObjectName(u"PeerLbl") self.gridLayout.addWidget(self.PeerLbl, 3, 0, 1, 1) self.LinesTableView = QTableView(self.SlipGroup) self.LinesTableView.setObjectName(u"LinesTableView") self.LinesTableView.verticalHeader().setVisible(False) self.LinesTableView.verticalHeader().setMinimumSectionSize(20) self.LinesTableView.verticalHeader().setDefaultSectionSize(20) self.gridLayout.addWidget(self.LinesTableView, 4, 1, 1, 3) self.SlipDateTime = QDateTimeEdit(self.SlipGroup) self.SlipDateTime.setObjectName(u"SlipDateTime") self.gridLayout.addWidget(self.SlipDateTime, 2, 1, 1, 1) self.DateTimeLbl = QLabel(self.SlipGroup) self.DateTimeLbl.setObjectName(u"DateTimeLbl") self.gridLayout.addWidget(self.DateTimeLbl, 1, 1, 1, 1) self.AccountLbl = QLabel(self.SlipGroup) self.AccountLbl.setObjectName(u"AccountLbl") self.gridLayout.addWidget(self.AccountLbl, 1, 3, 1, 1) self.PeerEdit = PeerSelector(self.SlipGroup) self.PeerEdit.setObjectName(u"PeerEdit") self.gridLayout.addWidget(self.PeerEdit, 3, 3, 1, 1) self.SlipShopName = QLineEdit(self.SlipGroup) self.SlipShopName.setObjectName(u"SlipShopName") self.SlipShopName.setEnabled(False) self.gridLayout.addWidget(self.SlipShopName, 3, 1, 1, 1) self.LinesLbl = QLabel(self.SlipGroup) self.LinesLbl.setObjectName(u"LinesLbl") self.LinesLbl.setAlignment(Qt.AlignLeading|Qt.AlignLeft|Qt.AlignTop) self.gridLayout.addWidget(self.LinesLbl, 4, 0, 1, 1) self.AccountEdit = AccountSelector(self.SlipGroup) self.AccountEdit.setObjectName(u"AccountEdit") self.gridLayout.addWidget(self.AccountEdit, 2, 3, 1, 1) self.label = QLabel(self.SlipGroup) self.label.setObjectName(u"label") self.gridLayout.addWidget(self.label, 3, 2, 1, 1) self.verticalLayout.addWidget(self.SlipGroup) self.DialogButtonsFrame = QFrame(ImportSlipDlg) self.DialogButtonsFrame.setObjectName(u"DialogButtonsFrame") self.DialogButtonsFrame.setFrameShape(QFrame.NoFrame) self.DialogButtonsFrame.setFrameShadow(QFrame.Plain) self.horizontalLayout_4 = QHBoxLayout(self.DialogButtonsFrame) self.horizontalLayout_4.setObjectName(u"horizontalLayout_4") self.horizontalLayout_4.setContentsMargins(2, 2, 2, 2) self.ClearBtn = QPushButton(self.DialogButtonsFrame) self.ClearBtn.setObjectName(u"ClearBtn") self.ClearBtn.setEnabled(True) self.horizontalLayout_4.addWidget(self.ClearBtn) self.AddOperationBtn = QPushButton(self.DialogButtonsFrame) self.AddOperationBtn.setObjectName(u"AddOperationBtn") self.AddOperationBtn.setEnabled(True) self.horizontalLayout_4.addWidget(self.AddOperationBtn) self.CloseBtn = QPushButton(self.DialogButtonsFrame) self.CloseBtn.setObjectName(u"CloseBtn") self.horizontalLayout_4.addWidget(self.CloseBtn) self.verticalLayout.addWidget(self.DialogButtonsFrame) self.retranslateUi(ImportSlipDlg) self.CloseBtn.clicked.connect(ImportSlipDlg.close) QMetaObject.connectSlotsByName(ImportSlipDlg)
def __init__(self): super(MainWindow, self).__init__() self.player = QMediaPlayer() self.playlist = QMediaPlaylist() toolBar = QToolBar() self.addToolBar(toolBar) playIcon = self.style().standardIcon(QStyle.SP_MediaPlay) previousIcon = self.style().standardIcon(QStyle.SP_MediaSkipBackward) nextIcon = self.style().standardIcon(QStyle.SP_MediaSkipForward) pauseIcon = self.style().standardIcon(QStyle.SP_MediaPause) stopIcon = self.style().standardIcon(QStyle.SP_MediaStop) self.playAction = toolBar.addAction(playIcon, "Play") self.previousAction = toolBar.addAction(previousIcon, "Previous") self.nextAction = toolBar.addAction(nextIcon, "Next") self.pauseAction = toolBar.addAction(pauseIcon, "Pause") self.stopAction = toolBar.addAction(stopIcon, "Stop") self.playAction.triggered.connect(self.player.play) self.previousAction.triggered.connect(self.previousClicked) self.nextAction.triggered.connect(self.playlist.next) self.pauseAction.triggered.connect(self.player.pause) self.stopAction.triggered.connect(self.player.stop) self.volSlider = QSlider() self.volSlider.setOrientation(Qt.Horizontal) self.volSlider.setMinimum(0) self.volSlider.setMaximum(100) self.volSlider.setFixedWidth(120) self.volSlider.setValue(self.player.volume()) self.volSlider.setTickInterval(10) self.volSlider.setTickPosition(QSlider.TicksBelow) self.volSlider.setToolTip("Volume") self.volSlider.valueChanged.connect(self.player.setVolume) toolBar.addWidget(self.volSlider) openAction = QAction(QIcon.fromTheme("document-open"), "&Open...", self, shortcut=QKeySequence.Open, triggered=self.open) exitAction = QAction(QIcon.fromTheme("application-exit"), "E&xit", self, shortcut="Ctrl+Q", triggered=self.close) aboutQtAct = QAction("About &Qt", self, triggered=qApp.aboutQt) fileMenu = self.menuBar().addMenu("&File") fileMenu.addAction(openAction) fileMenu.addAction(exitAction) playMenu = self.menuBar().addMenu("&Play") playMenu.addAction(self.playAction) playMenu.addAction(self.previousAction) playMenu.addAction(self.nextAction) playMenu.addAction(self.pauseAction) playMenu.addAction(self.stopAction) aboutMenu = self.menuBar().addMenu("&About") aboutMenu.addAction(aboutQtAct) self.videoWidget = QVideoWidget() self.setCentralWidget(self.videoWidget) self.player.setPlaylist(self.playlist) self.player.stateChanged.connect(self.updateButtons) self.player.setVideoOutput(self.videoWidget) self.updateButtons(self.player.state())
def setupUi(self, MainWindow): if MainWindow.objectName(): MainWindow.setObjectName(u"MainWindow") MainWindow.resize(900, 800) sizePolicy = QSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(MainWindow.sizePolicy().hasHeightForWidth()) MainWindow.setSizePolicy(sizePolicy) MainWindow.setMinimumSize(QSize(900, 800)) self.actionAdd_heatmap = QAction(MainWindow) self.actionAdd_heatmap.setObjectName(u"actionAdd_heatmap") self.actionAdd_video = QAction(MainWindow) self.actionAdd_video.setObjectName(u"actionAdd_video") self.centralwidget = QWidget(MainWindow) self.centralwidget.setObjectName(u"centralwidget") sizePolicy.setHeightForWidth(self.centralwidget.sizePolicy().hasHeightForWidth()) self.centralwidget.setSizePolicy(sizePolicy) self.gridLayout_5 = QGridLayout(self.centralwidget) self.gridLayout_5.setObjectName(u"gridLayout_5") self.frame_3 = QFrame(self.centralwidget) self.frame_3.setObjectName(u"frame_3") sizePolicy.setHeightForWidth(self.frame_3.sizePolicy().hasHeightForWidth()) self.frame_3.setSizePolicy(sizePolicy) self.frame_3.setFrameShape(QFrame.StyledPanel) self.frame_3.setFrameShadow(QFrame.Raised) self.gridLayout_4 = QGridLayout(self.frame_3) self.gridLayout_4.setObjectName(u"gridLayout_4") self.gridLayout_3 = QGridLayout() self.gridLayout_3.setObjectName(u"gridLayout_3") self.frame = QFrame(self.frame_3) self.frame.setObjectName(u"frame") sizePolicy.setHeightForWidth(self.frame.sizePolicy().hasHeightForWidth()) self.frame.setSizePolicy(sizePolicy) self.frame.setMinimumSize(QSize(400, 300)) self.frame.setMaximumSize(QSize(16777215, 16777215)) self.frame.setLayoutDirection(Qt.LeftToRight) self.frame.setFrameShape(QFrame.StyledPanel) self.frame.setFrameShadow(QFrame.Raised) self.verticalLayout_2 = QVBoxLayout(self.frame) self.verticalLayout_2.setObjectName(u"verticalLayout_2") self.VideoPlayer = QVideoWidget(self.frame) self.VideoPlayer.setObjectName(u"VideoPlayer") sizePolicy.setHeightForWidth(self.VideoPlayer.sizePolicy().hasHeightForWidth()) self.VideoPlayer.setSizePolicy(sizePolicy) self.VideoPlayer.setMinimumSize(QSize(400, 300)) self.VideoPlayer.setFocusPolicy(Qt.NoFocus) self.VideoPlayer.setLayoutDirection(Qt.LeftToRight) self.verticalLayout_2.addWidget(self.VideoPlayer) self.gridLayout_3.addWidget(self.frame, 0, 0, 1, 1) self.frame_2 = QFrame(self.frame_3) self.frame_2.setObjectName(u"frame_2") sizePolicy.setHeightForWidth(self.frame_2.sizePolicy().hasHeightForWidth()) self.frame_2.setSizePolicy(sizePolicy) self.frame_2.setMinimumSize(QSize(400, 300)) self.frame_2.setFrameShape(QFrame.StyledPanel) self.frame_2.setFrameShadow(QFrame.Raised) self.gridLayout_2 = QGridLayout(self.frame_2) self.gridLayout_2.setObjectName(u"gridLayout_2") self.heatMap = QLabel(self.frame_2) self.heatMap.setObjectName(u"heatMap") sizePolicy.setHeightForWidth(self.heatMap.sizePolicy().hasHeightForWidth()) self.heatMap.setSizePolicy(sizePolicy) self.heatMap.setMinimumSize(QSize(400, 300)) self.heatMap.setLayoutDirection(Qt.LeftToRight) self.heatMap.setScaledContents(True) self.heatMap.setAlignment(Qt.AlignCenter) self.gridLayout_2.addWidget(self.heatMap, 0, 0, 1, 1, Qt.AlignHCenter|Qt.AlignVCenter) self.gridLayout_3.addWidget(self.frame_2, 0, 1, 1, 1) self.gridLayout_4.addLayout(self.gridLayout_3, 0, 0, 1, 1) self.horizontalLayout = QHBoxLayout() self.horizontalLayout.setObjectName(u"horizontalLayout") self.ProgressBar = QSlider(self.frame_3) self.ProgressBar.setObjectName(u"ProgressBar") sizePolicy1 = QSizePolicy(QSizePolicy.Expanding, QSizePolicy.Fixed) sizePolicy1.setHorizontalStretch(0) sizePolicy1.setVerticalStretch(0) sizePolicy1.setHeightForWidth(self.ProgressBar.sizePolicy().hasHeightForWidth()) self.ProgressBar.setSizePolicy(sizePolicy1) self.ProgressBar.setMinimumSize(QSize(0, 0)) self.ProgressBar.setMaximumSize(QSize(16777215, 400)) self.ProgressBar.setOrientation(Qt.Horizontal) self.ProgressBar.setTickPosition(QSlider.NoTicks) self.horizontalLayout.addWidget(self.ProgressBar) self.progressLabel = QLabel(self.frame_3) self.progressLabel.setObjectName(u"progressLabel") sizePolicy2 = QSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed) sizePolicy2.setHorizontalStretch(0) sizePolicy2.setVerticalStretch(0) sizePolicy2.setHeightForWidth(self.progressLabel.sizePolicy().hasHeightForWidth()) self.progressLabel.setSizePolicy(sizePolicy2) self.horizontalLayout.addWidget(self.progressLabel) self.gridLayout_4.addLayout(self.horizontalLayout, 2, 0, 1, 1) self.horizontalLayout_2 = QHBoxLayout() self.horizontalLayout_2.setSpacing(2) self.horizontalLayout_2.setObjectName(u"horizontalLayout_2") self.PlayButton = QPushButton(self.frame_3) self.PlayButton.setObjectName(u"PlayButton") sizePolicy1.setHeightForWidth(self.PlayButton.sizePolicy().hasHeightForWidth()) self.PlayButton.setSizePolicy(sizePolicy1) self.PlayButton.setMaximumSize(QSize(16777215, 100)) self.horizontalLayout_2.addWidget(self.PlayButton) self.StopButton = QPushButton(self.frame_3) self.StopButton.setObjectName(u"StopButton") sizePolicy1.setHeightForWidth(self.StopButton.sizePolicy().hasHeightForWidth()) self.StopButton.setSizePolicy(sizePolicy1) self.StopButton.setMaximumSize(QSize(16777215, 100)) self.horizontalLayout_2.addWidget(self.StopButton) self.PauseButton = QPushButton(self.frame_3) self.PauseButton.setObjectName(u"PauseButton") sizePolicy1.setHeightForWidth(self.PauseButton.sizePolicy().hasHeightForWidth()) self.PauseButton.setSizePolicy(sizePolicy1) self.PauseButton.setMaximumSize(QSize(16777215, 100)) self.horizontalLayout_2.addWidget(self.PauseButton) self.verticalLayout = QVBoxLayout() self.verticalLayout.setObjectName(u"verticalLayout") self.stabilityLabel = QLabel(self.frame_3) self.stabilityLabel.setObjectName(u"stabilityLabel") sizePolicy1.setHeightForWidth(self.stabilityLabel.sizePolicy().hasHeightForWidth()) self.stabilityLabel.setSizePolicy(sizePolicy1) self.verticalLayout.addWidget(self.stabilityLabel) self.poseLabel = QLabel(self.frame_3) self.poseLabel.setObjectName(u"poseLabel") sizePolicy3 = QSizePolicy(QSizePolicy.MinimumExpanding, QSizePolicy.Fixed) sizePolicy3.setHorizontalStretch(0) sizePolicy3.setVerticalStretch(0) sizePolicy3.setHeightForWidth(self.poseLabel.sizePolicy().hasHeightForWidth()) self.poseLabel.setSizePolicy(sizePolicy3) self.verticalLayout.addWidget(self.poseLabel) self.horizontalLayout_2.addLayout(self.verticalLayout) self.gridLayout_4.addLayout(self.horizontalLayout_2, 1, 0, 1, 1) self.gridLayout_5.addWidget(self.frame_3, 0, 0, 1, 1) MainWindow.setCentralWidget(self.centralwidget) self.menubar = QMenuBar(MainWindow) self.menubar.setObjectName(u"menubar") self.menubar.setGeometry(QRect(0, 0, 900, 39)) self.menuAdd_video = QMenu(self.menubar) self.menuAdd_video.setObjectName(u"menuAdd_video") MainWindow.setMenuBar(self.menubar) self.statusbar = QStatusBar(MainWindow) self.statusbar.setObjectName(u"statusbar") MainWindow.setStatusBar(self.statusbar) self.menubar.addAction(self.menuAdd_video.menuAction()) self.menuAdd_video.addAction(self.actionAdd_heatmap) self.menuAdd_video.addAction(self.actionAdd_video) self.retranslateUi(MainWindow) QMetaObject.connectSlotsByName(MainWindow)
def setupUi(self, MainWindow): MainWindow.setObjectName("MainWindow") MainWindow.resize(931, 717) self.centralwidget = QtWidgets.QWidget(MainWindow) self.centralwidget.setObjectName("centralwidget") self.horizontalLayout_5 = QtWidgets.QHBoxLayout(self.centralwidget) self.horizontalLayout_5.setObjectName("horizontalLayout_5") self.verticalLayout = QtWidgets.QVBoxLayout() self.verticalLayout.setObjectName("verticalLayout") self.wVideo = QVideoWidget(self.centralwidget) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.wVideo.sizePolicy().hasHeightForWidth()) self.wVideo.setSizePolicy(sizePolicy) self.wVideo.setObjectName("wVideo") self.verticalLayout.addWidget(self.wVideo) self.horizontalLayout_2 = QtWidgets.QHBoxLayout() self.horizontalLayout_2.setObjectName("horizontalLayout_2") self.lTpsCourant = QtWidgets.QLabel(self.centralwidget) self.lTpsCourant.setObjectName("lTpsCourant") self.horizontalLayout_2.addWidget(self.lTpsCourant) self.sTpsCourant = QtWidgets.QSlider(self.centralwidget) self.sTpsCourant.setMinimumSize(QtCore.QSize(0, 40)) self.sTpsCourant.setOrientation(QtCore.Qt.Horizontal) self.sTpsCourant.setObjectName("sTpsCourant") self.horizontalLayout_2.addWidget(self.sTpsCourant) self.lTpsTotal = QtWidgets.QLabel(self.centralwidget) self.lTpsTotal.setObjectName("lTpsTotal") self.horizontalLayout_2.addWidget(self.lTpsTotal) self.verticalLayout.addLayout(self.horizontalLayout_2) self.horizontalLayout = QtWidgets.QHBoxLayout() self.horizontalLayout.setObjectName("horizontalLayout") self.pbLecture = QtWidgets.QPushButton(self.centralwidget) self.pbLecture.setObjectName("pbLecture") self.horizontalLayout.addWidget(self.pbLecture) self.pbPause = QtWidgets.QPushButton(self.centralwidget) self.pbPause.setObjectName("pbPause") self.horizontalLayout.addWidget(self.pbPause) self.pbStop = QtWidgets.QPushButton(self.centralwidget) self.pbStop.setObjectName("pbStop") self.horizontalLayout.addWidget(self.pbStop) self.pbSuivant = QtWidgets.QPushButton(self.centralwidget) self.pbSuivant.setObjectName("pbSuivant") self.horizontalLayout.addWidget(self.pbSuivant) self.pbPrecedent = QtWidgets.QPushButton(self.centralwidget) self.pbPrecedent.setObjectName("pbPrecedent") self.horizontalLayout.addWidget(self.pbPrecedent) self.verticalLayout.addLayout(self.horizontalLayout) self.horizontalLayout_5.addLayout(self.verticalLayout) self.verticalLayout_2 = QtWidgets.QVBoxLayout() self.verticalLayout_2.setObjectName("verticalLayout_2") self.line = QtWidgets.QFrame(self.centralwidget) self.line.setFrameShape(QtWidgets.QFrame.VLine) self.line.setFrameShadow(QtWidgets.QFrame.Sunken) self.line.setObjectName("line") self.verticalLayout_2.addWidget(self.line) spacerItem = QtWidgets.QSpacerItem(20, 80, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Fixed) self.verticalLayout_2.addItem(spacerItem) self.horizontalLayout_5.addLayout(self.verticalLayout_2) self.verticalLayout_3 = QtWidgets.QVBoxLayout() self.verticalLayout_3.setObjectName("verticalLayout_3") self.label_3 = QtWidgets.QLabel(self.centralwidget) self.label_3.setObjectName("label_3") self.verticalLayout_3.addWidget(self.label_3) self.lPlaylist = QtWidgets.QListWidget(self.centralwidget) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.lPlaylist.sizePolicy().hasHeightForWidth()) self.lPlaylist.setSizePolicy(sizePolicy) self.lPlaylist.setObjectName("lPlaylist") self.verticalLayout_3.addWidget(self.lPlaylist) self.horizontalLayout_4 = QtWidgets.QHBoxLayout() self.horizontalLayout_4.setObjectName("horizontalLayout_4") spacerItem1 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Minimum) self.horizontalLayout_4.addItem(spacerItem1) self.pbAjout = QtWidgets.QPushButton(self.centralwidget) self.pbAjout.setObjectName("pbAjout") self.horizontalLayout_4.addWidget(self.pbAjout) self.pbSuppr = QtWidgets.QPushButton(self.centralwidget) self.pbSuppr.setObjectName("pbSuppr") self.horizontalLayout_4.addWidget(self.pbSuppr) self.verticalLayout_3.addLayout(self.horizontalLayout_4) self.horizontalLayout_3 = QtWidgets.QHBoxLayout() self.horizontalLayout_3.setObjectName("horizontalLayout_3") spacerItem2 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Minimum) self.horizontalLayout_3.addItem(spacerItem2) self.label_4 = QtWidgets.QLabel(self.centralwidget) self.label_4.setObjectName("label_4") self.horizontalLayout_3.addWidget(self.label_4) self.dVolume = QtWidgets.QDial(self.centralwidget) self.dVolume.setMaximumSize(QtCore.QSize(40, 40)) self.dVolume.setMaximum(100) self.dVolume.setObjectName("dVolume") self.horizontalLayout_3.addWidget(self.dVolume) self.lVolume = QtWidgets.QLabel(self.centralwidget) self.lVolume.setObjectName("lVolume") self.horizontalLayout_3.addWidget(self.lVolume) self.verticalLayout_3.addLayout(self.horizontalLayout_3) self.horizontalLayout_5.addLayout(self.verticalLayout_3) MainWindow.setCentralWidget(self.centralwidget) self.menubar = QtWidgets.QMenuBar(MainWindow) self.menubar.setGeometry(QtCore.QRect(0, 0, 931, 26)) self.menubar.setObjectName("menubar") MainWindow.setMenuBar(self.menubar) self.statusbar = QtWidgets.QStatusBar(MainWindow) self.statusbar.setObjectName("statusbar") MainWindow.setStatusBar(self.statusbar) self.retranslateUi(MainWindow) QtCore.QMetaObject.connectSlotsByName(MainWindow)
def setupUi(self, MainWindow): MainWindow.setObjectName("MainWindow") MainWindow.resize(864, 717) self.centralwidget = QtWidgets.QWidget(MainWindow) self.centralwidget.setObjectName("centralwidget") self.horizontalLayout_7 = QtWidgets.QHBoxLayout(self.centralwidget) self.horizontalLayout_7.setObjectName("horizontalLayout_7") self.verticalLayout_4 = QtWidgets.QVBoxLayout() self.verticalLayout_4.setObjectName("verticalLayout_4") self.videoWidget = QVideoWidget(self.centralwidget) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.videoWidget.sizePolicy().hasHeightForWidth()) self.videoWidget.setSizePolicy(sizePolicy) self.videoWidget.setObjectName("videoWidget") self.verticalLayout_4.addWidget(self.videoWidget) self.horizontalLayout_3 = QtWidgets.QHBoxLayout() self.horizontalLayout_3.setObjectName("horizontalLayout_3") self.lTempsCourant = QtWidgets.QLabel(self.centralwidget) self.lTempsCourant.setObjectName("lTempsCourant") self.horizontalLayout_3.addWidget(self.lTempsCourant) self.sTempsCourant = QtWidgets.QSlider(self.centralwidget) self.sTempsCourant.setMinimumSize(QtCore.QSize(0, 40)) self.sTempsCourant.setOrientation(QtCore.Qt.Horizontal) self.sTempsCourant.setObjectName("sTempsCourant") self.horizontalLayout_3.addWidget(self.sTempsCourant) self.lTempsTotal = QtWidgets.QLabel(self.centralwidget) self.lTempsTotal.setObjectName("lTempsTotal") self.horizontalLayout_3.addWidget(self.lTempsTotal) self.verticalLayout_4.addLayout(self.horizontalLayout_3) self.horizontalLayout_2 = QtWidgets.QHBoxLayout() self.horizontalLayout_2.setObjectName("horizontalLayout_2") self.pbLecture = QtWidgets.QPushButton(self.centralwidget) self.pbLecture.setObjectName("pbLecture") self.horizontalLayout_2.addWidget(self.pbLecture) self.pbPause = QtWidgets.QPushButton(self.centralwidget) self.pbPause.setObjectName("pbPause") self.horizontalLayout_2.addWidget(self.pbPause) self.pbStop = QtWidgets.QPushButton(self.centralwidget) self.pbStop.setObjectName("pbStop") self.horizontalLayout_2.addWidget(self.pbStop) self.pbPrec = QtWidgets.QPushButton(self.centralwidget) self.pbPrec.setObjectName("pbPrec") self.horizontalLayout_2.addWidget(self.pbPrec) self.pbSuiv = QtWidgets.QPushButton(self.centralwidget) self.pbSuiv.setObjectName("pbSuiv") self.horizontalLayout_2.addWidget(self.pbSuiv) self.verticalLayout_4.addLayout(self.horizontalLayout_2) self.horizontalLayout_7.addLayout(self.verticalLayout_4) self.verticalLayout_5 = QtWidgets.QVBoxLayout() self.verticalLayout_5.setObjectName("verticalLayout_5") self.line = QtWidgets.QFrame(self.centralwidget) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Expanding) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.line.sizePolicy().hasHeightForWidth()) self.line.setSizePolicy(sizePolicy) self.line.setFrameShape(QtWidgets.QFrame.HLine) self.line.setFrameShadow(QtWidgets.QFrame.Sunken) self.line.setObjectName("line") self.verticalLayout_5.addWidget(self.line) spacerItem = QtWidgets.QSpacerItem(20, 85, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Preferred) self.verticalLayout_5.addItem(spacerItem) self.horizontalLayout_7.addLayout(self.verticalLayout_5) self.verticalLayout_8 = QtWidgets.QVBoxLayout() self.verticalLayout_8.setObjectName("verticalLayout_8") self.label_5 = QtWidgets.QLabel(self.centralwidget) self.label_5.setObjectName("label_5") self.verticalLayout_8.addWidget(self.label_5) self.listeLecture = QtWidgets.QListWidget(self.centralwidget) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Expanding) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.listeLecture.sizePolicy().hasHeightForWidth()) self.listeLecture.setSizePolicy(sizePolicy) self.listeLecture.setObjectName("listeLecture") self.verticalLayout_8.addWidget(self.listeLecture) self.horizontalLayout_5 = QtWidgets.QHBoxLayout() self.horizontalLayout_5.setObjectName("horizontalLayout_5") spacerItem1 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Minimum) self.horizontalLayout_5.addItem(spacerItem1) self.pbAjouter = QtWidgets.QPushButton(self.centralwidget) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.pbAjouter.sizePolicy().hasHeightForWidth()) self.pbAjouter.setSizePolicy(sizePolicy) self.pbAjouter.setObjectName("pbAjouter") self.horizontalLayout_5.addWidget(self.pbAjouter) self.pbSupprimer = QtWidgets.QPushButton(self.centralwidget) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.pbSupprimer.sizePolicy().hasHeightForWidth()) self.pbSupprimer.setSizePolicy(sizePolicy) self.pbSupprimer.setObjectName("pbSupprimer") self.horizontalLayout_5.addWidget(self.pbSupprimer) self.verticalLayout_8.addLayout(self.horizontalLayout_5) self.horizontalLayout_6 = QtWidgets.QHBoxLayout() self.horizontalLayout_6.setObjectName("horizontalLayout_6") spacerItem2 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Minimum) self.horizontalLayout_6.addItem(spacerItem2) self.label_3 = QtWidgets.QLabel(self.centralwidget) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Maximum, QtWidgets.QSizePolicy.Preferred) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.label_3.sizePolicy().hasHeightForWidth()) self.label_3.setSizePolicy(sizePolicy) self.label_3.setObjectName("label_3") self.horizontalLayout_6.addWidget(self.label_3) self.dial = QtWidgets.QDial(self.centralwidget) self.dial.setMaximumSize(QtCore.QSize(50, 50)) self.dial.setObjectName("dial") self.horizontalLayout_6.addWidget(self.dial) self.volume = QtWidgets.QLabel(self.centralwidget) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Preferred) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.volume.sizePolicy().hasHeightForWidth()) self.volume.setSizePolicy(sizePolicy) self.volume.setObjectName("volume") self.horizontalLayout_6.addWidget(self.volume) self.verticalLayout_8.addLayout(self.horizontalLayout_6) self.horizontalLayout_7.addLayout(self.verticalLayout_8) MainWindow.setCentralWidget(self.centralwidget) self.menubar = QtWidgets.QMenuBar(MainWindow) self.menubar.setGeometry(QtCore.QRect(0, 0, 864, 21)) self.menubar.setObjectName("menubar") MainWindow.setMenuBar(self.menubar) self.statusbar = QtWidgets.QStatusBar(MainWindow) self.statusbar.setObjectName("statusbar") MainWindow.setStatusBar(self.statusbar) self.retranslateUi(MainWindow) QtCore.QMetaObject.connectSlotsByName(MainWindow)
def __init__(self, parent=None): super(Form, self).__init__(parent) self.setObjectName("MainWindow") self.resize(804, 559) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Preferred) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.sizePolicy().hasHeightForWidth()) self.setSizePolicy(sizePolicy) self.centralwidget = QtWidgets.QWidget(self) self.centralwidget.setObjectName("centralwidget") self.horizontalLayout_5 = QtWidgets.QHBoxLayout(self.centralwidget) self.horizontalLayout_5.setObjectName("horizontalLayout_5") self.horizontalLayout = QtWidgets.QHBoxLayout() self.horizontalLayout.setObjectName("horizontalLayout") self.verticalLayout = QtWidgets.QVBoxLayout() self.verticalLayout.setObjectName("verticalLayout") self.wVideo = QVideoWidget(self.centralwidget) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.wVideo.sizePolicy().hasHeightForWidth()) self.wVideo.setSizePolicy(sizePolicy) self.wVideo.setObjectName("wVideo") self.verticalLayout.addWidget(self.wVideo) self.horizontalLayout_2 = QtWidgets.QHBoxLayout() self.horizontalLayout_2.setObjectName("horizontalLayout_2") self.lStartTime = QtWidgets.QLabel(self.centralwidget) self.lStartTime.setObjectName("lStartTime") self.horizontalLayout_2.addWidget(self.lStartTime) self.sProgression = QtWidgets.QSlider(self.centralwidget) self.sProgression.setOrientation(QtCore.Qt.Horizontal) self.sProgression.setObjectName("sProgression") self.horizontalLayout_2.addWidget(self.sProgression) self.lEndTime = QtWidgets.QLabel(self.centralwidget) self.lEndTime.setObjectName("lEndTime") self.horizontalLayout_2.addWidget(self.lEndTime) self.verticalLayout.addLayout(self.horizontalLayout_2) self.lBoutons = QtWidgets.QHBoxLayout() self.lBoutons.setObjectName("lBoutons") self.pbLecture = QtWidgets.QPushButton(self.centralwidget) self.pbLecture.setObjectName("pbLecture") self.lBoutons.addWidget(self.pbLecture) self.pbPause = QtWidgets.QPushButton(self.centralwidget) self.pbPause.setObjectName("pbPause") self.lBoutons.addWidget(self.pbPause) self.pbStop = QtWidgets.QPushButton(self.centralwidget) self.pbStop.setObjectName("pbStop") self.lBoutons.addWidget(self.pbStop) self.pbSuivant = QtWidgets.QPushButton(self.centralwidget) self.pbSuivant.setObjectName("pbSuivant") self.lBoutons.addWidget(self.pbSuivant) self.pbPrecedent = QtWidgets.QPushButton(self.centralwidget) self.pbPrecedent.setObjectName("pbPrecedent") self.lBoutons.addWidget(self.pbPrecedent) self.verticalLayout.addLayout(self.lBoutons) self.horizontalLayout.addLayout(self.verticalLayout) self.verticalLayout_3 = QtWidgets.QVBoxLayout() self.verticalLayout_3.setObjectName("verticalLayout_3") self.line = QtWidgets.QFrame(self.centralwidget) self.line.setBaseSize(QtCore.QSize(0, 0)) self.line.setFrameShape(QtWidgets.QFrame.VLine) self.line.setFrameShadow(QtWidgets.QFrame.Sunken) self.line.setObjectName("line") self.verticalLayout_3.addWidget(self.line) spacerItem = QtWidgets.QSpacerItem(20, 100, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Fixed) self.verticalLayout_3.addItem(spacerItem) self.horizontalLayout.addLayout(self.verticalLayout_3) self.verticalLayout_2 = QtWidgets.QVBoxLayout() self.verticalLayout_2.setObjectName("verticalLayout_2") self.label_3 = QtWidgets.QLabel(self.centralwidget) self.label_3.setObjectName("label_3") self.verticalLayout_2.addWidget(self.label_3) self.listWidget = QtWidgets.QListWidget(self.centralwidget) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.listWidget.sizePolicy().hasHeightForWidth()) self.listWidget.setSizePolicy(sizePolicy) self.listWidget.setObjectName("listWidget") self.verticalLayout_2.addWidget(self.listWidget) self.horizontalLayout_3 = QtWidgets.QHBoxLayout() self.horizontalLayout_3.setObjectName("horizontalLayout_3") spacerItem1 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Minimum) self.horizontalLayout_3.addItem(spacerItem1) self.pbAjout = QtWidgets.QPushButton(self.centralwidget) self.pbAjout.setObjectName("pbAjout") self.horizontalLayout_3.addWidget(self.pbAjout) self.pbSuppr = QtWidgets.QPushButton(self.centralwidget) self.pbSuppr.setObjectName("pbSuppr") self.horizontalLayout_3.addWidget(self.pbSuppr) self.verticalLayout_2.addLayout(self.horizontalLayout_3) self.horizontalLayout_4 = QtWidgets.QHBoxLayout() self.horizontalLayout_4.setObjectName("horizontalLayout_4") spacerItem2 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Minimum) self.horizontalLayout_4.addItem(spacerItem2) self.label_4 = QtWidgets.QLabel(self.centralwidget) self.label_4.setObjectName("label_4") self.horizontalLayout_4.addWidget(self.label_4) self.dVolume = QtWidgets.QDial(self.centralwidget) self.dVolume.setObjectName("dVolume") self.horizontalLayout_4.addWidget(self.dVolume) self.lPourcentVolume = QtWidgets.QLabel(self.centralwidget) self.lPourcentVolume.setObjectName("lPourcentVolume") self.horizontalLayout_4.addWidget(self.lPourcentVolume) self.verticalLayout_2.addLayout(self.horizontalLayout_4) self.horizontalLayout.addLayout(self.verticalLayout_2) self.horizontalLayout_5.addLayout(self.horizontalLayout) self.setCentralWidget(self.centralwidget) self.menubar = QtWidgets.QMenuBar(self) self.menubar.setGeometry(QtCore.QRect(0, 0, 804, 21)) self.menubar.setObjectName("menubar") self.setMenuBar(self.menubar) self.statusbar = QtWidgets.QStatusBar(self) self.statusbar.setObjectName("statusbar") self.setStatusBar(self.statusbar) self.retranslateUi(self) QtCore.QMetaObject.connectSlotsByName(self) self.mediaPlayer = QMediaPlayer() self.mediaPlayer.setVideoOutput(self.wVideo) self.pbLecture.clicked.connect(self.lectureClic) self.pbPause.clicked.connect(self.pauseClic) self.pbStop.clicked.connect(self.stopClic) self.pbSuivant.clicked.connect(self.suivantClic) self.pbPrecedent.clicked.connect(self.precedentClic) self.dVolume.valueChanged.connect(self.volumeChange) self.mediaPlayer.positionChanged.connect(self.progressionChange) self.sProgression.sliderMoved.connect(self.progressionDeplace) self.pbSuppr.clicked.connect(self.supprVid) self.pbAjout.clicked.connect(self.addVid) self.listWidget.itemDoubleClicked.connect(self.listeDoubleClic) self.dVolume.setMaximum(100) self.lEndTime.setText("") self.lStartTime.setText("") self.lPourcentVolume.setText("") self.dVolume.setValue(31)
def setupUi(self, MainWindow): MainWindow.setObjectName("MainWindow") MainWindow.resize(1123, 892) self.centralwidget = QtWidgets.QWidget(MainWindow) self.centralwidget.setObjectName("centralwidget") self.horizontalLayout_5 = QtWidgets.QHBoxLayout(self.centralwidget) self.horizontalLayout_5.setObjectName("horizontalLayout_5") self.verticalLayout_2 = QtWidgets.QVBoxLayout() self.verticalLayout_2.setObjectName("verticalLayout_2") self.videoScreen = QVideoWidget(self.centralwidget) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.videoScreen.sizePolicy().hasHeightForWidth()) self.videoScreen.setSizePolicy(sizePolicy) self.videoScreen.setObjectName("videoScreen") self.verticalLayout_2.addWidget(self.videoScreen) self.horizontalLayout_2 = QtWidgets.QHBoxLayout() self.horizontalLayout_2.setContentsMargins(-1, 8, -1, 8) self.horizontalLayout_2.setObjectName("horizontalLayout_2") self.lbTimeReal = QtWidgets.QLabel(self.centralwidget) font = QtGui.QFont() font.setPointSize(11) self.lbTimeReal.setFont(font) self.lbTimeReal.setObjectName("lbTimeReal") self.horizontalLayout_2.addWidget(self.lbTimeReal) self.slTimeBarre = QtWidgets.QSlider(self.centralwidget) self.slTimeBarre.setMinimumSize(QtCore.QSize(20, 30)) self.slTimeBarre.setOrientation(QtCore.Qt.Horizontal) self.slTimeBarre.setObjectName("slTimeBarre") self.horizontalLayout_2.addWidget(self.slTimeBarre) self.lbTimeTot = QtWidgets.QLabel(self.centralwidget) font = QtGui.QFont() font.setPointSize(11) self.lbTimeTot.setFont(font) self.lbTimeTot.setObjectName("lbTimeTot") self.horizontalLayout_2.addWidget(self.lbTimeTot) self.verticalLayout_2.addLayout(self.horizontalLayout_2) self.horizontalLayout = QtWidgets.QHBoxLayout() self.horizontalLayout.setContentsMargins(-1, -1, -1, 5) self.horizontalLayout.setObjectName("horizontalLayout") self.pbLect = QtWidgets.QPushButton(self.centralwidget) self.pbLect.setMinimumSize(QtCore.QSize(0, 30)) font = QtGui.QFont() font.setPointSize(11) self.pbLect.setFont(font) self.pbLect.setObjectName("pbLect") self.horizontalLayout.addWidget(self.pbLect) self.pbPause = QtWidgets.QPushButton(self.centralwidget) self.pbPause.setMinimumSize(QtCore.QSize(0, 30)) font = QtGui.QFont() font.setPointSize(11) self.pbPause.setFont(font) self.pbPause.setObjectName("pbPause") self.horizontalLayout.addWidget(self.pbPause) self.pbStop = QtWidgets.QPushButton(self.centralwidget) self.pbStop.setMinimumSize(QtCore.QSize(0, 30)) font = QtGui.QFont() font.setPointSize(11) self.pbStop.setFont(font) self.pbStop.setObjectName("pbStop") self.horizontalLayout.addWidget(self.pbStop) self.pbPreced = QtWidgets.QPushButton(self.centralwidget) self.pbPreced.setMinimumSize(QtCore.QSize(0, 30)) font = QtGui.QFont() font.setPointSize(11) self.pbPreced.setFont(font) self.pbPreced.setObjectName("pbPreced") self.horizontalLayout.addWidget(self.pbPreced) self.pbSuiv = QtWidgets.QPushButton(self.centralwidget) self.pbSuiv.setMinimumSize(QtCore.QSize(0, 30)) font = QtGui.QFont() font.setPointSize(11) self.pbSuiv.setFont(font) self.pbSuiv.setObjectName("pbSuiv") self.horizontalLayout.addWidget(self.pbSuiv) self.verticalLayout_2.addLayout(self.horizontalLayout) self.horizontalLayout_5.addLayout(self.verticalLayout_2) self.verticalLayout = QtWidgets.QVBoxLayout() self.verticalLayout.setObjectName("verticalLayout") self.line = QtWidgets.QFrame(self.centralwidget) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Minimum) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.line.sizePolicy().hasHeightForWidth()) self.line.setSizePolicy(sizePolicy) self.line.setLayoutDirection(QtCore.Qt.LeftToRight) self.line.setFrameShape(QtWidgets.QFrame.VLine) self.line.setFrameShadow(QtWidgets.QFrame.Sunken) self.line.setObjectName("line") self.verticalLayout.addWidget(self.line) spacerItem = QtWidgets.QSpacerItem(20, 85, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Fixed) self.verticalLayout.addItem(spacerItem) self.horizontalLayout_5.addLayout(self.verticalLayout) self.verticalLayout_3 = QtWidgets.QVBoxLayout() self.verticalLayout_3.setObjectName("verticalLayout_3") self.lbListFilm = QtWidgets.QLabel(self.centralwidget) self.lbListFilm.setMaximumSize(QtCore.QSize(16777215, 16777215)) font = QtGui.QFont() font.setPointSize(11) self.lbListFilm.setFont(font) self.lbListFilm.setObjectName("lbListFilm") self.verticalLayout_3.addWidget(self.lbListFilm) self.listFilm = QtWidgets.QListWidget(self.centralwidget) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.listFilm.sizePolicy().hasHeightForWidth()) self.listFilm.setSizePolicy(sizePolicy) self.listFilm.setObjectName("listFilm") self.verticalLayout_3.addWidget(self.listFilm) self.horizontalLayout_4 = QtWidgets.QHBoxLayout() self.horizontalLayout_4.setObjectName("horizontalLayout_4") spacerItem1 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Minimum) self.horizontalLayout_4.addItem(spacerItem1) self.pbAjout = QtWidgets.QPushButton(self.centralwidget) font = QtGui.QFont() font.setPointSize(10) self.pbAjout.setFont(font) self.pbAjout.setObjectName("pbAjout") self.horizontalLayout_4.addWidget(self.pbAjout) self.pbSuppr = QtWidgets.QPushButton(self.centralwidget) font = QtGui.QFont() font.setPointSize(10) self.pbSuppr.setFont(font) self.pbSuppr.setObjectName("pbSuppr") self.horizontalLayout_4.addWidget(self.pbSuppr) self.verticalLayout_3.addLayout(self.horizontalLayout_4) self.horizontalLayout_3 = QtWidgets.QHBoxLayout() self.horizontalLayout_3.setObjectName("horizontalLayout_3") self.lbVolumeTitre = QtWidgets.QLabel(self.centralwidget) font = QtGui.QFont() font.setPointSize(11) self.lbVolumeTitre.setFont(font) self.lbVolumeTitre.setAlignment(QtCore.Qt.AlignCenter) self.lbVolumeTitre.setObjectName("lbVolumeTitre") self.horizontalLayout_3.addWidget(self.lbVolumeTitre) self.dlVolume = QtWidgets.QDial(self.centralwidget) self.dlVolume.setMaximumSize(QtCore.QSize(50, 50)) self.dlVolume.setObjectName("dlVolume") self.horizontalLayout_3.addWidget(self.dlVolume) self.lbVolumePourc = QtWidgets.QLabel(self.centralwidget) font = QtGui.QFont() font.setPointSize(11) self.lbVolumePourc.setFont(font) self.lbVolumePourc.setAlignment(QtCore.Qt.AlignCenter) self.lbVolumePourc.setObjectName("lbVolumePourc") self.horizontalLayout_3.addWidget(self.lbVolumePourc) self.verticalLayout_3.addLayout(self.horizontalLayout_3) self.horizontalLayout_5.addLayout(self.verticalLayout_3) MainWindow.setCentralWidget(self.centralwidget) self.menubar = QtWidgets.QMenuBar(MainWindow) self.menubar.setGeometry(QtCore.QRect(0, 0, 1123, 21)) self.menubar.setObjectName("menubar") self.menuFile = QtWidgets.QMenu(self.menubar) self.menuFile.setObjectName("menuFile") self.menuAide = QtWidgets.QMenu(self.menubar) self.menuAide.setObjectName("menuAide") MainWindow.setMenuBar(self.menubar) self.statusbar = QtWidgets.QStatusBar(MainWindow) self.statusbar.setObjectName("statusbar") MainWindow.setStatusBar(self.statusbar) self.menubar.addAction(self.menuFile.menuAction()) self.menubar.addAction(self.menuAide.menuAction()) self.retranslateUi(MainWindow) QtCore.QMetaObject.connectSlotsByName(MainWindow)
def setupUi(self, MainWindow): MainWindow.setObjectName("MainWindow") MainWindow.resize(988, 794) self.centralwidget = QtWidgets.QWidget(MainWindow) self.centralwidget.setObjectName("centralwidget") self.horizontalLayout_5 = QtWidgets.QHBoxLayout(self.centralwidget) self.horizontalLayout_5.setObjectName("horizontalLayout_5") self.leftLayout = QtWidgets.QVBoxLayout() self.leftLayout.setObjectName("leftLayout") self.Lecteur = QVideoWidget(self.centralwidget) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.Lecteur.sizePolicy().hasHeightForWidth()) self.Lecteur.setSizePolicy(sizePolicy) self.Lecteur.setObjectName("Lecteur") self.leftLayout.addWidget(self.Lecteur) self.layoutSlider = QtWidgets.QHBoxLayout() self.layoutSlider.setObjectName("layoutSlider") self.lAvanceeTps = QtWidgets.QLabel(self.centralwidget) self.lAvanceeTps.setObjectName("lAvanceeTps") self.layoutSlider.addWidget(self.lAvanceeTps) self.sTpsCourant = QtWidgets.QSlider(self.centralwidget) self.sTpsCourant.setOrientation(QtCore.Qt.Horizontal) self.sTpsCourant.setObjectName("sTpsCourant") self.layoutSlider.addWidget(self.sTpsCourant) self.lRestantTps = QtWidgets.QLabel(self.centralwidget) self.lRestantTps.setObjectName("lRestantTps") self.layoutSlider.addWidget(self.lRestantTps) self.leftLayout.addLayout(self.layoutSlider) self.horizontalLayout_4 = QtWidgets.QHBoxLayout() self.horizontalLayout_4.setObjectName("horizontalLayout_4") self.pBLecture = QtWidgets.QPushButton(self.centralwidget) self.pBLecture.setObjectName("pBLecture") self.horizontalLayout_4.addWidget(self.pBLecture) self.pBPause = QtWidgets.QPushButton(self.centralwidget) self.pBPause.setObjectName("pBPause") self.horizontalLayout_4.addWidget(self.pBPause) self.pBStop = QtWidgets.QPushButton(self.centralwidget) self.pBStop.setObjectName("pBStop") self.horizontalLayout_4.addWidget(self.pBStop) self.pBPrecedent = QtWidgets.QPushButton(self.centralwidget) self.pBPrecedent.setObjectName("pBPrecedent") self.horizontalLayout_4.addWidget(self.pBPrecedent) self.pBSuivant = QtWidgets.QPushButton(self.centralwidget) self.pBSuivant.setObjectName("pBSuivant") self.horizontalLayout_4.addWidget(self.pBSuivant) self.leftLayout.addLayout(self.horizontalLayout_4) self.horizontalLayout_5.addLayout(self.leftLayout) self.centralLayout = QtWidgets.QVBoxLayout() self.centralLayout.setObjectName("centralLayout") self.line = QtWidgets.QFrame(self.centralwidget) self.line.setFrameShape(QtWidgets.QFrame.VLine) self.line.setFrameShadow(QtWidgets.QFrame.Sunken) self.line.setObjectName("line") self.centralLayout.addWidget(self.line) spacerItem = QtWidgets.QSpacerItem(20, 100, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Fixed) self.centralLayout.addItem(spacerItem) self.horizontalLayout_5.addLayout(self.centralLayout) self.rightLayout = QtWidgets.QVBoxLayout() self.rightLayout.setObjectName("rightLayout") self.label = QtWidgets.QLabel(self.centralwidget) self.label.setObjectName("label") self.rightLayout.addWidget(self.label) self.listWidget = QtWidgets.QListWidget(self.centralwidget) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.listWidget.sizePolicy().hasHeightForWidth()) self.listWidget.setSizePolicy(sizePolicy) self.listWidget.setObjectName("listWidget") self.rightLayout.addWidget(self.listWidget) self.horizontalLayout = QtWidgets.QHBoxLayout() self.horizontalLayout.setObjectName("horizontalLayout") spacerItem1 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Minimum) self.horizontalLayout.addItem(spacerItem1) self.pBAjout = QtWidgets.QPushButton(self.centralwidget) self.pBAjout.setObjectName("pBAjout") self.horizontalLayout.addWidget(self.pBAjout) self.pBSupp = QtWidgets.QPushButton(self.centralwidget) self.pBSupp.setObjectName("pBSupp") self.horizontalLayout.addWidget(self.pBSupp) self.rightLayout.addLayout(self.horizontalLayout) self.horizontalLayout_3 = QtWidgets.QHBoxLayout() self.horizontalLayout_3.setObjectName("horizontalLayout_3") spacerItem2 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Minimum) self.horizontalLayout_3.addItem(spacerItem2) self.label_2 = QtWidgets.QLabel(self.centralwidget) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Minimum) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.label_2.sizePolicy().hasHeightForWidth()) self.label_2.setSizePolicy(sizePolicy) self.label_2.setObjectName("label_2") self.horizontalLayout_3.addWidget(self.label_2) self.dBVolume = QtWidgets.QDial(self.centralwidget) self.dBVolume.setMaximumSize(QtCore.QSize(50, 50)) self.dBVolume.setObjectName("dBVolume") self.horizontalLayout_3.addWidget(self.dBVolume) self.suiviVol = QtWidgets.QLabel(self.centralwidget) self.suiviVol.setObjectName("suiviVol") self.horizontalLayout_3.addWidget(self.suiviVol) self.rightLayout.addLayout(self.horizontalLayout_3) self.horizontalLayout_5.addLayout(self.rightLayout) MainWindow.setCentralWidget(self.centralwidget) self.statusbar = QtWidgets.QStatusBar(MainWindow) self.statusbar.setObjectName("statusbar") MainWindow.setStatusBar(self.statusbar) self.menubar = QtWidgets.QMenuBar(MainWindow) self.menubar.setGeometry(QtCore.QRect(0, 0, 988, 21)) self.menubar.setObjectName("menubar") self.menuFichier = QtWidgets.QMenu(self.menubar) self.menuFichier.setObjectName("menuFichier") self.menuAide = QtWidgets.QMenu(self.menubar) self.menuAide.setObjectName("menuAide") MainWindow.setMenuBar(self.menubar) self.menubar.addAction(self.menuFichier.menuAction()) self.menubar.addAction(self.menuAide.menuAction()) self.retranslateUi(MainWindow) QtCore.QMetaObject.connectSlotsByName(MainWindow)