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


Python QtWidgets.QVBoxLayout方法代码示例

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


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

示例1: __init__

# 需要导入模块: from PySide2 import QtWidgets [as 别名]
# 或者: from PySide2.QtWidgets import QVBoxLayout [as 别名]
def __init__(self, parent=None):
        super(HotboxGeneralInfosWidget, self).__init__(parent)
        self.setFixedWidth(200)
        self.label = QtWidgets.QLabel()
        self.open_command = CommandButton('show')
        self.close_command = CommandButton('hide')
        self.switch_command = CommandButton('switch')

        self.layout = QtWidgets.QVBoxLayout(self)
        self.layout.setContentsMargins(0, 0, 0, 0)
        self.layout.setSpacing(0)
        self.layout.addWidget(Title('Infos'))
        self.layout.addSpacing(8)
        self.layout.addWidget(self.label)
        self.layout.addSpacing(8)
        self.layout.addStretch(1)
        self.layout.addWidget(Title('Commands'))
        self.layout.addSpacing(8)
        self.layout.addWidget(self.open_command)
        self.layout.addWidget(self.close_command)
        self.layout.addWidget(self.switch_command) 
开发者ID:luckylyk,项目名称:hotbox_designer,代码行数:23,代码来源:manager.py

示例2: __init__

# 需要导入模块: from PySide2 import QtWidgets [as 别名]
# 或者: from PySide2.QtWidgets import QVBoxLayout [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) 
开发者ID:luckylyk,项目名称:hotbox_designer,代码行数:19,代码来源:dialog.py

示例3: __init__

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

        self.button = QPushButton("button")
        self.button.clicked.connect(self.buttonClicked)

        self.label = QLabel("label: before clicked")

        layout = QVBoxLayout()
        layout.addWidget(self.button)
        layout.addWidget(self.label)

        self.setLayout(layout)

        self.long_process_thread = LongProcessThread()
        self.long_process_thread.transaction.connect(self.afterLongProcess) 
开发者ID:PacktPublishing,项目名称:Hands-On-Blockchain-for-Python-Developers,代码行数:18,代码来源:button_and_long_process.py

示例4: __init__

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

        button1 = QPushButton("button default")
        button2 = QPushButton("button maximum")
        button2.setSizePolicy(QSizePolicy.Maximum, QSizePolicy.Maximum)
        button3 = QPushButton("button preferred")
        button3.setSizePolicy(QSizePolicy.Preferred, QSizePolicy.Preferred)
        button4 = QPushButton("button expanding")
        button4.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding)
        button5 = QPushButton("button minimum")
        button5.setSizePolicy(QSizePolicy.Minimum, QSizePolicy.Minimum)
        button6 = QPushButton("button minimum expanding")
        button6.setSizePolicy(QSizePolicy.MinimumExpanding, QSizePolicy.MinimumExpanding)

        layout = QVBoxLayout()
        layout.addWidget(button1)
        layout.addWidget(button2)
        layout.addWidget(button3)
        layout.addWidget(button4)
        layout.addWidget(button5)
        layout.addWidget(button6)

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

示例5: __init__

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

        self.createPrivateKeyGroupBox()
        self.createWritingTweetGroupBox()
        self.createTweetsGroupBox()
        self.createBookmarkGroupBox()

        self.setWindowTitle("Twitter-Like Blockchain Dapp")

        mainLayout = QtWidgets.QVBoxLayout()
        mainLayout.addWidget(self.private_key_group_box)
        mainLayout.addLayout(self.write_button_layout)
        mainLayout.addWidget(self.tweets_group_box)
        mainLayout.addWidget(self.bookmark_group_box)

        self.setLayout(mainLayout)

        self.web3_read_tweets_thread = Web3ReadTweetsThread()
        self.web3_read_tweets_thread.fetched_posts.connect(self.fillPosts)
        self.web3_write_a_tweet_thread = Web3WriteATweetThread()
        self.web3_write_a_tweet_thread.write_a_tweet.connect(self.successfullyWriteATweet) 
开发者ID:PacktPublishing,项目名称:Hands-On-Blockchain-for-Python-Developers,代码行数:24,代码来源:twitter_dapp.py

示例6: createTweetsGroupBox

# 需要导入模块: from PySide2 import QtWidgets [as 别名]
# 或者: from PySide2.QtWidgets import QVBoxLayout [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) 
开发者ID:PacktPublishing,项目名称:Hands-On-Blockchain-for-Python-Developers,代码行数:24,代码来源:twitter_dapp.py

示例7: setupUi

# 需要导入模块: from PySide2 import QtWidgets [as 别名]
# 或者: from PySide2.QtWidgets import QVBoxLayout [as 别名]
def setupUi(self, Form):
        Form.setObjectName("Form")
        Form.resize(300, 150)
        self.verticalLayout = QtWidgets.QVBoxLayout(Form)
        self.verticalLayout.setObjectName("verticalLayout")
        self.btnCreateSphere = QtWidgets.QPushButton(Form)
        self.btnCreateSphere.setObjectName("btnCreateSphere")
        self.verticalLayout.addWidget(self.btnCreateSphere)
        self.btnCallCppPlugin = QtWidgets.QPushButton(Form)
        self.btnCallCppPlugin.setObjectName("btnCallCppPlugin")
        self.verticalLayout.addWidget(self.btnCallCppPlugin)
        self.btnCallCSPlugin = QtWidgets.QPushButton(Form)
        self.btnCallCSPlugin.setObjectName("btnCallCSPlugin")
        self.verticalLayout.addWidget(self.btnCallCSPlugin)

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

示例8: setupUi

# 需要导入模块: from PySide2 import QtWidgets [as 别名]
# 或者: from PySide2.QtWidgets import QVBoxLayout [as 别名]
def setupUi(self, TabItemWindow):
        TabItemWindow.setObjectName("TabItemWindow")
        TabItemWindow.resize(400, 300)
        self.verticalLayout = QtWidgets.QVBoxLayout(TabItemWindow)
        self.verticalLayout.setSpacing(0)
        self.verticalLayout.setContentsMargins(0, 0, 0, 0)
        self.verticalLayout.setObjectName("verticalLayout")
        self.tableWidget = QtWidgets.QTableWidget(TabItemWindow)
        self.tableWidget.setColumnCount(1)
        self.tableWidget.setObjectName("tableWidget")
        self.tableWidget.setColumnCount(1)
        self.tableWidget.setRowCount(0)
        self.tableWidget.horizontalHeader().setVisible(False)
        self.tableWidget.horizontalHeader().setStretchLastSection(True)
        self.tableWidget.verticalHeader().setDefaultSectionSize(24)
        self.tableWidget.verticalHeader().setHighlightSections(False)
        self.verticalLayout.addWidget(self.tableWidget)

        self.retranslateUi(TabItemWindow)
        QtCore.QMetaObject.connectSlotsByName(TabItemWindow) 
开发者ID:yukiarrr,项目名称:Il2cppSpy,代码行数:22,代码来源:ui_tabitemwindow.py

示例9: __init__

# 需要导入模块: from PySide2 import QtWidgets [as 别名]
# 或者: from PySide2.QtWidgets import QVBoxLayout [as 别名]
def __init__(self, viewer: QRemoteDesktop, parent: QWidget = None):
        """
        :param viewer: the RDP viewer widget
        :param parent: the parent widget
        """
        super().__init__(parent, Qt.WindowFlags())
        self.widget = viewer

        self.writeInCaps = False
        self.text = QTextEdit()
        self.text.setReadOnly(True)
        self.text.setMinimumHeight(150)
        self.log = logging.getLogger(LOGGER_NAMES.PLAYER)

        self.tabLayout = QVBoxLayout()

        self.scrollViewer = QScrollArea()
        self.scrollViewer.setWidget(self.widget)

        self.tabLayout.addWidget(self.scrollViewer, 10)
        self.tabLayout.addWidget(self.text, 2)

        self.setLayout(self.tabLayout) 
开发者ID:GoSecure,项目名称:pyrdp,代码行数:25,代码来源:BaseTab.py

示例10: quickLayout

# 需要导入模块: from PySide2 import QtWidgets [as 别名]
# 或者: from PySide2.QtWidgets import QVBoxLayout [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

示例11: quickMsg

# 需要导入模块: from PySide2 import QtWidgets [as 别名]
# 或者: from PySide2.QtWidgets import QVBoxLayout [as 别名]
def quickMsg(self, msg, block=1):
        tmpMsg = QtWidgets.QMessageBox(self) # for simple msg that no need for translation
        tmpMsg.setWindowTitle("Info")
        lineCnt = len(msg.split('\n'))
        if lineCnt > 25:
            scroll = QtWidgets.QScrollArea()
            scroll.setWidgetResizable(1)
            content = QtWidgets.QWidget()
            scroll.setWidget(content)
            layout = QtWidgets.QVBoxLayout(content)
            tmpLabel = QtWidgets.QLabel(msg)
            tmpLabel.setTextInteractionFlags(QtCore.Qt.TextSelectableByMouse)
            layout.addWidget(tmpLabel)
            tmpMsg.layout().addWidget(scroll, 0, 0, 1, tmpMsg.layout().columnCount())
            tmpMsg.setStyleSheet("QScrollArea{min-width:600 px; min-height: 400px}")
        else:
            tmpMsg.setText(msg)
        if block == 0:
            tmpMsg.setWindowModality( QtCore.Qt.NonModal )
        tmpMsg.addButton("OK",QtWidgets.QMessageBox.YesRole)
        if block:
            tmpMsg.exec_()
        else:
            tmpMsg.show() 
开发者ID:shiningdesign,项目名称:universal_tool_template.py,代码行数:26,代码来源:universal_tool_template_1115.py

示例12: setupUi

# 需要导入模块: from PySide2 import QtWidgets [as 别名]
# 或者: from PySide2.QtWidgets import QVBoxLayout [as 别名]
def setupUi(self, Dialog):
        Dialog.setObjectName("Dialog")
        Dialog.resize(400, 300)
        self.verticalLayout = QtWidgets.QVBoxLayout(Dialog)
        self.verticalLayout.setObjectName("verticalLayout")
        self.label = QtWidgets.QLabel(Dialog)
        self.label.setObjectName("label")
        self.verticalLayout.addWidget(self.label)
        self.plainTextEdit = QtWidgets.QPlainTextEdit(Dialog)
        self.plainTextEdit.setObjectName("plainTextEdit")
        self.verticalLayout.addWidget(self.plainTextEdit)
        self.buttonBox = QtWidgets.QDialogButtonBox(Dialog)
        self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
        self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Cancel|QtWidgets.QDialogButtonBox.Ok)
        self.buttonBox.setObjectName("buttonBox")
        self.verticalLayout.addWidget(self.buttonBox)

        self.retranslateUi(Dialog)
        QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL("accepted()"), Dialog.accept)
        QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL("rejected()"), Dialog.reject)
        QtCore.QMetaObject.connectSlotsByName(Dialog) 
开发者ID:eoyilmaz,项目名称:anima,代码行数:23,代码来源:multiLineInputDialog_UI_pyside2.py

示例13: _init_widgets

# 需要导入模块: from PySide2 import QtWidgets [as 别名]
# 或者: from PySide2.QtWidgets import QVBoxLayout [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) 
开发者ID:angr,项目名称:angr-management,代码行数:21,代码来源:strings_view.py

示例14: _init_widgets

# 需要导入模块: from PySide2 import QtWidgets [as 别名]
# 或者: from PySide2.QtWidgets import QVBoxLayout [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) 
开发者ID:angr,项目名称:angr-management,代码行数:26,代码来源:xref.py

示例15: __init__

# 需要导入模块: from PySide2 import QtWidgets [as 别名]
# 或者: from PySide2.QtWidgets import QVBoxLayout [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) 
开发者ID:Vector35,项目名称:debugger,代码行数:41,代码来源:ConsoleWidget.py


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