本文整理汇总了Python中PyQt5.QtCore.Qt.Window方法的典型用法代码示例。如果您正苦于以下问题:Python Qt.Window方法的具体用法?Python Qt.Window怎么用?Python Qt.Window使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt5.QtCore.Qt
的用法示例。
在下文中一共展示了Qt.Window方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import Window [as 别名]
def __init__(self, icon: str, parent=None):
super(Notification, self).__init__(parent)
self.parent = parent
self.theme = self.parent.theme
self.setObjectName('notification')
self.setContentsMargins(10, 10, 10, 10)
self.setModal(True)
self.setWindowFlags(Qt.Window | Qt.Dialog | Qt.FramelessWindowHint)
self.setMinimumWidth(550)
self.shown.connect(lambda: QTimer.singleShot(self.duration * 1000, self.close))
self._title, self._message = '', ''
self.buttons = []
self.msgLabel = QLabel(self._message, self)
self.msgLabel.setWordWrap(True)
logo_label = QLabel('<img src="{}" width="82" />'.format(icon), self)
logo_label.setFixedSize(82, 82)
self.left_layout = QVBoxLayout()
self.left_layout.addWidget(logo_label)
layout = QHBoxLayout()
layout.addStretch(1)
layout.addLayout(self.left_layout)
layout.addSpacing(10)
layout.addWidget(self.msgLabel, Qt.AlignVCenter)
layout.addStretch(1)
self.setLayout(layout)
示例2: vistaPrevia
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import Window [as 别名]
def vistaPrevia(self):
if not self.documento.isEmpty():
impresion = QPrinter(QPrinter.HighResolution)
vista = QPrintPreviewDialog(impresion, self)
vista.setWindowTitle("Vista previa")
vista.setWindowFlags(Qt.Window)
vista.resize(800, 600)
exportarPDF = vista.findChildren(QToolBar)
exportarPDF[0].addAction(QIcon("exportarPDF.png"), "Exportar a PDF", self.exportarPDF)
vista.paintRequested.connect(self.vistaPreviaImpresion)
vista.exec_()
else:
QMessageBox.critical(self, "Vista previa", "No hay datos para visualizar. ",
QMessageBox.Ok)
示例3: initUI
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import Window [as 别名]
def initUI(self):
self.confirm_button = QPushButton()
self.headline = QFont("Arial", 10, QFont.Bold)
self.elementInfo = QLabel()
self.elementInfo.setFont(self.headline)
self.exceptionMessage = QTextEdit()
self.exceptionMessage.setReadOnly(True)
self.setMinimumSize(400, 300)
self.setWindowFlags(Qt.Window)
self.exceptWindowLayout = QVBoxLayout()
self.exceptWindowLayout.addWidget(self.elementInfo)
self.exceptWindowLayout.addWidget(self.exceptionMessage)
self.exceptWindowLayout.addStretch(1)
self.exceptWindowLayout.addWidget(self.confirm_button)
self.confirm_button.clicked.connect(self.close)
self.setLayout(self.exceptWindowLayout)
示例4: __init__
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import Window [as 别名]
def __init__(self, *args, **kwargs):
super(Window, self).__init__(*args, **kwargs)
# 主屏幕的可用大小(去掉任务栏)
self._rect = QApplication.instance().desktop().availableGeometry(self)
self.resize(800, 600)
self.setWindowFlags(Qt.Window
| Qt.FramelessWindowHint
| Qt.WindowSystemMenuHint
| Qt.WindowMinimizeButtonHint
| Qt.WindowMaximizeButtonHint
| Qt.WindowCloseButtonHint)
# 增加薄边框
style = win32gui.GetWindowLong(int(self.winId()), win32con.GWL_STYLE)
win32gui.SetWindowLong(
int(self.winId()), win32con.GWL_STYLE, style | win32con.WS_THICKFRAME)
if QtWin.isCompositionEnabled():
# 加上 Aero 边框阴影
QtWin.extendFrameIntoClientArea(self, -1, -1, -1, -1)
else:
QtWin.resetExtendedFrame(self)
示例5: __init__
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import Window [as 别名]
def __init__(self, filename="", parent=None):
super().__init__(parent)
self.ui = Ui_DialogCSVImport()
self.ui.setupUi(self)
self.setAttribute(Qt.WA_DeleteOnClose)
self.setWindowFlags(Qt.Window)
self.ui.btnAutoDefault.hide()
completer = QCompleter()
completer.setModel(QDirModel(completer))
self.ui.lineEditFilename.setCompleter(completer)
self.filename = None # type: str
self.ui.lineEditFilename.setText(filename)
self.update_file()
self.ui.tableWidgetPreview.setColumnHidden(self.COLUMNS["T"], True)
self.update_preview()
self.create_connects()
示例6: __init__
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import Window [as 别名]
def __init__(self, parent=None):
super().__init__(parent)
self.ui = Ui_DialogFilterBandwidth()
self.ui.setupUi(self)
self.setWindowFlags(Qt.Window)
bw_type = settings.read("bandpass_filter_bw_type", "Medium", str)
custom_bw = settings.read("bandpass_filter_custom_bw", 0.1, float)
for item in dir(self.ui):
item = getattr(self.ui, item)
if isinstance(item, QLabel):
name = item.objectName().replace("label", "")
key = next((key for key in Filter.BANDWIDTHS.keys() if name.startswith(key.replace(" ", ""))), None)
if key is not None and name.endswith("Bandwidth"):
item.setText("{0:n}".format(Filter.BANDWIDTHS[key]))
elif key is not None and name.endswith("KernelLength"):
item.setText(str(Filter.get_filter_length_from_bandwidth(Filter.BANDWIDTHS[key])))
elif isinstance(item, QRadioButton):
item.setChecked(bw_type.replace(" ", "_") == item.objectName().replace("radioButton", ""))
self.ui.doubleSpinBoxCustomBandwidth.setValue(custom_bw)
self.ui.spinBoxCustomKernelLength.setValue(Filter.get_filter_length_from_bandwidth(custom_bw))
self.create_connects()
示例7: __init__
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import Window [as 别名]
def __init__(self, parent, connection, terminal):
super(TerminalDialog, self).__init__(None, Qt.WindowCloseButtonHint)
self.setupUi(self)
self.setWindowFlags(Qt.Window)
geometry = Settings().retrieve_geometry("terminal")
if geometry:
self.restoreGeometry(geometry)
self.connection = connection
self.terminal = terminal
self._auto_scroll = True # TODO: Settings?
self.terminal_listener = Listener(self.emit_update_content)
self._update_content_signal.connect(self.update_content)
self.terminal.add_event.connect(self.terminal_listener)
self.outputTextEdit.installEventFilter(self)
self.outputTextEdit.verticalScrollBar().sliderPressed.connect(self._stop_scrolling)
self.outputTextEdit.verticalScrollBar().sliderReleased.connect(self._scroll_released)
self.outputTextEdit.verticalScrollBar().installEventFilter(self)
self.inputTextBox.installEventFilter(self)
self.clearButton.clicked.connect(self.clear_content)
self.sendButton.clicked.connect(self.send_input)
self.ctrlaButton.clicked.connect(lambda: self.send_control("a"))
self.ctrlbButton.clicked.connect(lambda: self.send_control("b"))
self.ctrlcButton.clicked.connect(lambda: self.send_control("c"))
self.ctrldButton.clicked.connect(lambda: self.send_control("d"))
self.ctrleButton.clicked.connect(lambda: self.send_control("e"))
fixed_font = QFontDatabase.systemFont(QFontDatabase.FixedFont)
self.outputTextEdit.setFont(fixed_font)
self.inputTextBox.setFont(fixed_font)
self.autoscrollCheckBox.setChecked(self._auto_scroll)
self.autoscrollCheckBox.stateChanged.connect(self._auto_scroll_changed)
self.terminal.read()
self.outputTextEdit.setText(TerminalDialog.process_backspaces(self.terminal.history))
self._input_history_index = 0
示例8: __init__
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import Window [as 别名]
def __init__(self, parent, settings, title='Manage Night Mode', on_update=lambda x: x):
super().__init__(self, parent, Qt.Window)
self.on_update = on_update
self.settings = settings
self.init_ui(title)
示例9: __init__
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import Window [as 别名]
def __init__(self, parent, color_map, title='Customise colors swapping', on_update=None):
super().__init__(self, parent, Qt.Window)
self.on_update = on_update
self.color_map = color_map
self.init_ui(title)
示例10: __init__
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import Window [as 别名]
def __init__(self, parent, disabled_stylers: set, all_stylers, title=_('Choose what to style'), on_update=None):
super().__init__(self, parent, Qt.Window)
self.on_update = on_update
self.disabled_stylers = disabled_stylers
self.all_stylers = all_stylers
self.stylers_checkboxes = []
self.stylers_layout = None
self.init_ui(title)
示例11: set_window_to_defaults
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import Window [as 别名]
def set_window_to_defaults(self):
self.window_original_position.moveCenter(self.center)
self.move(self.window_original_position.topLeft())
self.resize(self.default_size("width"), self.default_size("height"))
self.hide_show_bar()
self.setWindowFlags(Qt.Window)
self.show()
示例12: __init__
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import Window [as 别名]
def __init__(self, message, position):
super().__init__()
self.setMinimumSize(400, 300)
self.setWindowFlags(Qt.Window)
self.setAttribute(Qt.WA_DeleteOnClose, True)
self.message = message
self.position = position
self.initUI()
self.raiseWindow()
示例13: __init__
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import Window [as 别名]
def __init__(self, parent):
super().__init__(parent)
self.setMinimumSize(400, 500)
self.setWindowFlags(Qt.Window)
self.setWindowModality(Qt.WindowModal)
self.setAttribute(Qt.WA_DeleteOnClose, True)
logging.debug('ElementEditor::__init__() called')
示例14: raiseWindow
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import Window [as 别名]
def raiseWindow(self, filename):
logging.debug('StackWindow() called')
self.setMinimumSize(400, 300)
self.setWindowFlags(Qt.Window)
self.setWindowTitle(QC.translate('', 'Stack'))
self.confirm_button = QPushButton()
self.confirm_button.setText(QC.translate('', 'Ok'))
self.confirm_button.clicked.connect(self.close)
self.headline = QFont("Arial", 10, QFont.Bold)
self.info_string = QC.translate('', 'Debug info of element:')
self.elementInfo = QLabel()
self.elementInfo.setFont(self.headline)
self.elementInfoText = QC.translate('', 'Last update:')
self.elementInfoText += ' {}'.format(self.timestamp)
self.elementInfo.setText(self.elementInfoText)
# Will contain the QListWidgetItems
self.stackWidget = QListWidget()
try:
self.restock(filename)
except Exception as e:
logging.error('StackWindow::raiseWindow() exception while opening file: {}'.format(e))
self.closed.emit()
return
self.debugWindowLayout = QVBoxLayout()
self.debugWindowLayout.addWidget(self.elementInfo)
self.debugWindowLayout.addWidget(self.stackWidget)
self.debugWindowLayout.addWidget(self.confirm_button)
self.setLayout(self.debugWindowLayout)
self.show()
示例15: edit
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import Window [as 别名]
def edit(self):
logging.debug('edit() called ExecBranch')
self.branchEditLayout = QVBoxLayout()
self.branchEdit = QWidget(self)
self.branchEdit.setMinimumSize(500, 400)
self.branchEdit.setWindowFlags(Qt.Window)
self.branchEdit.setWindowModality(Qt.WindowModal)
self.branchEdit.setWindowTitle('Edit Branch')
self.selectCondition = QComboBox()
self.selectCondition.addItem('Greater than (>) ...', QVariant('>'))
self.selectCondition.addItem('Greater or equal than (>=) ...', QVariant('>='))
self.selectCondition.addItem('Less than (<) ...', QVariant('<'))
self.selectCondition.addItem('Less or equal than (<=) ...', QVariant('<='))
self.selectCondition.addItem('equal to (==) ...', QVariant('=='))
self.selectCondition.addItem('NOT equal to (!=) ...', QVariant('!='))
self.checkNegate = QCheckBox('Negate query (if NOT ... )')
self.checkNegate.stateChanged.connect(self.negate_changed)
self.if_text_1 = QLabel()
self.if_text_1.setText('if INPUT is ...')
self.branchEditLayout.addWidget(self.checkNegate)
self.branchEditLayout.addWidget(self.if_text_1)
self.branchEditLayout.addWidget(self.selectCondition)
self.branchEditLayout.addStretch(1)
self.branchEdit.setLayout(self.branchEditLayout)
self.branchEdit.show()