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


Python QtCore.QSize方法代码示例

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


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

示例1: googlemapurl

# 需要导入模块: from PyQt4 import QtCore [as 别名]
# 或者: from PyQt4.QtCore import QSize [as 别名]
def googlemapurl(self, radar, rect):
        urlp = []
        if len(ApiKeys.googleapi) > 0:
            urlp.append('key=' + ApiKeys.googleapi)
        urlp.append(
            'center=' + str(radar['center'].lat) +
            ',' + str(radar['center'].lng))
        zoom = radar['zoom']
        rsize = rect.size()
        if rsize.width() > 640 or rsize.height() > 640:
            rsize = QtCore.QSize(rsize.width() / 2, rsize.height() / 2)
            zoom -= 1
        urlp.append('zoom=' + str(zoom))
        urlp.append('size=' + str(rsize.width()) + 'x' + str(rsize.height()))
        urlp.append('maptype=hybrid')

        return 'http://maps.googleapis.com/maps/api/staticmap?' + \
            '&'.join(urlp) 
开发者ID:n0bel,项目名称:PiClock,代码行数:20,代码来源:PyQtPiClock.py

示例2: __init__

# 需要导入模块: from PyQt4 import QtCore [as 别名]
# 或者: from PyQt4.QtCore import QSize [as 别名]
def __init__(self, tableName=None, layer=None, size=None, rows=None):
        CartoDBDatasetsListItem.__init__(self, tableName, None, size, rows)

        '''
        self.ui.statusLB = QLabel(self)
        self.ui.statusLB.setMaximumSize(QSize(100, 16777215))
        self.ui.statusLB.setAlignment(Qt.AlignCenter | Qt.AlignTrailing | Qt.AlignVCenter)
        self.ui.statusLB.setWordWrap(True)
        self.ui.horizontalLayout.insertWidget(1, self.ui.statusLB)
        '''

        self.ui.statusBar = QProgressBar(self)
        self.ui.statusBar.setProperty("value", 0)
        self.ui.statusBar.setFormat("Init")
        self.ui.statusBar.setAutoFillBackground(True)
        self.ui.statusBar.hide()
        self.ui.horizontalLayout.insertWidget(1, self.ui.statusBar)

        self.layer = layer 
开发者ID:gkudos,项目名称:qgis-cartodb,代码行数:21,代码来源:ListItemWidgets.py

示例3: readSettings

# 需要导入模块: from PyQt4 import QtCore [as 别名]
# 或者: from PyQt4.QtCore import QSize [as 别名]
def readSettings(self):
        """ Load settings from previous session """
        rospy.logdebug("Loading previous session settings")
        settings = QSettings("omwdunkley", "reset" if self.options.reset else "flieROS"+str(self.options.radio) )
        self.resize(settings.value("size", QVariant(QSize(300, 500))).toSize())
        self.move(settings.value("pos", QVariant(QPoint(200, 200))).toPoint())

        self.ui.checkBox_reconnect.setChecked(settings.value("autoReconnect", QVariant(self.ui.checkBox_reconnect.isChecked())).toBool())
        self.ui.checkBox_beep.setChecked(settings.value("beepOn", QVariant(self.ui.checkBox_beep.isChecked())).toBool())
        self.ui.checkBox_xmode.setChecked(settings.value("xmodeOn", QVariant(self.ui.checkBox_xmode.isChecked())).toBool())
        self.ui.checkBox_kill.setChecked(settings.value("killOn", QVariant(self.ui.checkBox_kill.isChecked())).toBool())
        self.ui.checkBox_startupConnect.setChecked(settings.value("startConnect", QVariant(self.ui.checkBox_startupConnect)).toBool())

        self.ui.checkBox_pktHZ.setChecked(settings.value("pktHzOn", QVariant(self.ui.checkBox_pktHZ.isChecked())).toBool())
        self.ui.checkBox_logHZ.setChecked(settings.value("logHzOn", QVariant(self.ui.checkBox_logHZ.isChecked())).toBool())
        self.ui.horizontalSlider_pktHZ.setValue(settings.value("pktHzVal", QVariant(self.ui.horizontalSlider_pktHZ.value())).toInt()[0])
        self.ui.horizontalSlider_logHZ.setValue(settings.value("logHzVal", QVariant(self.ui.horizontalSlider_logHZ.value())).toInt()[0])
        self.ui.horizontalSlider_guiHZ.setValue(settings.value("guiHzVal", QVariant(self.ui.horizontalSlider_guiHZ.value())).toInt()[0])
        self.ui.horizontalSlider_AI.setValue(settings.value("aiHzVal", QVariant(self.ui.horizontalSlider_AI.value())).toInt()[0])

        self.logManager.header().restoreState(settings.value("logTreeH", self.logManager.header().saveState()).toByteArray())
        self.paramManager.header().restoreState(settings.value("paramTreeH", self.paramManager.header().saveState()).toByteArray()) 
开发者ID:omwdunkley,项目名称:crazyflieROS,代码行数:24,代码来源:driverWindow.py

示例4: setRenderSize

# 需要导入模块: from PyQt4 import QtCore [as 别名]
# 或者: from PyQt4.QtCore import QSize [as 别名]
def setRenderSize(self, size):
		""" Set the render output size for the scene
			:param size: <QSize>
		"""
		from PyQt4.QtCore import QSize
		if isinstance(size, QSize):
			width = size.width()
			height = size.height()
		elif isinstance(size, list):
			if len(size) < 2:
				raise TypeError('You must provide a width and a height when setting the render size using a list')
			width = size[0]
			height = size[1]
		cmds.setAttr('defaultResolution.width', width)
		cmds.setAttr('defaultResolution.height', height)
		return True 
开发者ID:blurstudio,项目名称:cross3d,代码行数:18,代码来源:mayascene.py

示例5: setRenderSize

# 需要导入模块: from PyQt4 import QtCore [as 别名]
# 或者: from PyQt4.QtCore import QSize [as 别名]
def setRenderSize(self, size):
		"""
			\remarks	set the render output size for the scene
			\param		size	<QSize>
			\return		<bool> success
		"""
		from PyQt4.QtCore import QSize
		if isinstance(size, QSize):
			width = size.width()
			height = size.height()
		elif isinstance(size, list):
			if len(size) < 2:
				raise TypeError('You must provide a width and a height when setting the render size using a list')
			width = size[0]
			height = size[1]
		xsi.SetValue("Passes.RenderOptions.ImageWidth", width)
		xsi.SetValue("Passes.RenderOptions.ImageHeight", height)
		return True 
开发者ID:blurstudio,项目名称:cross3d,代码行数:20,代码来源:softimagescene.py

示例6: createWidget

# 需要导入模块: from PyQt4 import QtCore [as 别名]
# 或者: from PyQt4.QtCore import QSize [as 别名]
def createWidget(self,listWidget, title,markname,uin):
        self.listWidgetItem = QtGui.QListWidgetItem(listWidget)
        self.listWidgetItem.setSizeHint(QtCore.QSize(0, 48))
        self.widget = QtGui.QWidget()
        self.widget.setProperty('uin',uin)
        self.widget.setGeometry(QtCore.QRect(0, 0, 238, 51))
        self.graphicsView[uin] = QtGui.QGraphicsView(self.widget)
        self.graphicsView[uin].setGeometry(QtCore.QRect(1, 1, 38, 38))
        self.lbl_title = QtGui.QLabel(self.widget)
        self.lbl_title.setGeometry(QtCore.QRect(60, 10, 181, 18))
        self.lbl_title.setFont(self.font2)
        if markname != 'None':
            title=markname+'('+title+')'
        self.lbl_title.setText(_translate("Main", title, None))
        self.lbl_comment = QtGui.QLabel(self.widget)
        self.lbl_comment.setGeometry(QtCore.QRect(60, 30, 181, 18))
        info=self.userdict.get(uin)
        if info['online']:
            self.lbl_comment.setText(_translate("Main", '[在线]', None))
        else:
            self.lbl_comment.setText(_translate("Main", '[离线]', None))
        self.lbl_comment.setFont(self.font3)
        return self.listWidgetItem, self.widget 
开发者ID:younfor,项目名称:PyLinuxQQ,代码行数:25,代码来源:guiMainQQ.py

示例7: sizeHint

# 需要导入模块: from PyQt4 import QtCore [as 别名]
# 或者: from PyQt4.QtCore import QSize [as 别名]
def sizeHint(self):
        w, h = self.get_width_height()
        return QSize(w, h) 
开发者ID:swharden,项目名称:Python-GUI-examples,代码行数:5,代码来源:matplotlibwidget.py

示例8: minimumSizeHint

# 需要导入模块: from PyQt4 import QtCore [as 别名]
# 或者: from PyQt4.QtCore import QSize [as 别名]
def minimumSizeHint(self):
        return QSize(10, 10)



#===============================================================================
#   Example
#=============================================================================== 
开发者ID:swharden,项目名称:Python-GUI-examples,代码行数:10,代码来源:matplotlibwidget.py

示例9: minimumSize

# 需要导入模块: from PyQt4 import QtCore [as 别名]
# 或者: from PyQt4.QtCore import QSize [as 别名]
def minimumSize(self):
        size = QtCore.QSize()

        for item in self.itemList:
            size = size.expandedTo(item.minimumSize())

        size += QtCore.QSize(2 * self.margin(), 2 * self.margin())
        return size 
开发者ID:doctorguile,项目名称:pyqtggpo,代码行数:10,代码来源:emoticonsdialog.py

示例10: renderSize

# 需要导入模块: from PyQt4 import QtCore [as 别名]
# 或者: from PyQt4.QtCore import QSize [as 别名]
def renderSize(self):
		""" Return the render output size for the scene
			:return: <QSize>
		"""
		from PyQt4.QtCore import QSize
		width = cmds.getAttr('defaultResolution.width')
		height = cmds.getAttr('defaultResolution.height')
		return QSize(width, height) 
开发者ID:blurstudio,项目名称:cross3d,代码行数:10,代码来源:mayascene.py

示例11: renderSize

# 需要导入模块: from PyQt4 import QtCore [as 别名]
# 或者: from PyQt4.QtCore import QSize [as 别名]
def renderSize(self):
		"""
			\remarks	implements AbstractScene.renderSize method to return the current output width and height for renders
			\return		<QSize>
		"""
		from PyQt4.QtCore import QSize
		return QSize(mxs.renderWidth, mxs.renderHeight) 
开发者ID:blurstudio,项目名称:cross3d,代码行数:9,代码来源:studiomaxscene.py

示例12: setRenderSize

# 需要导入模块: from PyQt4 import QtCore [as 别名]
# 或者: from PyQt4.QtCore import QSize [as 别名]
def setRenderSize(self, size):
		"""
			\remarks	implements AbstractScene.setRenderSize method to set the current output width and height for renders for this scene
			\param		size	<QSize>
			\return		<bool> success
		"""
		mxs.renderWidth = size.width()
		mxs.renderHeight = size.height()
		if mxs.renderSceneDialog.isOpen():
			mxs.renderSceneDialog.update() 
开发者ID:blurstudio,项目名称:cross3d,代码行数:12,代码来源:studiomaxscene.py

示例13: generateRender

# 需要导入模块: from PyQt4 import QtCore [as 别名]
# 或者: from PyQt4.QtCore import QSize [as 别名]
def generateRender(self, **options):
        """
                \remarks	renders an image sequence form that camera with the current render settings
                \param 		path <String>
                \param 		frameRange <cross3d.FrameRange>
                \param 		resolution <QtCore.QSize>
                \param 		pixelAspect <float>
                \param 		step <int>
                \param 		missingFramesOnly <bool>
                \return		<cross3d.constants.CameraType>
        """

        path = options.get('path', '')
        resolution = options.get(
            'resolution', QSize(mxs.renderWidth, mxs.renderHeight))
        pixelAspect = options.get('pixelAspect', 1.0)
        step = options.get('step', 1)
        frameRange = options.get('frameRange', [])
        missingFramesOnly = options.get('missingFramesOnly', False)

        if path:
            basePath = os.path.split(path)[0]
            if not os.path.exists(basePath):
                os.makedirs(basePath)

        if frameRange:
            bitmap = mxs.render(outputFile=path, fromFrame=frameRange[0], toFrame=frameRange[
                                1], camera=self._nativePointer, nthFrame=step, outputWidth=resolution.width(), outputHeight=resolution.height(), pixelAspect=pixelAspect)
            mxs.undisplay(bitmap)
        else:
            bitmap = mxs.render(outputFile=path, frame=mxs.pyHelper.namify(
                'current'), camera=self._nativePointer, outputWidth=resolution.width(), outputHeight=resolution.height(), pixelAspect=pixelAspect) 
开发者ID:blurstudio,项目名称:cross3d,代码行数:34,代码来源:studiomaxscenecamera.py

示例14: setRenderSize

# 需要导入模块: from PyQt4 import QtCore [as 别名]
# 或者: from PyQt4.QtCore import QSize [as 别名]
def setRenderSize(self, size):
		"""
			\remarks	set the render output size for the scene
			\param		size	<QSize>
			\return		<bool> success
		"""
		return False 
开发者ID:blurstudio,项目名称:cross3d,代码行数:9,代码来源:abstractscene.py

示例15: renderSize

# 需要导入模块: from PyQt4 import QtCore [as 别名]
# 或者: from PyQt4.QtCore import QSize [as 别名]
def renderSize(self):
		"""
			\remarks	return the render output size for the scene
			\return		<QSize>
		"""
		from PyQt4.QtCore import QSize
		return QSize(xsi.GetValue("Passes.RenderOptions.ImageWidth"), xsi.GetValue("Passes.RenderOptions.ImageHeight")) 
开发者ID:blurstudio,项目名称:cross3d,代码行数:9,代码来源:softimagescene.py


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