當前位置: 首頁>>代碼示例>>Python>>正文


Python QSizePolicy.Minimum方法代碼示例

本文整理匯總了Python中PyQt5.QtWidgets.QSizePolicy.Minimum方法的典型用法代碼示例。如果您正苦於以下問題:Python QSizePolicy.Minimum方法的具體用法?Python QSizePolicy.Minimum怎麽用?Python QSizePolicy.Minimum使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在PyQt5.QtWidgets.QSizePolicy的用法示例。


在下文中一共展示了QSizePolicy.Minimum方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: __init__

# 需要導入模塊: from PyQt5.QtWidgets import QSizePolicy [as 別名]
# 或者: from PyQt5.QtWidgets.QSizePolicy import Minimum [as 別名]
def __init__(self, parent, buttons=False):
        super(CollectionEditor, self).__init__(QWidget(parent))

        self.preferences = None

        self.propertyEditors = {}
        self.setLayout(QVBoxLayout())
        self.layout().setSpacing(0)

        self.form = QFormLayout()
        self.layout().addLayout(self.form)

        self.stats = QVBoxLayout()
        self.layout().addLayout(self.stats)


        self.verticalSpacer = QSpacerItem(20, 40, QSizePolicy.Minimum, QSizePolicy.Expanding)
        self.layout().addItem(self.verticalSpacer)

        self.buttons = buttons
        if self.buttons:
            self.addButtons() 
開發者ID:reilleya,項目名稱:openMotor,代碼行數:24,代碼來源:collectionEditor.py

示例2: __init__

# 需要導入模塊: from PyQt5.QtWidgets import QSizePolicy [as 別名]
# 或者: from PyQt5.QtWidgets.QSizePolicy import Minimum [as 別名]
def __init__(self, win_id, parent=None):
        super().__init__(parent)
        self.setTextFormat(Qt.RichText)
        self._win_id = win_id
        self.setSizePolicy(QSizePolicy.Fixed, QSizePolicy.Minimum)
        self.hide()
        self._show_timer = usertypes.Timer(self, 'keyhint_show')
        self._show_timer.timeout.connect(self.show)
        self._show_timer.setSingleShot(True)
        stylesheet.set_register(self) 
開發者ID:qutebrowser,項目名稱:qutebrowser,代碼行數:12,代碼來源:keyhintwidget.py

示例3: __init__

# 需要導入模塊: from PyQt5.QtWidgets import QSizePolicy [as 別名]
# 或者: from PyQt5.QtWidgets.QSizePolicy import Minimum [as 別名]
def __init__(self, parent=None, elidemode=Qt.ElideRight):
        super().__init__(parent)
        self.setSizePolicy(QSizePolicy.Preferred, QSizePolicy.Minimum)
        self._elidemode = elidemode
        self._elided_text = '' 
開發者ID:qutebrowser,項目名稱:qutebrowser,代碼行數:7,代碼來源:textbase.py

示例4: __set_design

# 需要導入模塊: from PyQt5.QtWidgets import QSizePolicy [as 別名]
# 或者: from PyQt5.QtWidgets.QSizePolicy import Minimum [as 別名]
def __set_design(self):
        """
        Sets general settings of frame widget, adds dock area and dock widgets.
        """
        self.setWindowTitle('Player')
        self.resize(1200, 550)

        self.dock_area = DockAreaWidget()

        # dock fixed waveform
        dock_waveform = pgdock.Dock(name="Waveform", area='Top',
                                    hideTitle=True, closable=False,
                                    autoOrientation=False)
        dock_waveform.setMinimumHeight(100)
        dock_waveform.layout.setSizeConstraint(QLayout.SetMinimumSize)
        dock_waveform.widgetArea.setSizePolicy(QSizePolicy(QSizePolicy.Minimum,
                                                           QSizePolicy.Minimum))

        # initializing waveform widget
        self.waveform_widget = WaveformWidget()

        # adding waveform widget to waveform dock
        dock_waveform.addWidget(self.waveform_widget)
        dock_waveform.allowedAreas = ['top']
        dock_waveform.setAcceptDrops(False)
        # adding waveform dock to dock area
        self.dock_area.addDock(dock_waveform, position='top')

        # adding dock area to frame
        layout = QVBoxLayout(self)
        layout.addWidget(self.dock_area) 
開發者ID:MTG,項目名稱:dunya-desktop,代碼行數:33,代碼來源:playerframe.py

示例5: init_layout

# 需要導入模塊: from PyQt5.QtWidgets import QSizePolicy [as 別名]
# 或者: from PyQt5.QtWidgets.QSizePolicy import Minimum [as 別名]
def init_layout(self):
        for row in range(0, self.__rows):
            self.layout().setRowStretch(row, 1)
            # item = QSpacerItem(0, 0, QSizePolicy.Minimum, QSizePolicy.Expanding)
            # self.layout().addItem(item, row, 0)

        for column in range(0, self.__columns):
            self.layout().setColumnStretch(column, 1)
            # item = QSpacerItem(0, 0, QSizePolicy.Expanding, QSizePolicy.Minimum)
            # self.layout().addItem(item, 0, column) 
開發者ID:FrancescoCeruti,項目名稱:linux-show-player,代碼行數:12,代碼來源:page_widget.py

示例6: __init__

# 需要導入模塊: from PyQt5.QtWidgets import QSizePolicy [as 別名]
# 或者: from PyQt5.QtWidgets.QSizePolicy import Minimum [as 別名]
def __init__(self, *args, **kwargs):
        QWidget.__init__(self, *args, **kwargs)
        self.setLayout(QVBoxLayout())
        self.layout().setContentsMargins(0, 0, 0, 0)
        self.listenerlist = ListenerList()
        self.listenerlist.listenersUpdated.connect(self.listenersUpdated)
        self.layout().addWidget(self.listenerlist)

        self.hostinput = QLineEdit()
        self.hostinput.setText("127.0.0.1")
        self.hostinput.returnPressed.connect(self.add_listener)
        self.portinput = QLineEdit()
        self.portinput.setMaxLength(5)
        self.portinput.setSizePolicy(QSizePolicy.Minimum, QSizePolicy.Preferred)
        self.portinput.returnPressed.connect(self.add_listener)
        self.addbutton = QToolButton()
        self.addbutton.setText("+")
        self.removebutton = QToolButton()
        self.removebutton.setText("-")
        editbar = QHBoxLayout()
        editbar.addWidget(self.addbutton)
        editbar.addWidget(self.removebutton)
        editbar.addWidget(QLabel("Interface:"))
        editbar.addWidget(self.hostinput)
        editbar.addWidget(QLabel("Port:"))
        editbar.addWidget(self.portinput)

        self.removebutton.clicked.connect(self.listenerlist.delete_selected)
        self.addbutton.clicked.connect(self.add_listener)

        self.layout().addLayout(editbar) 
開發者ID:roglew,項目名稱:guppy-proxy,代碼行數:33,代碼來源:settings.py

示例7: loadProperties

# 需要導入模塊: from PyQt5.QtWidgets import QSizePolicy [as 別名]
# 或者: from PyQt5.QtWidgets.QSizePolicy import Minimum [as 別名]
def loadProperties(self, obj):
        self.cleanup()
        for prop in obj.props:
            self.propertyEditors[prop] = PropertyEditor(self, obj.props[prop], self.preferences)
            self.propertyEditors[prop].valueChanged.connect(self.propertyUpdate)
            label = QLabel(obj.props[prop].dispName + ':')
            label.setSizePolicy(QSizePolicy.Minimum, QSizePolicy.Expanding)
            self.form.addRow(label, self.propertyEditors[prop])
        if self.buttons:
            self.applyButton.show()
            self.cancelButton.show()
        self.propertyUpdate() 
開發者ID:reilleya,項目名稱:openMotor,代碼行數:14,代碼來源:collectionEditor.py

示例8: __init__

# 需要導入模塊: from PyQt5.QtWidgets import QSizePolicy [as 別名]
# 或者: from PyQt5.QtWidgets.QSizePolicy import Minimum [as 別名]
def __init__(self, client):
        QWidget.__init__(self)
        self.client = client
        self.history = []
        self.history_pos = 0

        self.setLayout(QVBoxLayout())
        self.layout().setSpacing(0)
        self.layout().setContentsMargins(0, 0, 0, 0)
        buttons = QHBoxLayout()
        buttons.setContentsMargins(0, 0, 0, 0)
        buttons.setSpacing(8)

        submitButton = QPushButton("Submit")
        submitButton.clicked.connect(self.submit)
        self.dest_host_input = QLineEdit()
        self.dest_port_input = QLineEdit()
        self.dest_port_input.setMaxLength(5)
        self.dest_port_input.setSizePolicy(QSizePolicy.Minimum, QSizePolicy.Preferred)
        self.dest_usetls_input = QCheckBox()
        
        self.back_button = QToolButton()
        self.back_button.setText("<")
        self.back_button.clicked.connect(self.back)
        self.forward_button = QToolButton()
        self.forward_button.setText(">")
        self.forward_button.clicked.connect(self.forward)

        buttons.addWidget(self.back_button)
        buttons.addWidget(self.forward_button)
        buttons.addWidget(submitButton)
        buttons.addWidget(QLabel("Host:"))
        buttons.addWidget(self.dest_host_input)
        buttons.addWidget(QLabel("Port:"))
        buttons.addWidget(self.dest_port_input)
        buttons.addWidget(QLabel("Use TLS:"))
        buttons.addWidget(self.dest_usetls_input)
        buttons.addStretch()

        self.reqview = ReqViewWidget(tag_tab=True)
        self.reqview.set_read_only(False)
        self.reqview.set_tags_read_only(False)
        self.layout().addLayout(buttons)
        self.layout().addWidget(self.reqview)

        self.req = None
        self.dest_host = ""
        self.dest_port = 80
        self.use_tls = False
        self._update_buttons() 
開發者ID:roglew,項目名稱:guppy-proxy,代碼行數:52,代碼來源:repeater.py

示例9: _initViews

# 需要導入模塊: from PyQt5.QtWidgets import QSizePolicy [as 別名]
# 或者: from PyQt5.QtWidgets.QSizePolicy import Minimum [as 別名]
def _initViews(self):
        self.setFixedHeight(TITLE_BAR_HEIGHT)

        palette = self.palette()
        palette.setColor(palette.Window, QColor(240, 240, 240))
        self.setPalette(palette)
        # 布局
        layout = QHBoxLayout(self, spacing=0)
        layout.setContentsMargins(0, 0, 0, 0)
        # 窗口圖標
        self.iconLabel = QLabel(self, objectName='iconLabel')
        # 窗口標題
        self.titleLabel = QLabel(self, objectName='titleLabel')
        self.titleLabel.setMargin(5)

        # 利用webdings字體來顯示圖標
        font = self.font() or QFont()
        font.setFamily('Webdings')
        # 最小化按鈕
        self.buttonMinimum = QPushButton('0', self, font=font, objectName='buttonMinimum')
        # 最大化/還原按鈕
        self.buttonMaximum = QPushButton('1', self, font=font, objectName='buttonMaximum')
        # 關閉按鈕
        self.buttonClose = QPushButton('r', self, font=font, objectName='buttonClose')

        self.theseSelect = QPushButton()
        self.theseSelect.setObjectName("theseSelect")
        self.theseSelect.setIcon(QIcon("icon/whitethese.png"))
        self.theseSelect.clicked.connect(self._theseCallback)

        self.buttonMinimum.setFixedSize(TITLE_BUTTON_SIZE, TITLE_BUTTON_SIZE)
        self.buttonMaximum.setFixedSize(TITLE_BUTTON_SIZE, TITLE_BUTTON_SIZE)
        self.buttonClose.setFixedSize(TITLE_BUTTON_SIZE, TITLE_BUTTON_SIZE)

        self.iconLabel.setFixedSize(TITLE_LABEL_SIZE, TITLE_LABEL_SIZE)
        self.titleLabel.setFixedHeight(TITLE_LABEL_SIZE)
        self.iconLabel.setAlignment(Qt.AlignCenter)
        self.titleLabel.setAlignment(Qt.AlignCenter)

        self.buttonMinimum.clicked.connect(self.win.showMinimized)
        self.buttonMaximum.clicked.connect(self.showMaximized)
        self.buttonClose.clicked.connect(self.closeWindow)

        layout.addWidget(self.iconLabel)
        layout.addWidget(self.titleLabel)
        # 中間伸縮條
        layout.addSpacerItem(QSpacerItem(40, 20, QSizePolicy.Expanding, QSizePolicy.Minimum))

        layout.addWidget(self.theseSelect)
        layout.addWidget(self.buttonMinimum)
        layout.addWidget(self.buttonMaximum)
        layout.addWidget(self.buttonClose)
        layout.setSpacing(2)
        # self.setHeight() 
開發者ID:epolestar,項目名稱:equant,代碼行數:56,代碼來源:titlebar.py


注:本文中的PyQt5.QtWidgets.QSizePolicy.Minimum方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。