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


Python QtGui.QMovie类代码示例

本文整理汇总了Python中PyQt5.QtGui.QMovie的典型用法代码示例。如果您正苦于以下问题:Python QMovie类的具体用法?Python QMovie怎么用?Python QMovie使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: SystemTrayIcon

class SystemTrayIcon(QSystemTrayIcon):
    def __init__(self, parent):
        super(SystemTrayIcon, self).__init__()
        self.parent = parent

        self.new_folder_window = NewFolderWindow(parent)
        self.preferences_window = PreferencesWindow()
        
        self.setIcon(QIcon(":gridsync.png"))

        self.right_menu = RightClickMenu(self)
        self.setContextMenu(self.right_menu)
        self.activated.connect(self.on_click)

        self.animation = QMovie()
        self.animation.setFileName(":sync.gif")
        self.animation.updated.connect(self.update_animation_frame)
        self.animation.setCacheMode(True)

    def update_animation_frame(self):
        self.setIcon(QIcon(self.animation.currentPixmap()))

    def set_icon(self, resource):
        self.setIcon(QIcon(resource))

    def on_click(self, value):
        #self.right_menu.populate()
        if value == QSystemTrayIcon.Trigger:
            open_gridsync_folder()

    def on_quit(self):
        reactor.stop()
开发者ID:david415,项目名称:gridsync,代码行数:32,代码来源:systray.py

示例2: animationLabel

 def animationLabel(self, index, animationFile, speed=100):
     """
     Public slot to set an animated icon.
     
     @param index tab index (integer)
     @param animationFile name of the file containing the animation (string)
     @param speed animation speed of the icon in percent of the original
         icon's speed (integer)
     @return reference to the created label (QLabel)
     """
     if index == -1:
         return None
     
     if hasattr(self.__tabBar, 'setTabButton'):
         side = self.__freeSide()
         animation = QLabel(self)
         if animationFile and not animation.movie():
             movie = QMovie(animationFile, QByteArray(), animation)
             movie.setSpeed(speed)
             animation.setMovie(movie)
             movie.start()
         self.__tabBar.setTabButton(index, side, None)
         self.__tabBar.setTabButton(index, side, animation)
         return animation
     else:
         return None
开发者ID:Darriall,项目名称:eric,代码行数:26,代码来源:E5TabWidget.py

示例3: MoviePlayer

class MoviePlayer(QWidget):
    def __init__(self):
        super(MoviePlayer, self).__init__()

        self.setAttribute(Qt.WA_TranslucentBackground)        
        self.setWindowFlags(Qt.FramelessWindowHint)

        self.movie = QMovie(self)

        self.movieLabel = QLabel("No movie loaded")
        self.movieLabel.setAlignment(Qt.AlignAbsolute)
        self.movieLabel.setSizePolicy(QSizePolicy.Ignored, QSizePolicy.Ignored)


        self.mainLayout = QVBoxLayout()
        self.mainLayout.addWidget(self.movieLabel)
        self.setLayout(self.mainLayout)
        
        #self.resize(400, 500)

        self.movieLabel.setMovie(self.movie)
        self.movie.setFileName('icon/gears.gif')

        pos = kp.pos()

        x = pos.x() - ((self.width()/2) - (kp.width()/2)) +220
        y = pos.y() - ((self.height()/2) - (kp.height()/2)) +160
        
        self.setGeometry(x,y, 400, 500)

        self.movie.start()   
开发者ID:dhoy,项目名称:KornitPrint,代码行数:31,代码来源:kornit_print.py

示例4: StatusBarView

class StatusBarView(QStatusBar):
    """
    The model of Navigation component
    """

    def __init__(self, parent):
        super().__init__(parent)

        self.status_label = QLabel("", parent)
        self.status_label.setTextFormat(Qt.RichText)

        self.label_time = QLabel("", parent)

        self.combo_referential = QComboBox(parent)
        self.movie_loader = QMovie(":/icons/loader")
        self.label_loading = QLabel(parent)
        self.label_loading.setMovie(self.movie_loader)
        self.label_loading.setMaximumHeight(self.height())
        self.movie_loader.setScaledSize(QSize(16, 16))
        self.movie_loader.start()
        self.movie_loader.setPaused(True)
        self.addPermanentWidget(self.label_loading)
        self.addPermanentWidget(self.status_label, 2)
        self.addPermanentWidget(self.label_time)
        self.addPermanentWidget(self.combo_referential)

    def start_loading(self):
        self.movie_loader.setPaused(False)

    def stop_loading(self):
        self.movie_loader.setPaused(True)
开发者ID:duniter,项目名称:sakia,代码行数:31,代码来源:view.py

示例5: initoptionspanel

    def initoptionspanel(self):
        label = QLabel('Filter')

        filtertype = QComboBox()
        filtertype.addItem('None')
        filtertype.addItem('Lowpass')
        filtertype.addItem('Highpass')
        filtertype.addItem('Bandreject')
        filtertype.addItem('Bandpass')
        filtertype.currentIndexChanged.connect(self.filtertypelistener)

        self.filterfunction = QComboBox()
        self.filterfunction.addItem('Ideal')
        self.filterfunction.addItem('Butterworth')
        self.filterfunction.addItem('Gaussian')
        self.filterfunction.currentIndexChanged.connect(self.filterfunctionlistener)
        self.filterfunction.setEnabled(False)

        self.filtercutoff = QDoubleSpinBox()
        self.filtercutoff.setValue(0.0)
        self.filtercutoff.setRange(0.0, 10000.0)
        self.filtercutoff.valueChanged.connect(self.filtercutofflistener)
        self.filtercutoff.setEnabled(False)

        self.filterbandwidth = QDoubleSpinBox()
        self.filterbandwidth.setValue(1.0)
        self.filterbandwidth.setRange(0.0, 10000.0)
        self.filterbandwidth.valueChanged.connect(self.filterbandwidthlistener)
        self.filterbandwidth.setEnabled(False)

        self.filterorder = QDoubleSpinBox()
        self.filterorder.setValue(1.0)
        self.filterorder.setRange(0.0, 10000.0)
        self.filterorder.valueChanged.connect(self.filterorderlistener)
        self.filterorder.setEnabled(False)

        loader = QMovie('loader.gif')
        loader.start()
        self.loadercontainer = QLabel()
        self.loadercontainer.setMovie(loader)
        self.loadercontainer.setVisible(False)

        formlayout = QFormLayout()
        formlayout.addRow('Type', filtertype)
        formlayout.addRow('Function', self.filterfunction)
        formlayout.addRow('Cut off', self.filtercutoff)
        formlayout.addRow('Bandwidth', self.filterbandwidth)
        formlayout.addRow('Order', self.filterorder)
        formlayout.addRow('', self.loadercontainer)

        filterbox = QGroupBox('Filter')
        filterbox.setLayout(formlayout)

        options = QDockWidget('Options')
        options.setFeatures(QDockWidget.DockWidgetFloatable)
        options.setFeatures(QDockWidget.DockWidgetMovable)
        options.setWidget(filterbox)
        self.addDockWidget(Qt.RightDockWidgetArea, options)
开发者ID:ipapi,项目名称:ipap,代码行数:58,代码来源:app.py

示例6: LoadingGifWin

class LoadingGifWin( QWidget):
    def __init__(self,parent=None):
        super(LoadingGifWin, self).__init__(parent)
        self.label =  QLabel('', self)
        self.setFixedSize(128,128)
        self.setWindowFlags( Qt.Dialog| Qt.CustomizeWindowHint)
        self.movie =  QMovie("./images/loading.gif")
        self.label.setMovie(self.movie)
        self.movie.start()
开发者ID:kiorry,项目名称:PYQT,代码行数:9,代码来源:qt08_loadGif.py

示例7: __makeAnimatedLabel

 def __makeAnimatedLabel(self, fileName, label):
     """
     Private slot to create an animated label.
     
     @param fileName name of the file containing the animation (string)
     @param label reference to the label to be animated (QLabel)
     """
     movie = QMovie(fileName, QByteArray(), label)
     movie.setSpeed(100)
     label.setMovie(movie)
     movie.start()
开发者ID:testmana2,项目名称:test,代码行数:11,代码来源:SyncCheckPage.py

示例8: WaitDialog

class WaitDialog(QWidget):
    def __init__(self, parent=None, *args, **kwargs):
        super(WaitDialog, self).__init__(parent)
        self.label = QLabel(self)
        self.label.setAlignment(Qt.AlignCenter)
        self.setFixedSize(551, 401)
        self.setWindowOpacity(0.5)  # set transparent
        self.setWindowFlags(Qt.Dialog | Qt.CustomizeWindowHint | Qt.FramelessWindowHint)
        self.setAttribute(Qt.WA_TranslucentBackground)  # background transparent
        self.setContentsMargins(0, 0, 0, 0)
        config = Config()
        self.movie = QMovie(os.path.join(config.images, 'wait.gif'))
        self.label.setMovie(self.movie)
        self.movie.start()
开发者ID:IfengAutomation,项目名称:uitester,代码行数:14,代码来源:conflict_tag.py

示例9: __init__

 def __init__(self):
     super(MainWindow, self).__init__()
     self.ui = Ui_MainWindow()
     self.ui.setupUi(self)
     self.ui.searchEdit.textChanged.connect(self.search_text_changed)
     self.ui.show_button.clicked.connect(self.show_episodes)
     self.ui.searchEdit.returnPressed.connect(self.show_episodes)
     self.episodes = None
     self.episode_list = None
     self.number = 0
     self.anime_list = None
     self.ui.download_button.clicked.connect(self.download)
     self.ui.res_list_widget.currentItemChanged.connect(self.episode_change)
     self.com = Comunicate()
     self.com.sig.connect(self.message)
     self.com.img.connect(self.set_image)
     self.ui.anime_list_widget.itemDoubleClicked.connect(self.show_episodes)
     self.setWindowIcon(QIcon(get_file('animes.png')))
     self.ui.anime_list_widget.itemPressed.connect(self.anime_entered)
     Thread(target=self.load_url_items).start()
     #self.load_url_items()
     self.movie = QMovie(get_file('ajax-loader.gif'))
     self.ui.loading_label.setMovie(self.movie)
     self.link = None
     self.main_download_page = None
     self.tray = SystemTrayIcon(
         QIcon(get_file('animes.png')), self.com, self)
     self.com.op.connect(self.show_semard)
     self.ui.action_About_Semard.triggered.connect(self.about_semard)
     self.ui.action_Contato.triggered.connect(self.show_feedback)
     self.setWindowTitle('Semard - Animes')
     self.browser = None
     self.player = None
开发者ID:ROAND,项目名称:Series-Manager,代码行数:33,代码来源:semard3_anbient.py

示例10: __init__

 def __init__(self, parent=None):
     super(XNCStatusBar, self).__init__(parent)
     # state vars
     self.world = XNovaWorld_instance()
     # initialization
     self.setSizeGripEnabled(True)
     # sub-widgets
     # progressbar
     self._progressbar = QProgressBar(self)
     self._progressbar.hide()
     self._progressbar.setValue(0)
     self._progressbar.setRange(0, 99)
     # online players counter
     self._lbl_online = QLabel(self.tr('Online') + ': 0', self)
     # label with loading.gif
     self._loading_gif = QMovie(':/i/loading.gif')
     self._lbl_loading = QLabel(self)
     self._lbl_loading.setMovie(self._loading_gif)
     self._lbl_loading.hide()
     # testing only
     self._btn_runscript = QPushButton('Run script', self)
     self._btn_runscript.clicked.connect(self.on_run_script)
     self.addPermanentWidget(self._btn_runscript)
     #
     self.addPermanentWidget(self._lbl_loading)
     self.addPermanentWidget(self._lbl_online)  # should be las right widget
     self.show()
开发者ID:minlexx,项目名称:xnovacmd,代码行数:27,代码来源:statusbar.py

示例11: __init__

    def __init__(self, parent=None):
        super(MoviePlayer, self).__init__(parent)

        self.movie = QMovie(self)
        self.movie.setCacheMode(QMovie.CacheAll)

        self.movieLabel = QLabel("No movie loaded")
        self.movieLabel.setAlignment(Qt.AlignCenter)
        self.movieLabel.setSizePolicy(QSizePolicy.Ignored, QSizePolicy.Ignored)
        self.movieLabel.setBackgroundRole(QPalette.Dark)
        self.movieLabel.setAutoFillBackground(True)

        self.currentMovieDirectory = ''

        self.createControls()
        self.createButtons()

        self.movie.frameChanged.connect(self.updateFrameSlider)
        self.movie.stateChanged.connect(self.updateButtons)
        self.fitCheckBox.clicked.connect(self.fitToWindow)
        self.frameSlider.valueChanged.connect(self.goToFrame)
        self.speedSpinBox.valueChanged.connect(self.movie.setSpeed)

        mainLayout = QVBoxLayout()
        mainLayout.addWidget(self.movieLabel)
        mainLayout.addLayout(self.controlsLayout)
        mainLayout.addLayout(self.buttonsLayout)
        self.setLayout(mainLayout)

        self.updateFrameSlider()
        self.updateButtons()

        self.setWindowTitle("Movie Player")
        self.resize(400, 400)
开发者ID:death-finger,项目名称:Scripts,代码行数:34,代码来源:movie.py

示例12: setPath

 def setPath(self, path):
     if hasattr(self, "_movie"):
         self._movie.stop()
         del self._movie
     if not path:
         return
     self._movie = QMovie(path)
     self.setMovie(self._movie)
     self._movie.start()
开发者ID:GrandHsu,项目名称:PyQtUiLibrary,代码行数:9,代码来源:GifWidget.py

示例13: __init__

    def __init__(self, parent=None):
        super(MainWindow, self).__init__(parent)
        self.setGeometry(50, 50, 600, 750)
        self.setFixedSize(500, 500)
        self.startUIWindow()

        self.movie = QMovie("mail.gif")
        self.movie.frameChanged.connect(self.repaint)
        self.movie.start()
开发者ID:KabiriDorsa,项目名称:AP_final_project,代码行数:9,代码来源:emaildialog.py

示例14: LoadingItem

class LoadingItem(QLabel):

    def __init__(self):
        super(LoadingItem, self).__init__()
        self.movie = QMovie(resources.IMAGES['loading'])
        self.setMovie(self.movie)
        self.movie.setScaledSize(QSize(16, 16))
        self.movie.start()

    def add_item_to_tree(self, folder, tree, item_type=None, parent=None):
        if item_type is None:
            item = QTreeWidgetItem()
            item.setText(0, (_translate("LoadingItem", "       LOADING: '%s'") % folder))
        else:
            item = item_type(parent, (
                _translate("LoadingItem", "       LOADING: '%s'") % folder), folder)
        tree.addTopLevelItem(item)
        tree.setItemWidget(item, 0, self)
        return item
开发者ID:Salmista-94,项目名称:Ninja_PyQt5,代码行数:19,代码来源:ui_tools.py

示例15: __init__

    def __init__(self, parent, text=""):
        QDialog.__init__(self, parent)

        # Create waiting image
        waitingImage = QMovie(qtUtils.getAbsoluteImagePath('waiting.gif'))
        waitingImage.start()
        waitingImageLabel = QLabel(self)
        waitingImageLabel.setMovie(waitingImage)

        waitingLabel = QLabel(text, self)

        hbox = QHBoxLayout()
        hbox.addStretch(1)
        hbox.addWidget(waitingImageLabel)
        hbox.addSpacing(10)
        hbox.addWidget(waitingLabel)
        hbox.addStretch(1)

        self.setLayout(hbox)
开发者ID:HingeChat,项目名称:HingeChat,代码行数:19,代码来源:qWaitingDialog.py


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