Jay
Jay

Reputation: 3479

PyQt Timeline Gui

I need to make a timeline like this:

enter image description here

using PyQt for the gui.

Basically, this timeline is for a car. On the timeline is all the stages of production the car goes through with dates and to the left is the team(s) involved in that specific stage.

i.e the Testing stage starts on the 21st January and ends on the 4th February. It's team(s) are the Crash Test Team and the Demolition Crew

The Production stages ( Design , Development, Testing , Marketing etc) need to be scalable so if you drag the end of the Design production phase from the 8th of January to the 10th of Jan, all the other stages in Production get a 2 day offset.

Any ideas, reccomendations, experiences, advice would be highly appreciated.

Many Thanks for taking the time to read this.

Upvotes: 2

Views: 4978

Answers (1)

docsteer
docsteer

Reputation: 2516

Of course, there are many ways to do this, but I would use QGraphicsView. I primarily use C++/Qt so can't comment how easy this would be to do in Python.

I would have each "stage" be a QGraphicsItem, and draw the Months/Days as the QGraphicsView background. I would override the mouse events for the graphics item to show appropriate cursors and resize it and its neighbours appropriately on mouse down/mouse move events.

This would be a fair amount of work. An easier approach would certainly be to use an existing control. A quick web search reveals KD Gantt from ICS (link) which is non-free but seems to have the facilities you need.

Upvotes: 3

Related Questions