PDA

View Full Version : interacting with qGraphicsItem



dubstar_04
24th April 2011, 10:42
I have a number of QGraphicsItems set up to form a tvguide as so:

https://lh4.googleusercontent.com/_yGkw0Cr-R9E/TbPuVPf0UUI/AAAAAAAACAU/vVXj5A7Loeg/s912/Screen%20shot%202011-04-24%20at%2010.32.04.png

I would like to capture the users action on the graphicsitem and change the parent QwidgetStack index to a page with details for the selected program.

I have set up a mouseDoubleClickEvent that captures the mouse click, the problem i am having is changing the qwidgetstack index as i cant make a new mainwindow object and connect to a public function as the constructer for the mainwindow controls all the database and downloading, so if i:

newMW = new mainwindow;
newMW.showProgramInfo();

it causes me all sorts of problems.

can anyone suggest a better approach to achieving the desired functionality?

Thanks,

Dubstar_04

high_flyer
27th April 2011, 08:22
can anyone suggest a better approach to achieving the desired functionality?
Yes - redesign.
Don't mix non GUI functionality (data base connections) with GUI.
Separate the two.
Get you data base code out of your main window, its conceptually in the wrong place.