當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。