本文整理汇总了Python中PyQt5.QtGui.QMovie.setScaledSize方法的典型用法代码示例。如果您正苦于以下问题:Python QMovie.setScaledSize方法的具体用法?Python QMovie.setScaledSize怎么用?Python QMovie.setScaledSize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt5.QtGui.QMovie
的用法示例。
在下文中一共展示了QMovie.setScaledSize方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: StatusBarView
# 需要导入模块: from PyQt5.QtGui import QMovie [as 别名]
# 或者: from PyQt5.QtGui.QMovie import setScaledSize [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)
示例2: LoadingItem
# 需要导入模块: from PyQt5.QtGui import QMovie [as 别名]
# 或者: from PyQt5.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, (_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