Qt 绘图应用程序
目前,我正在尝试开发一些简单的情节原型,但我正在与某种白/空纸综合症作斗争。 两年后我又回到了Qt,所以我感觉自己很落后。
我的应用程序应该:
- 绘制和管理自定义数据层
- 在自定义画布背景上
- 管理绘图上的标记
我的计划是使用以下设计:
QGraphicsScene
/View/Item 作为精灵,例如背景、标记的管理小部件、指针和其他“位图”对象等。- 用于实际数据层的
QPainter
/Qpixmap
或QPicture
- 如果可能,将它们设置为QGraphicItem
简化动态图形的管理
我不想使用 Qwt 或类似的库,除非我可以用它在自定义背景上绘图(我不喜欢 qwt 图形样式的外观)。
我的计划在 qt 类的使用和组成范围内是否正确? 我想至少对这种原型应该涉及的类有一个清晰的概述。 提前致谢。 P。
Currently I'm trying to develop some simple plot prototype and I'm struggling with some kind of white/empty sheet syndrome.
I'm back to Qt after 2 years, so I feel quite retarded.
My application should:
- plot and manage custom layers of data
- plot on custom canvas background
- manage markers on plot
My plan is to use following design:
QGraphicsScene
/View/Item as a sprite like management widgets for background, markers, pointers and other "bitmap" objects etc.QPainter
/Qpixmap
orQPicture
for actual data layers - and if possible set them asQGraphicItem
to simplify management of dynamic graphics
I don't want to use Qwt or similar library, unless I can plot with it on custom background (I don't like the look of the qwt's graphic style).
Is my plan proper in scope of qt class usage and composition?
I'd like to have at least clear overview of the classes which should be involved for this kind of prototype.
Thanks in advance.
P.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
我认为您对 QGraphicsView 有了基本的了解。以下是一些可能有帮助的资源:
图形视图
图表场景
如果您想使用新的动画和状态集类:
Stickman
另外,请查看 gunnar 的实验室博客。他最近做了一个关于图形性能的系列。
所有这些都是严格的 Qt(动画和状态集在 4.6 中)。它们是 C++ 语言的,但希望你能将你需要的内容翻译成 Python。
I think you have the basic idea with QGraphicsView. Here are a few resources which might help:
Graphics View
Diagram Scene
If you want to use the new animation and state set classes:
Stickman
Also, take a look at gunnar's labs blog. He recently did a series on graphics performance.
All of these are strictly Qt (animation and state set are in 4.6). They are in C++ but hopefully you can translate what you need to python.
你没有对你的项目说太多,让我提出一个更有帮助的答案,但看看涉及图形视图的Qt演示,特别是图表场景和40000个芯片。我想你会发现它们对你想做的事情很有启发。
You don't say much about your project for me to propose a more helpful answer, but have a look at the Qt demos involving the graphics view, especially diagram scene and 40000 chips. I think you will find them inspiring for what you want to do.
可能 MathGL 适合您。它有 Qt 小部件,或者您可以直接使用 RGBA 图像将其与小部件中的任何背景组合。
May be MathGL is appropriate for you. It have Qt widget or you can use RGBA image directly to combine it with any background in your widget.
我建议您使用 QCustomPlot,它是一个 Qt C++ 库。它专注于制作美观、出版质量的 2D 绘图、图表和图表,并且还具有实时可视化应用程序的高性能。您可以在此处获取它: http://www.qcustomplot.com/
I recommend you to use QCustomPlot which is a Qt C++ library. It focuses on making good looking, publication quality 2D plots, graphs and charts and also has high performance for realtime visualization applications. You get it here: http://www.qcustomplot.com/
您可能需要查看核心图框架。 Core Plot 是 OS X 特定的,但它是建立在 OS X Core Animation 系统之上的,该系统与 Qt Graphics View Framework 有很多概念相似之处。您必须学习直观地解析 Objective-C(对于任何有能力的 C++ 开发人员来说,这个过程不到两天),但您应该能够相对轻松地看到总体架构。 Core Plot wiki 有一些不错的高级文档,可以设置您甚至无需查看代码即可上路。
You may want to take a look at the Core Plot framework. Core Plot is OS X specific, but it is built on the the OS X Core Animation system which has a lot of conceptual similarity to the Qt Graphics View Framework. You'll have to learn to visually parse the Objective-C (a less-than-two day process for any competent C++ developer), but you should be able to see the general architecture relatively easily. The Core Plot wiki has some nice high-level documentation that might set you on your way without even needing to look at the code.