Click here to Skip to main content
15,868,016 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hello!
I am working on an activities organizer. The activities are shown in a timeline:

  • The Activities are shown in light gray
  • The Dead Times are shown in red


<img src="http://i.imgur.com/M2I0lqW.png" >
(the screen shot shows the timeline generated using the C++ framework, but without working with the database)

I have the following (relevant) fields for every activity: start time (hh:MM) and end time (hh:MM)

I want to pass through all entries in the database and create a
C++
std::list<Schedule::Core::QTimelineObject*>

object containing the dead time items.

How can I achieve this? I want clear explanation and maybe some code. Thanks!
Posted
Updated 17-Aug-14 2:48am
v2
Comments
Richard MacCutchan 17-Aug-14 13:21pm    
You just iterate through all records comparing the start time of each activity with the end time of the previous one. If the times do not match then you have a dead time, so you record it in your list and continue with the next record.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900