• Skip to content
  • Skip to link menu
KDE 4.2 API Reference
  • KDE API Reference
  • kdepim
  • Sitemap
  • Contact Us
 

kdgantt1

KDGanttView Class Reference

#include <KDGanttView.h>

Inheritance diagram for KDGanttView:

Inheritance graph
[legend]

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 67 of file KDGanttView.h.


Public Types

enum  HourFormat { Hour_24, Hour_12, Hour_24_FourDigit }
enum  RepaintMode { No, Medium, Always }
enum  Scale {
  Second = 0, Minute, Hour, Day,
  Week, Month, Auto
}
enum  ShowTicksType { ShowMajorTicks = 0, ShowMinorTicks, ShowNoTicks }
enum  YearFormat { FourDigit, TwoDigit, TwoDigitApostrophe, NoDate }

Public Slots

void center (KDGanttViewItem *)
void centerTimeline (const QDateTime &center)
void editItem (KDGanttViewItem *)
void gotoCurrentMonth ()
void gotoCurrentWeek ()
void gotoCurrentYear ()
void gotoLastMonth ()
void gotoLastWeek ()
void gotoLastYear ()
void gotoToday ()
void gotoYesterday ()
void print ()
void selectCurrentMonth ()
void selectCurrentWeek ()
void selectCurrentYear ()
void selectLastMonth ()
void selectLastWeek ()
void selectLastYear ()
void selectToday ()
void selectYesterday ()
void setAllClose ()
void setAllOpen ()
void setEditable (bool editable)
void setListViewWidth (int)
void setScale (Scale)
void setScaleSilent (Scale)
void setShowLegend (bool show)
void setShowListView (bool show)
void setShowTaskLinks (bool show)
void setTimelineToEnd ()
void setTimelineToStart ()
void zoomToFit ()
void zoomToSelection (const QDateTime &start, const QDateTime &end)
void zoomToSelectionAndSetStartEnd (const QDateTime &start, const QDateTime &end)

Signals

void addOneTickLeft ()
void addOneTickRight ()
void dateTimeDoubleClicked (const QDateTime &)
void dropped (QDropEvent *e, KDGanttViewItem *droppedItem, KDGanttViewItem *itemBelowMouse)
void gvContextMenuRequested (KDGanttViewItem *item, const QPoint &pos)
void gvCreateTaskLink (KDGanttViewItem *, int, KDGanttViewItem *, int)
void gvCurrentChanged (KDGanttViewItem *)
void gvItemDoubleClicked (KDGanttViewItem *)
void gvItemLeftClicked (KDGanttViewItem *)
void gvItemMidClicked (KDGanttViewItem *)
void gvItemMoved (KDGanttViewItem *)
void gvItemRightClicked (KDGanttViewItem *)
void gvMouseButtonClicked (int button, KDGanttViewItem *item, const QPoint &pos)
void gvMouseButtonPressed (int button, KDGanttViewItem *item, const QPoint &pos)
void gvMouseButtonReleased (int button, KDGanttViewItem *item, const QPoint &pos)
void gvMouseMove (int button, KDGanttViewItem *item, const QPoint &pos)
void intervalColorRectangleMoved (const QDateTime &start, const QDateTime &end)
void itemChanged (KDGanttViewItem *)
void itemCollapsed (KDGanttViewItem *item)
void itemConfigured (KDGanttViewItem *)
void itemDeleted (KDGanttViewItem *)
void itemDoubleClicked (KDGanttViewItem *)
void itemExpanded (KDGanttViewItem *item)
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 (KDGanttView::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 addIntervalBackgroundColor (KDIntervalColorRectangle *newItem)
void addLegendItem (KDGanttViewItem::Shape shape, const QColor &shapeColor, const QString &text, KDGanttViewItem::Shape shape2, const QColor &shapeColor2, const QString &text2)
void addLegendItem (KDGanttViewItem::Shape shape, const QColor &shapeColor, const QString &text)
int addTickcountForTimeline () const
void addTicksLeft (int num=1)
void addTicksRight (int num=1)
void addUserdefinedLegendHeaderWidget (QWidget *w)
int autoScaleMinorTickCount () const
bool calendarMode () const
void centerTimelineAfterShow (const QDateTime &center)
int childCount () const
void clear ()
void clearAll ()
void clearBackgroundColor ()
void clearLegend ()
bool colors (KDGanttViewItem::Type type, QColor &start, QColor &middle, QColor &end) const
QColor columnBackgroundColor (const QDateTime &column) const
virtual KDGanttViewItem * createNewItem (QString KDGanttViewItemTypeAsString, KDGanttViewItem *parent=0, KDGanttViewItem *after=0, const QString &lvtext=QString(), const QString &name=QString())
virtual KDGanttViewItem * createUserDefinedItem (QString KDGanttViewItemTypeAsString, KDGanttViewItem *parent=0, KDGanttViewItem *after=0, const QString &lvtext=QString(), const QString &name=QString())
QDate currentMonth () const
QDate currentWeek () const
QDate currentYear () const
QColor defaultColor (KDGanttViewItem::Type type) const
QColor defaultHighlightColor (KDGanttViewItem::Type type) const
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 *)
KDGanttViewItem * firstChild () const
int ganttMaximumWidth () const
QDateTime getDateTimeForCoordX (int coordX, bool global=true) const
KDGanttViewItem * getItemAt (const QPoint &pos, bool global=true) const
KDGanttViewItem * getItemByGanttViewPos (const QPoint &pos) const
KDGanttViewItem * getItemByListViewPos (const QPoint &pos) const
KDGanttViewItem * getItemByName (const QString &name) const
KDGanttViewItem * getItemByUid (const QString &name, KDGanttViewItem *parentItem=0) const
bool getUpdateEnabled () const
int getWeekOfYear (const QDate &date)
QColor gvBackgroundColor () const
bool headerVisible () const
bool highlightColors (KDGanttViewItem::Type type, QColor &start, QColor &middle, QColor &end) const
int horBackgroundLines (QBrush &brush) const
QDateTime horizonEnd () const
QDateTime horizonStart () const
HourFormat hourFormat () const
bool isConnectorEnabled (int connector) const
bool isDragEnabled () const
bool isDropEnabled () const
 KDGanttView (QWidget *parent=0, const char *name=0)
KDGanttViewItem * lastItem () const
QDate lastMonth () const
QDate lastWeek () const
QDate lastYear () const
QDockWindow * legendDockwindow () const
QColor legendHeaderBackgroundColor () const
bool legendIsDockwindow () const
QHeader * listViewHeader () 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
int minimumColumnWidth () const
Scale minimumScale () const
int minorScaleCount () const
QBrush noInformationBrush () const
void print (QPrinter *printer, bool printListView=true, bool printTimeLine=true, bool printLegend=false)
virtual void removeColumn (int index)
bool saveProject (QIODevice *)
Scale scale () const
KDGanttViewItem * selectedItem () const
void setAddTickcountForTimeline (int)
void setAllConnectorsEnabled (bool state)
void setAutoScaleMinorTickCount (int count)
void setAutoScrollEnabled (bool state)
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::Second, Scale maxi=KDGanttView::Month)
void setConnectorEnabled (int connector, bool state)
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 setEditorEnabled (bool enable)
void setFixedHorizon (bool f)
void setFont (const QFont &f)
void setGanttMaximumWidth (int w)
void setGermanDateTimeFormat ()
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 setLegendHeaderBackgroundColor (const QColor &)
void setLegendIsDockwindow (bool dock)
void setListViewColumnWidth (int column, int w)
void setLvBackgroundColor (const QColor &)
void setLvVScrollBarMode (QScrollView::ScrollBarMode)
void setMajorScaleCount (int count)
void setMaximumScale (Scale)
void setMinimumColumnWidth (int width)
void setMinimumScale (Scale)
void setMinorScaleCount (int count)
void setNoInformationBrush (const QBrush &brush)
void setPaletteBackgroundColor (const QColor &col)
void setRepaintMode (RepaintMode mode)
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 setShowLegendButton (bool show)
void setShowTicks (ShowTicksType)
void setShowTimeTablePopupMenu (bool)
void setTextColor (const QColor &color)
void setTimeHeaderBackgroundColor (const QColor &)
void setTimeHeaderDateFormatDay (const QString &fmt)
void setTimeHeaderDateFormatMonth (const QString &fmt)
void setTimeHeaderDateFormatWeek (const QString &fmt)
void setTimeHeaderDatetimeFormatHour (const QString &fmt)
void setTimeHeaderDatetimeFormatMinute (const QString &fmt)
void setTimeHeaderDatetimeFormatSecond (const QString &fmt)
void setTimeHeaderTooltipDateTimeFormat (const QString &fmt)
void setUpdateEnabled (bool enable)
void setUserHorizonChangeEnabled (bool b)
void setWeekdayBackgroundColor (const QColor &color, int weekday)
void setWeekendBackgroundColor (const QColor &color)
void setWeekendDays (int start, int end)
void setWeekScaleShowNumber (bool b)
void setWeekStartsMonday (bool b)
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
bool showHeaderPopupMenu () const
bool showLegend () const
bool showLegendButton () const
bool showListView () const
bool showTaskLinks () const
ShowTicksType showTicks () const
bool showTimeTablePopupMenu () const
virtual QSize sizeHint () const
QPtrList
< KDGanttViewTaskLinkGroup > 
taskLinkGroups () const
QPtrList< KDGanttViewTaskLink > taskLinks () const
QColor textColor () const
QColor timeHeaderBackgroundColor () const
QString timeHeaderDateFormatDay () const
QString timeHeaderDateFormatMonth () const
QString timeHeaderDateFormatWeek () const
QString timeHeaderDatetimeFormatHour () const
QString timeHeaderDatetimeFormatMinute () const
QString timeHeaderDatetimeFormatSecond () const
QString timeHeaderTooltipDateTimeFormat () const
KDTimeHeaderWidget * timeHeaderWidget ()
KDTimeTableWidget * timeTableWidget ()
QDate today () const
QDate tomorrow () const
bool userHorizonChangeEnabled () const
QColor weekdayBackgroundColor (int weekday) const
QColor weekendBackgroundColor () const
void weekendDays (int &start, int &end) const
bool weekScaleShowNumber () const
bool weekStartsMonday () const
YearFormat yearFormat () const
QDate yesterday () const
double zoomFactor () const
 ~KDGanttView ()

Static Public Member Functions

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

Protected Member Functions

virtual void closeEvent (QCloseEvent *event)
virtual QDragObject * dragObject ()
virtual void showEvent (QShowEvent *event)
virtual void startDrag ()
virtual void userReadFromElement (QDomElement &element)
virtual void userWriteToElement (QDomDocument &doc, QDomElement &parentElement) const

Properties

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
int minimumColumnWidth
Scale minimumScale
int minorScaleCount
QBrush noInformationBrush
Scale scale
bool showHeaderPopupMenu
bool showLegend
bool showLegendButton
bool showListView
bool showTaskLinks
ShowTicksType showTicks
bool showTimeTablePopupMenu
QColor textColor
QColor timeHeaderBackgroundColor
QColor weekendBackgroundColor
YearFormat yearFormat
double zoomFactor

Member Enumeration Documentation

enum KDGanttView::HourFormat

This enum is used to specify the hour format used in the header.

Enumerator:
Hour_24 
Hour_12 
Hour_24_FourDigit 

Definition at line 115 of file KDGanttView.h.

enum KDGanttView::RepaintMode

Please see setRepaintMode() for a description of the values of this enumeration.

Enumerator:
No 
Medium 
Always 

Definition at line 116 of file KDGanttView.h.

enum KDGanttView::Scale

This enum is used to specify the units of the scales in the header.

Enumerator:
Second 
Minute 
Hour 
Day 
Week 
Month 
Auto 

Definition at line 113 of file KDGanttView.h.

enum KDGanttView::ShowTicksType

Enumerator:
ShowMajorTicks 
ShowMinorTicks 
ShowNoTicks 

Definition at line 117 of file KDGanttView.h.

enum KDGanttView::YearFormat

This enum is used to specify the year format used in the header.

Enumerator:
FourDigit 
TwoDigit 
TwoDigitApostrophe 
NoDate 

Definition at line 114 of file KDGanttView.h.


Constructor & Destructor Documentation

KDGanttView::KDGanttView ( QWidget *  parent = 0,
const char *  name = 0 
)

Constructs an empty KDGanttView.

Parameters:
parent the widget parent
name the internal debugging name

Definition at line 89 of file KDGanttView.cpp.

KDGanttView::~KDGanttView (  ) 

Definition at line 252 of file KDGanttView.cpp.


Member Function Documentation

int KDGanttView::addColumn ( const QIconSet &  iconset,
const QString &  label,
int  width = -1 
) [virtual]

Calls to this method are passed through to the underlying QListView.

Definition at line 4658 of file KDGanttView.cpp.

int KDGanttView::addColumn ( const QString &  label,
int  width = -1 
) [virtual]

Calls to this method are passed through to the underlying QListView.

Definition at line 4648 of file KDGanttView.cpp.

void KDGanttView::addIntervalBackgroundColor ( KDIntervalColorRectangle *  newItem  ) 

Adds a filled rectangle for a time interval given by start and end, across all tasks. start may be later than end.

See also:
KDIntervalColorRectangle

Definition at line 2426 of file KDGanttView.cpp.

void KDGanttView::addLegendItem ( KDGanttViewItem::Shape  shape,
const QColor &  shapeColor,
const QString &  text,
KDGanttViewItem::Shape  shape2,
const QColor &  shapeColor2,
const QString &  text2 
)

Adds an item to the legend with two shapes and text right of the shapes. The text may be empty.

Parameters:
shape the first shape to display
shapeColor the color in which to display the first shape
text the text to display right of the first shape. may be empty.
shape2 the second shape to display
shapeColor2 the color in which to display the second shape
text2 the text to display right of the second shape. may be empty.
See also:
clearLegend()

Definition at line 2029 of file KDGanttView.cpp.

void KDGanttView::addLegendItem ( KDGanttViewItem::Shape  shape,
const QColor &  shapeColor,
const QString &  text 
)

Adds an item to the legend.

Parameters:
shape the shape to display
shapeColor the color in which to display the shape
text the text to display
See also:
clearLegend()

Definition at line 2004 of file KDGanttView.cpp.

void KDGanttView::addOneTickLeft (  )  [signal]

void KDGanttView::addOneTickRight (