views:

516

answers:

3

Hi All,

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 or QPicture for actual data layers - and if possible set them as QGraphicItem 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.

A: 

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.

Gnurou
A: 

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.

Barry Wark
+1  A: 

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.

Adam W
Thanks for the links, I'm actualy familiar with them, but the blog is new to me and it seems to look very nice.
bua