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

kdgantt2

  • sources
  • kde-4.12
  • kdepim
  • kdgantt2
kdganttgraphicsitem.cpp
Go to the documentation of this file.
1 /****************************************************************************
2  ** Copyright (C) 2001-2006 Klarälvdalens Datakonsult AB. All rights reserved.
3  **
4  ** This file is part of the KD Gantt library.
5  **
6  ** This file may be distributed and/or modified under the terms of the
7  ** GNU General Public License version 2 as published by the Free Software
8  ** Foundation and appearing in the file LICENSE.GPL included in the
9  ** packaging of this file.
10  **
11  ** Licensees holding valid commercial KD Gantt licenses may use this file in
12  ** accordance with the KD Gantt Commercial License Agreement provided with
13  ** the Software.
14  **
15  ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
16  ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
17  **
18  ** See http://www.kdab.net/kdgantt for
19  ** information about KD Gantt Commercial License Agreements.
20  **
21  ** Contact info@kdab.net if any conditions of this
22  ** licensing are not clear to you.
23  **
24  **********************************************************************/
25 #include "kdganttgraphicsitem.h"
26 #include "kdganttgraphicsscene.h"
27 #include "kdganttgraphicsview.h"
28 #include "kdganttitemdelegate.h"
29 #include "kdganttconstraintgraphicsitem.h"
30 #include "kdganttconstraintmodel.h"
31 #include "kdganttabstractgrid.h"
32 #include "kdganttabstractrowcontroller.h"
33 
34 #include <cassert>
35 #include <cmath>
36 #include <algorithm>
37 #include <iterator>
38 
39 #include <QPainter>
40 #include <QAbstractItemModel>
41 #include <QAbstractProxyModel>
42 #include <QItemSelectionModel>
43 #include <QGraphicsSceneMouseEvent>
44 #include <QGraphicsLineItem>
45 
46 #include <QDebug>
47 
52 using namespace KDGantt;
53 
54 typedef QGraphicsItem BASE;
55 
56 namespace {
57  class Updater {
58  bool *u_ptr;
59  bool oldval;
60  public:
61  Updater( bool* u ) : u_ptr( u ), oldval( *u ) {
62  *u=true;
63  }
64  ~Updater() {
65  *u_ptr = oldval;
66  }
67  };
68 }
69 
70 GraphicsItem::GraphicsItem( QGraphicsItem* parent, GraphicsScene* scene )
71  : BASE( parent, scene ), m_isupdating( false )
72 {
73  init();
74 }
75 
76 GraphicsItem::GraphicsItem( const QModelIndex& idx, QGraphicsItem* parent,
77  GraphicsScene* scene )
78  : BASE( parent, scene ), m_index( idx ), m_isupdating( false )
79 {
80  init();
81 }
82 
83 GraphicsItem::~GraphicsItem()
84 {
85 }
86 
87 void GraphicsItem::init()
88 {
89 #if QT_VERSION >= QT_VERSION_CHECK(4,4,0)
90  setCacheMode( QGraphicsItem::DeviceCoordinateCache );
91 #endif
92  setFlags( ItemIsMovable|ItemIsSelectable|ItemIsFocusable );
93  setAcceptsHoverEvents( true );
94  setHandlesChildEvents( true );
95  setZValue( 100. );
96  m_dragline = 0;
97 }
98 
99 int GraphicsItem::type() const
100 {
101  return Type;
102 }
103 
104 StyleOptionGanttItem GraphicsItem::getStyleOption() const
105 {
106  StyleOptionGanttItem opt;
107  opt.itemRect = rect();
108  opt.boundingRect = boundingRect();
109  QVariant tp = m_index.model()->data( m_index, TextPositionRole );
110  if(tp.isValid()) {
111  opt.displayPosition = static_cast<StyleOptionGanttItem::Position>(tp.toInt());
112  } else {
113 #if 0
114  qDebug() << "Item" << m_index.model()->data( m_index, Qt::DisplayRole ).toString()
115  << ", ends="<<m_endConstraints.size() << ", starts="<<m_startConstraints.size();
116 #endif
117  opt.displayPosition = m_endConstraints.size()<m_startConstraints.size()?StyleOptionGanttItem::Left:StyleOptionGanttItem::Right;
118 #if 0
119  qDebug() << "choosing" << opt.displayPosition;
120 #endif
121  }
122  QVariant da = m_index.model()->data( m_index, Qt::TextAlignmentRole );
123  if ( da.isValid() ) {
124  opt.displayAlignment = static_cast< Qt::Alignment >( da.toInt() );
125  } else {
126  switch( opt.displayPosition ) {
127  case StyleOptionGanttItem::Left: opt.displayAlignment = Qt::AlignLeft|Qt::AlignVCenter; break;
128  case StyleOptionGanttItem::Right: opt.displayAlignment = Qt::AlignRight|Qt::AlignVCenter; break;
129  case StyleOptionGanttItem::Center: opt.displayAlignment = Qt::AlignCenter; break;
130  }
131  }
132  opt.grid = scene()->grid();
133  opt.text = m_index.model()->data( m_index, Qt::DisplayRole ).toString();
134  if ( isEnabled() ) opt.state |= QStyle::State_Enabled;
135  if ( isSelected() ) opt.state |= QStyle::State_Selected;
136  if ( hasFocus() ) opt.state |= QStyle::State_HasFocus;
137  return opt;
138 }
139 
140 GraphicsScene* GraphicsItem::scene() const
141 {
142  return qobject_cast<GraphicsScene*>( QGraphicsItem::scene() );
143 }
144 
145 void GraphicsItem::setRect( const QRectF& r )
146 {
147 #if 0
148  qDebug() << "GraphicsItem::setRect("<<r<<"), txt="<<m_index.model()->data( m_index, Qt::DisplayRole ).toString();
149  if ( m_index.model()->data( m_index, Qt::DisplayRole ).toString() == QLatin1String("Code Freeze" ) ) {
150  qDebug() << "gotcha";
151  }
152 #endif
153 
154  prepareGeometryChange();
155  m_rect = r;
156  updateConstraintItems();
157  update();
158 }
159 
160 void GraphicsItem::setBoundingRect( const QRectF& r )
161 {
162  prepareGeometryChange();
163  m_boundingrect = r;
164  update();
165 }
166 
167 bool GraphicsItem::isEditable() const
168 {
169  return !scene()->isReadOnly() && m_index.model()->flags( m_index ) & Qt::ItemIsEditable;
170 }
171 
172 void GraphicsItem::paint( QPainter* painter, const QStyleOptionGraphicsItem* option,
173  QWidget* widget )
174 {
175  Q_UNUSED( widget );
176  if ( boundingRect().isValid() && scene() ) {
177  StyleOptionGanttItem opt = getStyleOption();
178  *static_cast<QStyleOption*>(&opt) = *static_cast<const QStyleOption*>( option );
179  //opt.fontMetrics = painter->fontMetrics();
180  scene()->itemDelegate()->paintGanttItem( painter, opt, index() );
181  }
182 }
183 
184 void GraphicsItem::setIndex( const QPersistentModelIndex& idx )
185 {
186  m_index=idx;
187  update();
188 }
189 
190 QString GraphicsItem::ganttToolTip() const
191 {
192  // TODO: Make delegate handle this
193  const QAbstractItemModel* model = index().model();
194  if ( !model ) return QString();
195 #if 0
196  QString dbgstr;
197  QDebug( &dbgstr ) << m_index;
198  return dbgstr;
199 #endif
200  QString tip = model->data( index(), Qt::ToolTipRole ).toString();
201  if ( !tip.isNull() ) return tip;
202  else return GraphicsScene::tr( "%1 -> %2: %3" )
203  .arg( model->data( index(), StartTimeRole ).toString() )
204  .arg( model->data( index(), EndTimeRole ).toString() )
205  .arg( model->data( index(), Qt::DisplayRole ).toString() );
206 }
207 
208 QRectF GraphicsItem::boundingRect() const
209 {
210  return m_boundingrect;
211 }
212 
213 QPointF GraphicsItem::startConnector() const
214 {
215  return mapToScene( m_rect.right(), m_rect.top()+m_rect.height()/2. );
216 }
217 
218 QPointF GraphicsItem::endConnector() const
219 {
220  return mapToScene( m_rect.left(), m_rect.top()+m_rect.height()/2. );
221 }
222 
223 
224 void GraphicsItem::constraintsChanged()
225 {
226  if ( !scene() || !scene()->itemDelegate() ) return;
227  const Span bs = scene()->itemDelegate()->itemBoundingSpan( getStyleOption(), index() );
228  const QRectF br = boundingRect();
229  setBoundingRect( QRectF( bs.start(), 0., bs.length(), br.height() ) );
230 }
231 
232 void GraphicsItem::addStartConstraint( ConstraintGraphicsItem* item )
233 {
234  assert( item );
235  m_startConstraints << item;
236  item->setStart( startConnector() );
237  constraintsChanged();
238 }
239 
240 void GraphicsItem::addEndConstraint( ConstraintGraphicsItem* item )
241 {
242  assert( item );
243  m_endConstraints << item;
244  item->setEnd( endConnector() );
245  constraintsChanged();
246 }
247 
248 void GraphicsItem::removeStartConstraint( ConstraintGraphicsItem* item )
249 {
250  assert( item );
251  m_startConstraints.removeAll( item );
252  constraintsChanged();
253 }
254 
255 void GraphicsItem::removeEndConstraint( ConstraintGraphicsItem* item )
256 {
257  assert( item );
258  m_endConstraints.removeAll( item );
259  constraintsChanged();
260 }
261 
262 void GraphicsItem::updateConstraintItems()
263 {
264  QPointF s = startConnector();
265  QPointF e = endConnector();
266  { // Workaround for multiple definition error with MSVC6
267  Q_FOREACH( ConstraintGraphicsItem* item, m_startConstraints ) {
268  item->setStart( s );
269  }}
270  {// Workaround for multiple definition error with MSVC6
271  Q_FOREACH( ConstraintGraphicsItem* item, m_endConstraints ) {
272  item->setEnd( e );
273  }}
274 }
275 
276 void GraphicsItem::updateItem( const Span& rowGeometry, const QPersistentModelIndex& idx )
277 {
278  //qDebug() << "GraphicsItem::updateItem("<<rowGeometry<<idx<<")";
279  Updater updater( &m_isupdating );
280  if ( !idx.isValid() || idx.data( ItemTypeRole )==TypeMulti ) {
281  setRect( QRectF() );
282  hide();
283  return;
284  }
285 
286  const Span s = scene()->grid()->mapToChart( idx );
287  setPos( QPointF( s.start(), rowGeometry.start() ) );
288  setRect( QRectF( 0., 0., s.length(), rowGeometry.length() ) );
289  setIndex( idx );
290  const Span bs = scene()->itemDelegate()->itemBoundingSpan( getStyleOption(), index() );
291  //qDebug() << "boundingSpan for" << getStyleOption().text << rect() << "is" << bs;
292  setBoundingRect( QRectF( bs.start(), 0., bs.length(), rowGeometry.length() ) );
293  const int maxh = scene()->rowController()->maximumItemHeight();
294  if ( maxh < rowGeometry.length() ) {
295  QRectF r = rect();
296  const Qt::Alignment align = getStyleOption().displayAlignment;
297  if ( align & Qt::AlignTop ) {
298  // Do nothing
299  } else if ( align & Qt::AlignBottom ) {
300  r.setY( rowGeometry.length()-maxh );
301  } else {
302  // Center
303  r.setY( ( rowGeometry.length()-maxh ) / 2. );
304  }
305  r.setHeight( maxh );
306  setRect( r );
307  }
308 
309  //scene()->setSceneRect( scene()->sceneRect().united( mapToScene( boundingRect() ).boundingRect() ) );
310  //updateConstraintItems();
311 }
312 
313 QVariant GraphicsItem::itemChange( GraphicsItemChange change, const QVariant& value )
314 {
315  if ( !isUpdating() && change==ItemPositionChange && scene() ) {
316  QPointF newPos=value.toPointF();
317  if ( isEditable() ) {
318  newPos.setY( pos().y() );
319  return newPos;
320  } else {
321  return pos();
322  }
323  } else if ( change==QGraphicsItem::ItemSelectedChange ) {
324  if ( index().isValid() && !( index().model()->flags( index() ) & Qt::ItemIsSelectable ) ) {
325  // Reject selection attempt
326  return qVariantFromValue( false );
327  }
328 
329  if ( value.toBool() ) {
330  scene()->selectionModel()->select( index(), QItemSelectionModel::Select );
331  } else {
332  scene()->selectionModel()->select( index(), QItemSelectionModel::Deselect );
333  }
334  }
335 
336  return QGraphicsItem::itemChange( change, value );
337 }
338 
339 void GraphicsItem::focusInEvent( QFocusEvent* event )
340 {
341  Q_UNUSED( event );
342  scene()->selectionModel()->select( index(), QItemSelectionModel::SelectCurrent );
343 }
344 
345 void GraphicsItem::updateModel()
346 {
347  //qDebug() << "GraphicsItem::updateModel()";
348  if ( isEditable() ) {
349  QAbstractItemModel* model = const_cast<QAbstractItemModel*>( index().model() );
350  ConstraintModel* cmodel = scene()->constraintModel();
351  assert( model );
352  assert( cmodel );
353  Q_UNUSED( cmodel );
354  if ( model ) {
355  //ItemType typ = static_cast<ItemType>( model->data( index(),
356  // ItemTypeRole ).toInt() );
357  const QModelIndex sourceIdx = scene()->summaryHandlingModel()->mapToSource( index() );
358  Q_UNUSED( sourceIdx );
359  QList<Constraint> constraints;
360  for( QList<ConstraintGraphicsItem*>::iterator it1 = m_startConstraints.begin() ;
361  it1 != m_startConstraints.end() ;
362  ++it1 )
363  constraints.push_back((*it1)->proxyConstraint());
364  for( QList<ConstraintGraphicsItem*>::iterator it2 = m_endConstraints.begin() ;
365  it2 != m_endConstraints.end() ;
366  ++it2 )
367  constraints.push_back((*it2)->proxyConstraint());
368  if ( scene()->grid()->mapFromChart( Span( scenePos().x(), rect().width() ),
369  index(),
370  constraints ) ) {
371  scene()->updateRow( index().parent() );
372  }
373  }
374  }
375 }
376 
377 void GraphicsItem::hoverMoveEvent( QGraphicsSceneHoverEvent* event )
378 {
379  if ( !isEditable() ) return;
380  StyleOptionGanttItem opt = getStyleOption();
381  ItemDelegate::InteractionState istate = scene()->itemDelegate()->interactionStateFor( event->pos(), opt, index() );
382  switch( istate ) {
383  case ItemDelegate::State_ExtendLeft:
384 #ifndef QT_NO_CURSOR
385  setCursor( Qt::SizeHorCursor );
386 #endif
387  scene()->itemEntered( index() );
388  break;
389  case ItemDelegate::State_ExtendRight:
390 #ifndef QT_NO_CURSOR
391  setCursor( Qt::SizeHorCursor );
392 #endif
393  scene()->itemEntered( index() );
394  break;
395  case ItemDelegate::State_Move:
396 #ifndef QT_NO_CURSOR
397  setCursor( Qt::SplitHCursor );
398 #endif
399  scene()->itemEntered( index() );
400  break;
401  default:
402 #ifndef QT_NO_CURSOR
403  unsetCursor();
404 #endif
405  break;
406  };
407 }
408 
409 void GraphicsItem::hoverLeaveEvent( QGraphicsSceneHoverEvent* )
410 {
411 #ifndef QT_NO_CURSOR
412  unsetCursor();
413 #endif
414 }
415 
416 void GraphicsItem::mousePressEvent( QGraphicsSceneMouseEvent* event )
417 {
418  //qDebug() << "GraphicsItem::mousePressEvent("<<event<<")";
419  StyleOptionGanttItem opt = getStyleOption();
420  m_istate = scene()->itemDelegate()->interactionStateFor( event->pos(), opt, index() );
421  m_presspos = event->pos();
422  m_pressscenepos = event->scenePos();
423  scene()->itemPressed( index() );
424 
425  switch( m_istate ) {
426  case ItemDelegate::State_ExtendLeft:
427  case ItemDelegate::State_ExtendRight:
428  default: /* None and Move */
429  BASE::mousePressEvent( event );
430  break;
431  }
432 }
433 
434 void GraphicsItem::mouseReleaseEvent( QGraphicsSceneMouseEvent* event )
435 {
436  //qDebug() << "GraphicsItem::mouseReleaseEvent("<<event << ")";
437  if ( !m_presspos.isNull() ) {
438  scene()->itemClicked( index() );
439  }
440  delete m_dragline; m_dragline = 0;
441  if ( scene()->dragSource() ) {
442  // Create a new constraint
443  GraphicsItem* other = qgraphicsitem_cast<GraphicsItem*>( scene()->itemAt( event->scenePos() ) );
444  if ( other && scene()->dragSource()!=other &&
445  other->mapToScene( other->rect() ).boundingRect().contains( event->scenePos() )) {
446  GraphicsView* view = qobject_cast<GraphicsView*>( event->widget()->parentWidget() );
447  if ( view ) {
448  view->addConstraint( scene()->summaryHandlingModel()->mapToSource( scene()->dragSource()->index() ),
449  scene()->summaryHandlingModel()->mapToSource( other->index() ), event->modifiers() );
450  }
451  }
452  scene()->setDragSource( 0 );
453  //scene()->update();
454  } else {
455  if ( isEditable() ) {
456  updateItemFromMouse(event->scenePos());
457 
458  // It is important to set m_presspos to null here because
459  // when the sceneRect updates because we move the item
460  // a MouseMoveEvent will be delivered, and we have to
461  // protect against that
462  m_presspos = QPointF();
463  updateModel();
464  // without this command we sometimes get a white area at the left side of a task item
465  // after we moved that item right-ways into a grey weekend section of the scene:
466  scene()->update();
467  }
468  }
469 
470  m_presspos = QPointF();
471  BASE::mouseReleaseEvent( event );
472 }
473 
474 void GraphicsItem::mouseDoubleClickEvent( QGraphicsSceneMouseEvent* event )
475 {
476  StyleOptionGanttItem opt = getStyleOption();
477  ItemDelegate::InteractionState istate = scene()->itemDelegate()->interactionStateFor( event->pos(), opt, index() );
478  if ( istate != ItemDelegate::State_None ) {
479  scene()->itemDoubleClicked( index() );
480  }
481  BASE::mouseDoubleClickEvent( event );
482 }
483 
484 void GraphicsItem::updateItemFromMouse( const QPointF& scenepos )
485 {
486  //qDebug() << "GraphicsItem::updateItemFromMouse("<<scenepos<<")";
487  const QPointF p = scenepos - m_presspos;
488  QRectF r = rect();
489  QRectF br = boundingRect();
490  switch( m_istate ) {
491  case ItemDelegate::State_Move:
492  setPos( p.x(), pos().y() );
493  break;
494  case ItemDelegate::State_ExtendLeft: {
495  const qreal brr = br.right();
496  const qreal rr = r.right();
497  const qreal delta = pos().x()-p.x();
498  setPos( p.x(), QGraphicsItem::pos().y() );
499  br.setRight( brr+delta );
500  r.setRight( rr+delta );
501  break;
502  }
503  case ItemDelegate::State_ExtendRight: {
504  const qreal rr = r.right();
505  r.setRight( scenepos.x()-pos().x() );
506  br.setWidth( br.width() + r.right()-rr );
507  break;
508  }
509  default: return;
510  }
511  setRect( r );
512  setBoundingRect( br );
513 }
514 
515 void GraphicsItem::mouseMoveEvent( QGraphicsSceneMouseEvent* event )
516 {
517  if ( !isEditable() ) return;
518  if ( m_presspos.isNull() ) return;
519 
520  //qDebug() << "GraphicsItem::mouseMoveEvent("<<event<<"), m_istate="<< static_cast<ItemDelegate::InteractionState>( m_istate );
521  //QPointF pos = event->pos() - m_presspos;
522  switch( m_istate ) {
523  case ItemDelegate::State_ExtendLeft:
524  case ItemDelegate::State_ExtendRight:
525  case ItemDelegate::State_Move:
526  // Check for constraint drag
527  if ( qAbs( m_pressscenepos.x()-event->scenePos().x() ) < 10.
528  && qAbs( m_pressscenepos.y()-event->scenePos().y() ) > 5. ) {
529  m_istate = ItemDelegate::State_DragConstraint;
530  m_dragline = new QGraphicsLineItem( this );
531  m_dragline->setPen( QPen( Qt::DashLine ) );
532  m_dragline->setLine(QLineF( rect().center(), event->pos() ));
533  scene()->addItem( m_dragline );
534  scene()->setDragSource( this );
535  break;
536  }
537 
538  scene()->selectionModel()->setCurrentIndex( index(), QItemSelectionModel::Current );
539  updateItemFromMouse(event->scenePos());
540  //BASE::mouseMoveEvent(event);
541  break;
542  case ItemDelegate::State_DragConstraint: {
543  QLineF line = m_dragline->line();
544  m_dragline->setLine( QLineF( line.p1(), event->pos() ) );
545  //QGraphicsItem* item = scene()->itemAt( event->scenePos() );
546  break;
547  }
548  }
549 }
KDGantt::StyleOptionGanttItem::text
QString text
Definition: kdganttstyleoptionganttitem.h:48
KDGantt::GraphicsScene::selectionModel
QItemSelectionModel * selectionModel() const
Definition: kdganttgraphicsscene.cpp:255
KDGantt::StyleOptionGanttItem::displayPosition
Position displayPosition
Definition: kdganttstyleoptionganttitem.h:46
KDGantt::GraphicsItem::mousePressEvent
void mousePressEvent(QGraphicsSceneMouseEvent *)
Definition: kdganttgraphicsitem.cpp:416
KDGantt::GraphicsItem::updateItem
void updateItem(const Span &rowgeometry, const QPersistentModelIndex &idx)
Definition: kdganttgraphicsitem.cpp:276
KDGantt::GraphicsItem::GraphicsItem
GraphicsItem(QGraphicsItem *parent=0, GraphicsScene *scene=0)
Definition: kdganttgraphicsitem.cpp:70
KDGantt::GraphicsItem::setBoundingRect
void setBoundingRect(const QRectF &r)
Definition: kdganttgraphicsitem.cpp:160
KDGantt::Span::start
qreal start() const
Definition: kdganttglobal.h:232
KDGantt::StyleOptionGanttItem::Center
Definition: kdganttstyleoptionganttitem.h:38
KDGantt::GraphicsScene::itemDoubleClicked
void itemDoubleClicked(const QModelIndex &)
Definition: kdganttgraphicsscene.cpp:611
KDGantt::GraphicsItem::removeStartConstraint
void removeStartConstraint(ConstraintGraphicsItem *)
Definition: kdganttgraphicsitem.cpp:248
KDGantt::ConstraintGraphicsItem::setStart
void setStart(const QPointF &start)
Definition: kdganttconstraintgraphicsitem.cpp:104
KDGantt::ItemDelegate::InteractionState
InteractionState
Definition: kdganttitemdelegate.h:43
KDGantt::GraphicsView
The GraphicsView class provides a model/view implementation of a gantt chart.
Definition: kdganttgraphicsview.h:44
KDGantt::ItemDelegate::State_ExtendRight
Definition: kdganttitemdelegate.h:46
KDGantt::GraphicsScene::grid
AbstractGrid * grid() const
Definition: kdganttgraphicsscene.cpp:281
QGraphicsItem
QWidget
kdganttabstractgrid.h
KDGantt::AbstractRowController::maximumItemHeight
virtual int maximumItemHeight() const =0
KDGantt::GraphicsItem::index
const QPersistentModelIndex & index() const
Definition: kdganttgraphicsitem.h:66
KDGantt::StartTimeRole
Definition: kdganttglobal.h:204
KDGantt::ItemDelegate::State_DragConstraint
Definition: kdganttitemdelegate.h:47
KDGantt::ConstraintGraphicsItem::setEnd
void setEnd(const QPointF &end)
Definition: kdganttconstraintgraphicsitem.cpp:111
KDGantt::GraphicsScene::itemClicked
void itemClicked(const QModelIndex &)
Definition: kdganttgraphicsscene.cpp:606
KDGantt::GraphicsItem::hoverMoveEvent
void hoverMoveEvent(QGraphicsSceneHoverEvent *)
Definition: kdganttgraphicsitem.cpp:377
KDGantt::AbstractGrid::mapFromChart
virtual bool mapFromChart(const Span &span, const QModelIndex &idx, const QList< Constraint > &constraints=QList< Constraint >()) const =0
KDGantt::GraphicsScene::itemEntered
void itemEntered(const QModelIndex &)
Definition: kdganttgraphicsscene.cpp:596
KDGantt::GraphicsItem::Type
Definition: kdganttgraphicsitem.h:44
KDGantt::GraphicsScene
Definition: kdganttgraphicsscene.h:48
KDGantt::StyleOptionGanttItem::Position
Position
Definition: kdganttstyleoptionganttitem.h:38
KDGantt::ItemDelegate::interactionStateFor
virtual InteractionState interactionStateFor(const QPointF &pos, const StyleOptionGanttItem &opt, const QModelIndex &idx) const
Definition: kdganttitemdelegate.cpp:200
KDGantt::GraphicsItem::type
int type() const
Definition: kdganttgraphicsitem.cpp:99
KDGantt::ItemDelegate::itemBoundingSpan
virtual Span itemBoundingSpan(const StyleOptionGanttItem &opt, const QModelIndex &idx) const
Definition: kdganttitemdelegate.cpp:163
KDGantt::GraphicsItem::boundingRect
QRectF boundingRect() const
Definition: kdganttgraphicsitem.cpp:208
KDGantt::ItemDelegate::State_ExtendLeft
Definition: kdganttitemdelegate.h:45
KDGantt::GraphicsItem::hoverLeaveEvent
void hoverLeaveEvent(QGraphicsSceneHoverEvent *)
Definition: kdganttgraphicsitem.cpp:409
KDGantt::GraphicsScene::constraintModel
ConstraintModel * constraintModel() const
Definition: kdganttgraphicsscene.cpp:232
KDGantt::GraphicsScene::updateRow
void updateRow(const QModelIndex &idx)
Definition: kdganttgraphicsscene.cpp:370
KDGantt::GraphicsScene::summaryHandlingModel
QAbstractProxyModel * summaryHandlingModel() const
Definition: kdganttgraphicsscene.cpp:211
KDGantt::GraphicsItem::mouseReleaseEvent
void mouseReleaseEvent(QGraphicsSceneMouseEvent *)
Definition: kdganttgraphicsitem.cpp:434
KDGantt::Span
A class representing a start point and a length.
Definition: kdganttglobal.h:220
KDGantt::GraphicsItem::removeEndConstraint
void removeEndConstraint(ConstraintGraphicsItem *)
Definition: kdganttgraphicsitem.cpp:255
KDGantt::GraphicsItem::isEditable
bool isEditable() const
Definition: kdganttgraphicsitem.cpp:167
KDGantt::GraphicsItem::mouseDoubleClickEvent
void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *)
Definition: kdganttgraphicsitem.cpp:474
KDGantt::ItemTypeRole
Definition: kdganttglobal.h:207
KDGantt::StyleOptionGanttItem::Left
Definition: kdganttstyleoptionganttitem.h:38
KDGantt::GraphicsItem::focusInEvent
void focusInEvent(QFocusEvent *event)
Definition: kdganttgraphicsitem.cpp:339
KDGantt::GraphicsItem::~GraphicsItem
virtual ~GraphicsItem()
Definition: kdganttgraphicsitem.cpp:83
KDGantt::GraphicsItem::addEndConstraint
void addEndConstraint(ConstraintGraphicsItem *)
Definition: kdganttgraphicsitem.cpp:240
KDGantt::ItemDelegate::State_None
Definition: kdganttitemdelegate.h:43
kdganttitemdelegate.h
KDGantt::GraphicsScene::itemPressed
void itemPressed(const QModelIndex &)
Definition: kdganttgraphicsscene.cpp:601
KDGantt::EndTimeRole
Definition: kdganttglobal.h:205
QAbstractProxyModel
kdganttgraphicsview.h
KDGantt::GraphicsScene::isReadOnly
bool isReadOnly() const
Definition: kdganttgraphicsscene.cpp:291
KDGantt::GraphicsItem::mouseMoveEvent
void mouseMoveEvent(QGraphicsSceneMouseEvent *)
Definition: kdganttgraphicsitem.cpp:515
kdganttgraphicsitem.h
KDGantt::AbstractGrid::mapToChart
virtual Span mapToChart(const QModelIndex &idx) const =0
kdganttabstractrowcontroller.h
KDGantt::GraphicsScene::setDragSource
void setDragSource(GraphicsItem *item)
Definition: kdganttgraphicsscene.cpp:616
KDGantt::GraphicsScene::itemDelegate
ItemDelegate * itemDelegate() const
Definition: kdganttgraphicsscene.cpp:192
KDGantt::GraphicsItem::scene
GraphicsScene * scene() const
Definition: kdganttgraphicsitem.cpp:140
KDGantt::GraphicsItem::addStartConstraint
void addStartConstraint(ConstraintGraphicsItem *)
Definition: kdganttgraphicsitem.cpp:232
KDGantt::ConstraintGraphicsItem
Definition: kdganttconstraintgraphicsitem.h:35
KDGantt::TextPositionRole
Definition: kdganttglobal.h:209
KDGantt::GraphicsItem::ganttToolTip
virtual QString ganttToolTip() const
Definition: kdganttgraphicsitem.cpp:190
KDGantt::GraphicsView::addConstraint
virtual void addConstraint(const QModelIndex &from, const QModelIndex &to, Qt::KeyboardModifiers modifiers)
Definition: kdganttgraphicsview.cpp:552
KDGantt::TypeMulti
Definition: kdganttglobal.h:216
KDGantt::GraphicsItem::setIndex
void setIndex(const QPersistentModelIndex &idx)
Definition: kdganttgraphicsitem.cpp:184
KDGantt::GraphicsScene::rowController
AbstractRowController * rowController() const
Definition: kdganttgraphicsscene.cpp:265
KDGantt::Span::length
qreal length() const
Definition: kdganttglobal.h:237
kdganttconstraintgraphicsitem.h
KDGantt::StyleOptionGanttItem::itemRect
QRectF itemRect
Definition: kdganttstyleoptionganttitem.h:45
KDGantt::ItemDelegate::State_Move
Definition: kdganttitemdelegate.h:44
KDGantt::GraphicsItem::paint
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=0)
Definition: kdganttgraphicsitem.cpp:172
KDGantt::StyleOptionGanttItem
QStyleOption subclass for gantt items.
Definition: kdganttstyleoptionganttitem.h:36
KDGantt::GraphicsItem::setRect
void setRect(const QRectF &r)
Definition: kdganttgraphicsitem.cpp:145
kdganttconstraintmodel.h
KDGantt::StyleOptionGanttItem::Right
Definition: kdganttstyleoptionganttitem.h:38
KDGantt::ItemDelegate::paintGanttItem
virtual void paintGanttItem(QPainter *p, const StyleOptionGanttItem &opt, const QModelIndex &idx)
Definition: kdganttitemdelegate.cpp:225
KDGantt::GraphicsItem::itemChange
QVariant itemChange(GraphicsItemChange, const QVariant &value)
Definition: kdganttgraphicsitem.cpp:313
KDGantt::GraphicsItem
Definition: kdganttgraphicsitem.h:42
kdganttgraphicsscene.h
KDGantt::GraphicsItem::rect
QRectF rect() const
Definition: kdganttgraphicsitem.h:60
BASE
QGraphicsItem BASE
Definition: kdganttgraphicsitem.cpp:54
KDGantt::GraphicsItem::isUpdating
bool isUpdating() const
Definition: kdganttgraphicsitem.h:70
KDGantt::StyleOptionGanttItem::boundingRect
QRectF boundingRect
Definition: kdganttstyleoptionganttitem.h:44
KDGantt::ConstraintModel
Definition: kdganttconstraintmodel.h:35
KDGantt::StyleOptionGanttItem::grid
AbstractGrid * grid
Definition: kdganttstyleoptionganttitem.h:47
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:55:05 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kdgantt2

Skip menu "kdgantt2"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Modules
  • Related Pages

kdepim API Reference

Skip menu "kdepim API Reference"
  • akonadi_next
  • akregator
  • blogilo
  • calendarsupport
  • console
  •   kabcclient
  •   konsolekalendar
  • kaddressbook
  • kalarm
  •   lib
  • kdgantt2
  • kjots
  • kleopatra
  • kmail
  • knode
  • knotes
  • kontact
  • korgac
  • korganizer
  • ktimetracker
  • libkdepim
  • libkleo
  • libkpgp
  • mailcommon
  • messagelist
  • messageviewer

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal