kdgantt Library API Documentation

KDGanttViewItem Class Reference

#include <KDGanttViewItem.h>

Inheritance diagram for KDGanttViewItem:

Inheritance graph
[legend]
Collaboration diagram for KDGanttViewItem:

Collaboration graph
[legend]
List of all members.

Public Types

enum  Type { Event, Task, Summary }
enum  Shape {
  TriangleDown, TriangleUp, Diamond, Square,
  Circle
}

Public Member Functions

virtual ~KDGanttViewItem ()
Type type () const
void setEnabled (bool on)
bool enabled () const
virtual void setOpen (bool o)
void setItemVisible (bool on)
bool itemVisible () const
void setEditable (bool editable)
bool editable () const
void setShowNoInformation (bool show)
bool showNoInformation ()
void setDisplaySubitemsAsGroup (bool show)
bool displaySubitemsAsGroup () const
void setPriority (int prio)
int priority ()
virtual void setStartTime (const QDateTime &start)
QDateTime startTime () const
virtual void setEndTime (const QDateTime &end)
QDateTime endTime () const
void setText (const QString &text)
QString text () const
void setListViewText (const QString &text, int column=0)
void setListViewText (int column, const QString &text)
QString listViewText (int column=0) const
void setFont (const QFont &font)
QFont font () const
void setTooltipText (const QString &text)
QString tooltipText () const
void setWhatsThisText (const QString &text)
QString whatsThisText () const
void setPixmap (int column, const QPixmap &pixmap)
void setPixmap (const QPixmap &pixmap)
const QPixmappixmap (int column=0) const
void setHighlight (bool)
bool highlight () const
bool subitemIsCalendar () const
void setShapes (Shape start, Shape middle, Shape end)
void shapes (Shape &start, Shape &middle, Shape &end) const
void setDefaultColor (const QColor &)
QColor defaultColor () const
void setColors (const QColor &start, const QColor &middle, const QColor &end)
void colors (QColor &start, QColor &middle, QColor &end) const
void setDefaultHighlightColor (const QColor &)
QColor defaultHighlightColor () const
void setHighlightColors (const QColor &start, const QColor &middle, const QColor &end)
void highlightColors (QColor &start, QColor &middle, QColor &end) const
void setTextColor (const QColor &color)
QColor textColor () const
void setProgress (int percent)
void setFloatStartTime (const QDateTime &start)
void setFloatEndTime (const QDateTime &end)
KDGanttViewItemfirstChild () const
KDGanttViewItemnextSibling () const
KDGanttViewItemparent () const
KDGanttViewItemitemAbove ()
KDGanttViewItemitemBelow (bool includeDisabled=true)
KDGanttViewItemgetChildByName (const QString &name)
QString name () const
void createNode (QDomDocument &doc, QDomElement &parentElement)

Static Public Member Functions

static KDGanttViewItemfind (const QString &name)
static KDGanttViewItemcreateFromDomElement (KDGanttView *view, QDomElement &element)
static KDGanttViewItemcreateFromDomElement (KDGanttView *view, KDGanttViewItem *previous, QDomElement &element)
static KDGanttViewItemcreateFromDomElement (KDGanttViewItem *parent, QDomElement &element)
static KDGanttViewItemcreateFromDomElement (KDGanttViewItem *parent, KDGanttViewItem *previous, QDomElement &element)

Protected Member Functions

 KDGanttViewItem (Type type, KDGanttView *view, const QString &lvtext=QString::null, const QString &name=QString::null)
 KDGanttViewItem (Type type, KDGanttViewItem *parent, const QString &lvtext=QString::null, const QString &name=QString::null)
 KDGanttViewItem (Type type, KDGanttView *view, KDGanttViewItem *after, const QString &lvtext=QString::null, const QString &name=QString::null)
 KDGanttViewItem (Type type, KDGanttViewItem *parent, KDGanttViewItem *after, const QString &lvtext=QString::null, const QString &name=QString::null)
void updateCanvasItems ()
int getCoordY ()
QDateTime myChildStartTime ()
QDateTime myChildEndTime ()
void generateAndInsertName (const QString &name)
void moveTextCanvas (int x, int y)

Protected Attributes

bool isVisibleInGanttView
KDCanvasLine * startLine
KDCanvasLine * endLine
KDCanvasLine * startLineBack
KDCanvasLine * endLineBack
KDCanvasLine * actualEnd
KDCanvasPolygonItem * startShape
KDCanvasPolygonItem * midShape
KDCanvasPolygonItem * endShape
KDCanvasPolygonItem * progressShape
KDCanvasPolygonItem * startShapeBack
KDCanvasPolygonItem * midShapeBack
KDCanvasPolygonItem * endShapeBack
KDCanvasPolygonItem * floatStartShape
KDCanvasPolygonItem * floatEndShape
KDGanttViewmyGanttView
KDCanvasText * textCanvas
QString textCanvasText
QDateTime myStartTime
QDateTime myEndTime
bool isHighlighted
bool isEditable
int myItemSize
bool blockUpdating
int myProgress
QDateTime myFloatStartTime
QDateTime myFloatEndTime

Friends

class KDGanttView
class KDTimeTableWidget
class KDTimeHeaderWidget
class KDListView
class KDGanttViewTaskLink
class KDGanttViewTaskLinkGroup
class KDGanttCanvasView
class KDGanttViewItemDrag
class itemAttributeDialog

Detailed Description

This class represents an item in a Gantt chart.

This class is an abstract base class, it cannot be instantiated directly. Instead, you should create items of one of the subclasses. This class provides methods common to all Gantt items.

The initialization of the shapes/colors of the item works as follows:

Shapes: When a new item is created, the shapes are set to the default values for items of the type of this item, defined in the KDGanttView class with void setShapes( KDGanttViewItem::Type type, KDGanttViewItem::Shape start, KDGanttViewItem::Shape middle, KDGanttViewItem::Shape end ); If there is no default value defined for this type, the shapes are set as follows: For TaskViewItems all three shapes are set to Square. For SummaryViewItems all three shapes are set to TriangleDown. For EventViewItems all three shapes are set to Diamond.

Colors: When a new item is created, the colors are set to the default values for items of the type of this item, defined in the KDGanttView class with void setColors( KDGanttViewItem::Type type, const QColor& start, const QColor& middle, const QColor& end ); If there is no default value defined for this type, the colors of the shapes are set to the default color for items of this type, defined in the KDGanttView class with: void setDefaultColor( KDGanttViewItem::Type type, const QColor& ); The initial default color in the KDGanttView class is set to blue for KDGanttViewItem::Event, green for KDGanttViewItem::Task, cyan for KDGanttViewItem::Summary.

Highlight Colors: When a new item is created, the highlight colors are set to the default values for items of the type of this item, defined in the KDGanttView class with: void setHighlightColors( KDGanttViewItem::Type type, const QColor& start, const QColor& middle, const QColor& end ); If there is no default value defined for this type, the highlight colors of the shapes are set to the default color for items of this type, defined in the KDGanttView class with: void setDefaultHighlightColor( KDGanttViewItem::Type type, const QColor& ); The initial default highlight color in the KDGanttView class is set to red for all types.

Start/End time: When a new item is created, the start time and the end time is set automatically. The time, which is currently displayed in the middle of the Gantt View, is set as start/end time. At startup of a newly created Gantt view, this is the current time.

The Priority: The priority is set with setPriority(). The priority determines which items are painted over which other items. The item with the highest priority is painted on top of all others. The priority for an item can be between 1 and 199. A priority less than 100 means that the item is painted below the grid in the Gantt chart. For Task items, the default priority is 50, for all other items it is 150. This feature only makes sense for an item which is a child of another item, for which displaySubitemsAsGroup() property is set to true.

The Display Mode: The display mode is set with setDisplaySubitemsAsGroup(). In the normal view mode (set with setDisplaySubitemsAsGroup( false ); ), an item is displayed in the same manner, when its child items are shown or not. In the other mode (set with setDisplaySubitemsAsGroup( true ); ), called "calendar mode", the item is displayed as follows: If the item has no children, it is displayed as usual. If the item is opened (i.e., its children are displayed), the start/end time of this item is computed automatically according to the earliest start time/latest end time of its children. The item and its children are displayed as usual. If the item is closed (i.e., its children are hidden in the left list view), the item itself is hidden, and its children are displayed on the timeline of this item instead. To control the painting of overlapping children, call setPriority() for the childs.

Blocking of user interaction to open item: If you want to block users to open items used as parents of calendar items, call KDGanttView::setCalendarMode( true );

Example 1, Color: If you create an instance of a KDGanttView class and add a SummaryViewItem without setting any color/shape values, you get an item with three shapes of the form TriangleDown in the color magenta. If the item is highlighted, the color will change to the highlight color red.

Example 2, Calender View: To use a Gantt view as a calendar view, call KDGanttView::setCalendarMode( true ); KDGanttView::setDisplaySubitemsAsGroup( true ); Insert root items in the Gantt view. Insert items as children of these root item in the Gantt view. You may use any item type as parent and child; there are no limitations. It is, however, recommended to use KDGanttViewTaskItems Actually, you may add child items to the children themselves. Such a child behaves then like a parent. Now set the start/end time of the children to specify a time interval for these items.

Definition at line 58 of file KDGanttViewItem.h.


Member Enumeration Documentation

enum KDGanttViewItem::Type
 

This enum is used in order to return the type of a Gantt chart item.

Definition at line 61 of file KDGanttViewItem.h.

enum KDGanttViewItem::Shape
 

This enum is used in order to specify the shapes of a Gantt chart item.

Definition at line 62 of file KDGanttViewItem.h.


Constructor & Destructor Documentation

KDGanttViewItem::KDGanttViewItem Type  type,
KDGanttView view,
const QString lvtext = QString::null,
const QString name = QString::null
[protected]
 

Constructs an empty Gantt item.

Parameters:
type the type of the item to insert
view the Gantt view to insert this item into
lvtext the text to show in the list view
name the name by which the item can be identified. If no name is specified, a unique name will be generated

Definition at line 171 of file KDGanttViewItem.cpp.

References generateAndInsertName().

KDGanttViewItem::KDGanttViewItem Type  type,
KDGanttViewItem parentItem,
const QString lvtext = QString::null,
const QString name = QString::null
[protected]
 

Constructs an empty Gantt item.

Parameters:
type the type of the item to insert
parentItem a parent item under which this one goes
lvtext the text to show in the list view
name the name by which the item can be identified. If no name is specified, a unique name will be generated

Definition at line 191 of file KDGanttViewItem.cpp.

References generateAndInsertName().

KDGanttViewItem::KDGanttViewItem Type  type,
KDGanttView view,
KDGanttViewItem after,
const QString lvtext = QString::null,
const QString name = QString::null
[protected]
 

Constructs an empty Gantt item.

Parameters:
type the type of the item to insert
view the Gantt view to insert this item into
after another item at the same level behind which this one should go
lvtext the text to show in the list view
name the name by which the item can be identified. If no name is specified, a unique name will be generated

Definition at line 212 of file KDGanttViewItem.cpp.

References generateAndInsertName().

KDGanttViewItem::KDGanttViewItem Type  type,
KDGanttViewItem parentItem,
KDGanttViewItem after,
const QString lvtext = QString::null,
const QString name = QString::null
[protected]
 

Constructs an empty Gantt item.

Parameters:
type the type of the item to insert
parentItem a parent item under which this one goes
after another item at the same level behind which this one should go
lvtext the text to show in the list view
name the name by which the item can be identified. If no name is specified, a unique name will be generated

Definition at line 234 of file KDGanttViewItem.cpp.

References generateAndInsertName().

KDGanttViewItem::~KDGanttViewItem  )  [virtual]
 

Destroys the object and frees any allocated resources.

Definition at line 248 of file KDGanttViewItem.cpp.

References actualEnd, endLine, endLineBack, endShape, endShapeBack, midShape, midShapeBack, KDGanttView::myCanvasView, myGanttView, KDGanttView::myListView, KDGanttView::myTimeTable, KDGanttView::notifyEditdialog(), parent(), setOpen(), startLine, startLineBack, startShape, startShapeBack, and textCanvas.


Member Function Documentation

void KDGanttViewItem::updateCanvasItems  )  [protected]
 

Updates the colors of the item, but not the coordinates.

Definition at line 1304 of file KDGanttViewItem.cpp.

References blockUpdating, enabled(), endLine, endLineBack, endShape, isHighlighted, midShape, myGanttView, myItemSize, KDGanttView::myTimeTable, startLine, startLineBack, startShape, and textCanvas.

Referenced by KDGanttViewSummaryItem::setActualEndTime(), setColors(), setDefaultColor(), setDefaultHighlightColor(), setDisplaySubitemsAsGroup(), setEnabled(), KDGanttViewTaskItem::setEndTime(), KDGanttViewSummaryItem::setEndTime(), setFont(), setHighlight(), setHighlightColors(), KDGanttViewEventItem::setLeadTime(), KDGanttViewSummaryItem::setMiddleTime(), setPriority(), setShapes(), KDGanttViewTaskItem::setStartTime(), KDGanttViewSummaryItem::setStartTime(), KDGanttViewEventItem::setStartTime(), setText(), and setTextColor().

int KDGanttViewItem::getCoordY  )  [protected]
 

Returns the y coordinate of this item.

Returns:
the y coordinate of this item

Definition at line 1906 of file KDGanttViewItem.cpp.

QDateTime KDGanttViewItem::myChildStartTime  )  [protected]
 

Returns the start time of the children of this item.

Returns:
the start time of the children of this item

Definition at line 1949 of file KDGanttViewItem.cpp.

References displaySubitemsAsGroup(), firstChild(), myChildStartTime(), nextSibling(), and startTime().

Referenced by myChildStartTime().

QDateTime KDGanttViewItem::myChildEndTime  )  [protected]
 

Returns the end time of the children of this item.

Returns:
the end time of the children of this item

Definition at line 1983 of file KDGanttViewItem.cpp.

References displaySubitemsAsGroup(), endTime(), firstChild(), myChildEndTime(), and nextSibling().

Referenced by myChildEndTime().

void KDGanttViewItem::generateAndInsertName const QString name  )  [protected]
 

Generates a unique name if necessary and inserts it into the item dictionary.

Definition at line 286 of file KDGanttViewItem.cpp.

Referenced by KDGanttViewItem().

void KDGanttViewItem::moveTextCanvas int  x,
int  y
[protected]
 

Moves this items text.

Definition at line 2480 of file KDGanttViewItem.cpp.

References moveTextCanvas(), myItemSize, and textCanvas.

Referenced by moveTextCanvas().

KDGanttViewItem::Type KDGanttViewItem::type  )  const
 

Returns the type of the item. This may be Event, Task, Summary.

Returns:
the type of the item

Definition at line 344 of file KDGanttViewItem.cpp.

Referenced by createNode(), and setEndTime().

void KDGanttViewItem::setEnabled bool  on  ) 
 

Specifies whether this item is enabled. If disabled, the item stays in the Gantt view and the item is shown in gray to show that the item is disabled. All signals of this item (like itemLeftClicked( this )) are blocked. If the item displays its subitems (childs) as a group, (displaySubitemsAsGroup() == true) all changes apply to all subitems as well.

Parameters:
on pass true to make this item editable
See also:
enabled ()

Definition at line 362 of file KDGanttViewItem.cpp.

References displaySubitemsAsGroup(), firstChild(), myGanttView, KDGanttView::myTimeTable, nextSibling(), setEnabled(), and updateCanvasItems().

Referenced by setEnabled().

bool KDGanttViewItem::enabled  )  const
 

Returns whether this item is enabled.

Returns:
true if this item is enabled, false otherwise
See also:
setEnabled()

Definition at line 385 of file KDGanttViewItem.cpp.

Referenced by KDGanttView::getItemByGanttViewPos(), itemBelow(), and updateCanvasItems().

void KDGanttViewItem::setOpen bool  open  )  [virtual]
 

This method is reimplemented for internal purposes.

Definition at line 1374 of file KDGanttViewItem.cpp.

Referenced by setDisplaySubitemsAsGroup(), and ~KDGanttViewItem().

void KDGanttViewItem::setItemVisible bool  on  ) 
 

Specifies whether this item is visible.

Parameters:
on pass true to make this item visible
See also:
itemVisible ()

Definition at line 398 of file KDGanttViewItem.cpp.

References myGanttView, and KDGanttView::myTimeTable.

bool KDGanttViewItem::itemVisible  )  const
 

Returns whether this item is visible.

Returns:
true if this item is visible, false otherwise
See also:
setItemVisible()

Definition at line 415 of file KDGanttViewItem.cpp.

void KDGanttViewItem::setEditable bool  editable  ) 
 

Specifies whether this item is editable. The whole Gantt view needs to be editable as well for this to have any effect.

Parameters:
editable pass true to make this item editable
See also:
editable(), KDGanttView::setEditable(), KDGanttView::editable()

Definition at line 430 of file KDGanttViewItem.cpp.

References isEditable.

bool KDGanttViewItem::editable  )  const
 

Returns whether this item is editable.

Returns:
true if this item is editable, false otherwise
See also:
setEditable(), KDGanttView::setEditable(), KDGanttView::editable()

Definition at line 443 of file KDGanttViewItem.cpp.

References isEditable.

void KDGanttViewItem::setShowNoInformation bool  show  ) 
 

Specifies whether the 'showNoInformation' line should be shown for this item. The 'showNoInformation' line is drawn over the whole timeline. The height of the line is the height of the item. The brush of the line is specified by KDGanttView::setNoInformationBrush(). (i.e. the same brush for all items of the Gantt view). The default brush is QBrush( QColor ( 100,100,100 ), Qt::FDiagPattern );

Parameters:
show if true, the 'showNoInformation' line is shown for this item
See also:
showNoInformation(), KDGanttView::setNoInformationBrush(), KDGanttView::noInformationBrush()

Definition at line 2035 of file KDGanttViewItem.cpp.

References myGanttView, and KDGanttView::myTimeTable.

bool KDGanttViewItem::showNoInformation  ) 
 

Returns whether the 'showNoInformation' line should be shown for this item

Returns:
true if showNoInformation line should be shown
See also:
setShowNoInformation(), KDGanttView::setNoInformationBrush(), KDGanttView::noInformationBrush()

Definition at line 2018 of file KDGanttViewItem.cpp.

void KDGanttViewItem::setDisplaySubitemsAsGroup bool  show  ) 
 

Specifies whether this item shows hidden subitems on its timeline. Useful to get a so called "calendar view" with many items in one row. When displaySubitemsAsGroup() is set to true, this item has a normal view, when it is expanded. If it is not expanded (and has at least one child), the item itself is hidden, and all children are displayed instead. To manage the painting priority of the childs (if overlapping), you may set priority() of these items.

Parameters:
show pass true to make this item displaying hidden subitems
See also:
editable(), KDGanttView::setEditable(), KDGanttView::editable(), setPriority()

Definition at line 461 of file KDGanttViewItem.cpp.

References isVisibleInGanttView, parent(), setOpen(), and updateCanvasItems().

Referenced by KDGanttView::setDisplaySubitemsAsGroup().

bool KDGanttViewItem::displaySubitemsAsGroup  )  const
 

Returns whether this item displays hidden subitems. Initial set to false.

Returns:
true if this item displays hidden subitems, false otherwise
See also:
setDisplaySubitemsAsGroup()

Definition at line 482 of file KDGanttViewItem.cpp.

Referenced by myChildEndTime(), myChildStartTime(), setColors(), setDefaultColor(), setDefaultHighlightColor(), setEnabled(), setHighlight(), setHighlightColors(), setTextColor(), and subitemIsCalendar().

void KDGanttViewItem::setPriority int  prio  ) 
 

Specifies the priority of this item. Valid values are between 1 and 199. A priority less than 100 means that the item is painted in the Gantt chart below the grid. A priority more than 100 means that the item is painted in the Gantt chart over the grid. For a value of 100, the behavior is unspecified. An item with a higher priority is painted over an item with a lower priority in the Gantt chart. The painting order of items with the same priority is unspecified. For Calendar items, the default priority is 50, for all other items it is 150. This feature makes only sense for an item which is a child of another item, which displaySubitemsAsGroup() property is set to true.

Parameters:
prio the new priority of this item.
See also:
priority(), displaySubitemsAsGroup()

Definition at line 507 of file KDGanttViewItem.cpp.

References updateCanvasItems().

int KDGanttViewItem::priority  ) 
 

Returns the priority of this item.

Returns:
the priority of this item
See also:
setDisplaySubitemsAsGroup()

Definition at line 523 of file KDGanttViewItem.cpp.

void KDGanttViewItem::setStartTime const QDateTime start  )  [virtual]
 

Specifies the start time of this item. The parameter must be valid and non-null. If the parameter is invalid or null, no value is set. Reimplemented in the subclasses.

Parameters:
start the start time
See also:
startTime(), setEndTime(), endTime()

Reimplemented in KDGanttViewEventItem, KDGanttViewSummaryItem, and KDGanttViewTaskItem.

Definition at line 537 of file KDGanttViewItem.cpp.

QDateTime KDGanttViewItem::startTime  )  const
 

Returns the start time of this item.

Returns:
the start time of this item
See also:
setStartTime(), setEndTime(), endTime()

Definition at line 548 of file KDGanttViewItem.cpp.

References myStartTime.

Referenced by createNode(), myChildStartTime(), KDGanttViewTaskItem::setEndTime(), and KDGanttViewEventItem::setLeadTime().

void KDGanttViewItem::setEndTime const QDateTime end  )  [virtual]
 

Specifies the end time of this item. The parameter must be valid and non-null. If the parameter is invalid or null, no value is set. Reimplemented in the subclasses

Parameters:
end the end time
See also:
endTime(), setStartTime(), startTime()

Reimplemented in KDGanttViewSummaryItem, and KDGanttViewTaskItem.

Definition at line 562 of file KDGanttViewItem.cpp.

References type().

QDateTime KDGanttViewItem::endTime  )  const
 

Returns the end time of this item.

Returns:
the end time of this item
See also:
setEndTime(), setStartTime(), startTime()

Definition at line 586 of file KDGanttViewItem.cpp.

References myEndTime.

Referenced by createNode(), myChildEndTime(), and KDGanttViewTaskItem::setStartTime().

void KDGanttViewItem::setText const QString text  ) 
 

Sets the text to be shown in this item in the Gantt view. For a KDGanttViewTaskItem witht displaySubitemsAsGroup() == true, the text is shown in the item itself and the text is truncated automatically, if it does not fit in the item. For all other item types, the text is shown to the right of the item.

Parameters:
text the text to be shown
See also:
text(), setTextColor(), textColor(), setListViewText(), listViewText()

Definition at line 603 of file KDGanttViewItem.cpp.

References textCanvas, textCanvasText, and updateCanvasItems().

QString KDGanttViewItem::text  )  const
 

Returns the text to be shown in this item in the Gantt view.

Returns:
the text to be shown in this item
See also:
setText(), setTextColor(), textColor(), setListViewText(), listViewText()

Definition at line 618 of file KDGanttViewItem.cpp.

References textCanvasText.

Referenced by createNode().

void KDGanttViewItem::setListViewText const QString text,
int  column = 0
 

Deprecated:
Use setListViewTest( int, const QString& ) instead

Definition at line 627 of file KDGanttViewItem.cpp.

void KDGanttViewItem::setListViewText int  column,
const QString text
 

Sets the text to be shown in this item in the list view.

Parameters:
column the column in which the text will be shown
text the text to be shown
See also:
text(), setTextColor(), textColor(), setText(), listViewText()

Definition at line 640 of file KDGanttViewItem.cpp.

QString KDGanttViewItem::listViewText int  column = 0  )  const
 

Returns the text to be shown in this item in the list view.

Parameters:
column the column in which the text will be shown
Returns:
the text to be shown in this item
See also:
setText(), setTextColor(), textColor(), text(), setListViewText()

Definition at line 654 of file KDGanttViewItem.cpp.

Referenced by createNode(), and getChildByName().

void KDGanttViewItem::setFont const QFont font  ) 
 

Sets the font to be used for the text in this item.

Parameters:
font the font to be shown
See also:
font()

Definition at line 666 of file KDGanttViewItem.cpp.

References textCanvas, and updateCanvasItems().

QFont KDGanttViewItem::font  )  const
 

Returns the font used for the text in this item.

Returns:
the font used for the text in this item
See also:
setFont()

Definition at line 679 of file KDGanttViewItem.cpp.

References textCanvas.

Referenced by createNode().

void KDGanttViewItem::setTooltipText const QString text  ) 
 

Sets the text to show in a tooltip for this item.

Parameters:
text the tooltip text
See also:
tooltipText()

Definition at line 691 of file KDGanttViewItem.cpp.

QString KDGanttViewItem::tooltipText  )  const
 

Returns the tooltip text of this item

Returns:
the tooltip text
See also:
setTooltipText()

Definition at line 703 of file KDGanttViewItem.cpp.

Referenced by createNode().

void KDGanttViewItem::setWhatsThisText const QString text  ) 
 

Sets the text to show in a What's This window for this item.

Parameters:
text the what's this text
See also:
whatsThisText()

Definition at line 716 of file KDGanttViewItem.cpp.

QString KDGanttViewItem::whatsThisText  )  const
 

Returns the what's this text of this item

Returns:
the what's this text
See also:
setWhatsThisText()

Definition at line 729 of file KDGanttViewItem.cpp.

Referenced by createNode().

void KDGanttViewItem::setPixmap int  column,
const QPixmap pixmap
 

Sets the pixmap that is shown in the listview.

Parameters:
column the column in which the pixmap is shown
pixmap the pixmap to show
See also:
pixmap()

Definition at line 1108 of file KDGanttViewItem.cpp.

void KDGanttViewItem::setPixmap const QPixmap pixmap  ) 
 

Deprecated:
use setPixmap( int, const QPixmap& ) instead

Definition at line 1116 of file KDGanttViewItem.cpp.

const QPixmap * KDGanttViewItem::pixmap int  column = 0  )  const
 

Returns a pixmap that is shown in the listview.

Parameters:
column the column for which to query the pixmap
Returns:
a pointer to the pixmap shown
See also:
setPixmap()

Definition at line 1129 of file KDGanttViewItem.cpp.

Referenced by createNode(), and KDGanttViewItemDrag::KDGanttViewItemDrag().

void KDGanttViewItem::setHighlight bool  highlight  ) 
 

Specifies whether this item should be shown highlighted. The user can also highlight items with the mouse. If the item displays its subitems (children) as a group (displaySubitemsAsGroup() == true), all changes apply to all subitems as well.

Parameters:
highlight true in order to highlight, false in order to turn highlighting off for this item
See also:
highlight()

Definition at line 746 of file KDGanttViewItem.cpp.

References displaySubitemsAsGroup(), firstChild(), isHighlighted, myGanttView, KDGanttView::myTimeTable, nextSibling(), setHighlight(), and updateCanvasItems().

Referenced by setHighlight().

bool KDGanttViewItem::highlight  )  const
 

Returns whether this item is highlighted, either programmatically with setHighlight() or by the user with the mouse.

Returns:
true if the item is highlighted
See also:
setHighlight()

Definition at line 769 of file KDGanttViewItem.cpp.

References isHighlighted.

Referenced by createNode().

bool KDGanttViewItem::subitemIsCalendar  )  const
 

Returns whether this item has at least one subitem that is a calendar. A subitem is a calendar, if that item has at least one subitem or displaySubitemAsGroup() is true for that item.

Returns:
true if the item has at least one subitem that is a calendar.

Definition at line 2083 of file KDGanttViewItem.cpp.

References displaySubitemsAsGroup(), firstChild(), and nextSibling().

void KDGanttViewItem::setShapes Shape  start,
Shape  middle,
Shape  end
 

Specifies the shapes to be used for this item.

It is advisable not to use this method, but rather set the shapes for all items of a type with KDGanttView::setShapes() in order to get a uniform Gantt view.

Parameters:
start the start shape
middle the middle shape
end the end shape
See also:
shapes(), setColors(), colors()

Definition at line 787 of file KDGanttViewItem.cpp.

References endShape, endShapeBack, midShape, midShapeBack, startShape, startShapeBack, and updateCanvasItems().

void KDGanttViewItem::shapes Shape start,
Shape middle,
Shape end
const
 

Returns the shapes used for this item

Parameters:
start returns the start shape
middle returns the middle shape
end returns the end shape
See also:
setShapes(), setColors(), colors()

Definition at line 937 of file KDGanttViewItem.cpp.

Referenced by createNode(), and KDGanttViewItemDrag::KDGanttViewItemDrag().

void KDGanttViewItem::setDefaultColor const QColor color  ) 
 

Sets the default color that is used for the item if no specific start, middle, or end colors are set.

It is advisable not to use this method, but rather set the colors for all items of a type with KDGanttView::setDefaultColor() in order to get a uniform Gantt view.

If the item displays its subitems (children) as a group, (displaySubitemsAsGroup() == true) all changes apply to all subitems as well.

Parameters:
color the default color to use
See also:
defaultColor(), setColors(), colors()

Definition at line 1150 of file KDGanttViewItem.cpp.

References displaySubitemsAsGroup(), firstChild(), myGanttView, KDGanttView::myTimeTable, nextSibling(), setDefaultColor(), and updateCanvasItems().

Referenced by setDefaultColor().

QColor KDGanttViewItem::defaultColor  )  const
 

Returns the default color that is used for the item if no specific start, middle, or end colors are set.

Returns:
color the default color used
See also:
setDefaultColor(), setColors(), colors()

Definition at line 1176 of file KDGanttViewItem.cpp.

Referenced by createNode().

void KDGanttViewItem::setColors const QColor start,
const QColor middle,
const QColor end
 

Specifies the colors in which to draw the shapes of this item.

It is advisable not to use this method, but rather set the colors for all items of a type with KDGanttView::setColors() in order to get a uniform Gantt view.

Parameters:
start the color for the start shape
middle the color for the middle shape
end the color for the end shape
See also:
colors(), setShapes(), shapes(), setDefaultColor(), defaultColor()

Definition at line 957 of file KDGanttViewItem.cpp.

References displaySubitemsAsGroup(), firstChild(), myGanttView, KDGanttView::myTimeTable, nextSibling(), setColors(), and updateCanvasItems().

Referenced by setColors().

void KDGanttViewItem::colors QColor start,
QColor middle,
QColor end
const
 

Returns the colors used for this item

Parameters:
start returns the start color
middle returns the middle color
end returns the end color
See also:
setColors(), setShapes(), shapes(), setDefaultColor(), defaultColor()

Definition at line 985 of file KDGanttViewItem.cpp.

Referenced by createNode(), and KDGanttViewItemDrag::KDGanttViewItemDrag().

void KDGanttViewItem::setDefaultHighlightColor const QColor color  ) 
 

Sets the default highlighting color that is used for the item if no specific start, middle, or end colors are set.

It is advisable not to use this method, but rather set the colors for all items of a type with KDGanttView::setDefaultHighlightColor() in order to get a uniform Gantt view.

If the item displays its subitems (children) as a group, (displaySubitemsAsGroup() == true) all changes apply to all subitems as well.

Parameters:
color the default highlighting color to use
See also:
defaultHighlightColor(), setHighlightColors(), highlightColors()

Definition at line 1197 of file KDGanttViewItem.cpp.

References displaySubitemsAsGroup(), firstChild(), myGanttView, KDGanttView::myTimeTable, nextSibling(), setDefaultHighlightColor(), and updateCanvasItems().

Referenced by setDefaultHighlightColor().

QColor KDGanttViewItem::defaultHighlightColor  )  const
 

Returns the default highlighting color that is used for the item if no specific start, middle, or end colors are set.

Returns:
color the default highlighting color used
See also:
setDefaultHighlightColor(), setHighlightColors(), highlightColors()

Definition at line 1220 of file KDGanttViewItem.cpp.

Referenced by createNode().

void KDGanttViewItem::setHighlightColors const QColor start,
const QColor middle,
const QColor end
 

Specifies the highlight colors in which to draw the shapes of this item.

It is advisable not to use this method, but rather set the highlight colors for all items of a type with KDGanttView::setHighlightColors() in order to get a uniform Gantt view.

If the item displays its subitems (children) as a group, (displaySubitemsAsGroup() == true) all changes apply to all subitems as well.

Parameters:
start the highlight color for the start shape
middle the highlight color for the middle shape
end the highlight color for the end shape
See also:
highlightColors(), setShapes(), shapes()

Definition at line 1011 of file KDGanttViewItem.cpp.

References displaySubitemsAsGroup(), firstChild(), myGanttView, KDGanttView::myTimeTable, nextSibling(), setHighlightColors(), and updateCanvasItems().

Referenced by setHighlightColors().

void KDGanttViewItem::highlightColors QColor start,
QColor middle,
QColor end
const
 

Returns the highlight colors used for this item

Parameters:
start returns the start highlight color
middle returns the middle highlight color
end returns the end highlight color
See also:
setHighlightColors(), setShapes(), shapes()

Definition at line 1037 of file KDGanttViewItem.cpp.

Referenced by createNode().

void KDGanttViewItem::setTextColor const QColor color  ) 
 

Specifies the color to be used for the text of this item.

It is advisable not to use this method, but rather set the text color for all items with KDGanttView::setTextColor() in order to get a uniform Gantt view. If the item displays its subitems (children) as a group, (displaySubitemsAsGroup() == true) all changes apply to all subitems as well.

Parameters:
color the text color
See also:
textColor(), setText(), text()

Definition at line 1057 of file KDGanttViewItem.cpp.

References displaySubitemsAsGroup(), firstChild(), myGanttView, KDGanttView::myTimeTable, nextSibling(), setTextColor(), and updateCanvasItems().

Referenced by setTextColor().

QColor KDGanttViewItem::textColor  )  const
 

Returns the color used for the text of this item.

Returns:
the text color
See also:
setTextColor(), setText(), text()

Definition at line 1080 of file KDGanttViewItem.cpp.

Referenced by createNode().

void KDGanttViewItem::setProgress int  percent  ) 
 

Specifies the progress of this item in percent. Progress is limited to minimum 0, maximum 100.

Parameters:
percent the progress in percent.

Definition at line 2523 of file KDGanttViewItem.cpp.

void KDGanttViewItem::setFloatStartTime const QDateTime start  ) 
 

Specifies the float start time of this item. If the time is invalid, the start float is not shown.

Parameters:
start the float start time

Definition at line 2535 of file KDGanttViewItem.cpp.

void KDGanttViewItem::setFloatEndTime const QDateTime end  ) 
 

Specifies the float end time of this item. If the time is invalid, the end float is not shown.

Parameters:
end the float end time

Definition at line 2546 of file KDGanttViewItem.cpp.

KDGanttViewItem * KDGanttViewItem::firstChild  )  const
 

Returns the first child of this item.

Returns:
the first child of this item, 0 if this item has no children

Definition at line 1231 of file KDGanttViewItem.cpp.

Referenced by createNode(), getChildByName(), myChildEndTime(), myChildStartTime(), setColors(), setDefaultColor(), setDefaultHighlightColor(), setEnabled(), setHighlight(), setHighlightColors(), setTextColor(), and subitemIsCalendar().

KDGanttViewItem * KDGanttViewItem::nextSibling  )  const
 

Returns the next sibling item of this item

Returns:
the next sibling item of this item, 0 if this item has no more siblings

Definition at line 1244 of file KDGanttViewItem.cpp.

Referenced by createNode(), getChildByName(), KDGanttView::getItemByName(), myChildEndTime(), myChildStartTime(), setColors(), setDefaultColor(), setDefaultHighlightColor(), setEnabled(), setHighlight(), setHighlightColors(), setTextColor(), and subitemIsCalendar().

KDGanttViewItem * KDGanttViewItem::parent  )  const
 

Returns the parent item of this item

Returns:
the parent item of this item, 0 if this item is a top-level item

Definition at line 1256 of file KDGanttViewItem.cpp.

Referenced by setDisplaySubitemsAsGroup(), and ~KDGanttViewItem().

KDGanttViewItem * KDGanttViewItem::itemAbove  ) 
 

Returns the item above this item in the listview

Returns:
the item above this item, 0 if this is the first item

Definition at line 1267 of file KDGanttViewItem.cpp.

KDGanttViewItem * KDGanttViewItem::itemBelow bool  includeDisabled = true  ) 
 

Returns the item below this item in the listview. It can be specified whether the disabled items are taken into account as well.

Parameters:
includeDisabled if true, disabled items are considered as well
Returns:
the item below this item, 0 if this is the last item

Definition at line 1281 of file KDGanttViewItem.cpp.

References enabled().

Referenced by KDGanttView::getItemAt().

KDGanttViewItem * KDGanttViewItem::getChildByName const QString name  ) 
 

If the name of this item is name (i.e., listViewText() == name), the pointer to this item is returned. Otherwise, it looks for an item with name name in the set of children and subchildren of this item.

Parameters:
name the name of the item
Returns:
the pointer to the item with name name

Definition at line 2050 of file KDGanttViewItem.cpp.

References firstChild(), getChildByName(), listViewText(), and nextSibling().

Referenced by getChildByName(), and KDGanttView::getItemByName().

QString KDGanttViewItem::name  )  const
 

Returns the unique name that can identify the item.

Returns:
the unique item name

Definition at line 314 of file KDGanttViewItem.cpp.

Referenced by KDGanttViewTaskLink::createNode(), and createNode().

KDGanttViewItem * KDGanttViewItem::find const QString name  )  [static]
 

Returns the item with the specified name.

Parameters:
name the name to search for
Returns:
the item with the specified name; 0 if no group with that name exists

Definition at line 328 of file KDGanttViewItem.cpp.

Referenced by KDGanttViewTaskLink::createFromDomElement().

void KDGanttViewItem::createNode QDomDocument doc,
QDomElement parentElement
 

Creates a DOM node that describes this item.

Parameters:
doc the DOM document to which the node belongs
parentElement the element into which to insert this node

Definition at line 1550 of file KDGanttViewItem.cpp.

References colors(), createNode(), defaultColor(), defaultHighlightColor(), endShape, endTime(), firstChild(), font(), highlight(), highlightColors(), listViewText(), name(), nextSibling(), pixmap(), shapes(), startShape, startTime(), text(), textColor(), tooltipText(), type(), and whatsThisText().

Referenced by createNode(), and KDGanttViewItemDrag::KDGanttViewItemDrag().

KDGanttViewItem * KDGanttViewItem::createFromDomElement KDGanttView view,
QDomElement element
[static]
 

Creates a KDGanttViewItem according to the specification in a DOM element.

Parameters:
view the view in which the item will be inserted
element the DOM element from which to read the specification
Returns:
the newly created item

Definition at line 1615 of file KDGanttViewItem.cpp.

References loadFromDomElement().

KDGanttViewItem * KDGanttViewItem::createFromDomElement KDGanttView view,
KDGanttViewItem previous,
QDomElement element
[static]
 

Creates a KDGanttViewItem according to the specification in a DOM element.

Parameters:
view the view in which the item will be inserted
previous to item behind this one should appear
element the DOM element from which to read the specification
Returns:
the newly created element

Definition at line 1646 of file KDGanttViewItem.cpp.

References loadFromDomElement().

KDGanttViewItem * KDGanttViewItem::createFromDomElement KDGanttViewItem parent,
QDomElement element
[static]
 

Creates a KDGanttViewItem according to the specification in a DOM element.

Parameters:
parent the parent item under which the item will be inserted
element the DOM element from which to read the specification
Returns:
the newly created element

Definition at line 1679 of file KDGanttViewItem.cpp.

References loadFromDomElement().

KDGanttViewItem * KDGanttViewItem::createFromDomElement KDGanttViewItem parent,
KDGanttViewItem previous,
QDomElement element
[static]
 

Creates a KDGanttViewItem according to the specification in a DOM element.

Parameters:
parent the parent item under which the item will be inserted
previous to item behind this one should appear
element the DOM element from which to read the specification
Returns:
the newly created element

Definition at line 1710 of file KDGanttViewItem.cpp.

References loadFromDomElement().


Member Data Documentation

KDGanttViewItem::isVisibleInGanttView [protected]
 

this instance variable is true if the item is visible in the Gantt view

Referenced by setDisplaySubitemsAsGroup().

KDGanttViewItem::startLine [protected]
 

the line at the beginning of the item

Referenced by updateCanvasItems(), and ~KDGanttViewItem().

KDGanttViewItem::endLine [protected]
 

the line at the end of the item

Referenced by updateCanvasItems(), and ~KDGanttViewItem().

KDGanttViewItem::startLineBack [protected]
 

the background line at the beginning of the item

Referenced by updateCanvasItems(), and ~KDGanttViewItem().

KDGanttViewItem::endLineBack [protected]
 

the background line at the end of the item

Referenced by updateCanvasItems(), and ~KDGanttViewItem().

KDGanttViewItem::actualEnd [protected]
 

the line at the actual end of the item

Referenced by ~KDGanttViewItem().

KDGanttViewItem::startShape [protected]
 

the shape at the beginning of the item

Referenced by createNode(), setShapes(), updateCanvasItems(), and ~KDGanttViewItem().

KDGanttViewItem::midShape [protected]
 

the shape in the middle of the item

Referenced by setShapes(), updateCanvasItems(), and ~KDGanttViewItem().

KDGanttViewItem::endShape [protected]
 

the shape at the end of the item

Referenced by createNode(), setShapes(), updateCanvasItems(), and ~KDGanttViewItem().

KDGanttViewItem::startShapeBack [protected]
 

the background shape at the beginning of the item

Referenced by setShapes(), and ~KDGanttViewItem().

KDGanttViewItem::midShapeBack [protected]
 

the background shape in the middle of the item

Referenced by setShapes(), and ~KDGanttViewItem().

KDGanttViewItem::endShapeBack [protected]
 

the background shape at the end of the item

Referenced by setShapes(), and ~KDGanttViewItem().

KDGanttViewItem::myGanttView [protected]
 

a pointer to the KDGanttView object to which this item belongs

Referenced by KDGanttViewItemDrag::KDGanttViewItemDrag(), setColors(), setDefaultColor(), setDefaultHighlightColor(), setEnabled(), setHighlight(), setHighlightColors(), setItemVisible(), setShowNoInformation(), setTextColor(), updateCanvasItems(), and ~KDGanttViewItem().

KDGanttViewItem::textCanvas [protected]
 

the text object that is used for this item

Referenced by font(), moveTextCanvas(), setFont(), setText(), updateCanvasItems(), and ~KDGanttViewItem().

KDGanttViewItem::textCanvasText [protected]
 

the actual string that is displayed in the text object for this item

Referenced by setText(), and text().

KDGanttViewItem::myStartTime [protected]
 

the starting time of this item

Referenced by KDGanttViewEventItem::leadTime(), KDGanttViewSummaryItem::middleTime(), KDGanttViewSummaryItem::setMiddleTime(), KDGanttViewTaskItem::setStartTime(), KDGanttViewSummaryItem::setStartTime(), KDGanttViewEventItem::setStartTime(), and startTime().

KDGanttViewItem::myEndTime [protected]
 

the ending time of this item

Referenced by KDGanttViewSummaryItem::actualEndTime(), endTime(), KDGanttViewTaskItem::setEndTime(), KDGanttViewSummaryItem::setEndTime(), KDGanttViewSummaryItem::setMiddleTime(), and KDGanttViewEventItem::setStartTime().

KDGanttViewItem::isHighlighted [protected]
 

whether this item is currently highlighted or not

Referenced by highlight(), setHighlight(), and updateCanvasItems().

KDGanttViewItem::isEditable [protected]
 

whether this item is currently editable or not

Referenced by editable(), and setEditable().

KDGanttViewItem::myItemSize [protected]
 

the current size of this item

Referenced by moveTextCanvas(), and updateCanvasItems().

KDGanttViewItem::blockUpdating [protected]
 

if true, updates to this item are currently blocked, to reduce flicker or speed up redraws

Referenced by updateCanvasItems().


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for kdgantt Library Version 1.4.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Mon Feb 13 09:42:33 2006 by doxygen 1.4.2 written by Dimitri van Heesch, © 1997-2003