本文整理汇总了Python中PyQt5.QtWidgets.QVBoxLayout.addSpacing方法的典型用法代码示例。如果您正苦于以下问题:Python QVBoxLayout.addSpacing方法的具体用法?Python QVBoxLayout.addSpacing怎么用?Python QVBoxLayout.addSpacing使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt5.QtWidgets.QVBoxLayout
的用法示例。
在下文中一共展示了QVBoxLayout.addSpacing方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from PyQt5.QtWidgets import QVBoxLayout [as 别名]
# 或者: from PyQt5.QtWidgets.QVBoxLayout import addSpacing [as 别名]
def __init__(self):
"""The constructor initializes the class NewVariantDialog."""
super().__init__()
# information about sales tax
self.taxHeadline = QLabel()
self.taxHint = QLabel(wordWrap=True)
# information about associated employer outlay
self.outlayHeadline = QLabel()
self.outlayHint = QLabel(wordWrap=True)
# create an ok button and abort button within a button box
line = QFrame(frameShadow=QFrame.Sunken, frameShape=QFrame.HLine)
button = QDialogButtonBox(QDialogButtonBox.Ok)
# create the dialog layout
layout = QVBoxLayout(self)
layout.addWidget(self.taxHeadline)
layout.addWidget(self.taxHint)
layout.addSpacing(15)
layout.addWidget(self.outlayHeadline)
layout.addWidget(self.outlayHint)
layout.addWidget(line)
layout.addWidget(button)
# connect the button action
button.accepted.connect(self.accept)
# translate the graphical user interface
self.retranslateUi()
示例2: LP_LibraryPanel
# 需要导入模块: from PyQt5.QtWidgets import QVBoxLayout [as 别名]
# 或者: from PyQt5.QtWidgets.QVBoxLayout import addSpacing [as 别名]
class LP_LibraryPanel(FFrame):
def __init__(self, app, parent=None):
super().__init__(parent)
self._app = app
self.header = LP_GroupHeader(self._app, '我的音乐')
self.current_playlist_item = LP_GroupItem(self._app, '当前播放列表')
self.current_playlist_item.set_img_text('❂')
self._layout = QVBoxLayout(self)
self.setObjectName('lp_library_panel')
self.set_theme_style()
self.setup_ui()
def set_theme_style(self):
theme = self._app.theme_manager.current_theme
style_str = '''
#{0} {{
background: transparent;
}}
'''.format(self.objectName(),
theme.color3.name())
self.setStyleSheet(style_str)
def setup_ui(self):
self._layout.setContentsMargins(0, 0, 0, 0)
self._layout.setSpacing(0)
self._layout.addSpacing(3)
self._layout.addWidget(self.header)
self._layout.addWidget(self.current_playlist_item)
def add_item(self, item):
self._layout.addWidget(item)
示例3: __init__
# 需要导入模块: from PyQt5.QtWidgets import QVBoxLayout [as 别名]
# 或者: from PyQt5.QtWidgets.QVBoxLayout import addSpacing [as 别名]
def __init__(self, Wizard, parent=None):
super(BuildPage, self).__init__(parent)
self.base = Wizard.base
self.Wizard = Wizard # Main wizard of program
self.nextPageIsFinal = True # BOOL to determine which page is next one
self.setTitle(self.tr("Build page"))
self.setSubTitle(self.tr("Options to build"))
self.buildToButton = QPushButton("Build to")
self.buildToButton.clicked.connect(self.openBuildPathFileDialog)
self.uploadToCOPR_Button = QPushButton("Upload to COPR")
self.editSpecButton = QPushButton("Edit SPEC file")
self.uploadToCOPR_Button.clicked.connect(self.switchToCOPR)
self.uploadToCOPR_Button.clicked.connect(self.Wizard.next)
specWarningLabel = QLabel("* Edit SPEC file on your own risk")
self.buildLocationEdit = QLineEdit()
mainLayout = QVBoxLayout()
midleLayout = QHBoxLayout()
lowerLayout = QHBoxLayout()
midleLayout.addWidget(self.editSpecButton)
midleLayout.addWidget(specWarningLabel)
midleLayout.addSpacing(330)
midleLayout.addWidget(self.uploadToCOPR_Button)
lowerLayout.addWidget(self.buildToButton)
lowerLayout.addWidget(self.buildLocationEdit)
mainLayout.addSpacing(60)
mainLayout.addLayout(midleLayout)
mainLayout.addSpacing(10)
mainLayout.addLayout(lowerLayout)
self.setLayout(mainLayout)
示例4: __init__
# 需要导入模块: from PyQt5.QtWidgets import QVBoxLayout [as 别名]
# 或者: from PyQt5.QtWidgets.QVBoxLayout import addSpacing [as 别名]
def __init__(self, url, color):
QWidget.__init__(self)
self.setStyleSheet("background-color: black")
self.file_name_font = QFont()
self.file_name_font.setPointSize(24)
self.file_name_label = QLabel(self)
self.file_name_label.setText(url)
self.file_name_label.setFont(self.file_name_font)
self.file_name_label.setAlignment(Qt.AlignCenter)
self.file_name_label.setStyleSheet("color: #eee")
self.qrcode_label = QLabel(self)
self.notify_font = QFont()
self.notify_font.setPointSize(12)
self.notify_label = QLabel(self)
self.notify_label.setText("Scan above QR to copy information")
self.notify_label.setFont(self.notify_font)
self.notify_label.setAlignment(Qt.AlignCenter)
self.notify_label.setStyleSheet("color: #eee")
layout = QVBoxLayout(self)
layout.setContentsMargins(0, 0, 0, 0)
layout.addStretch()
layout.addWidget(self.qrcode_label, 0, Qt.AlignCenter)
layout.addSpacing(20)
layout.addWidget(self.file_name_label, 0, Qt.AlignCenter)
layout.addSpacing(40)
layout.addWidget(self.notify_label, 0, Qt.AlignCenter)
layout.addStretch()
self.qrcode_label.setPixmap(qrcode.make(url, image_factory=Image).pixmap())
示例5: choice_and_line_dialog
# 需要导入模块: from PyQt5.QtWidgets import QVBoxLayout [as 别名]
# 或者: from PyQt5.QtWidgets.QVBoxLayout import addSpacing [as 别名]
def choice_and_line_dialog(self, title: str, message1: str, choices: List[Tuple[str, str, str]],
message2: str, test_text: Callable[[str], int],
run_next, default_choice_idx: int=0) -> Tuple[str, str]:
vbox = QVBoxLayout()
c_values = [x[0] for x in choices]
c_titles = [x[1] for x in choices]
c_default_text = [x[2] for x in choices]
def on_choice_click(clayout):
idx = clayout.selected_index()
line.setText(c_default_text[idx])
clayout = ChoicesLayout(message1, c_titles, on_choice_click,
checked_index=default_choice_idx)
vbox.addLayout(clayout.layout())
vbox.addSpacing(50)
vbox.addWidget(WWLabel(message2))
line = QLineEdit()
def on_text_change(text):
self.next_button.setEnabled(test_text(text))
line.textEdited.connect(on_text_change)
on_choice_click(clayout) # set default text for "line"
vbox.addWidget(line)
self.exec_layout(vbox, title)
choice = c_values[clayout.selected_index()]
return str(line.text()), choice
示例6: __init__
# 需要导入模块: from PyQt5.QtWidgets import QVBoxLayout [as 别名]
# 或者: from PyQt5.QtWidgets.QVBoxLayout import addSpacing [as 别名]
def __init__(self, parent):
super(CharacterDialog, self).__init__(parent)
self.setWindowTitle(_("KeepKey Seed Recovery"))
self.character_pos = 0
self.word_pos = 0
self.loop = QEventLoop()
self.word_help = QLabel()
self.char_buttons = []
vbox = QVBoxLayout(self)
vbox.addWidget(WWLabel(CHARACTER_RECOVERY))
hbox = QHBoxLayout()
hbox.addWidget(self.word_help)
for i in range(4):
char_button = CharacterButton('*')
char_button.setMaximumWidth(36)
self.char_buttons.append(char_button)
hbox.addWidget(char_button)
self.accept_button = CharacterButton(_("Accept Word"))
self.accept_button.clicked.connect(partial(self.process_key, 32))
self.rejected.connect(partial(self.loop.exit, 1))
hbox.addWidget(self.accept_button)
hbox.addStretch(1)
vbox.addLayout(hbox)
self.finished_button = QPushButton(_("Seed Entered"))
self.cancel_button = QPushButton(_("Cancel"))
self.finished_button.clicked.connect(partial(self.process_key,
Qt.Key_Return))
self.cancel_button.clicked.connect(self.rejected)
buttons = Buttons(self.finished_button, self.cancel_button)
vbox.addSpacing(40)
vbox.addLayout(buttons)
self.refresh()
self.show()
示例7: SongsTable_Container
# 需要导入模块: from PyQt5.QtWidgets import QVBoxLayout [as 别名]
# 或者: from PyQt5.QtWidgets.QVBoxLayout import addSpacing [as 别名]
class SongsTable_Container(FFrame):
def __init__(self, app, parent=None):
super().__init__(parent)
self._app = app
self.songs_table = None
self.table_control = TableControl(self._app)
self._layout = QVBoxLayout(self)
self.setup_ui()
def setup_ui(self):
self._layout.setContentsMargins(0, 0, 0, 0)
self._layout.setSpacing(0)
self._layout.addWidget(self.table_control)
def set_table(self, songs_table):
if self.songs_table:
self._layout.replaceWidget(self.songs_table, songs_table)
self.songs_table.close()
del self.songs_table
else:
self._layout.addWidget(songs_table)
self._layout.addSpacing(10)
self.songs_table = songs_table
示例8: __init__
# 需要导入模块: from PyQt5.QtWidgets import QVBoxLayout [as 别名]
# 或者: from PyQt5.QtWidgets.QVBoxLayout import addSpacing [as 别名]
def __init__(self, parent=None):
super(BasicFilterPage, self).__init__(parent)
self.blockCombo = QComboBox()
self.deviceCombo = QComboBox()
self.unitCombo = QComboBox()
self.combos = {'block': self.blockCombo, \
'device': self.deviceCombo, \
'unit': self.unitCombo}
groupLayout = QFormLayout()
groupLayout.addRow("Skupina měření:", self.blockCombo)
groupLayout.addRow("Přístroj:", self.deviceCombo)
groupLayout.addRow("Veličina:", self.unitCombo)
filterGroup = QGroupBox("Základní filtry")
filterGroup.setLayout(groupLayout)
self.deviatedValuesCheckbox = QCheckBox()
valuesLayout = QFormLayout()
valuesLayout.addRow("Mimo odchylku:", self.deviatedValuesCheckbox)
valuesGroup = QGroupBox("Hodnoty")
valuesGroup.setLayout(valuesLayout)
layout = QVBoxLayout()
layout.addWidget(filterGroup)
layout.addSpacing(12)
layout.addWidget(valuesGroup)
layout.addStretch(1)
self.setLayout(layout)
示例9: __init__
# 需要导入模块: from PyQt5.QtWidgets import QVBoxLayout [as 别名]
# 或者: from PyQt5.QtWidgets.QVBoxLayout import addSpacing [as 别名]
def __init__(self, parent, app):
super().__init__()
layout1 = QHBoxLayout()
layout2 = QVBoxLayout()
layout1.addStretch()
layout1.addLayout(layout2)
layout1.addStretch()
label = QLabel(self)
label.setText("Simple Project: <b>Display Environment Measurements on LCD</b>. Simply displays all measured values on LCD. Sources in all programming languages can be found <a href=\"http://www.tinkerforge.com/en/doc/Kits/WeatherStation/WeatherStation.html#display-environment-measurements-on-lcd\">here</a>.<br>")
label.setTextFormat(Qt.RichText)
label.setTextInteractionFlags(Qt.TextBrowserInteraction)
label.setOpenExternalLinks(True)
label.setWordWrap(True)
label.setAlignment(Qt.AlignJustify)
layout2.addSpacing(10)
layout2.addWidget(label)
layout2.addSpacing(10)
self.lcdwidget = LCDWidget(self, app)
layout2.addWidget(self.lcdwidget)
layout2.addStretch()
self.setLayout(layout1)
self.qtcb_update_illuminance.connect(self.update_illuminance_data_slot)
self.qtcb_update_air_pressure.connect(self.update_air_pressure_data_slot)
self.qtcb_update_temperature.connect(self.update_temperature_data_slot)
self.qtcb_update_humidity.connect(self.update_humidity_data_slot)
self.qtcb_button_pressed.connect(self.button_pressed_slot)
示例10: __init__
# 需要导入模块: from PyQt5.QtWidgets import QVBoxLayout [as 别名]
# 或者: from PyQt5.QtWidgets.QVBoxLayout import addSpacing [as 别名]
def __init__(self):
super(MainWindow, self).__init__()
centralWidget = QWidget()
fontLabel = QLabel("Font:")
self.fontCombo = QFontComboBox()
sizeLabel = QLabel("Size:")
self.sizeCombo = QComboBox()
styleLabel = QLabel("Style:")
self.styleCombo = QComboBox()
fontMergingLabel = QLabel("Automatic Font Merging:")
self.fontMerging = QCheckBox()
self.fontMerging.setChecked(True)
self.scrollArea = QScrollArea()
self.characterWidget = CharacterWidget()
self.scrollArea.setWidget(self.characterWidget)
self.findStyles(self.fontCombo.currentFont())
self.findSizes(self.fontCombo.currentFont())
self.lineEdit = QLineEdit()
clipboardButton = QPushButton("&To clipboard")
self.clipboard = QApplication.clipboard()
self.fontCombo.currentFontChanged.connect(self.findStyles)
self.fontCombo.activated[str].connect(self.characterWidget.updateFont)
self.styleCombo.activated[str].connect(self.characterWidget.updateStyle)
self.sizeCombo.currentIndexChanged[str].connect(self.characterWidget.updateSize)
self.characterWidget.characterSelected.connect(self.insertCharacter)
clipboardButton.clicked.connect(self.updateClipboard)
controlsLayout = QHBoxLayout()
controlsLayout.addWidget(fontLabel)
controlsLayout.addWidget(self.fontCombo, 1)
controlsLayout.addWidget(sizeLabel)
controlsLayout.addWidget(self.sizeCombo, 1)
controlsLayout.addWidget(styleLabel)
controlsLayout.addWidget(self.styleCombo, 1)
controlsLayout.addWidget(fontMergingLabel)
controlsLayout.addWidget(self.fontMerging, 1)
controlsLayout.addStretch(1)
lineLayout = QHBoxLayout()
lineLayout.addWidget(self.lineEdit, 1)
lineLayout.addSpacing(12)
lineLayout.addWidget(clipboardButton)
centralLayout = QVBoxLayout()
centralLayout.addLayout(controlsLayout)
centralLayout.addWidget(self.scrollArea, 1)
centralLayout.addSpacing(4)
centralLayout.addLayout(lineLayout)
centralWidget.setLayout(centralLayout)
self.setCentralWidget(centralWidget)
self.setWindowTitle("Character Map")
示例11: __init__
# 需要导入模块: from PyQt5.QtWidgets import QVBoxLayout [as 别名]
# 或者: from PyQt5.QtWidgets.QVBoxLayout import addSpacing [as 别名]
def __init__(self, Wizard, parent=None):
super(InstallPage, self).__init__(parent)
self.base = Wizard.base
self.setTitle(self.tr("Package installation information"))
self.setSubTitle(self.tr(
"Properties for installation of package"))
self.textLabel = QLabel()
self.textLabel.setText(
"<html><head/><body><p><span style=\"font-size:12pt;\">" +
"Please fill commands to execute before installation, " +
"how install your files and what to do after installation." +
"</p></body></html>")
pretransLabel = QLabel("%pretrans: ")
self.pretransEdit = QTextEdit()
pretransLabel.setCursor(QtGui.QCursor(QtCore.Qt.WhatsThisCursor))
pretransLabel.setToolTip("At the start of transaction")
preLabel = QLabel("%pre: ")
self.preEdit = QTextEdit()
preLabel.setCursor(QtGui.QCursor(QtCore.Qt.WhatsThisCursor))
preLabel.setToolTip("Before a package is installed")
installLabel = QLabel("%install: ")
self.installEdit = QTextEdit()
installLabel.setCursor(QtGui.QCursor(QtCore.Qt.WhatsThisCursor))
installLabel.setToolTip("Script commands to install the program")
postLabel = QLabel("%post: ")
self.postEdit = QTextEdit()
postLabel.setCursor(QtGui.QCursor(QtCore.Qt.WhatsThisCursor))
postLabel.setToolTip("After a package is installed")
mainLayout = QVBoxLayout()
grid = QGridLayout()
gridtext = QGridLayout()
grid.setVerticalSpacing(15)
gridtext.addWidget(self.textLabel, 0, 0)
grid.addWidget(pretransLabel, 1, 0, 1, 1)
grid.addWidget(self.pretransEdit, 1, 1, 1, 1)
grid.addWidget(preLabel, 2, 0, 1, 1)
grid.addWidget(self.preEdit, 2, 1, 1, 1)
grid.addWidget(installLabel, 3, 0, 1, 1)
grid.addWidget(self.installEdit, 3, 1, 1, 1)
grid.addWidget(postLabel, 4, 0, 1, 1)
grid.addWidget(self.postEdit, 4, 1, 1, 1)
mainLayout.addSpacing(25)
mainLayout.addLayout(gridtext)
mainLayout.addSpacing(15)
mainLayout.addLayout(grid)
self.setLayout(mainLayout)
示例12: __init__
# 需要导入模块: from PyQt5.QtWidgets import QVBoxLayout [as 别名]
# 或者: from PyQt5.QtWidgets.QVBoxLayout import addSpacing [as 别名]
def __init__(self, parent=None):
super().__init__(parent)
self.setObjectName("toolbar")
self.setSizePolicy(QSizePolicy.Preferred, QSizePolicy.Expanding)
self._action_layout = QVBoxLayout()
self._action_layout.setContentsMargins(0, 0, 0, 0)
spacer = QVBoxLayout(self)
spacer.addLayout(self._action_layout)
spacer.addStretch()
spacer.addSpacing(2)
spacer.setContentsMargins(0, 0, 0, 0)
示例13: setup_dialog
# 需要导入模块: from PyQt5.QtWidgets import QVBoxLayout [as 别名]
# 或者: from PyQt5.QtWidgets.QVBoxLayout import addSpacing [as 别名]
def setup_dialog(self, window):
self.wallet = window.parent().wallet
self.update_wallet_name(self.wallet)
self.user_input = False
self.d = WindowModalDialog(window, "Setup Dialog")
self.d.setMinimumWidth(500)
self.d.setMinimumHeight(210)
self.d.setMaximumHeight(320)
self.d.setContentsMargins(11,11,1,1)
self.hbox = QHBoxLayout(self.d)
vbox = QVBoxLayout()
logo = QLabel()
self.hbox.addWidget(logo)
logo.setPixmap(QPixmap(icon_path('revealer.png')))
logo.setAlignment(Qt.AlignLeft)
self.hbox.addSpacing(16)
vbox.addWidget(WWLabel("<b>"+_("Revealer Secret Backup Plugin")+"</b><br>"
+_("To encrypt your backup, first we need to load some noise.")+"<br/>"))
vbox.addSpacing(7)
bcreate = QPushButton(_("Create a new Revealer"))
bcreate.setMaximumWidth(181)
bcreate.setDefault(True)
vbox.addWidget(bcreate, Qt.AlignCenter)
self.load_noise = ScanQRTextEdit()
self.load_noise.setTabChangesFocus(True)
self.load_noise.textChanged.connect(self.on_edit)
self.load_noise.setMaximumHeight(33)
self.hbox.addLayout(vbox)
vbox.addWidget(WWLabel(_("or type an existing revealer code below and click 'next':")))
vbox.addWidget(self.load_noise)
vbox.addSpacing(3)
self.next_button = QPushButton(_("Next"), self.d)
self.next_button.setEnabled(False)
vbox.addLayout(Buttons(self.next_button))
self.next_button.clicked.connect(self.d.close)
self.next_button.clicked.connect(partial(self.cypherseed_dialog, window))
vbox.addWidget(
QLabel("<b>" + _("Warning") + "</b>: " + _("Each revealer should be used only once.")
+"<br>"+_("more information at <a href=\"https://revealer.cc/faq\">https://revealer.cc/faq</a>")))
def mk_digital():
try:
self.make_digital(self.d)
except Exception:
self.logger.exception('')
else:
self.cypherseed_dialog(window)
bcreate.clicked.connect(mk_digital)
return bool(self.d.exec_())
示例14: __init__
# 需要导入模块: from PyQt5.QtWidgets import QVBoxLayout [as 别名]
# 或者: from PyQt5.QtWidgets.QVBoxLayout import addSpacing [as 别名]
def __init__(self, parent, options):
QDialog.__init__(self, parent)
##self.setPalette(white_palette)
self.setWindowTitle(options.titre)
self.parent = parent
self.onglets = QTabWidget(self)
main_sizer = QVBoxLayout()
main_sizer.addWidget(self.onglets)
self.setLayout(main_sizer)
##dimensions_onglets = []
self.widgets = {}
for theme in options:
panel = QWidget(self.onglets)
sizer = QVBoxLayout()
self.onglets.addTab(panel, theme.titre)
for elt in theme:
if isinstance(elt, Section):
box = QGroupBox(elt.titre, panel)
bsizer = QVBoxLayout()
box.setLayout(bsizer)
bsizer.addSpacing(3)
for parametre in elt:
if isinstance(parametre, Parametre):
psizer = self.ajouter_parametre(parametre, panel, sizer)
bsizer.addLayout(psizer)
elif isinstance(parametre, str):
bsizer.addWidget(QLabel(parametre))
else:
raise NotImplementedError(repr(type(elt)))
bsizer.addSpacing(3)
sizer.addWidget(box)
elif isinstance(elt, Parametre):
psizer = self.ajouter_parametre(elt, panel, sizer)
sizer.addLayout(psizer)
elif isinstance(elt, str):
sizer.addWidget(QLabel(elt))
else:
raise NotImplementedError(repr(type(elt)))
boutons = QHBoxLayout()
ok = QPushButton('OK', clicked=self.ok)
boutons.addWidget(ok)
defaut = QPushButton("Défaut", clicked=self.defaut)
boutons.addWidget(defaut)
annuler = QPushButton("Annuler", clicked=self.close)
boutons.addWidget(annuler)
sizer.addStretch()
sizer.addLayout(boutons)
panel.setLayout(sizer)
示例15: __init__
# 需要导入模块: from PyQt5.QtWidgets import QVBoxLayout [as 别名]
# 或者: from PyQt5.QtWidgets.QVBoxLayout import addSpacing [as 别名]
def __init__(self, map_limits, fig_names, fig_queues):
QMainWindow.__init__(self)
self.setAttribute(Qt.WA_DeleteOnClose)
# self.setWindowTitle("application main window")
self.main_widget = QWidget(self)
self.main_widget.setStyleSheet("* { background-color: white }")
grid = QVBoxLayout(self.main_widget)
grid.setContentsMargins(0, 0, 0, 0)
grid.setSpacing(0)
self.dc = []
self.information_getters = []
self.fig_queues = fig_queues
self.shutdown = Event()
for i in range(len(fig_names)):
shared_object = shared_zeros(map_limits["width"], map_limits["height"])
self.information_getters.append(InformationGetter(queue=fig_queues[i],
shared_object=shared_object,
shutdown=self.shutdown))
self.dc.append(DynamicMplCanvas(self.main_widget, data=shared_object, width=5, height=4,
dpi=100))
label = QLabel(fig_names[i])
label.setStyleSheet("QLabel { background-color: white }")
label.setAlignment(Qt.AlignCenter)
grid.addWidget(label)
grid.addWidget(self.dc[i])
grid.addSpacing(20)
for i in self.information_getters:
i.start()
self.main_widget.setFocus()
self.setCentralWidget(self.main_widget)
timer = QTimer(self)
timer.timeout.connect(self.update_display)
timer.setInterval(0)
timer.start()
self.show()