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


Python QSize.setHeight方法代码示例

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


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

示例1: readSettings

# 需要导入模块: from PyQt4.QtCore import QSize [as 别名]
# 或者: from PyQt4.QtCore.QSize import setHeight [as 别名]
	def readSettings(self):
		self.imageFolder = os.path.normpath(str(self.settings.value("imageFolder").toString()))
		self.ui.actionIgnore_Transparent_Pixels.setChecked( self.settings.value("ignoreAlpha", True).toBool())
		self.ui.actionCheck_for_update_at_start.setChecked( self.settings.value("checkupdate", True).toBool())
		self.ui.tolerance_le.setText( self.settings.value("tolerance").toString())
		self.settings.beginGroup("/geometry")
		p = QPoint()  # position
		s = QSize()  # size

		x = self.settings.value("X", -1).toInt()[0]
		y = self.settings.value("Y", -1).toInt()[0]
		# don't position outside current screen
		qRect = QtGui.QDesktopWidget.availableGeometry(app.desktop())
		if x > qRect.right():
			x = 10
		if y > qRect.bottom():
			y = 10
		p.setX(x)
		p.setY(y)
		s.setWidth(self.settings.value("W", -1).toInt()[0])
		s.setHeight(self.settings.value("H", -1).toInt()[0])
		self.settings.endGroup()
		if p.x() > 0 and p.y() > 0 and s.width() > 0 and s.height() > 0:
			self.resize(s)  # restore size
			self.move(p)  # restore position
开发者ID:iantestplant,项目名称:ImageDiff,代码行数:27,代码来源:ImageDiff.py

示例2: sizeHint

# 需要导入模块: from PyQt4.QtCore import QSize [as 别名]
# 或者: from PyQt4.QtCore.QSize import setHeight [as 别名]
    def sizeHint(self):
        """ A virtual method implementation which returns the size hint
        for the layout.

        """
        if self._cached_hint is None:
            size = QSize(0, 0)
            for item in self._items:
                size = size.expandedTo(item.sizeHint())
            left, top, right, bottom = self.getContentsMargins()
            size.setWidth(size.width() + left + right)
            size.setHeight(size.height() + top + bottom)
            self._cached_hint = size
        return self._cached_hint
开发者ID:B-Rich,项目名称:enaml,代码行数:16,代码来源:q_flow_layout.py

示例3: minimumSize

# 需要导入模块: from PyQt4.QtCore import QSize [as 别名]
# 或者: from PyQt4.QtCore.QSize import setHeight [as 别名]
    def minimumSize(self):
        """ A reimplemented method which returns the minimum size hint
        of the layout item widget as the minimum size of the window.

        """
        if self._cached_min is None:
            size = QSize(0, 0)
            for item in self._items:
                size = size.expandedTo(item.minimumSize())
            left, top, right, bottom = self.getContentsMargins()
            size.setWidth(size.width() + left + right)
            size.setHeight(size.height() + top + bottom)
            self._cached_min = size
        # XXX hack! We really need hasWidthForHeight! This doesn't quite
        # work because a QScrollArea internally caches the min size.
        d = self._options.direction
        if d == self.TopToBottom or d == self.BottomToTop:
            m = QSize(self._cached_min)
            if m.width() < self._cached_wfh:
                m.setWidth(self._cached_wfh)
            return m
        return self._cached_min
开发者ID:B-Rich,项目名称:enaml,代码行数:24,代码来源:q_flow_layout.py

示例4: sizeHint

# 需要导入模块: from PyQt4.QtCore import QSize [as 别名]
# 或者: from PyQt4.QtCore.QSize import setHeight [as 别名]
    def sizeHint(self):
        """ Get the size hint for the scroll area.

        This reimplemented method fixes a Qt bug where the size hint
        is not updated after the scroll widget is first shown. The
        bug is documented on the Qt bug tracker:
        https://bugreports.qt-project.org/browse/QTBUG-10545

        """
        # This code is ported directly from QScrollArea.cpp but instead
        # of caching the size hint of the scroll widget, it caches the
        # size hint for the entire scroll area, and invalidates it when
        # the widget is changed or it receives a LayoutRequest event.
        hint = self._size_hint
        if hint.isValid():
            return QSize(hint)
        fw = 2 * self.frameWidth()
        hint = QSize(fw, fw)
        font_height = self.fontMetrics().height()
        widget = self.widget()
        if widget is not None:
            if self.widgetResizable():
                hint += widget.sizeHint()
            else:
                hint += widget.size()
        else:
            hint += QSize(12 * font_height, 8 * font_height)
        if self.verticalScrollBarPolicy() == Qt.ScrollBarAlwaysOn:
            vbar = self.verticalScrollBar()
            hint.setWidth(hint.width() + vbar.sizeHint().width())
        if self.horizontalScrollBarPolicy() == Qt.ScrollBarAlwaysOn:
            hbar = self.horizontalScrollBar()
            hint.setHeight(hint.height() + hbar.sizeHint().height())
        hint = hint.boundedTo(QSize(36 * font_height, 24 * font_height))
        self._size_hint = hint
        return QSize(hint)
开发者ID:davidjk,项目名称:enaml,代码行数:38,代码来源:qt_scroll_area.py

示例5: sizeHint

# 需要导入模块: from PyQt4.QtCore import QSize [as 别名]
# 或者: from PyQt4.QtCore.QSize import setHeight [as 别名]
 def sizeHint(self):
     size = QSize()
     size.setWidth(self.width * self.fixed_font_width + 2)
     size.setHeight(self.height * self.fixed_font_height)
     return size
开发者ID:parapente,项目名称:PiFi,代码行数:7,代码来源:qtztextwidget.py

示例6: sizeHint

# 需要导入模块: from PyQt4.QtCore import QSize [as 别名]
# 或者: from PyQt4.QtCore.QSize import setHeight [as 别名]
 def sizeHint(self):
     size = QSize()
     size.setHeight(200)
     return size
开发者ID:CospanDesign,项目名称:nysa-gui,代码行数:6,代码来源:lax_trigger_view.py

示例7: PluginWidget

# 需要导入模块: from PyQt4.QtCore import QSize [as 别名]
# 或者: from PyQt4.QtCore.QSize import setHeight [as 别名]
class PluginWidget(QWidget):

    def __init__(self, parent=None):
        QWidget.__init__(self, parent)

        self.pluginMetadata = {}

        # Main layout
        self.mainLayout = QVBoxLayout()
        self.setLayout(self.mainLayout)

        # Define size used for the underlines
        self.underlineSize = QSize()
        self.underlineSize.setHeight(1)

        # Define font used for headers
        self.font = QFont()
        self.font.setPointSize(11)
        self.font.setBold(True)
        self.font.setUnderline(True)

        # Plugins Description
        self.pluginDescription = QLabel()
        self.pluginDescription.setText("Click a plugin to see more information." +
            " Plugins can be configured from the Recording tab. \n")
        self.pluginDescription.setWordWrap(True)

        # Plugins GroupBox
        self.pluginLayout = QVBoxLayout()
        self.pluginGroupBox = QGroupBox("Plugins extend the functionality of Freeseer")
        self.pluginGroupBox.setLayout(self.pluginLayout)
        self.pluginLayout.insertWidget(0, self.pluginDescription)
        self.mainLayout.insertWidget(0, self.pluginGroupBox)

        # Plugins list
        self.list = QTreeWidget()
        self.list.setHeaderHidden(True)
        self.list.headerItem().setText(0, "1")
        self.pluginLayout.insertWidget(1, self.list)

        # Details
        self.detailPane = QGroupBox()
        self.detailLayout = QVBoxLayout()
        self.detailPane.setLayout(self.detailLayout)
        self.detailPaneDesc = QLabel()
        self.detailPaneDesc.setWordWrap(True)
        self.detailLayout.addWidget(self.detailPaneDesc)
        self.pluginLayout.insertWidget(2, self.detailPane)

        self.list.itemSelectionChanged.connect(self.treeViewSelect)

    def treeViewSelect(self):
        item = self.list.currentItem()
        key = str(item.text(0))
        if key in self.pluginMetadata.keys():
            self.showDetails(key)
        else:
            self.hideDetails()

    def showDetails(self, key):
        self.detailPane.setTitle(key)
        self.detailPaneDesc.setText(self.pluginMetadata[key])
        self.detailPane.show()

    def hideDetails(self):
        self.detailPane.hide()

    def getWidgetPlugin(self, plugin, plugin_category, plugman):
        plugin_name = plugin.plugin_object.get_name()
        item = QTreeWidgetItem()

        # Display Plugin's meta data in a tooltip
        pluginDetails = """
        <table>
        <tr>
            <td>Name: </td>
            <td><b>%(name)s</b></td>
        </tr>
        <tr>
            <td>Version: </td>
            <td><b>%(version)s</b></td>
        <tr>
            <td>Author: </td>
            <td><b>%(author)s</b></td>
        </tr>
        <tr>
            <td>Website: </td>
            <td><b>%(website)s</b></td>
        </tr>
        <tr>
            <td>Description: </td>
            <td><b>%(description)s</b></td>
        </tr>
        </table>
        """ % {"name": plugin.name,
               "version": plugin.version,
               "author": plugin.author,
               "website": plugin.website,
               "description": plugin.description}

#.........这里部分代码省略.........
开发者ID:Blakstar26,项目名称:freeseer,代码行数:103,代码来源:PluginWidget.py

示例8: sizeHint

# 需要导入模块: from PyQt4.QtCore import QSize [as 别名]
# 或者: from PyQt4.QtCore.QSize import setHeight [as 别名]
 def sizeHint(self):
     size = QSize()
     size.setWidth(640)
     size.setHeight(480)
     return size
开发者ID:parapente,项目名称:PiFi,代码行数:7,代码来源:qtztextwidget_v2.py


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