本文整理汇总了Python中qtpy.QtWidgets.QApplication.setAttribute方法的典型用法代码示例。如果您正苦于以下问题:Python QApplication.setAttribute方法的具体用法?Python QApplication.setAttribute怎么用?Python QApplication.setAttribute使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类qtpy.QtWidgets.QApplication
的用法示例。
在下文中一共展示了QApplication.setAttribute方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: new_figure_manager_given_figure
# 需要导入模块: from qtpy.QtWidgets import QApplication [as 别名]
# 或者: from qtpy.QtWidgets.QApplication import setAttribute [as 别名]
def new_figure_manager_given_figure(num, figure):
"""
Create a new figure manager instance for the given figure.
"""
canvas = FigureCanvasQTAgg(figure)
manager = FigureManagerWorkbench(canvas, num)
return manager
if __name__ == '__main__':
# testing code
import numpy as np
qapp = QApplication([' '])
qapp.setAttribute(Qt.AA_UseHighDpiPixmaps)
if hasattr(Qt, 'AA_EnableHighDpiScaling'):
qapp.setAttribute(Qt.AA_EnableHighDpiScaling, True)
x = np.linspace(0, 10*np.pi, 1000)
cx, sx = np.cos(x), np.sin(x)
fig_mgr_1 = new_figure_manager(1)
fig1 = fig_mgr_1.canvas.figure
ax = fig1.add_subplot(111)
ax.set_title("Test title")
ax.set_xlabel("$\mu s$")
ax.set_ylabel("Counts")
ax.plot(x, cx)
fig1.show()
qapp.exec_()
示例2: QApplication
# 需要导入模块: from qtpy.QtWidgets import QApplication [as 别名]
# 或者: from qtpy.QtWidgets.QApplication import setAttribute [as 别名]
while changed:
changed = False
for edge in edges:
source = edge.node_source
dest = edge.node_dest
if source in connected and dest not in connected:
current.append(dest)
changed = True
if dest in connected and source not in connected:
current.append(source)
changed = True
current = indirect
connected.extend(current)
return direct, indirect
if __name__ == '__main__':
import sys
app = QApplication(sys.argv)
app.setAttribute(Qt.AA_UseHighDpiPixmaps)
from glue.core.state import load
dc = load('links.glu')
widget = DataGraphWidget(dc)
widget.show()
sys.exit(app.exec_())