Logo Search packages:      
Sourcecode: kdepim version File versions

KDGanttView Class Reference

#include <KDGanttView.h>

Inheritance diagram for KDGanttView:


List of all members.

Detailed Description

This class represents a Gantt view with the Gantt chart, the header, an optional listview and an optional legend.

In order to set up a Gantt view, create an object of this class, and populate it with a number of KDGanttViewItem objects.

If you experience problems with the repainting of the content of the Gantt View after scrolling, call setRepaintMode().

Definition at line 69 of file KDGanttView.h.

Public Types

enum  Direction { Left, Right, Up, Down }
enum  HourFormat { Hour_24, Hour_12, Hour_24_FourDigit }
enum  RepaintMode { No, Medium, Always }
enum  ResizeMode { Stretch, KeepSize, FollowSizeHint }
enum  Scale {
  Minute, Hour, Day, Week,
  Month, Auto
enum  YearFormat { FourDigit, TwoDigit, TwoDigitApostrophe, NoDate }

Public Slots

void editItem (KDGanttViewItem *)
void zoomToSelection (const QDateTime &start, const QDateTime &end)


void dropped (QDropEvent *e, KDGanttViewItem *droppedItem, KDGanttViewItem *itemBelowMouse)
void gvContextMenuRequested (KDGanttViewItem *item, const QPoint &pos)
void gvCurrentChanged (KDGanttViewItem *)
void gvItemDoubleClicked (KDGanttViewItem *)
void gvItemLeftClicked (KDGanttViewItem *)
void gvItemMidClicked (KDGanttViewItem *)
void gvItemRightClicked (KDGanttViewItem *)
void gvMouseButtonClicked (int button, KDGanttViewItem *item, const QPoint &pos)
void itemConfigured (KDGanttViewItem *)
void itemDoubleClicked (KDGanttViewItem *)
void itemLeftClicked (KDGanttViewItem *)
void itemMidClicked (KDGanttViewItem *)
void itemRightClicked (KDGanttViewItem *)
void lvContextMenuRequested (KDGanttViewItem *item, const QPoint &pos, int col)
void lvCurrentChanged (KDGanttViewItem *)
void lvItemDoubleClicked (KDGanttViewItem *)
void lvItemLeftClicked (KDGanttViewItem *)
void lvItemMidClicked (KDGanttViewItem *)
void lvItemRenamed (KDGanttViewItem *, int col, const QString &text)
void lvItemRightClicked (KDGanttViewItem *)
void lvMouseButtonClicked (int button, KDGanttViewItem *item, const QPoint &pos, int c)
void lvMouseButtonPressed (int button, KDGanttViewItem *item, const QPoint &pos, int c)
void lvSelectionChanged (KDGanttViewItem *)
void rescaling (Scale)
void taskLinkDoubleClicked (KDGanttViewTaskLink *)
void taskLinkLeftClicked (KDGanttViewTaskLink *)
void taskLinkMidClicked (KDGanttViewTaskLink *)
void taskLinkRightClicked (KDGanttViewTaskLink *)
void timeIntervallSelected (const QDateTime &start, const QDateTime &end)
void timeIntervalSelected (const QDateTime &start, const QDateTime &end)

Public Member Functions

virtual int addColumn (const QIconSet &iconset, const QString &label, int width=-1)
virtual int addColumn (const QString &label, int width=-1)
void addLegendItem (KDGanttViewItem::Shape shape, const QColor &shapeColor, const QString &text)
void addTicksLeft (int num=1)
void addTicksRight (int num=1)
void addUserdefinedLegendHeaderWidget (QWidget *w)
int autoScaleMinorTickCount () const
bool calendarMode () const
void center (KDGanttViewItem *)
void centerTimeline (const QDateTime &center)
void centerTimelineAfterShow (const QDateTime &center)
bool changeBackgroundInterval (const QDateTime &oldstart, const QDateTime &oldend, const QDateTime &newstart, const QDateTime &newend)
int childCount () const
void clear ()
void clearBackgroundColor ()
void clearLegend ()
virtual bool close (bool alsoDelete)
bool colors (KDGanttViewItem::Type type, QColor &start, QColor &middle, QColor &end) const
QColor columnBackgroundColor (const QDateTime &column) const
QColor defaultColor (KDGanttViewItem::Type type) const
QColor defaultHighlightColor (KDGanttViewItem::Type type) const
bool deleteBackgroundInterval (const QDateTime &start, const QDateTime &end)
bool displayEmptyTasksAsLine () const
bool displaySubitemsAsGroup () const
bool dragEnabled () const
QSize drawContents (QPainter *p=0, bool drawListView=true, bool drawTimeLine=true, bool drawLegend=false)
bool dropEnabled () const
bool editable () const
bool editorEnabled () const
void ensureVisible (KDGanttViewItem *)
KDGanttViewItemfirstChild () const
int ganttMaximumWidth () const
QDateTime getDateTimeForCoordX (int coordX, bool global=true) const
KDGanttViewItemgetItemAt (const QPoint &pos, bool global=true) const
KDGanttViewItemgetItemByGanttViewPos (const QPoint &pos) const
KDGanttViewItemgetItemByListViewPos (const QPoint &pos) const
KDGanttViewItemgetItemByName (const QString &name) const
bool getUpdateEnabled () const
QColor gvBackgroundColor () const
bool headerVisible () const
bool highlightColors (KDGanttViewItem::Type type, QColor &start, QColor &middle, QColor &end) const
int horBackgroundLines (QBrush &brush)
QDateTime horizonEnd () const
QDateTime horizonStart () const
HourFormat hourFormat () const
bool isDragEnabled () const
bool isDropEnabled () const
 KDGanttView (QWidget *parent=0, const char *name=0)
KDGanttViewItemlastItem () const
QDockWindow * legendDockwindow () const
QColor legendHeaderBackgroundColor () const
bool legendIsDockwindow () const
int listViewWidth ()
bool loadProject (QIODevice *)
QColor lvBackgroundColor () const
virtual void lvDragEnterEvent (QDragEnterEvent *e)
virtual bool lvDragMoveEvent (QDragMoveEvent *e, KDGanttViewItem *, KDGanttViewItem *)
virtual bool lvDropEvent (QDropEvent *e, KDGanttViewItem *, KDGanttViewItem *)
virtual void lvStartDrag (KDGanttViewItem *)
int majorScaleCount () const
Scale maximumScale () const
Direction minimizeDirection () const
int minimumColumnWidth () const
Scale minimumScale () const
int minorScaleCount () const
QBrush noInformationBrush () const
Orientation orientation () const
void print (QPrinter *printer=0, bool printListView=true, bool printTimeLine=true, bool printLegend=false)
virtual void removeColumn (int index)
bool saveProject (QIODevice *)
Scale scale () const
KDGanttViewItemselectedItem () const
void setAutoScaleMinorTickCount (int count)
void setCalendarMode (bool mode)
void setColors (KDGanttViewItem::Type type, const QColor &start, const QColor &middle, const QColor &end, bool overwriteExisting=true)
void setColumnBackgroundColor (const QDateTime &column, const QColor &color, Scale mini=KDGanttView::Minute, Scale maxi=KDGanttView::Month)
void setDefaultColor (KDGanttViewItem::Type type, const QColor &, bool overwriteExisting=true)
void setDefaultHighlightColor (KDGanttViewItem::Type type, const QColor &, bool overwriteExisting=true)
void setDisplayEmptyTasksAsLine (bool show)
void setDisplaySubitemsAsGroup (bool show)
void setDragDropEnabled (bool b)
void setDragEnabled (bool b)
void setDropEnabled (bool b)
void setEditable (bool editable)
void setEditorEnabled (bool enable)
void setFont (const QFont &f)
void setGanttMaximumWidth (int w)
void setGvBackgroundColor (const QColor &)
void setGvVScrollBarMode (QScrollView::ScrollBarMode)
void setHeaderVisible (bool)
void setHighlightColors (KDGanttViewItem::Type type, const QColor &start, const QColor &middle, const QColor &end, bool overwriteExisting=true)
void setHorBackgroundLines (int count=2, QBrush brush=QBrush(QColor(200, 200, 200), Qt::Dense6Pattern))
void setHorizonEnd (const QDateTime &start)
void setHorizonStart (const QDateTime &start)
void setHourFormat (HourFormat format)
void setIntervalBackgroundColor (const QDateTime &start, const QDateTime &end, const QColor &color, Scale mini=KDGanttView::Minute, Scale maxi=KDGanttView::Month)
void setLegendHeaderBackgroundColor (const QColor &)
void setLegendIsDockwindow (bool dock)
void setListViewWidth (int)
void setLvBackgroundColor (const QColor &)
void setLvVScrollBarMode (QScrollView::ScrollBarMode)
void setMajorScaleCount (int count)
void setMaximumScale (Scale)
void setMinimizeDirection (Direction)
void setMinimumColumnWidth (int width)
void setMinimumScale (Scale)
void setMinorScaleCount (int count)
void setNoInformationBrush (const QBrush &brush)
virtual void setOrientation (Orientation)
 the orientation of the splitter
void setPaletteBackgroundColor (const QColor &col)
void setRepaintMode (RepaintMode mode)
void setScale (Scale)
void setSelected (KDGanttViewItem *, bool)
void setShapes (KDGanttViewItem::Type type, KDGanttViewItem::Shape start, KDGanttViewItem::Shape middle, KDGanttViewItem::Shape end, bool overwriteExisting=true)
void setShowHeaderPopupMenu (bool show=true, bool showZoom=true, bool showScale=true, bool showTime=true, bool showYear=true, bool showGrid=true, bool showPrint=false)
void setShowLegend (bool show)
void setShowLegendButton (bool show)
void setShowListView (bool show)
void setShowMajorTicks (bool)
void setShowMinorTicks (bool)
void setShowTaskLinks (bool show)
void setShowTimeTablePopupMenu (bool)
void setTextColor (const QColor &color)
void setTimeHeaderBackgroundColor (const QColor &)
void setTimelineToEnd ()
void setTimelineToStart ()
void setUpdateEnabled (bool enable)
void setWeekdayBackgroundColor (const QColor &color, int weekday)
void setWeekendBackgroundColor (const QColor &color)
void setWeekendDays (int start, int end)
void setYearFormat (YearFormat format)
void setZoomFactor (double factor, bool absolute)
bool shapes (KDGanttViewItem::Type type, KDGanttViewItem::Shape &start, KDGanttViewItem::Shape &middle, KDGanttViewItem::Shape &end) const
virtual void show ()
bool showHeaderPopupMenu () const
bool showLegend () const
bool showLegendButton () const
bool showListView () const
bool showMajorTicks () const
bool showMinorTicks () const
bool showTaskLinks () const
bool showTimeTablePopupMenu () const
QSize sizeHint ()
< KDGanttViewTaskLinkGroup
taskLinkGroups () const
QPtrList< KDGanttViewTaskLinktaskLinks () const
QColor textColor () const
QColor timeHeaderBackgroundColor () const
QColor weekdayBackgroundColor (int weekday) const
QColor weekendBackgroundColor () const
void weekendDays (int &start, int &end) const
YearFormat yearFormat () const
double zoomFactor () const
void zoomToFit ()

Static Public Member Functions

static QPixmap getPixmap (KDGanttViewItem::Shape shape, const QColor &shapeColor, const QColor &backgroundColor, int itemSize)

Protected Member Functions

virtual QDragObject * dragObject ()
virtual void startDrag ()


int autoScaleMinorTickCount
bool calendarMode
bool displayEmptyTasksAsLine
bool dragEnabled
bool dropEnabled
bool editable
bool editorEnabled
int ganttMaximumWidth
QColor ganttViewBackgroundColor
bool headerVisible
QDateTime horizonEnd
QDateTime horizonStart
HourFormat hourFormat
QColor legendHeaderBackgroundColor
bool legendIsDockwindow
QColor listViewBackgroundColor
int majorScaleCount
Scale maximumScale
Direction minimizeDirection
int minimumColumnWidth
Scale minimumScale
int minorScaleCount
QBrush noInformationBrush
Orientation orientation
Scale scale
bool showHeaderPopupMenu
bool showLegend
bool showLegendButton
bool showListView
bool showMajorTicks
bool showMinorTicks
bool showTaskLinks
bool showTimeTablePopupMenu
QColor textColor
QColor timeHeaderBackgroundColor
QColor weekendBackgroundColor
YearFormat yearFormat
double zoomFactor

Private Slots

void addTickLeft ()
void addTickRight ()
void enableAdding (int)
void forceRepaint (int val=0)
void slot_lvDropped (QDropEvent *e, KDGanttViewItem *droppedItem, KDGanttViewItem *itemBelowMouse)
void slotcontextMenuRequested (QListViewItem *item, const QPoint &pos, int col)
void slotCurrentChanged (QListViewItem *item)
void slotdoubleClicked (QListViewItem *item)
void slotHeaderSizeChanged ()
void slotItemRenamed (QListViewItem *item, int col, const QString &text)
void slotmouseButtonClicked (int button, QListViewItem *item, const QPoint &pos, int c)
void slotMouseButtonPressed (int button, QListViewItem *item, const QPoint &pos, int c)
void slotSelectionChanged (QListViewItem *item)

Private Member Functions

void addTaskLinkGroup (KDGanttViewTaskLinkGroup *)
int getIndex (KDGanttViewItem::Type) const
void initDefaults ()
bool loadXML (const QDomDocument &doc)
void notifyEditdialog (KDGanttViewItem *)
void removeTaskLinkGroup (KDGanttViewTaskLinkGroup *)
QDomDocument saveXML (bool withPI=true) const

Static Private Member Functions

static QString hourFormatToString (HourFormat format)
static QString scaleToString (Scale scale)
static HourFormat stringToHourFormat (const QString &string)
static Scale stringToScale (const QString &string)
static YearFormat stringToYearFormat (const QString &string)
static QString yearFormatToString (YearFormat format)

Private Attributes

bool _displayEmptyTasksAsLine
bool _displaySubitemsAsGroup
bool _enableAdding
bool _showHeader
bool _showLegendButton
bool chartIsEditable
bool closingBlocked
QDateTime dtCenterTimeLineAfterShow
bool editorIsEnabled
bool fCenterTimeLineAfterShow
bool fDragEnabled
bool fDropEnabled
QVBox * leftWidget
bool listViewIsVisible
KDGanttCanvasView * myCanvasView
QColor myColor [9]
QColor myColorHL [9]
QColor myDefaultColor [3]
QColor myDefaultColorHL [3]
KDGanttViewItem::Shape myDefaultShape [9]
itemAttributeDialog * myItemAttributeDialog
KDLegendWidget * myLegend
QPtrList< legendItem > * myLegendItems
KDListView * myListView
< KDGanttViewTaskLinkGroup
QColor myTextColor
KDTimeHeaderWidget * myTimeHeader
QHBox * myTimeHeaderContainer
QScrollView * myTimeHeaderScroll
KDTimeTableWidget * myTimeTable
QVBox * rightWidget
QHBox * spacerLeft
QWidget * spacerRight
QWidget * timeHeaderSpacerWidget
bool undefinedColor [3]
bool undefinedColorHL [3]
bool undefinedShape [3]


class KDGanttCanvasView
class KDGanttViewCalendarItem
class KDGanttViewEventItem
class KDGanttViewItem
class KDGanttViewSummaryItem
class KDGanttViewTaskItem
class KDGanttViewTaskLink
class KDGanttViewTaskLinkGroup
class KDLegendWidget
class KDListView
class KDTimeHeaderWidget
class KDTimeTableWidget


struct  legendItem

The documentation for this class was generated from the following files:

Generated by  Doxygen 1.6.0   Back to index