本文整理汇总了Python中PySide2.QtCore.Qt.AlignCenter方法的典型用法代码示例。如果您正苦于以下问题:Python Qt.AlignCenter方法的具体用法?Python Qt.AlignCenter怎么用?Python Qt.AlignCenter使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PySide2.QtCore.Qt
的用法示例。
在下文中一共展示了Qt.AlignCenter方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from PySide2.QtCore import Qt [as 别名]
# 或者: from PySide2.QtCore.Qt import AlignCenter [as 别名]
def __init__(self):
super(_HomeTab, self).__init__()
self._layout = QHBoxLayout()
self.setLayout(self._layout)
message_label = QLabel("""\
Welcome to <b>EvilOSX</b>:<br/>
An evil RAT (Remote Administration Tool) for macOS / OS X.<br/><br/><br/>
Author: Marten4n6<br/>
License: GPLv3<br/>
Version: <b>{}</b>
""".format(VERSION))
logo_label = QLabel()
logo_path = path.join(path.dirname(__file__), path.pardir, path.pardir, "data", "images", "logo_334x600.png")
logo_label.setPixmap(QPixmap(logo_path))
self._layout.setAlignment(Qt.AlignCenter)
self._layout.setSpacing(50)
self._layout.addWidget(message_label)
self._layout.addWidget(logo_label)
示例2: __init__
# 需要导入模块: from PySide2.QtCore import Qt [as 别名]
# 或者: from PySide2.QtCore.Qt import AlignCenter [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
示例3: __init__
# 需要导入模块: from PySide2.QtCore import Qt [as 别名]
# 或者: from PySide2.QtCore.Qt import AlignCenter [as 别名]
def __init__(self, parent=None):
super(SendWidget, self).__init__(parent)
self.token_name = 'Ethereum'
self.setupSenderSection()
self.setupDestinationSection()
self.setupTokenSection()
self.setupProgressSection()
self.setupSendButtonSection()
self.setupFeeSection()
self.send_thread = SendThread()
self.send_thread.send_transaction.connect(self.sendTransactionFinished)
self.send_token_thread = SendTokenThread()
self.send_token_thread.send_token_transaction.connect(self.sendTransactionFinished)
layout = QGridLayout()
layout.addLayout(self.sender_layout, 0, 0)
layout.addLayout(self.destination_layout, 0, 1)
layout.addLayout(self.progress_layout, 1, 0, 1, 2, Qt.AlignCenter)
layout.addLayout(self.token_layout, 2, 0)
layout.addLayout(self.send_layout, 2, 1)
layout.addLayout(self.slider_layout, 3, 0)
self.setLayout(layout)
示例4: __init__
# 需要导入模块: from PySide2.QtCore import Qt [as 别名]
# 或者: from PySide2.QtCore.Qt import AlignCenter [as 别名]
def __init__(self):
super().__init__()
self.setAlignment(Qt.AlignCenter | Qt.AlignCenter)
示例5: centered_text
# 需要导入模块: from PySide2.QtCore import Qt [as 别名]
# 或者: from PySide2.QtCore.Qt import AlignCenter [as 别名]
def centered_text(txt):
item = RatioWidgetItem(txt)
item.setTextAlignment(Qt.AlignCenter)
return item
示例6: _init_widgets
# 需要导入模块: from PySide2.QtCore import Qt [as 别名]
# 或者: from PySide2.QtCore.Qt import AlignCenter [as 别名]
def _init_widgets(self):
# icon
icon_label = QLabel(self)
icon_location = os.path.join(IMG_LOCATION, 'angr-ds.png')
angr_icon = QPixmap(icon_location)
icon_label.setPixmap(angr_icon)
# textbox
angr_text = QLabel("angr")
angr_text.setFont(QFont("Consolas", 24, weight=QFont.Bold))
version_text_tup = "Version: " + ".".join(str(x) for x in angr.__version__[0:4])
version_text = QLabel(version_text_tup)
version_text.setFont(QFont("Consolas", weight=QFont.Bold))
version_text.setAlignment(Qt.AlignCenter)
credits_text = QLabel("<a href=\"http://angr.io/\">Credits</a>")
credits_text.setFont(QFont("Consolas", weight=QFont.Bold))
credits_text.setTextFormat(Qt.RichText)
credits_text.setTextInteractionFlags(Qt.TextBrowserInteraction)
credits_text.setOpenExternalLinks(True)
# buttons
btn_ok = QPushButton('OK')
btn_ok.clicked.connect(self._on_close_clicked)
buttons_layout = QHBoxLayout()
buttons_layout.addWidget(btn_ok)
structure = QVBoxLayout()
structure.addWidget(angr_text)
structure.addWidget(version_text)
structure.addWidget(credits_text)
structure.addLayout(buttons_layout)
layout = QHBoxLayout()
layout.addWidget(icon_label)
layout.addLayout(structure)
self.setLayout(layout)
#
# Event handlers
#