本文整理汇总了Python中PyQt5.QtQuick.QQuickView.requestActivate方法的典型用法代码示例。如果您正苦于以下问题:Python QQuickView.requestActivate方法的具体用法?Python QQuickView.requestActivate怎么用?Python QQuickView.requestActivate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt5.QtQuick.QQuickView
的用法示例。
在下文中一共展示了QQuickView.requestActivate方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Application
# 需要导入模块: from PyQt5.QtQuick import QQuickView [as 别名]
# 或者: from PyQt5.QtQuick.QQuickView import requestActivate [as 别名]
#.........这里部分代码省略.........
)
if Options.system_wide:
versions += " [admin]"
context.setContextProperty("modulesVersionText", versions)
colors = {
"darkBlue": "#1F28BF",
"nuxeoBlue": "#0066FF",
"lightBlue": "#00ADED",
"teal": "#73D2CF",
"purple": "#8400FF",
"red": "#C02828",
"orange": "#FF9E00",
"darkGray": "#495055",
"mediumGray": "#7F8284",
"lightGray": "#BCBFBF",
"lighterGray": "#F5F5F5",
}
for name, value in colors.items():
context.setContextProperty(name, value)
def _window_root(self, window):
if WINDOWS:
return window.rootObject()
return window
def translate(self, message: str, values: List[Any] = None) -> str:
return Translator.get(message, values)
def _show_window(self, window: QWindow) -> None:
window.show()
window.raise_()
window.requestActivate()
def _init_translator(self) -> None:
locale = Options.force_locale or Options.locale
Translator(find_resource("i18n"), self.manager.get_config("locale", locale))
# Make sure that a language change changes external values like
# the text in the contextual menu
Translator.on_change(self._handle_language_change)
# Trigger it now
self.osi.register_contextual_menu()
self.installTranslator(Translator._singleton)
@pyqtSlot(str, Path, str)
def _direct_edit_conflict(self, filename: str, ref: Path, digest: str) -> None:
log.debug(f"Entering _direct_edit_conflict for {filename!r} / {ref!r}")
try:
if filename in self._conflicts_modals:
log.debug(f"Filename already in _conflicts_modals: {filename!r}")
return
log.debug(f"Putting filename in _conflicts_modals: {filename!r}")
self._conflicts_modals[filename] = True
msg = QMessageBox()
msg.setInformativeText(
Translator.get("DIRECT_EDIT_CONFLICT_MESSAGE", [short_name(filename)])
)
overwrite = msg.addButton(
Translator.get("DIRECT_EDIT_CONFLICT_OVERWRITE"), QMessageBox.AcceptRole
)
msg.addButton(Translator.get("CANCEL"), QMessageBox.RejectRole)
msg.setIcon(QMessageBox.Warning)
msg.exec_()
if msg.clickedButton() == overwrite: