求QTextEdit超链接问题解答

tianzc 2014-04-01 04:34:48
我想在QTextEdit中显示一个超链接,然后我在qt中要捕获这个超链接的点击事件,请问有什么办法啊?
...全文
272 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
qq_32175061 2015-11-17
  • 打赏
  • 举报
回复
但是这个QTextBrowser必须是只读的
imsaws 2014-04-02
  • 打赏
  • 举报
回复
QTextBrowser中的 Signals: void anchorClicked(const QUrl & link) This signal is emitted when the user clicks an anchor. The URL referred to by the anchor is passed in link. Note that the browser will automatically handle navigation to the location specified by link unless the openLinks property is set to false or you call setSource() in a slot connected. This mechanism is used to override the default navigation features of the browser.
tianzc 2014-04-02
  • 打赏
  • 举报
回复
用QTextBrowser怎么截获鼠标点击超链接事件呢?
  • 打赏
  • 举报
回复
你应该用QTextBrower

16,173

社区成员

发帖
与我相关
我的任务
社区描述
Qt 是一个跨平台应用程序框架。通过使用 Qt,您可以一次性开发应用程序和用户界面,然后将其部署到多个桌面和嵌入式操作系统,而无需重复编写源代码。
社区管理员
  • Qt
  • 亭台六七座
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧