PDA

View Full Version : Create interactive matrix using QGraphicsFramework



Scope
28th June 2016, 09:14
Hi,

I try achieve effect like as on the image below using QGraphicsFramework.
12008

I saw 40000 Chip example and now I have problem how I can select row and column which is currently under the mouse pointer? I should append dynamic rectangle and move them when I move cursor?

Maybe you have some idea how to implement this feature?
Regards,

anda_skoa
28th June 2016, 09:50
Are you sure you don't just want a table view?

Which part of the QGraphicsView framework's features do you need?

Cheers,
_

Scope
28th June 2016, 11:26
I think that one of the feature which I want to have will be difficult or even impossible to implement using QTableWidget - zooming by mouse wheel.

But in future maybe I will need also draw dynamic descriptions of specific element in matrix or drag and replace elements in matrix.

Do you think that implement matrix similar to that from image will be difficult using QGraphicsView Framework?

anda_skoa
28th June 2016, 14:08
I see. Yes, if you need zooming, then this might be a good approach.

You will need some internal data structure that allows you to know where an item is logically, i.e. in which row/column it is.
The item for a mouse position can be had via QGraphicView::itemAt().

Cheers,
_