本文整理汇总了Python中Tc2Config.sizeToString方法的典型用法代码示例。如果您正苦于以下问题:Python Tc2Config.sizeToString方法的具体用法?Python Tc2Config.sizeToString怎么用?Python Tc2Config.sizeToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tc2Config
的用法示例。
在下文中一共展示了Tc2Config.sizeToString方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: import Tc2Config [as 别名]
# 或者: from Tc2Config import sizeToString [as 别名]
def __init__(self,
parent=None,
name='',
size=None,
itemIsExpanded=False,
**kws
):
TemplateBase.__init__(self, parent)
self.size = newValidSize(size)
self.itemIsExpanded = itemIsExpanded
self.setFirstColumnSpanned(True)
self.setFlags(QtCore.Qt.ItemIsSelectable | QtCore.Qt.ItemIsEnabled | QtCore.Qt.ItemIsEditable)
self.setIcon(0, QtGui.QIcon(Tc2Config.Pixmaps.stars()) )
font = self.font(0)
font.setBold(True)
self.setFont(0, font)
self.setExpanded( self.itemIsExpanded)
self.setText(0, name if name else self.menuName() )
self.itemType = QtGui.QTreeWidgetItem(self, ['Type:', self.menuName()])
self.itemType.setDisabled(True)
self.itemSize = QtGui.QTreeWidgetItem(self, ['Size:', Tc2Config.sizeToString(self.size)])
self.itemSize.setDisabled(True)
self.points = {}
self.pointItems = []
for pointName in self.PointNames:
#NOTE: we have to make shure points in out point dict are the same as
# points points in our tree items
point = newPoint(kws.get(pointName, None))
item = PointItem(pointName, point, parent=self)
self.points[pointName] = item.point
self.pointItems.append(item)
示例2: handleScreenshotDoubleClicked
# 需要导入模块: import Tc2Config [as 别名]
# 或者: from Tc2Config import sizeToString [as 别名]
def handleScreenshotDoubleClicked(self, item, pixmap, point):
if item.isDisabled():
return False
if item not in self.pointItems:
return False
self.size.setWidth(pixmap.width())
self.size.setHeight(pixmap.height())
self.itemSize.setText(1, Tc2Config.sizeToString(self.size) )
point = QtCore.QPoint(point)
item.setPoint(point)
self.points[item.pointName] = item.point
return True
示例3: _giveFeedback
# 需要导入模块: import Tc2Config [as 别名]
# 或者: from Tc2Config import sizeToString [as 别名]
def _giveFeedback(self, pixmap, point):
name = Tc2Config.truncateString(self._screenshotName, Tc2Config.MaxName)
p = '%s -- Size: %s Mouse: %s' % (name, Tc2Config.sizeToString(pixmap.size()), Tc2Config.pointToString(point) )
Tc2Config.globalObject.feedback.emit(self, p)