本文整理汇总了Python中AnyQt.QtWidgets.QGridLayout.setSpacing方法的典型用法代码示例。如果您正苦于以下问题:Python QGridLayout.setSpacing方法的具体用法?Python QGridLayout.setSpacing怎么用?Python QGridLayout.setSpacing使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AnyQt.QtWidgets.QGridLayout
的用法示例。
在下文中一共展示了QGridLayout.setSpacing方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: create_configuration_layout
# 需要导入模块: from AnyQt.QtWidgets import QGridLayout [as 别名]
# 或者: from AnyQt.QtWidgets.QGridLayout import setSpacing [as 别名]
def create_configuration_layout(self):
layout = QGridLayout()
layout.setSpacing(10)
row = 0
combo = widgets.ComboBox(self, 'wlocal',
items=tuple(BowVectorizer.wlocals.keys()))
combo.currentIndexChanged.connect(self.on_change)
layout.addWidget(QLabel('Term Frequency:'))
layout.addWidget(combo, row, 1)
row += 1
combo = widgets.ComboBox(self, 'wglobal',
items=tuple(BowVectorizer.wglobals.keys()))
combo.currentIndexChanged.connect(self.on_change)
layout.addWidget(QLabel('Document Frequency:'))
layout.addWidget(combo, row, 1)
row += 1
combo = widgets.ComboBox(self, 'normalization',
items=tuple(BowVectorizer.norms.keys()))
combo.currentIndexChanged.connect(self.on_change)
layout.addWidget(QLabel('Regularization:'))
layout.addWidget(combo, row, 1)
return layout
示例2: __setupUi
# 需要导入模块: from AnyQt.QtWidgets import QGridLayout [as 别名]
# 或者: from AnyQt.QtWidgets.QGridLayout import setSpacing [as 别名]
def __setupUi(self):
layout = QGridLayout()
layout.setContentsMargins(0, 0, 0, 0)
layout.setSpacing(0)
layout.setSizeConstraint(QGridLayout.SetFixedSize)
self.setLayout(layout)
self.setSizePolicy(QSizePolicy.Fixed, QSizePolicy.MinimumExpanding)
示例3: generate_grid_layout
# 需要导入模块: from AnyQt.QtWidgets import QGridLayout [as 别名]
# 或者: from AnyQt.QtWidgets.QGridLayout import setSpacing [as 别名]
def generate_grid_layout(self):
box = QGroupBox(title='Options')
layout = QGridLayout()
layout.setSpacing(10)
row = 0
self.tweet_attr_combo = gui.comboBox(None, self, 'tweet_attr',
callback=self.apply)
layout.addWidget(QLabel('Attribute:'))
layout.addWidget(self.tweet_attr_combo, row, 1)
row += 1
self.model_name_combo = gui.comboBox(None, self, 'model_name',
items=self.profiler.model_names,
sendSelectedValue=True,
callback=self.apply)
if self.profiler.model_names:
self.model_name = self.profiler.model_names[0] # select 0th
layout.addWidget(QLabel('Emotions:'))
layout.addWidget(self.model_name_combo, row, 1)
row += 1
self.output_mode_combo = gui.comboBox(None, self, 'output_mode',
items=self.profiler.output_modes,
sendSelectedValue=True,
callback=self.apply)
if self.profiler.output_modes:
self.output_mode = self.profiler.output_modes[0] # select 0th
layout.addWidget(QLabel('Output:'))
layout.addWidget(self.output_mode_combo, row, 1)
box.setLayout(layout)
return box
示例4: __init__
# 需要导入模块: from AnyQt.QtWidgets import QGridLayout [as 别名]
# 或者: from AnyQt.QtWidgets.QGridLayout import setSpacing [as 别名]
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.api = WikipediaAPI(on_error=self.Error.api_error)
self.result = None
query_box = gui.hBox(self.controlArea, 'Query')
# Queries configuration
layout = QGridLayout()
layout.setSpacing(7)
row = 0
self.query_edit = ListEdit(self, 'query_list', "Each line represents a "
"separate query.", 100, self)
layout.addWidget(QLabel('Query word list:'), row, 0, 1, self.label_width)
layout.addWidget(self.query_edit, row, self.label_width, 1,
self.widgets_width)
# Language
row += 1
language_edit = ComboBox(self, 'language', tuple(sorted(lang2code.items())))
layout.addWidget(QLabel('Language:'), row, 0, 1, self.label_width)
layout.addWidget(language_edit, row, self.label_width, 1, self.widgets_width)
# Articles per query
row += 1
layout.addWidget(QLabel('Articles per query:'), row, 0, 1, self.label_width)
slider = gui.valueSlider(query_box, self, 'articles_per_query', box='',
values=[1, 3, 5, 10, 25])
layout.addWidget(slider.box, row, 1, 1, self.widgets_width)
query_box.layout().addLayout(layout)
self.controlArea.layout().addWidget(query_box)
self.controlArea.layout().addWidget(
CheckListLayout('Text includes', self, 'text_includes', self.attributes, cols=2,
callback=self.set_text_features))
self.info_box = gui.hBox(self.controlArea, 'Info')
self.result_label = gui.label(self.info_box, self, self.info_label.format(0))
self.button_box = gui.hBox(self.controlArea)
self.search_button = gui.button(self.button_box, self, 'Search', self.start_stop)
self.search_button.setFocusPolicy(Qt.NoFocus)
示例5: __init__
# 需要导入模块: from AnyQt.QtWidgets import QGridLayout [as 别名]
# 或者: from AnyQt.QtWidgets.QGridLayout import setSpacing [as 别名]
def __init__(self, *args):
QWidget.__init__(self, *args)
self.setContentsMargins(0, 0, 0, 0)
gridLayout = QGridLayout()
gridLayout.setContentsMargins(0, 0, 0, 0)
gridLayout.setSpacing(1)
model = QStandardItemModel(self)
model.rowsInserted.connect(self.__changed)
model.rowsRemoved.connect(self.__changed)
model.dataChanged.connect(self.__changed)
self._listView = QListView(self)
self._listView.setModel(model)
# self._listView.setDragEnabled(True)
self._listView.setDropIndicatorShown(True)
self._listView.setDragDropMode(QListView.InternalMove)
self._listView.viewport().setAcceptDrops(True)
self._listView.setMinimumHeight(100)
gridLayout.addWidget(self._listView, 0, 0, 2, 2)
vButtonLayout = QVBoxLayout()
self._upAction = QAction(
"\u2191", self, toolTip="Move up")
self._upButton = QToolButton(self)
self._upButton.setDefaultAction(self._upAction)
self._upButton.setSizePolicy(
QSizePolicy.Fixed, QSizePolicy.MinimumExpanding)
self._downAction = QAction(
"\u2193", self, toolTip="Move down")
self._downButton = QToolButton(self)
self._downButton.setDefaultAction(self._downAction)
self._downButton.setSizePolicy(
QSizePolicy.Fixed, QSizePolicy.MinimumExpanding)
vButtonLayout.addWidget(self._upButton)
vButtonLayout.addWidget(self._downButton)
gridLayout.addLayout(vButtonLayout, 0, 2, 2, 1)
hButtonLayout = QHBoxLayout()
self._addAction = QAction("+", self)
self._addButton = QToolButton(self)
self._addButton.setDefaultAction(self._addAction)
self._removeAction = QAction("-", self)
self._removeButton = QToolButton(self)
self._removeButton.setDefaultAction(self._removeAction)
hButtonLayout.addWidget(self._addButton)
hButtonLayout.addWidget(self._removeButton)
hButtonLayout.addStretch(10)
gridLayout.addLayout(hButtonLayout, 2, 0, 1, 2)
self.setLayout(gridLayout)
self._addAction.triggered.connect(self._onAddAction)
self._removeAction.triggered.connect(self._onRemoveAction)
self._upAction.triggered.connect(self._onUpAction)
self._downAction.triggered.connect(self._onDownAction)