當前位置: 首頁>>代碼示例>>Python>>正文


Python QMovie.start方法代碼示例

本文整理匯總了Python中PyQt5.QtGui.QMovie.start方法的典型用法代碼示例。如果您正苦於以下問題:Python QMovie.start方法的具體用法?Python QMovie.start怎麽用?Python QMovie.start使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在PyQt5.QtGui.QMovie的用法示例。


在下文中一共展示了QMovie.start方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: GifWidget

# 需要導入模塊: from PyQt5.QtGui import QMovie [as 別名]
# 或者: from PyQt5.QtGui.QMovie import start [as 別名]
class GifWidget(QLabel):

    def __init__(self, parent = None, path = None):
        super(GifWidget, self).__init__(parent)
        self.setPath(path)

    def __del__(self):
        print("GifWidget __del__")
        if hasattr(self, "_movie"):
            self._movie.stop()
            del self._movie

    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()

    def start(self):
        if hasattr(self, "_movie"):
            self._movie.start()

    def stop(self):
        if hasattr(self, "_movie"):
            self._movie.stop()
開發者ID:GrandHsu,項目名稱:PyQtUiLibrary,代碼行數:31,代碼來源:GifWidget.py

示例2: MoviePlayer

# 需要導入模塊: from PyQt5.QtGui import QMovie [as 別名]
# 或者: from PyQt5.QtGui.QMovie import start [as 別名]
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,代碼行數:33,代碼來源:kornit_print.py

示例3: animationLabel

# 需要導入模塊: from PyQt5.QtGui import QMovie [as 別名]
# 或者: from PyQt5.QtGui.QMovie import start [as 別名]
 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,代碼行數:28,代碼來源:E5TabWidget.py

示例4: StatusBarView

# 需要導入模塊: from PyQt5.QtGui import QMovie [as 別名]
# 或者: from PyQt5.QtGui.QMovie import start [as 別名]
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,代碼行數:33,代碼來源:view.py

示例5: initoptionspanel

# 需要導入模塊: from PyQt5.QtGui import QMovie [as 別名]
# 或者: from PyQt5.QtGui.QMovie import start [as 別名]
    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,代碼行數:60,代碼來源:app.py

示例6: LoadingGifWin

# 需要導入模塊: from PyQt5.QtGui import QMovie [as 別名]
# 或者: from PyQt5.QtGui.QMovie import start [as 別名]
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,代碼行數:11,代碼來源:qt08_loadGif.py

示例7: open

# 需要導入模塊: from PyQt5.QtGui import QMovie [as 別名]
# 或者: from PyQt5.QtGui.QMovie import start [as 別名]
 def open(self):
     self.file = QFileDialog.getOpenFileName(self, "Open File", self.pwd)[0]
     if self.file == "":
         return
     self.information = info.Information(self, self.file)
     movie = QMovie(self.file, QByteArray(), self)
     movie.setCacheMode(QMovie.CacheAll)
     movie.setSpeed(100)
     self.label.setMovie(movie)
     movie.start()
開發者ID:v0kuzyo,項目名稱:python-anytask,代碼行數:12,代碼來源:main.py

示例8: __makeAnimatedLabel

# 需要導入模塊: from PyQt5.QtGui import QMovie [as 別名]
# 或者: from PyQt5.QtGui.QMovie import start [as 別名]
 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,代碼行數:13,代碼來源:SyncCheckPage.py

示例9: WaitDialog

# 需要導入模塊: from PyQt5.QtGui import QMovie [as 別名]
# 或者: from PyQt5.QtGui.QMovie import start [as 別名]
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,代碼行數:16,代碼來源:conflict_tag.py

示例10: LoadingItem

# 需要導入模塊: from PyQt5.QtGui import QMovie [as 別名]
# 或者: from PyQt5.QtGui.QMovie import start [as 別名]
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,代碼行數:21,代碼來源:ui_tools.py

示例11: __init__

# 需要導入模塊: from PyQt5.QtGui import QMovie [as 別名]
# 或者: from PyQt5.QtGui.QMovie import start [as 別名]
    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,代碼行數:21,代碼來源:qWaitingDialog.py

示例12: setupWidget1

# 需要導入模塊: from PyQt5.QtGui import QMovie [as 別名]
# 或者: from PyQt5.QtGui.QMovie import start [as 別名]
    def setupWidget1(self):
        #setup the tree
        movie = QMovie()
        movie.setFileName("res/tree.gif")
        self.ui.lb_tree.setMovie(movie)
        self.ui.lb_tree_big.setMovie(movie)
        movie.start()

        #setup the statistics
        self.ui.gridLayout.setHorizontalSpacing(60)
        self.ui.gridLayout.setVerticalSpacing(10)
        self.ui.gridLayout.setGeometry(QRect(0, 51, 291, 224))
        self.ui.gridLayout.setAlignment(QtCore.Qt.AlignCenter)
        self.statLabels = []
        for i in range(7):
            self.statLabels.append([])
            for j in range(4):
                self.statLabels[i].append(QLabel())
                self.statLabels[i][j].setScaledContents(True)
                self.statLabels[i][j].setAutoFillBackground(False)
                self.statLabels[i][j].setAlignment(QtCore.Qt.AlignCenter)
                self.ui.gridLayout.addWidget(self.statLabels[i][j], i, j, 1, 1)
開發者ID:blackskygg,項目名稱:jielu,代碼行數:24,代碼來源:blueApp.py

示例13: IconManagement

# 需要導入模塊: from PyQt5.QtGui import QMovie [as 別名]
# 或者: from PyQt5.QtGui.QMovie import start [as 別名]
class IconManagement(object):

    def __init__(self, tray, interval = 100):
        self.tray = tray
        self.movie = QMovie(":/images/tray_animations/tray.gif")
        self.movie.setSpeed(interval)
        self.movie.frameChanged.connect(self.next_icon)
        self.icons = Enum(
            ok = QIcon(":/images/demerio.png"),
            problem = QIcon(":/images/demerio-problem.png"),
            conductor_problem = QIcon(":/images/demerio-conductor-problem.png")
        )
        self.icon = self.icons.ok
        self.update_icon()

    def internet_is_ok(self, internet_is_ok):
        self.icon = self.icons.ok if internet_is_ok else self.icons.problem
        self.update_icon()

    @pyqtSlot(int)
    def next_icon(self, i):
        self.tray.setIcon(QIcon(self.movie.currentPixmap()))

    def start(self):
        self.movie.start()

    def stop(self):
        self.update_icon()
        self.movie.stop()

    def update_icon(self):
        self.tray.setIcon(self.icon)

    def conductor_problem(self):
        if self.movie.state() == QMovie.Running:
            self.movie.stop()
        self.icon = self.icons.conductor_problem
        self.update_icon()
開發者ID:sabativi,項目名稱:demerio,代碼行數:40,代碼來源:system_tray.py

示例14: MainWindow

# 需要導入模塊: from PyQt5.QtGui import QMovie [as 別名]
# 或者: from PyQt5.QtGui.QMovie import start [as 別名]
class MainWindow(QMainWindow):
    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()


    def startUIWindow(self):
        self.Window = UIWindow(self)
        self.setWindowTitle("Email Dialog")
        self.show()

    def paintEvent(self, event):
        currentFrame = self.movie.currentPixmap()
        frameRect = currentFrame.rect()
        frameRect.moveCenter(self.rect().center())
        if frameRect.intersects(event.rect()):
            painter = QPainter(self)
            painter.drawPixmap(frameRect.left(), frameRect.top(), currentFrame)
開發者ID:KabiriDorsa,項目名稱:AP_final_project,代碼行數:26,代碼來源:emaildialog.py

示例15: QConnectingWidget

# 需要導入模塊: from PyQt5.QtGui import QMovie [as 別名]
# 或者: from PyQt5.QtGui.QMovie import start [as 別名]
class QConnectingWidget(QWidget):

    def __init__(self, parent=None):
        QWidget.__init__(self, parent)

        # Create connecting image
        self.connectingGif = QMovie(qtUtils.getAbsoluteImagePath('waiting.gif'))
        self.connectingGif.start()
        self.connetingImageLabel = QLabel(self)
        self.connetingImageLabel.setMovie(self.connectingGif)
        self.connectingLabel = QLabel(self)

        hbox = QHBoxLayout()
        hbox.addStretch(1)
        hbox.addWidget(self.connetingImageLabel, alignment=Qt.AlignCenter)
        hbox.addSpacing(10)
        hbox.addWidget(self.connectingLabel, alignment=Qt.AlignCenter)
        hbox.addStretch(1)

        self.setLayout(hbox)


    def setConnectingToNick(self, nick):
        self.connectingLabel.setText("Connecting to " + nick + "...")
開發者ID:HingeChat,項目名稱:HingeChat,代碼行數:26,代碼來源:qConnectingWidget.py


注:本文中的PyQt5.QtGui.QMovie.start方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。