本文整理汇总了Python中PyQt5.QtWidgets.QVBoxLayout.getContentsMargins方法的典型用法代码示例。如果您正苦于以下问题:Python QVBoxLayout.getContentsMargins方法的具体用法?Python QVBoxLayout.getContentsMargins怎么用?Python QVBoxLayout.getContentsMargins使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt5.QtWidgets.QVBoxLayout
的用法示例。
在下文中一共展示了QVBoxLayout.getContentsMargins方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from PyQt5.QtWidgets import QVBoxLayout [as 别名]
# 或者: from PyQt5.QtWidgets.QVBoxLayout import getContentsMargins [as 别名]
def __init__(self, parent, cli_iface, iface_name):
super(ControlPanelWindow, self).__init__(parent)
self.setWindowTitle('SLCAN Adapter Control Panel')
self.setAttribute(Qt.WA_DeleteOnClose) # This is required to stop background timers!
self._cli_iface = cli_iface
self._iface_name = iface_name
self._state_widget = StateWidget(self, self._cli_iface)
self._config_widget = ConfigWidget(self, self._cli_iface)
self._cli_widget = CLIWidget(self, self._cli_iface)
self._tab_widget = QTabWidget(self)
self._tab_widget.addTab(self._state_widget, get_icon('dashboard'), 'Adapter State')
self._tab_widget.addTab(self._config_widget, get_icon('wrench'), 'Configuration')
self._tab_widget.addTab(self._cli_widget, get_icon('terminal'), 'Command Line')
self._status_bar = QStatusBar(self)
self._status_bar.setSizeGripEnabled(False)
iface_name_label = QLabel(iface_name.split('/')[-1], self)
iface_name_label.setFont(get_monospace_font())
layout = QVBoxLayout(self)
layout.addWidget(iface_name_label)
layout.addWidget(self._tab_widget)
layout.addWidget(self._status_bar)
left, top, right, bottom = layout.getContentsMargins()
bottom = 0
layout.setContentsMargins(left, top, right, bottom)
self.setLayout(layout)
self.resize(400, 400)
示例2: __init__
# 需要导入模块: from PyQt5.QtWidgets import QVBoxLayout [as 别名]
# 或者: from PyQt5.QtWidgets.QVBoxLayout import getContentsMargins [as 别名]
def __init__(
self, parent, node, target_node_id, file_server_widget, node_monitor, dynamic_node_id_allocator_widget
):
super(NodePropertiesWindow, self).__init__(parent)
self.setAttribute(Qt.WA_DeleteOnClose) # This is required to stop background timers!
self.setWindowTitle("Node Properties [%d]" % target_node_id)
self.setMinimumWidth(640)
self._target_node_id = target_node_id
self._node = node
self._file_server_widget = file_server_widget
self._info_box = InfoBox(self, target_node_id, node_monitor)
self._controls = Controls(self, node, target_node_id, file_server_widget, dynamic_node_id_allocator_widget)
self._config_params = ConfigParams(self, node, target_node_id)
self._status_bar = QStatusBar(self)
self._status_bar.setSizeGripEnabled(False)
layout = QVBoxLayout(self)
layout.addWidget(self._info_box)
layout.addWidget(self._controls)
layout.addWidget(self._config_params)
layout.addWidget(self._status_bar)
left, top, right, bottom = layout.getContentsMargins()
bottom = 0
layout.setContentsMargins(left, top, right, bottom)
self.setLayout(layout)