KDTools  2.3
Public Slots | Signals | Public Member Functions | Properties
KDTimeLineWidget Class Reference

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
KDTimeLineWidgetItemitem (int idx) 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.

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.

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

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

Returns the number of KDTimeLineWidgetItems.

Returns a pointer to the KDTimeLineWidgetItem number idx in this widget.

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

This signal is emitted when the user clicks an event item

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.

Advances the current time indicator to the next minor tickmark.

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.

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

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

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.
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:
 All Classes Functions Variables Typedefs Enumerations Enumerator Properties Friends

Klarälvdalens Datakonsult AB (KDAB)
Qt-related services and products
http://www.kdab.com/

http://www.kdab.com/products/kd-tools/