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


Python QtGui.QSizePolicy方法代码示例

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


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

示例1: setupUi

# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QSizePolicy [as 别名]
def setupUi(self, onionSkinObject_layout):
        onionSkinObject_layout.setObjectName("onionSkinObject_layout")
        onionSkinObject_layout.resize(204, 38)
        self.horizontalLayout = QtGui.QHBoxLayout(onionSkinObject_layout)
        self.horizontalLayout.setSpacing(3)
        self.horizontalLayout.setContentsMargins(4, 2, 4, 2)
        self.horizontalLayout.setObjectName("horizontalLayout")
        self.object_label = QtGui.QLabel(onionSkinObject_layout)
        self.object_label.setObjectName("object_label")
        self.horizontalLayout.addWidget(self.object_label)
        self.object_remove_btn = QtGui.QPushButton(onionSkinObject_layout)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Minimum)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.object_remove_btn.sizePolicy().hasHeightForWidth())
        self.object_remove_btn.setSizePolicy(sizePolicy)
        self.object_remove_btn.setMinimumSize(QtCore.QSize(16, 16))
        self.object_remove_btn.setMaximumSize(QtCore.QSize(16, 16))
        self.object_remove_btn.setObjectName("object_remove_btn")
        self.horizontalLayout.addWidget(self.object_remove_btn)

        self.retranslateUi(onionSkinObject_layout)
        QtCore.QMetaObject.connectSlotsByName(onionSkinObject_layout) 
开发者ID:Viele,项目名称:onionSkinRenderer,代码行数:25,代码来源:onionSkinRendererObjectWidget.py

示例2: setupUi

# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QSizePolicy [as 别名]
def setupUi(self, Form):
        Form.setObjectName("Form")
        Form.resize(224, 117)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Preferred)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(Form.sizePolicy().hasHeightForWidth())
        Form.setSizePolicy(sizePolicy)
        self.verticalLayout = QtGui.QVBoxLayout(Form)
        self.verticalLayout.setSpacing(1)
        self.verticalLayout.setContentsMargins(0, 0, 0, 0)
        self.verticalLayout.setObjectName("verticalLayout")
        self.translateLabel = QtGui.QLabel(Form)
        self.translateLabel.setObjectName("translateLabel")
        self.verticalLayout.addWidget(self.translateLabel)
        self.rotateLabel = QtGui.QLabel(Form)
        self.rotateLabel.setObjectName("rotateLabel")
        self.verticalLayout.addWidget(self.rotateLabel)
        self.scaleLabel = QtGui.QLabel(Form)
        self.scaleLabel.setObjectName("scaleLabel")
        self.verticalLayout.addWidget(self.scaleLabel)
        self.horizontalLayout = QtGui.QHBoxLayout()
        self.horizontalLayout.setObjectName("horizontalLayout")
        self.mirrorImageBtn = QtGui.QPushButton(Form)
        self.mirrorImageBtn.setToolTip("")
        self.mirrorImageBtn.setObjectName("mirrorImageBtn")
        self.horizontalLayout.addWidget(self.mirrorImageBtn)
        self.reflectImageBtn = QtGui.QPushButton(Form)
        self.reflectImageBtn.setObjectName("reflectImageBtn")
        self.horizontalLayout.addWidget(self.reflectImageBtn)
        self.verticalLayout.addLayout(self.horizontalLayout)

        self.retranslateUi(Form)
        QtCore.QMetaObject.connectSlotsByName(Form) 
开发者ID:SrikanthVelpuri,项目名称:tf-pose,代码行数:36,代码来源:TransformGuiTemplate_pyside.py

示例3: get_QSizePolicy

# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QSizePolicy [as 别名]
def get_QSizePolicy():
    """QSizePolicy getter."""

    try:
        import PySide.QtGui as QtGui
        return QtGui.QSizePolicy
    except ImportError:
        import PyQt5.QtWidgets as QtWidgets
        return QtWidgets.QSizePolicy 
开发者ID:AirbusCyber,项目名称:grap,代码行数:11,代码来源:QtShim.py

示例4: addRemoveButton

# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QSizePolicy [as 别名]
def addRemoveButton(self):
        self.frame_remove_btn = QtGui.QPushButton('rm')
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Minimum)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.frame_remove_btn.sizePolicy().hasHeightForWidth())
        self.frame_remove_btn.setSizePolicy(sizePolicy)
        self.frame_remove_btn.setMinimumSize(QtCore.QSize(16, 16))
        self.frame_remove_btn.setMaximumSize(QtCore.QSize(16, 16))
        self.frame_widget_layout.addWidget(self.frame_remove_btn) 
开发者ID:Viele,项目名称:onionSkinRenderer,代码行数:12,代码来源:onionSkinRendererWindow.py

示例5: setupUi

# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QSizePolicy [as 别名]
def setupUi(self, Dialog):
        Dialog.setObjectName("Dialog")
        Dialog.setWindowModality(QtCore.Qt.ApplicationModal)
        Dialog.resize(1304, 753)
        self.verticalLayout = QtGui.QVBoxLayout(Dialog)
        self.verticalLayout.setObjectName("verticalLayout")
        self.label = QtGui.QLabel(Dialog)
        self.label.setObjectName("label")
        self.verticalLayout.addWidget(self.label)
        self.versions_treeView = QtGui.QTreeView(Dialog)
        self.versions_treeView.setObjectName("versions_treeView")
        self.verticalLayout.addWidget(self.versions_treeView)
        self.horizontalWidget = QtGui.QWidget(Dialog)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Preferred)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.horizontalWidget.sizePolicy().hasHeightForWidth())
        self.horizontalWidget.setSizePolicy(sizePolicy)
        self.horizontalWidget.setObjectName("horizontalWidget")
        self.horizontalLayout = QtGui.QHBoxLayout(self.horizontalWidget)
        self.horizontalLayout.setContentsMargins(0, 0, 0, 0)
        self.horizontalLayout.setObjectName("horizontalLayout")
        spacerItem = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
        self.horizontalLayout.addItem(spacerItem)
        self.selectNone_pushButton = QtGui.QPushButton(self.horizontalWidget)
        self.selectNone_pushButton.setObjectName("selectNone_pushButton")
        self.horizontalLayout.addWidget(self.selectNone_pushButton)
        self.selectAll_pushButton = QtGui.QPushButton(self.horizontalWidget)
        self.selectAll_pushButton.setObjectName("selectAll_pushButton")
        self.horizontalLayout.addWidget(self.selectAll_pushButton)
        self.update_pushButton = QtGui.QPushButton(self.horizontalWidget)
        self.update_pushButton.setObjectName("update_pushButton")
        self.horizontalLayout.addWidget(self.update_pushButton)
        self.cancel_pushButton = QtGui.QPushButton(self.horizontalWidget)
        self.cancel_pushButton.setObjectName("cancel_pushButton")
        self.horizontalLayout.addWidget(self.cancel_pushButton)
        self.verticalLayout.addWidget(self.horizontalWidget)

        self.retranslateUi(Dialog)
        QtCore.QMetaObject.connectSlotsByName(Dialog) 
开发者ID:eoyilmaz,项目名称:anima,代码行数:42,代码来源:version_updater_UI_pyside.py

示例6: createWidgets

# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QSizePolicy [as 别名]
def createWidgets(self):
        self.item_list_model = QtGui.QStandardItemModel(self)
        self.item_list_model.setSortRole(QtCore.Qt.DisplayRole)
        self.item_list_model.dataChanged.connect(self.handleDataChange)
        self.setModel(self.item_list_model)
        self.item_selection_model = self.selectionModel()
        self.setMinimumHeight(60)
        self.setSizePolicy(QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Preferred)) 
开发者ID:DrHibbitts,项目名称:TiltBrushConverter,代码行数:10,代码来源:CustomQtWidgets.py

示例7: __init__

# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QSizePolicy [as 别名]
def __init__(self, parent=None):
        super(GLWidget, self).__init__(parent)
        self.setMouseTracking(True)
        #self.setFocusPolicy(_QtCore.Qt.WheelFocus)
        self.setAttribute(_QtCore.Qt.WA_PaintOnScreen)
        self.setAttribute(_QtCore.Qt.WA_NoSystemBackground)
        self.setSizePolicy(_QtGui.QSizePolicy(_QtGui.QSizePolicy.Expanding,
                                              _QtGui.QSizePolicy.Expanding))
        self.occ_view = None
        self.SCR = (400, 400) 
开发者ID:charles-sharman,项目名称:ccad,代码行数:12,代码来源:display.py

示例8: _init_gui

# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QSizePolicy [as 别名]
def _init_gui(self):
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Expanding)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(2)

        mask_options = QtWidgets.QGroupBox()
        sizePolicy.setHeightForWidth(mask_options.sizePolicy().hasHeightForWidth())
        mask_options.setSizePolicy(sizePolicy)
        mask_options.setObjectName('mask_options')
        mask_options.setTitle('Mask Options')

        vbox_mask = QtWidgets.QVBoxLayout(mask_options)
        for text, name in self.maskings:
            checkbox = QtWidgets.QCheckBox(text, mask_options)
            checkbox.setObjectName(name)
            vbox_mask.addWidget(checkbox)

        vbox_mask.addStretch()

        if self.registers:
            #   Original Opcodes GUI Area
            reg_groupbox = QtWidgets.QGroupBox()
            sizePolicy.setHeightForWidth(reg_groupbox.sizePolicy().hasHeightForWidth())
            reg_groupbox.setSizePolicy(sizePolicy)
            reg_groupbox.setObjectName('reg_groupbox')
            reg_groupbox.setTitle('Mask Registers')
            hbox_reg = QtWidgets.QHBoxLayout(reg_groupbox)
            vbox_reg = QtWidgets.QVBoxLayout()
            vbox_reg.setContentsMargins(1, 1, 1, 1)
            hbox_reg.addLayout(vbox_reg)
            vbox_mask.addWidget(reg_groupbox)

            for text, name in self.registers:
                if self.registers.index((text, name)) == (len(self.registers)/2):
                    vbox_reg = QtWidgets.QVBoxLayout()
                    vbox_reg.setContentsMargins(1, 1, 1, 1)
                    hbox_reg.addLayout(vbox_reg)

                checkbox = QtWidgets.QCheckBox(text, mask_options)
                checkbox.setObjectName(name)
                vbox_reg.addWidget(checkbox)

        return mask_options 
开发者ID:Cisco-Talos,项目名称:CASC,代码行数:45,代码来源:casc_plugin.py

示例9: setupUi

# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QSizePolicy [as 别名]
def setupUi(self, Form):
        Form.setObjectName("Authenticate")
        Form.resize(220, 105)
        icon = QtGui.QIcon()
        icon.addPixmap(QtGui.QPixmap("logo.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
        Form.setWindowIcon(icon)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(Form.sizePolicy().hasHeightForWidth())
        Form.setSizePolicy(sizePolicy)
        Form.setMinimumSize(QtCore.QSize(220, 105))
        Form.setMaximumSize(QtCore.QSize(220, 105))
        self.verticalLayout = QtGui.QVBoxLayout(Form)
        self.verticalLayout.setObjectName("verticalLayout")
        self.label_3 = QtGui.QLabel(Form)
        self.label_3.setAlignment(QtCore.Qt.AlignHCenter|QtCore.Qt.AlignTop)
        self.label_3.setWordWrap(True)
        self.label_3.setObjectName("label_3")
        self.verticalLayout.addWidget(self.label_3)
        self.horizontalLayout = QtGui.QHBoxLayout()
        self.horizontalLayout.setObjectName("horizontalLayout")
        self.label = QtGui.QLabel(Form)
        self.label.setObjectName("label")
        self.horizontalLayout.addWidget(self.label)
        self.AuthBox = QtGui.QLineEdit(Form)
        self.AuthBox.setObjectName("AuthBox")
        self.horizontalLayout.addWidget(self.AuthBox)
        self.verticalLayout.addLayout(self.horizontalLayout)
        self.horizontalLayout_2 = QtGui.QHBoxLayout()
        self.horizontalLayout_2.setObjectName("horizontalLayout_2")
        spacerItem = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
        self.horizontalLayout_2.addItem(spacerItem)
        self.AuthButton = QtGui.QPushButton(Form)
        self.AuthButton.setObjectName("AuthButton")
        self.horizontalLayout_2.addWidget(self.AuthButton)
        spacerItem1 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
        self.horizontalLayout_2.addItem(spacerItem1)
        self.verticalLayout.addLayout(self.horizontalLayout_2)

        self.retranslateUi(Form)
        QtCore.QMetaObject.connectSlotsByName(Form)

        QtCore.QObject.connect(self.AuthButton, QtCore.SIGNAL("clicked()"), self.auth) 
开发者ID:adamb70,项目名称:CSGO-Market-Float-Finder,代码行数:46,代码来源:ui.py

示例10: setupUi

# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QSizePolicy [as 别名]
def setupUi(self, Dialog):
        Dialog.setObjectName("Dialog")
        Dialog.setWindowModality(QtCore.Qt.ApplicationModal)
        Dialog.resize(209, 149)
        self.gridLayout_2 = QtGui.QGridLayout(Dialog)
        self.gridLayout_2.setObjectName("gridLayout_2")
        self.placeButton = QtGui.QPushButton(Dialog)
        self.placeButton.setObjectName("placeButton")
        self.gridLayout_2.addWidget(self.placeButton, 2, 0, 1, 1)
        self.gridLayout = QtGui.QGridLayout()
        self.gridLayout.setSizeConstraint(QtGui.QLayout.SetMaximumSize)
        self.gridLayout.setObjectName("gridLayout")
        self.label = QtGui.QLabel(Dialog)
        self.label.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter)
        self.label.setObjectName("label")
        self.gridLayout.addWidget(self.label, 0, 0, 1, 1)
        self.label_2 = QtGui.QLabel(Dialog)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Preferred)
        sizePolicy.setHorizontalStretch(1)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.label_2.sizePolicy().hasHeightForWidth())
        self.label_2.setSizePolicy(sizePolicy)
        self.label_2.setMinimumSize(QtCore.QSize(61, 0))
        self.label_2.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter)
        self.label_2.setObjectName("label_2")
        self.gridLayout.addWidget(self.label_2, 1, 0, 1, 1)
        self.upperLineEdit = QtGui.QLineEdit(Dialog)
        self.upperLineEdit.setObjectName("upperLineEdit")
        self.gridLayout.addWidget(self.upperLineEdit, 0, 1, 1, 1)
        self.lowerLineEdit = QtGui.QLineEdit(Dialog)
        self.lowerLineEdit.setObjectName("lowerLineEdit")
        self.gridLayout.addWidget(self.lowerLineEdit, 1, 1, 1, 1)
        self.label_3 = QtGui.QLabel(Dialog)
        self.label_3.setObjectName("label_3")
        self.gridLayout.addWidget(self.label_3, 2, 0, 1, 1)
        self.scaleDoubleSpinBox = QtGui.QDoubleSpinBox(Dialog)
        self.scaleDoubleSpinBox.setMinimum(0.05)
        self.scaleDoubleSpinBox.setSingleStep(0.05)
        self.scaleDoubleSpinBox.setProperty("value", 0.8)
        self.scaleDoubleSpinBox.setObjectName("scaleDoubleSpinBox")
        self.gridLayout.addWidget(self.scaleDoubleSpinBox, 2, 1, 1, 1)
        self.gridLayout_2.addLayout(self.gridLayout, 1, 0, 1, 1)

        self.retranslateUi(Dialog)
        QtCore.QObject.connect(self.placeButton, QtCore.SIGNAL("released()"), Dialog.accept)
        QtCore.QObject.connect(self.upperLineEdit, QtCore.SIGNAL("returnPressed()"), Dialog.accept)
        QtCore.QObject.connect(self.lowerLineEdit, QtCore.SIGNAL("returnPressed()"), Dialog.accept)
        QtCore.QMetaObject.connectSlotsByName(Dialog) 
开发者ID:hamish2014,项目名称:FreeCAD_drawing_dimensioning,代码行数:50,代码来源:toleranceDialog.py


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