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


Python QtWidgets.QGridLayout方法代码示例

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


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

示例1: __init__

# 需要导入模块: from PySide2 import QtWidgets [as 别名]
# 或者: from PySide2.QtWidgets import QGridLayout [as 别名]
def __init__(self, node: NetworkNode):
        super().__init__()

        self.network = node.network
        self.node = node

        self.layout = QGridLayout()
        self.setLayout(self.layout)

        self.tabs = QTabWidget()
        self.layout.addWidget(self.tabs)

        self.tab_dialogs = []

        for node_tab in node_tabs[self.network]:
            tab_dialog = node_tab['class'](self.node)
            self.tabs.addTab(tab_dialog, node_tab['title']) 
开发者ID:lightning-power-users,项目名称:node-launcher,代码行数:19,代码来源:node_manage.py

示例2: __init__

# 需要导入模块: from PySide2 import QtWidgets [as 别名]
# 或者: from PySide2.QtWidgets import QGridLayout [as 别名]
def __init__(self, node):
        super().__init__()

        self.node = node

        self.layout = QGridLayout()
        self.setLayout(self.layout)

        self.output_area = QTextEdit()
        self.output_area.setReadOnly(True)
        self.output_area.acceptRichText = True
        self.output_area.document().setMaximumBlockCount(5000)

        self.layout.addWidget(self.output_area)

        self.node.process.log_line.connect(
            lambda line: self.output_area.append(line)
        ) 
开发者ID:lightning-power-users,项目名称:node-launcher,代码行数:20,代码来源:logs.py

示例3: addLayout

# 需要导入模块: from PySide2 import QtWidgets [as 别名]
# 或者: from PySide2.QtWidgets import QGridLayout [as 别名]
def addLayout(self,
                  widget: QWidget,
                  same_row: bool = False,
                  column: int = 1,
                  row_span: int = 1,
                  column_span: int = 1):
        if same_row:
            row = self.row_number - 1
        else:
            row = self.row_number
            self.row_number += 1
        super(QGridLayout, self).addLayout(widget,
                                           row,
                                           column,
                                           row_span,
                                           column_span) 
开发者ID:lightning-power-users,项目名称:node-launcher,代码行数:18,代码来源:grid_layout.py

示例4: quickLayout

# 需要导入模块: from PySide2 import QtWidgets [as 别名]
# 或者: from PySide2.QtWidgets import QGridLayout [as 别名]
def quickLayout(self, type, ui_name=""):
        the_layout = ''
        if type in ("form", "QFormLayout"):
            the_layout = QtWidgets.QFormLayout()
            the_layout.setLabelAlignment(QtCore.Qt.AlignLeft)
            the_layout.setFieldGrowthPolicy(QtWidgets.QFormLayout.AllNonFixedFieldsGrow)    
        elif type in ("grid", "QGridLayout"):
            the_layout = QtWidgets.QGridLayout()
        elif type in ("hbox", "QHBoxLayout"):
            the_layout = QtWidgets.QHBoxLayout()
            the_layout.setAlignment(QtCore.Qt.AlignTop)
        else:        
            the_layout = QtWidgets.QVBoxLayout()
            the_layout.setAlignment(QtCore.Qt.AlignTop)
        if ui_name != "":
            self.uiList[ui_name] = the_layout
        return the_layout 
开发者ID:shiningdesign,项目名称:universal_tool_template.py,代码行数:19,代码来源:universal_tool_template_1116.py

示例5: _create_difficulty_details_row

# 需要导入模块: from PySide2 import QtWidgets [as 别名]
# 或者: from PySide2.QtWidgets import QGridLayout [as 别名]
def _create_difficulty_details_row(self):
        row = 1

        trick_label = QtWidgets.QLabel(self.trick_level_scroll_contents)
        trick_label.setWordWrap(True)
        trick_label.setFixedWidth(80)
        trick_label.setText("Difficulty Details")

        self.trick_difficulties_layout.addWidget(trick_label, row, 1, 1, 1)

        slider_layout = QtWidgets.QGridLayout()
        slider_layout.setHorizontalSpacing(0)
        for i in range(12):
            slider_layout.setColumnStretch(i, 1)

        for i, trick_level in enumerate(LayoutTrickLevel):
            if trick_level not in {LayoutTrickLevel.NO_TRICKS, LayoutTrickLevel.MINIMAL_RESTRICTIONS}:
                tool_button = QtWidgets.QToolButton(self.trick_level_scroll_contents)
                tool_button.setText(trick_level.long_name)
                tool_button.clicked.connect(functools.partial(self._open_difficulty_details_popup, trick_level))

                slider_layout.addWidget(tool_button, 1, 2 * i, 1, 2)

        self.trick_difficulties_layout.addLayout(slider_layout, row, 2, 1, 1) 
开发者ID:randovania,项目名称:randovania,代码行数:26,代码来源:logic_settings_window.py

示例6: build

# 需要导入模块: from PySide2 import QtWidgets [as 别名]
# 或者: from PySide2.QtWidgets import QGridLayout [as 别名]
def build(self):

        self.setStyleSheet('QLabel {color: white}')

        layout = QGridLayout()
        self.setLayout(layout)

        layout.setRowStretch(0, 10)
        layout.setColumnStretch(3, 1)

        key_lbl = QLabel('{} Hotkeys:'.format(self.mode.title()))
        layout.addWidget(key_lbl, 1, 0, 1, 2)

        position = 2
        for key, op in self.mapping.iteritems():

            key_lbl = QLabel(key)
            layout.addWidget(key_lbl, position, 0, 1, 1)

            op_lbl = QLabel(op)
            layout.addWidget(op_lbl, position, 1, 1, 1)

            position += 1

        #  help_key_lbl = QLabel('h')
        #  layout.addWidget(help_key_lbl, position, 0, 1, 1)
        #
        #  help_lbl = QLabel('Toggle Help')
        #  layout.addWidget(help_lbl, position, 1, 1, 1)

        layout.setRowStretch(position, 1) 
开发者ID:wiremas,项目名称:spore,代码行数:33,代码来源:canvas.py

示例7: build

# 需要导入模块: from PySide2 import QtWidgets [as 别名]
# 或者: from PySide2.QtWidgets import QGridLayout [as 别名]
def build(self):
        layout = QGridLayout()
        self.setLayout(layout)

        lbl - QLabel('FOOOOOOO')
        layout.addWidget(lbl) 
开发者ID:wiremas,项目名称:spore,代码行数:8,代码来源:draw_override.py

示例8: initUI

# 需要导入模块: from PySide2 import QtWidgets [as 别名]
# 或者: from PySide2.QtWidgets import QGridLayout [as 别名]
def initUI(self):
		grid = QtWidgets.QGridLayout()
		#Create actions dictionary and group dictionary
		self.atomActionGroup = QtWidgets.QActionGroup(self, exclusive=True)
		self.atomActions = {}								   
		#for atomname in self.editor.atomtypes.keys(): Gives unsorted list
		for key in self.ptable.keys():
			atomname = self.ptable[key]["Symbol"]
			action = QtWidgets.QAction( '%s'%atomname,
								   self, 
								   statusTip="Set atomtype to %s"%atomname,
								   triggered=self.atomtypePush, objectName=atomname,
								   checkable=True)
			self.atomActionGroup.addAction(action)
			self.atomActions[atomname] = action
			if action.objectName() == "C":
				action.setChecked(True)		
		
			button = QtWidgets.QToolButton()
			button.setDefaultAction(action)
			button.setFocusPolicy(QtCore.Qt.NoFocus)
			button.setMaximumWidth(40)
			
			if self.ptable[key]["Group"] != None:
				grid.addWidget(button, self.ptable[key]["Period"], self.ptable[key]["Group"])
			else:
				if key <72:
					grid.addWidget(button, 9, key-54)
				else:
					grid.addWidget(button, 10, key-86)
		#Ensure spacing between main table and actinides/lathanides			
		grid.addWidget(QtWidgets.QLabel(''), 8,1)

		self.setLayout(grid)   
		
		self.move(300, 150)
		self.setWindowTitle('Periodic Table') 
开发者ID:EBjerrum,项目名称:rdeditor,代码行数:39,代码来源:ptable_widget.py

示例9: __init__

# 需要导入模块: from PySide2 import QtWidgets [as 别名]
# 或者: from PySide2.QtWidgets import QGridLayout [as 别名]
def __init__(self):
        super(GridWindow, self).__init__()

        layout = QGridLayout()

        label = QLabel("Label A")
        layout.addWidget(label, 0, 0)

        label = QLabel("Label B")
        layout.addWidget(label, 1, 0)

        label = QLabel("Label C")
        layout.addWidget(label, 2, 0)

        label = QLabel("Label D")
        layout.addWidget(label, 3, 0)

        label = QLabel("Label E")
        layout.addWidget(label, 0, 1)

        label = QLabel("Label F")
        layout.addWidget(label, 0, 2)

        label = QLabel("Label G")
        label.setAlignment(Qt.AlignCenter)
        layout.addWidget(label, 1, 1, 2, 2)

        self.setLayout(layout) 
开发者ID:PacktPublishing,项目名称:Hands-On-Blockchain-for-Python-Developers,代码行数:30,代码来源:create_grid_window.py

示例10: setupUi

# 需要导入模块: from PySide2 import QtWidgets [as 别名]
# 或者: from PySide2.QtWidgets import QGridLayout [as 别名]
def setupUi(self, Form):
        Form.setObjectName("Form")
        Form.resize(360, 180)
        self.gridLayout = QtWidgets.QGridLayout(Form)
        self.gridLayout.setObjectName("gridLayout")
        self.label_2 = QtWidgets.QLabel(Form)
        self.label_2.setObjectName("label_2")
        self.gridLayout.addWidget(self.label_2, 0, 0, 1, 1)
        self.cbObjType = QtWidgets.QComboBox(Form)
        self.cbObjType.setObjectName("cbObjType")
        self.cbObjType.addItem("")
        self.cbObjType.addItem("")
        self.gridLayout.addWidget(self.cbObjType, 0, 1, 1, 1)
        self.btnCreate = QtWidgets.QPushButton(Form)
        self.btnCreate.setObjectName("btnCreate")
        self.gridLayout.addWidget(self.btnCreate, 0, 2, 1, 1)
        self.label = QtWidgets.QLabel(Form)
        self.label.setObjectName("label")
        self.gridLayout.addWidget(self.label, 1, 0, 1, 1)
        self.leNewName = QtWidgets.QLineEdit(Form)
        self.leNewName.setObjectName("leNewName")
        self.gridLayout.addWidget(self.leNewName, 1, 1, 1, 1)
        self.btnRename = QtWidgets.QPushButton(Form)
        self.btnRename.setObjectName("btnRename")
        self.gridLayout.addWidget(self.btnRename, 1, 2, 1, 1)

        self.retranslateUi(Form)
        QtCore.QMetaObject.connectSlotsByName(Form) 
开发者ID:WendyAndAndy,项目名称:MayaDev,代码行数:30,代码来源:guiDemo_ui.py

示例11: __init__

# 需要导入模块: from PySide2 import QtWidgets [as 别名]
# 或者: from PySide2.QtWidgets import QGridLayout [as 别名]
def __init__(self, node):
        super().__init__()

        self.node: NetworkNode = node

        self.delete_popup = None

        self.layout = QGridLayout()

        self.table = QTableWidget(0, 3)
        self.table.setHorizontalHeaderLabels(['Id', 'Key', 'Value'])

        self.table.setColumnHidden(0, True)

        self.node.configuration.configuration_changed.connect(
            self.handle_configuration_change
        )

        self.table.cellChanged.connect(self.handle_cell_change)

        self.layout.addWidget(self.table, 0, 0, 1, 2)

        self.deleteButton = QPushButton('Remove Selected Row')
        self.deleteButton.clicked.connect(
            self.handle_delete_action
        )
        self.layout.addWidget(self.deleteButton, 1, 0)

        self.addButton = QPushButton('Add Configuration')
        self.addButton.clicked.connect(
            self.handle_add_action
        )
        self.layout.addWidget(self.addButton, 1, 1)

        self.setLayout(self.layout)

    #################################
    # Add/Update/Get for table rows #
    ################################# 
开发者ID:lightning-power-users,项目名称:node-launcher,代码行数:41,代码来源:configuration.py

示例12: __init__

# 需要导入模块: from PySide2 import QtWidgets [as 别名]
# 或者: from PySide2.QtWidgets import QGridLayout [as 别名]
def __init__(self, node):
        super().__init__()

        self.node = node

        self.show_help = True

        self.layout = QGridLayout()
        self.setLayout(self.layout)

        self.output_area = QTextEdit()
        self.output_area.setReadOnly(True)
        self.output_area.acceptRichText = True
        self.output_area.document().setMaximumBlockCount(5000)
        self.layout.addWidget(self.output_area)

        self.input_area = QLineEdit()
        self.completer = QCompleter()
        # noinspection PyUnresolvedReferences
        self.completer.setCaseSensitivity(Qt.CaseInsensitive)
        self.input_area.setCompleter(self.completer)
        self.input_area.setFocus()
        self.layout.addWidget(self.input_area)

        self.connect(self.input_area, SIGNAL("returnPressed(void)"),
                     self.execute_user_command) 
开发者ID:lightning-power-users,项目名称:node-launcher,代码行数:28,代码来源:console.py

示例13: __init__

# 需要导入模块: from PySide2 import QtWidgets [as 别名]
# 或者: from PySide2.QtWidgets import QGridLayout [as 别名]
def __init__(self, *args, **kwargs):
        super(QGridLayout, self).__init__(*args, **kwargs)
        self.row_number = 1 
开发者ID:lightning-power-users,项目名称:node-launcher,代码行数:5,代码来源:grid_layout.py

示例14: __init__

# 需要导入模块: from PySide2 import QtWidgets [as 别名]
# 或者: from PySide2.QtWidgets import QGridLayout [as 别名]
def __init__(self):
        super().__init__()

        self.output_text_edit = QTextEdit()
        self.output_text_edit.setReadOnly(True)
        self.output_text_edit.acceptRichText = True
        self.output_text_edit.document().setMaximumBlockCount(5000)

        self.layout = QGridLayout()
        self.layout.addWidget(self.output_text_edit)
        self.setLayout(self.layout) 
开发者ID:lightning-power-users,项目名称:node-launcher,代码行数:13,代码来源:output_widget.py

示例15: __init__

# 需要导入模块: from PySide2 import QtWidgets [as 别名]
# 或者: from PySide2.QtWidgets import QGridLayout [as 别名]
def __init__ (self, parent):
        QtWidgets.QDialog.__init__(self, parent)
        self.setWindowTitle("Export depth maps")

        self.btnQuit = QtWidgets.QPushButton("&Close")
        self.btnP1 = QtWidgets.QPushButton("&Export")
        self.pBar = QtWidgets.QProgressBar()
        self.pBar.setTextVisible(False)

        # self.selTxt =QtWidgets.QLabel()
        # self.selTxt.setText("Apply to:")
        self.radioBtn_all = QtWidgets.QRadioButton("Apply to all cameras")
        self.radioBtn_sel = QtWidgets.QRadioButton("Apply to selected")
        self.radioBtn_all.setChecked(True)
        self.radioBtn_sel.setChecked(False)

        self.formTxt = QtWidgets.QLabel()
        self.formTxt.setText("Export format:")
        self.formCmb = QtWidgets.QComboBox()
        self.formCmb.addItem("1-band F32")
        self.formCmb.addItem("Grayscale 8-bit")
        self.formCmb.addItem("Grayscale 16-bit")

        # creating layout
        layout = QtWidgets.QGridLayout()
        layout.setSpacing(10)
        layout.addWidget(self.radioBtn_all, 0, 0)
        layout.addWidget(self.radioBtn_sel, 1, 0)
        layout.addWidget(self.formTxt, 0, 1)
        layout.addWidget(self.formCmb, 1, 1)
        layout.addWidget(self.btnP1, 2, 0)
        layout.addWidget(self.btnQuit, 2, 1)
        layout.addWidget(self.pBar, 3, 0, 1, 2)
        self.setLayout(layout)  

        QtCore.QObject.connect(self.btnP1, QtCore.SIGNAL("clicked()"), self.export_depth)
        QtCore.QObject.connect(self.btnQuit, QtCore.SIGNAL("clicked()"), self, QtCore.SLOT("reject()"))    

        self.exec() 
开发者ID:agisoft-llc,项目名称:metashape-scripts,代码行数:41,代码来源:export_depth_maps_dialog.py


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