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


Python QMovie.setScaledSize方法代码示例

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


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

示例1: add_loading_widgets

# 需要导入模块: from PyQt4.QtGui import QMovie [as 别名]
# 或者: from PyQt4.QtGui.QMovie import setScaledSize [as 别名]
    def add_loading_widgets(self, children):
        # Generate list if only one item was given
        if not type(children) is list:
            item_list = []
            item_list.append(children)
            children = item_list
        # Add loading widgets to tree items
        for child in children:
            if child.tree_item == None:
                return
            # Create loading widget
            load_widget = QtGui.QLabel()
            load_widget.resize(50,50)
            #load_widget.setMaximumSize(50,50)
            load_widget.setStyleSheet("QLabel { background-color: transparent; }")

            # Create animation
            load_anim = QMovie(self.datahandler.datapath("ui/images/loading_tree.gif"), "GIF", load_widget)
            load_anim.setCacheMode(QMovie.CacheAll)
            load_anim.setSpeed(150)
            load_anim.setScaledSize(QtCore.QSize(50,50))

            # Add to data model and tree
            child.set_load_widget(load_widget, load_anim)
            self.tree.setItemWidget(child.tree_item, 1, load_widget)
开发者ID:Sohil876,项目名称:DropN900,代码行数:27,代码来源:uicontroller.py

示例2: LoadingItem

# 需要导入模块: from PyQt4.QtGui import QMovie [as 别名]
# 或者: from PyQt4.QtGui.QMovie import setScaledSize [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, self.tr('       LOADING: "%1"').arg(folder))
        else:
            item = item_type(parent, self.tr('       LOADING: "%1"').arg(folder), folder)
        tree.addTopLevelItem(item)
        tree.setItemWidget(item, 0, self)
        return item
开发者ID:kennyfm91,项目名称:ninja-ide,代码行数:19,代码来源:ui_tools.py

示例3: setStatus

# 需要导入模块: from PyQt4.QtGui import QMovie [as 别名]
# 或者: from PyQt4.QtGui.QMovie import setScaledSize [as 别名]
    def setStatus(self,status,message='',tooltip=None):
        '''Sets indicator icon and statusbar message'''
        self.parent.statusbar.showMessage(message)
        self.parent.statusbar.setToolTip(tooltip if tooltip else '')

        #progress
        loc = os.path.abspath(os.path.join(IMG_LOC,self.imgset[status]))
        #loc = os.path.abspath(os.path.join(os.path.dirname(__file__),self.parent.IMG_LOC,self.imgset[status]))
        self.progressbar.setVisible(status in (self.STATUS.BUSY, self.STATUS.CLEAN))
        
        #icon
        anim = QMovie(loc, QByteArray(), self)
        anim.setScaledSize(QSize(self.IMG_WIDTH,self.IMG_HEIGHT))
        anim.setCacheMode(QMovie.CacheAll)
        anim.setSpeed(self.IMG_SPEED)
        self.view.clear()
        self.view.setMovie(anim)
        anim.start()

        self.view.repaint()
        QApplication.processEvents(QEventLoop.AllEvents)
开发者ID:josephramsay,项目名称:LDS,代码行数:23,代码来源:LDSGUI.py

示例4: MuteButtonLabel

# 需要导入模块: from PyQt4.QtGui import QMovie [as 别名]
# 或者: from PyQt4.QtGui.QMovie import setScaledSize [as 别名]
class MuteButtonLabel(QWidget):

    def __init__(self, parent=None): 
        QWidget.__init__(self, parent) 
        #self.setFixedSize(CustomSize)
        self.movie_screen = QLabel()
        self.movie_screen.setFixedSize(CustomSize)
        self.movie_screen.setAlignment(Qt.AlignLeft)
        main_layout = QVBoxLayout()
        main_layout.addWidget(self.movie_screen)
        self.setLayout(main_layout)
        self.muted = False

        #self.unmute() # this is for testpurpose only

        
    def unmute(self):
        """start animation"""
        self.movie = QMovie(":/unmute.gif", QByteArray(), self)
        self.movie.setScaledSize(CustomSize*0.7)
        self.movie.setCacheMode(QMovie.CacheAll)
        self.movie.setSpeed(100)
        self.movie_screen.setMovie(self.movie)
        self.muted = False
        #print("Emitted 'sig_unmute'")
        self.emit(SIGNAL("sig_unmute"))
        self.movie.start()

    def show_unmute(self):
        self.movie = QMovie(":/unmute.gif", QByteArray(), self)
        self.movie.setScaledSize(CustomSize*0.7)
        self.movie.setCacheMode(QMovie.CacheAll)
        self.movie.setSpeed(100)
        self.movie_screen.setMovie(self.movie)
        self.muted = False
        self.movie.start()

    def mute(self):
        """stop the animation"""
        self.movie = QMovie(":/mute.gif", QByteArray(), self)
        self.movie.setScaledSize(CustomSize*0.7)
        self.movie.setCacheMode(QMovie.CacheAll)
        self.movie.setSpeed(100)
        self.movie_screen.setMovie(self.movie)
        self.muted = True
        #print("Emitted 'sig_mute'")
        self.emit(SIGNAL("sig_mute"))
        self.movie.start()

    def toggleMute(self):
        if self.muted:
            self.unmute()
        else:
            self.mute()

    def mousePressEvent(self, QMouseEvent):

        self.toggleMute()

        QMouseEvent.accept()
开发者ID:Acer54,项目名称:Webradio_v2,代码行数:62,代码来源:button_labels.py

示例5: __init__

# 需要导入模块: from PyQt4.QtGui import QMovie [as 别名]
# 或者: from PyQt4.QtGui.QMovie import setScaledSize [as 别名]

#.........这里部分代码省略.........
        self.manager_ui.sync_button.clicked.connect(self.synchronize_now)
        self.last_dl_location = None
        self.last_ul_location = None

        ### Console widget
        self.console_widget = QWidget(self.main_widget, Qt.Window)
        self.console_widget.setAttribute(Qt.WA_Maemo5StackedWindow)
        self.console_ui = Ui_ConsoleWidget()
        self.console_ui.setupUi(self.console_widget)
        self.console_ui.button_save.clicked.connect(self.save_log_to_file)
        self.console_ui.button_back.clicked.connect(self.hide_console)
        
        ### Settings widget
        self.settings_widget = None

        ### Fill stacked layout
        self.stacked_layout.addWidget(self.trusted_login_widget)
        self.stacked_layout.addWidget(self.manager_widget)
        self.stacked_layout.setCurrentWidget(self.trusted_login_widget)

        ### Loading Widget
        self.loading_widget = QWidget(self.manager_widget)
        self.loading_ui = Ui_LoadingWidget()
        self.loading_ui.setupUi(self.loading_widget)
        self.manager_ui.action_layout.insertWidget(3, self.loading_widget)
        self.loading_widget.hide()
        
        self.tree_controller.set_loading_ui(self.loading_ui)

        # Init loading animation
        self.loading_animation = QMovie(self.datahandler.datapath("ui/images/loading.gif"), "GIF", self.loading_ui.load_animation_label)
        self.loading_animation.setCacheMode(QMovie.CacheAll)
        self.loading_animation.setSpeed(150)
        self.loading_animation.setScaledSize(QtCore.QSize(48,48))
        self.loading_ui.load_animation_label.setMovie(self.loading_animation)

        # Init hide timer and icons for information messages
        self.information_message_timer = QTimer()
        self.information_message_timer.setSingleShot(True)
        self.information_message_timer.timeout.connect(self.hide_information_message)
        self.information_icon_ok = QPixmap(self.datahandler.datapath("ui/icons/check.png")).scaled(24,24)
        self.information_icon_error = QPixmap(self.datahandler.datapath("ui/icons/cancel.png")).scaled(24,24)
        self.information_icon_queue = QPixmap(self.datahandler.datapath("ui/icons/queue.png")).scaled(24,24)
        
        ### About dialog
        self.about_dialog = AboutDialog(self)
        
        self.set_synching(False)
        
    def set_synching(self, syncing):
        self.manager_ui.sync_button.setVisible(not syncing)
        self.manager_ui.sync_label.setVisible(syncing)

    def set_settings_widget(self, settings_widget):
        self.settings_widget = settings_widget
        
    def set_transfer_widget(self, transfer_widget):
        self.transfer_widget = transfer_widget
        
    def synchronize_now(self):
        self.settings_widget.sync_now_clicked()
        
    def synchronize_now_photos(self):
        self.controller.sync_manager.sync_media()
        
    def show(self):
开发者ID:Sohil876,项目名称:DropN900,代码行数:70,代码来源:uicontroller.py


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