本文整理汇总了Python中PyQt5.QtWidgets.QWidget.tr方法的典型用法代码示例。如果您正苦于以下问题:Python QWidget.tr方法的具体用法?Python QWidget.tr怎么用?Python QWidget.tr使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt5.QtWidgets.QWidget
的用法示例。
在下文中一共展示了QWidget.tr方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: not_enough_ram_for_sending_precache
# 需要导入模块: from PyQt5.QtWidgets import QWidget [as 别名]
# 或者: from PyQt5.QtWidgets.QWidget import tr [as 别名]
def not_enough_ram_for_sending_precache(memory_size_bytes):
w = QWidget()
if memory_size_bytes:
msg = "Precaching all your modulated data would take <b>{0}B</b> of memory, " \
"which does not fit into your RAM.<br>".format(Formatter.big_value_with_suffix(memory_size_bytes))
else:
msg = ""
msg += "Sending will be done in <b>continuous mode</b>.<br><br>" \
"This means, modulation will be performed live during sending.<br><br>" \
"If you experience problems, " \
"consider sending less messages or upgrade your RAM."
QMessageBox.information(w, w.tr("Entering continuous send mode"), w.tr(msg))
示例2: hackrf_not_found
# 需要导入模块: from PyQt5.QtWidgets import QWidget [as 别名]
# 或者: from PyQt5.QtWidgets.QWidget import tr [as 别名]
def hackrf_not_found():
w = QWidget()
if sys.platform == "win32":
msg = "Could not connect to HackRF. Try these solutions:" \
"<br/><br/> 1. Ensure HackRF is plugged in." \
"<br/> 2. <b>Install HackRF USB driver</b> with <a href='http://zadig.akeo.ie/'>Zadig</a>."
else:
msg = "Could not connect to HackRF. Try these solutions:" \
"<br/><br/> 1. Ensure HackRF is plugged in." \
"<br/> 2. Run the command <b>hackrf_info</b> in terminal as root." \
"<br/> 3. If 2. works for you, follow the instructions " \
"<a href='https://github.com/mossmann/hackrf/wiki/FAQ'>here</a>."
QMessageBox.critical(w, w.tr("HackRF not found"),
w.tr(msg))
示例3: invalid_path
# 需要导入模块: from PyQt5.QtWidgets import QWidget [as 别名]
# 或者: from PyQt5.QtWidgets.QWidget import tr [as 别名]
def invalid_path(path: str):
w = QWidget()
QMessageBox.critical(w, w.tr("Invalid Path"),
w.tr("The path {0} is invalid.".format(path)))
示例4: empty_group
# 需要导入模块: from PyQt5.QtWidgets import QWidget [as 别名]
# 或者: from PyQt5.QtWidgets.QWidget import tr [as 别名]
def empty_group():
w = QWidget()
QMessageBox.critical(w, w.tr("Empty group"),
w.tr("The group may not be empty."))
示例5: gnuradio_not_installed
# 需要导入模块: from PyQt5.QtWidgets import QWidget [as 别名]
# 或者: from PyQt5.QtWidgets.QWidget import tr [as 别名]
def gnuradio_not_installed():
w = QWidget()
QMessageBox.critical(w, w.tr("Gnuradio not found"),
w.tr("You need to install Gnuradio for this "
"feature."))
示例6: usrp_found
# 需要导入模块: from PyQt5.QtWidgets import QWidget [as 别名]
# 或者: from PyQt5.QtWidgets.QWidget import tr [as 别名]
def usrp_found():
w = QWidget()
QMessageBox.critical(w, w.tr("USRP not found"),
w.tr("USRP could not be found . Is the IP "
"correct?"))
示例7: write_error
# 需要导入模块: from PyQt5.QtWidgets import QWidget [as 别名]
# 或者: from PyQt5.QtWidgets.QWidget import tr [as 别名]
def write_error(msg):
w = QWidget()
QMessageBox.critical(w, w.tr("Write error"),
w.tr("There was a error writing this file! {0}".format(msg)))
示例8: empty_selection
# 需要导入模块: from PyQt5.QtWidgets import QWidget [as 别名]
# 或者: from PyQt5.QtWidgets.QWidget import tr [as 别名]
def empty_selection():
w = QWidget()
QMessageBox.critical(w, w.tr("No selection"),
w.tr("Your selection is empty!"))
示例9: no_device
# 需要导入模块: from PyQt5.QtWidgets import QWidget [as 别名]
# 或者: from PyQt5.QtWidgets.QWidget import tr [as 别名]
def no_device():
w = QWidget()
QMessageBox.critical(w, w.tr("No devices"),
w.tr("You have to choose at least one available "
"device in Edit->Options->Device."))