本文整理汇总了Python中PySide2.QtWidgets.QHBoxLayout方法的典型用法代码示例。如果您正苦于以下问题:Python QtWidgets.QHBoxLayout方法的具体用法?Python QtWidgets.QHBoxLayout怎么用?Python QtWidgets.QHBoxLayout使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PySide2.QtWidgets
的用法示例。
在下文中一共展示了QtWidgets.QHBoxLayout方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: setupUi
# 需要导入模块: from PySide2 import QtWidgets [as 别名]
# 或者: from PySide2.QtWidgets import QHBoxLayout [as 别名]
def setupUi(self, OutputDock):
OutputDock.setObjectName("OutputDock")
OutputDock.resize(700, 397)
OutputDock.setFloating(False)
OutputDock.setFeatures(QtWidgets.QDockWidget.AllDockWidgetFeatures)
self.dockWidgetContents = QtWidgets.QWidget()
self.dockWidgetContents.setObjectName("dockWidgetContents")
self.horizontalLayout = QtWidgets.QHBoxLayout(self.dockWidgetContents)
self.horizontalLayout.setObjectName("horizontalLayout")
self.textEdit = QtWidgets.QTextEdit(self.dockWidgetContents)
self.textEdit.setReadOnly(True)
self.textEdit.setObjectName("textEdit")
self.horizontalLayout.addWidget(self.textEdit)
OutputDock.setWidget(self.dockWidgetContents)
self.retranslateUi(OutputDock)
QtCore.QMetaObject.connectSlotsByName(OutputDock)
示例2: __init__
# 需要导入模块: from PySide2 import QtWidgets [as 别名]
# 或者: from PySide2.QtWidgets import QHBoxLayout [as 别名]
def __init__(self, parent=None):
super(BrowseEdit, self).__init__(parent)
self.text = QtWidgets.QLineEdit()
self.text.returnPressed.connect(self.apply)
self.button = QtWidgets.QPushButton('B')
self.button.setFixedSize(21, 21)
self.button.released.connect(self.browse)
self.layout = QtWidgets.QHBoxLayout(self)
self.layout.setContentsMargins(0, 0, 0, 0)
self.layout.setSpacing(0)
self.layout.addWidget(self.text)
self.layout.addWidget(self.button)
self._value = self.value()
示例3: __init__
# 需要导入模块: from PySide2 import QtWidgets [as 别名]
# 或者: from PySide2.QtWidgets import QHBoxLayout [as 别名]
def __init__(self, command, parent=None):
super(CommandDisplayDialog, self).__init__(parent)
self.setWindowTitle("Command")
self.text = QtWidgets.QTextEdit()
self.text.setReadOnly(True)
self.text.setPlainText(command)
self.ok = QtWidgets.QPushButton('ok')
self.ok.released.connect(self.accept)
self.button_layout = QtWidgets.QHBoxLayout()
self.button_layout.setContentsMargins(0, 0, 0, 0)
self.button_layout.addStretch(1)
self.button_layout.addWidget(self.ok)
self.layout = QtWidgets.QVBoxLayout(self)
self.layout.addWidget(self.text)
self.layout.addLayout(self.button_layout)
示例4: createTweetsGroupBox
# 需要导入模块: from PySide2 import QtWidgets [as 别名]
# 或者: from PySide2.QtWidgets import QHBoxLayout [as 别名]
def createTweetsGroupBox(self):
self.tweets_group_box = QtWidgets.QGroupBox("Tweets")
self.account_address = QtWidgets.QLineEdit()
self.fetch_button = QtWidgets.QPushButton("Fetch")
self.add_to_bookmark_button = QtWidgets.QPushButton("Bookmark it!")
self.connect(self.fetch_button, QtCore.SIGNAL('clicked()'), self.fetchTweets)
self.connect(self.add_to_bookmark_button, QtCore.SIGNAL('clicked()'), self.bookmarkAddress)
account_address_layout = QtWidgets.QHBoxLayout()
account_address_layout.addWidget(self.account_address)
account_address_layout.addWidget(self.fetch_button)
account_address_layout.addWidget(self.add_to_bookmark_button)
self.tweets_layout = QtWidgets.QVBoxLayout()
self.tweets_main_layout = QtWidgets.QVBoxLayout()
self.tweets_main_layout.addWidget(QtWidgets.QLabel("Address:"))
self.tweets_main_layout.addLayout(account_address_layout)
self.tweets_main_layout.addSpacing(20)
self.tweets_main_layout.addLayout(self.tweets_layout)
self.tweets_group_box.setLayout(self.tweets_main_layout)
示例5: quickLayout
# 需要导入模块: from PySide2 import QtWidgets [as 别名]
# 或者: from PySide2.QtWidgets import QHBoxLayout [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
示例6: __init__
# 需要导入模块: from PySide2 import QtWidgets [as 别名]
# 或者: from PySide2.QtWidgets import QHBoxLayout [as 别名]
def __init__(self, *args):
QtWidgets.QFrame.__init__(self, *args)
self.setFrameStyle(QtWidgets.QFrame.StyledPanel | QtWidgets.QFrame.Sunken)
self.edit = self.PlainTextEdit()
self.number_bar = self.NumberBar(self.edit)
hbox = QtWidgets.QHBoxLayout(self)
hbox.setSpacing(0)
hbox.setContentsMargins(0,0,0,0) # setMargin
hbox.addWidget(self.number_bar)
hbox.addWidget(self.edit)
self.edit.blockCountChanged.connect(self.number_bar.adjustWidth)
self.edit.updateRequest.connect(self.number_bar.updateContents)
示例7: setupUi
# 需要导入模块: from PySide2 import QtWidgets [as 别名]
# 或者: from PySide2.QtWidgets import QHBoxLayout [as 别名]
def setupUi(self, onionSkinObject_layout):
onionSkinObject_layout.setObjectName("onionSkinObject_layout")
onionSkinObject_layout.resize(204, 38)
self.horizontalLayout = QtWidgets.QHBoxLayout(onionSkinObject_layout)
self.horizontalLayout.setSpacing(3)
self.horizontalLayout.setContentsMargins(4, 2, 4, 2)
self.horizontalLayout.setObjectName("horizontalLayout")
self.object_label = QtWidgets.QLabel(onionSkinObject_layout)
self.object_label.setObjectName("object_label")
self.horizontalLayout.addWidget(self.object_label)
self.object_remove_btn = QtWidgets.QPushButton(onionSkinObject_layout)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.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)
示例8: __init__
# 需要导入模块: from PySide2 import QtWidgets [as 别名]
# 或者: from PySide2.QtWidgets import QHBoxLayout [as 别名]
def __init__(self, parent, name, view):
try:
QWidget.__init__(self, parent)
DockContextHandler.__init__(self, self, name)
view.session_data['emulator.memory.dockWidget'] = self
self.view = view
self.layout = QHBoxLayout(self)
dock_handler = DockHandler.getActiveDockHandler()
dock_handler.setVisible('Emulator Memory View', False)
except Exception as e:
print(e)
示例9: _init_widgets
# 需要导入模块: from PySide2 import QtWidgets [as 别名]
# 或者: from PySide2.QtWidgets import QHBoxLayout [as 别名]
def _init_widgets(self):
import angr, claripy, cle
namespace = {
'angr': angr,
'claripy': claripy,
'cle': cle,
}
try:
ipython_widget = QIPythonWidget(namespace=namespace)
except MultipleInstanceError:
_l.warning("Fails to load the Console view since an IPython interpreter has already been loaded. "
"You might be running angr Management with IPython.")
return
self._ipython_widget = ipython_widget
hlayout = QHBoxLayout()
hlayout.addWidget(ipython_widget)
self.setLayout(hlayout)
示例10: _init_widgets
# 需要导入模块: from PySide2 import QtWidgets [as 别名]
# 或者: from PySide2.QtWidgets import QHBoxLayout [as 别名]
def _init_widgets(self):
lbl_function = QLabel(self)
lbl_function.setText("Function")
self._function_list = QFunctionComboBox(show_all_functions=True, selection_callback=self._on_function_selected,
parent=self
)
function_layout = QHBoxLayout()
function_layout.addWidget(lbl_function)
function_layout.addWidget(self._function_list)
self._string_table = QStringTable(self, selection_callback=self._on_string_selected)
layout = QVBoxLayout()
layout.addLayout(function_layout)
layout.addWidget(self._string_table)
layout.setContentsMargins(0, 0, 0, 0)
self.setLayout(layout)
示例11: _init_widgets
# 需要导入模块: from PySide2 import QtWidgets [as 别名]
# 或者: from PySide2.QtWidgets import QHBoxLayout [as 别名]
def _init_widgets(self):
# xref viewer
xref_viewer = QXRefViewer(
addr=self._addr, variable_manager=self._variable_manager, variable=self._variable,
xrefs_manager=self._xrefs_manager, dst_addr=self._dst_addr,
instance=self._instance, disassembly_view=self._disassembly_view, parent=self,
)
# buttons
btn_ok = QPushButton('OK')
btn_close = QPushButton('Close')
btn_close.clicked.connect(self._on_close_clicked)
buttons_layout = QHBoxLayout()
buttons_layout.addWidget(btn_ok)
buttons_layout.addWidget(btn_close)
layout = QVBoxLayout()
layout.addWidget(xref_viewer)
layout.addLayout(buttons_layout)
self.setLayout(layout)
示例12: _init_widgets
# 需要导入模块: from PySide2 import QtWidgets [as 别名]
# 或者: from PySide2.QtWidgets import QHBoxLayout [as 别名]
def _init_widgets(self):
layout = QHBoxLayout()
ast_label = QLabel(self)
self._ast_label = ast_label
if self._display_size:
size_label = QLabel(self)
size_label.setProperty('class', 'ast_viewer_size')
size_label.setAlignment(Qt.AlignRight)
size_label.setMaximumSize(QSize(24, 65536))
self._size_label = size_label
layout.addWidget(self._size_label)
if self._ast is not None:
self.reload()
layout.addWidget(ast_label)
layout.setContentsMargins(0, 0, 0, 0)
self.setLayout(layout)
示例13: __init__
# 需要导入模块: from PySide2 import QtWidgets [as 别名]
# 或者: from PySide2.QtWidgets import QHBoxLayout [as 别名]
def __init__(self, parent, name, data):
if not type(data) == binaryninja.binaryview.BinaryView:
raise Exception('expected widget data to be a BinaryView')
self.bv = data
QWidget.__init__(self, parent)
DockContextHandler.__init__(self, self, name)
self.actionHandler = UIActionHandler()
self.actionHandler.setupActionHandler(self)
layout = QVBoxLayout()
self.consoleText = QTextEdit(self)
self.consoleText.setReadOnly(True)
self.consoleText.setFont(getMonospaceFont(self))
layout.addWidget(self.consoleText, 1)
inputLayout = QHBoxLayout()
inputLayout.setContentsMargins(4, 4, 4, 4)
promptLayout = QVBoxLayout()
promptLayout.setContentsMargins(0, 5, 0, 5)
inputLayout.addLayout(promptLayout)
self.consoleEntry = QLineEdit(self)
inputLayout.addWidget(self.consoleEntry, 1)
self.entryLabel = QLabel("dbg>>> ", self)
self.entryLabel.setFont(getMonospaceFont(self))
promptLayout.addWidget(self.entryLabel)
promptLayout.addStretch(1)
self.consoleEntry.returnPressed.connect(lambda: self.sendLine())
layout.addLayout(inputLayout)
layout.setContentsMargins(0, 0, 0, 0)
layout.setSpacing(0)
self.setLayout(layout)
示例14: createWritingTweetGroupBox
# 需要导入模块: from PySide2 import QtWidgets [as 别名]
# 或者: from PySide2.QtWidgets import QHBoxLayout [as 别名]
def createWritingTweetGroupBox(self):
self.tweet_button = QtWidgets.QPushButton("Write a new tweet")
self.tweet_button.setMaximumSize(200,40)
self.write_button_layout = QtWidgets.QHBoxLayout()
self.write_button_layout.addWidget(self.tweet_button)
self.connect(self.tweet_button, QtCore.SIGNAL('clicked()'), self.writeANewTweet)
示例15: open_error_dialog
# 需要导入模块: from PySide2 import QtWidgets [as 别名]
# 或者: from PySide2.QtWidgets import QHBoxLayout [as 别名]
def open_error_dialog(self):
error_dialog = QDialog(self)
label = QLabel()
label.setText('Sorry...\nNot support this apk.')
layout = QHBoxLayout()
layout.addWidget(label)
error_dialog.setLayout(layout)
error_dialog.show()