gnuplot qt:超链接和单击事件 [英] gnuplot qt: hyperlinks and click events

查看:167
本文介绍了gnuplot qt:超链接和单击事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

某些终端支持hypertext.将鼠标悬停在数据点上时,会显示一些文本,例如

Some terminal supports hypertext. When hover a data point, some text is shown, e.g.

$data <<EOD
1.2 0.12 Berlin
2 0.83 Paris
3 0.6 London
4.3 0.5 Rom
EOD

plot $data w labels hypertext

是否有可能进行交互,即绑定单击事件以在控制台上打印文本或执行超链接? svg可能有可能,但qt控制台有可能吗?

Is there a possibility to have interaction, i.e. bind a click event to print the text on console or execute a hyperlink? It's likely possible with svg, but with qt console?

推荐答案

当前的qt实现在单击鼠标时将超文本字符串发送到剪贴板.如何从剪贴板中检索它取决于您的桌面配置. X11的经典行为是鼠标中键会从剪贴板粘贴到活动窗口,但是如今,这种期望常常是徒劳的.

The current qt implementation sends the hypertext string to the clipboard on mouse click. How to retrieve it from the clipboard depends on your desktop configuration. The classic X11 behavior was that middle-mouse-click would paste from the clipboard to the active window, but these days that expectation is often in vain.

如果它可以帮助您确定系统上的行为,则发出的Qt命令是这样的:

In case it helps you to pin down the behavior on your system, the Qt command issued is this:

QApplication::clipboard()->setText(m_selectedHypertext);

wxt终端实际上​​执行相同的操作,但是增加了皱纹,即wxWidgets可以具有多个后端,这些后端可能以不同的方式解释剪贴板".那里执行的命令是

The wxt terminal does essentially the same thing, with the added wrinkle that wxWidgets can have multiple back-ends that may interpret "clipboard" in different ways. There the command executed is

wxt_set_clipboard(wxt_display_hypertext);

如您所建议,svg实现使用javascript.您可以根据自己的喜好修改文件gnuplot_svg.js以对其进行自定义.

As you suggest, the svg implementation uses javascript. You could modify the file gnuplot_svg.js to customize it however you like.

这篇关于gnuplot qt:超链接和单击事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆