KDTimeLineWidget Class Reference
[KDTimeLineWidget]

KDTimeLineWidget is a widget showing a timeline with a current time and optionally a number of events. It does not provide scrollbars or other means of navigation. More...

List of all members.

Public Slots

void setStartDateTime (const QDateTime &)
void setEndDateTime (const QDateTime &)
void setSnapToTickmarks (bool)
void setCurrentDateTime (const QDateTime &)
void nextCurrentDateTime ()
void previousCurrentDateTime ()
void setElapsedDateTime (const QDateTime &)
void setCurrentItem (KDTimeLineWidgetItem *)
void nextCurrentItem ()
void previousCurrentItem ()

Signals

void itemSelected (KDTimeLineWidgetItem *)
void itemMoved (KDTimeLineWidgetItem *)
void currentDateTimeChanged (const QDateTime &)

Public Member Functions

 KDTimeLineWidget (QWidget *parent=0)
virtual ~KDTimeLineWidget ()
void setDateTimeFormat (const QString &format)
void setDateTimeFormat (Qt::DateFormat format)
void addItem (KDTimeLineWidgetItem *item)
void removeItem (KDTimeLineWidgetItem *item)
int itemCount () const
KDTimeLineWidgetItemcurrentItem () const
QDateTime dateTimeAt (int x) const
int position (const QDateTime &dt) const

Properties

QDateTime startDateTime
QDateTime endDateTime
QDateTime currentDateTime
bool snapToTickmarks


Detailed Description

KDTimeLineWidget is a widget showing a timeline with a current time and optionally a number of events. It does not provide scrollbars or other means of navigation.

kdtimelinewidget.png

Constructor & Destructor Documentation

KDTimeLineWidget::KDTimeLineWidget ( QWidget *  parent = 0  )  [explicit]

Contructor. Creates a KDTimeLineWidget with parent parent showing time from now and one day forward.

KDTimeLineWidget::~KDTimeLineWidget (  )  [virtual]

Destructor. When a KDTimeLineWidget is deleted, any KDTimeLineWidgetItems contained in it are deleted too.


Member Function Documentation

void KDTimeLineWidget::setDateTimeFormat ( const QString &  format  ) 

Set the datetime format string used to display textual datetimes on the timeline. Default is QString::null which means that the Qt::DateFormat set with setDateTimeFormat( Qt::DateFormat ) is used instead.

void KDTimeLineWidget::setDateTimeFormat ( Qt::DateFormat  format  ) 

Set the datetime format string used to display textual datetimes on the timeline. Default is Qt::TextFormat. Calling this method sets the datime format string to QString::null.

void KDTimeLineWidget::addItem ( KDTimeLineWidgetItem item  ) 

Add a KDTimeLineWidgetItem to this KDTimeLineWidget. The KDTimeLineWidget object becomes the owner of item

void KDTimeLineWidget::removeItem ( KDTimeLineWidgetItem item  ) 

Remove a KDTimeLineWidgetItem from this KDTimeLineWidget. Ownership is transferred to the caller and the item is not deleted.

int KDTimeLineWidget::itemCount (  )  const

Returns the number of KDTimeLineWidgetItems.

KDTimeLineWidgetItem * KDTimeLineWidget::currentItem (  )  const

Returns:
the current item.

QDateTime KDTimeLineWidget::dateTimeAt ( int  x  )  const

Returns the datetime associated with the given x coordinate in the widget

int KDTimeLineWidget::position ( const QDateTime &  dt  )  const

Returns:
the position x coordinate in widget coordinates corresponding to the time dt

void KDTimeLineWidget::itemSelected ( KDTimeLineWidgetItem  )  [signal]

This signal is emitted when the user clicks an event item

void KDTimeLineWidget::itemMoved ( KDTimeLineWidgetItem  )  [signal]

This signal is emitted when the user has moved an event item

void KDTimeLineWidget::currentDateTimeChanged ( const QDateTime &   )  [signal]

This signal is emitted when the user has changed the current datetime

void KDTimeLineWidget::setStartDateTime ( const QDateTime &  dt  )  [slot]

Set the starting time of the time line to dt

void KDTimeLineWidget::setEndDateTime ( const QDateTime &  dt  )  [slot]

Set the ending time of the time line to dt

void KDTimeLineWidget::setSnapToTickmarks ( bool  b  )  [slot]

If set to true, the current time indicator can only be positioned so it is aligned to minor tickmarks. If set to false, it can be positioned freely in time.

void KDTimeLineWidget::setCurrentDateTime ( const QDateTime &  dt  )  [slot]

Set the current time of the timeline to dt. Current time display can be disabled by passing an invalid QDateTime to this method.

void KDTimeLineWidget::nextCurrentDateTime (  )  [slot]

Advances the current time indicator to the next minor tickmark.

void KDTimeLineWidget::previousCurrentDateTime (  )  [slot]

Advances the current time indicator to the previous minor tickmark.

void KDTimeLineWidget::setElapsedDateTime ( const QDateTime &  dt  )  [slot]

Set the elapsed time of the timeline to dt. Current time display can be disabled by passing an invalid QDateTime to this method.

void KDTimeLineWidget::setCurrentItem ( KDTimeLineWidgetItem item  )  [slot]

Sets the current items to item. item must be an item on this timeline.

void KDTimeLineWidget::nextCurrentItem (  )  [slot]

Sets the next item on the timeline to be current. Does nothing if there is no next item

void KDTimeLineWidget::previousCurrentItem (  )  [slot]

Sets the previous item on the timeline to be current. Does nothing if there is no previous item


Property Documentation

QDateTime KDTimeLineWidget::startDateTime [read, write]

Returns:
the oldest point in time displayed by this KDTimeLineWidget.
See also:
KDTimeLineWidget::setStartDateTime( const QDateTime& )

QDateTime KDTimeLineWidget::endDateTime [read, write]

Returns:
the youngest point in time displayed by this KDTimeLineWidget.
See also:
KDTimeLineWidget::setEndDateTime( const QDateTime& )

QDateTime KDTimeLineWidget::currentDateTime [read, write]

Returns:
the datetime of the current time indicator.

bool KDTimeLineWidget::snapToTickmarks [read, write]

Returns:
true if the current time indicator will snap to the minor tickmarks in this timeline and false otherwise.
See also:
KDTimeLineWidget::setSnapToTickmarks(bool)


The documentation for this class was generated from the following files:
Klarälvdalens Datakonsult AB (KDAB)
Qt-related services and products
http://www.kdab.net/

http://www.kdab.net/kdtools/