def clicking_close_to_a_link_will_select_it_on_the_plot(self):
pdds, nwm = draw_a_network(self.aw, network=ex.networks[0])
# select a link
l = pdds.links[3]
pos = [(l.start.x + l.end.x) / 2.0, (l.start.y, l.end.y) / 2.0]
curve = [x for x in nwm.get_plot().get_items() if x.title().text() == l.id][0]
plot = curve.plot()
ax = curve.xAxis()
ay = curve.yAxis()
px = plot.transform(ax, pos[0])
py = plot.transform(ay, pos[1])
logger = logging.getLogger()
logger.info(curve.title().text())
QTest.mouseClick(plot, Qt.RightButton, pos=QPoint(px, py), delay=10.)
logger = logging.getLogger()
logger.info(str(plot.get_selected_items()))
logger = logging.getLogger()
logger.info((nwm.get_plot().get_selected_items()))
# this test does not work yet.
# todo: fix this test to work.
评论列表
文章目录