PyQt4富文本编辑器所见即所得工具栏设置基本文本属性
我正在使用 PyQT4 创建一个小 GUI,允许我实验室的人员编写有关生理实验的笔记。现在我已经进行了纯文本编辑,但是如果用户可以使用富文本编辑来设置当前选定文本的字体属性,粗体/斜体/字体/字体大小就足够了,那就太好了。我专门寻找一个可以连接并控制 QTextEdit 的现成组件。如果支持添加图片就更好了。我正在寻找比 stackoverflow 的 javascript wysiwyg 富文本编辑器更奇特的东西,我用它来写这个问题,但显然是在 PyQT4 中。
我可以自己编写这个工具栏,但我确信有人已经这样做了,但谷歌却没有提供任何帮助。如果不是现成的东西,那么至少有一个我可以复制粘贴片段的存根。谢谢!
I'm using PyQT4 to create a little GUI that allows people in my lab to write notes about physiological experiments. Right now I've got plain text editing going but it would be nice if the user could use rich text editing to set the currently selected text's font properties, bold/italic/font/font size would be sufficient. I am specifically looking for a ready-made component that would connect to and control a QTextEdit. If adding images was supported that would be even better. I am looking for something no more fancy than stackoverflow's javascript wysiwyg rich text editor which I am using to write this question, but in PyQT4, obviously.
I could program this toolbar myself, however I am sure someone has already done this, yet Google has been unhelpful. If not something ready-made, then at least a stub I could copy-paste snippets of. Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我的 OpenWorld 软件中有一个 WIP:http://traipse.assembla.com/wiki /show/open-world 它还远未完成,可能可以做得更好。这是 GPL v2
I have a WIP one in my OpenWorld software: http://traipse.assembla.com/wiki/show/open-world It's far from complete and could probably be done better. It's GPL v2
查看此示例。
当然它是用 C++ 编写的,但 Qt/Python 与 Qt/C++ 非常相似。
Have a look at this example.
Of course it is in C++ but Qt/Python is pretty similar to Qt/C++.