• 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
kdganttgraphicsview.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 "kdganttgraphicsview.h"
26 #include "kdganttgraphicsview_p.h"
27 #include "kdganttabstractrowcontroller.h"
28 #include "kdganttgraphicsitem.h"
29 #include "kdganttconstraintmodel.h"
30 
31 #include <QMenu>
32 #include <QPainter>
33 #include <QPaintEvent>
34 #include <QResizeEvent>
35 #include <QScrollBar>
36 #include <QAbstractProxyModel>
37 
38 #include <cassert>
39 
40 #if defined KDAB_EVAL
41 #include "../evaldialog/evaldialog.h"
42 #endif
43 
48 using namespace KDGantt;
49 
50 HeaderWidget::HeaderWidget( GraphicsView* parent )
51  : QWidget( parent ), m_offset( 0. )
52 {
53  assert( parent ); // Parent must be set
54 }
55 
56 HeaderWidget::~HeaderWidget()
57 {
58 }
59 
60 void HeaderWidget::scrollTo( int v )
61 {
62  m_offset = v;
63  // QWidget::scroll() wont work properly for me on Mac
64  //scroll( static_cast<int>( old-v ), 0 );
65  update();
66 }
67 
68 void HeaderWidget::paintEvent( QPaintEvent* ev )
69 {
70  QPainter p( this );
71  view()->grid()->paintHeader( &p, rect(), ev->rect(), m_offset, this );
72 }
73 
74 #ifndef QT_NO_CONTEXTMENU
75 void HeaderWidget::contextMenuEvent( QContextMenuEvent* event )
76 {
77  QMenu contextMenu;
78 
79  DateTimeGrid* const grid = qobject_cast< DateTimeGrid* >( view()->grid() );
80  QAction* actionScaleAuto = 0;
81  QAction* actionScaleDay = 0;
82  QAction* actionScaleHour = 0;
83  QAction* actionZoomIn = 0;
84  QAction* actionZoomOut = 0;
85  if( grid != 0 )
86  {
87  QMenu* menuScale = new QMenu( tr( "Scale" ), &contextMenu );
88  QActionGroup* scaleGroup = new QActionGroup( &contextMenu );
89  scaleGroup->setExclusive( true );
90 
91  actionScaleAuto = new QAction( tr( "Auto" ), menuScale );
92  actionScaleAuto->setCheckable( true );
93  actionScaleAuto->setChecked( grid->scale() == DateTimeGrid::ScaleAuto );
94  actionScaleDay = new QAction( tr( "Day" ), menuScale );
95  actionScaleDay->setCheckable( true );
96  actionScaleDay->setChecked( grid->scale() == DateTimeGrid::ScaleDay );
97  actionScaleHour = new QAction( tr( "Hour" ), menuScale );
98  actionScaleHour->setCheckable( true );
99  actionScaleHour->setChecked( grid->scale() == DateTimeGrid::ScaleHour );
100 
101  scaleGroup->addAction( actionScaleAuto );
102  menuScale->addAction( actionScaleAuto );
103 
104  scaleGroup->addAction( actionScaleDay );
105  menuScale->addAction( actionScaleDay );
106 
107  scaleGroup->addAction( actionScaleHour );
108  menuScale->addAction( actionScaleHour );
109 
110  contextMenu.addMenu( menuScale );
111 
112  contextMenu.addSeparator();
113 
114  actionZoomIn = new QAction( tr( "Zoom In" ), &contextMenu );
115  contextMenu.addAction( actionZoomIn );
116  actionZoomOut = new QAction( tr( "Zoom Out" ), &contextMenu );
117  contextMenu.addAction( actionZoomOut );
118  }
119 
120  if( contextMenu.isEmpty() )
121  {
122  event->ignore();
123  return;
124  }
125 
126  const QAction* const action = contextMenu.exec( event->globalPos() );
127  if( action == 0 ) {}
128  else if( action == actionScaleAuto )
129  {
130  assert( grid != 0 );
131  grid->setScale( DateTimeGrid::ScaleAuto );
132  }
133  else if( action == actionScaleDay )
134  {
135  assert( grid != 0 );
136  grid->setScale( DateTimeGrid::ScaleDay );
137  }
138  else if( action == actionScaleHour )
139  {
140  assert( grid != 0 );
141  grid->setScale( DateTimeGrid::ScaleHour );
142  }
143  else if( action == actionZoomIn )
144  {
145  assert( grid != 0 );
146  grid->setDayWidth( grid->dayWidth() + 10.0 );
147  }
148  else if( action == actionZoomOut )
149  {
150  assert( grid != 0 );
151  grid->setDayWidth( grid->dayWidth() - 10.0 );
152  }
153 
154  event->accept();
155 }
156 #endif
157 
158 GraphicsView::Private::Private( GraphicsView* _q )
159  : q( _q ), rowcontroller(0), headerwidget( _q )
160 {
161 }
162 
163 void GraphicsView::Private::updateHeaderGeometry()
164 {
165  q->setViewportMargins(0,rowcontroller->headerHeight(),0,0);
166  headerwidget.setGeometry( q->viewport()->x(),
167  q->viewport()->y() - rowcontroller->headerHeight(),
168  q->viewport()->width(),
169  rowcontroller->headerHeight() );
170 }
171 
172 void GraphicsView::Private::slotGridChanged()
173 {
174  updateHeaderGeometry();
175  headerwidget.update();
176  q->updateSceneRect();
177  q->update();
178 }
179 
180 void GraphicsView::Private::slotHorizontalScrollValueChanged( int val )
181 {
182 #if QT_VERSION >= 0x040300
183  const QRectF viewRect = q->transform().mapRect( q->sceneRect() );
184 #else
185  const QRectF viewRect = q->sceneRect();
186 #endif
187  headerwidget.scrollTo( val-q->horizontalScrollBar()->minimum()+static_cast<int>( viewRect.left() ) );
188 }
189 
190 void GraphicsView::Private::slotColumnsInserted( const QModelIndex& parent, int start, int end )
191 {
192  Q_UNUSED( start );
193  Q_UNUSED( end );
194  QModelIndex idx = scene.model()->index( 0, 0, scene.summaryHandlingModel()->mapToSource( parent ) );
195  do {
196  scene.updateRow( scene.summaryHandlingModel()->mapFromSource( idx ) );
197  } while ( ( idx = rowcontroller->indexBelow( idx ) ) != QModelIndex() && rowcontroller->isRowVisible( idx ) );
198  //} while ( ( idx = d->treeview.indexBelow( idx ) ) != QModelIndex() && d->treeview.visualRect(idx).isValid() );
199  q->updateSceneRect();
200 }
201 
202 void GraphicsView::Private::slotColumnsRemoved( const QModelIndex& parent, int start, int end )
203 {
204  // TODO
205  Q_UNUSED( start );
206  Q_UNUSED( end );
207  Q_UNUSED( parent );
208  q->updateScene();
209 }
210 
211 void GraphicsView::Private::slotDataChanged( const QModelIndex& topLeft, const QModelIndex& bottomRight )
212 {
213  //qDebug() << "GraphicsView::slotDataChanged("<<topLeft<<bottomRight<<")";
214  const QModelIndex parent = topLeft.parent();
215  for ( int row = topLeft.row(); row <= bottomRight.row(); ++row ) {
216  scene.updateRow( scene.summaryHandlingModel()->index( row, 0, parent ) );
217  }
218 }
219 
220 void GraphicsView::Private::slotLayoutChanged()
221 {
222  //qDebug() << "slotLayoutChanged()";
223  q->updateScene();
224 }
225 
226 void GraphicsView::Private::slotModelReset()
227 {
228  //qDebug() << "slotModelReset()";
229  q->updateScene();
230 }
231 
232 void GraphicsView::Private::slotRowsInserted( const QModelIndex& parent, int start, int end )
233 {
234  Q_UNUSED( parent );
235  Q_UNUSED( start );
236  Q_UNUSED( end );
237  q->updateScene(); // TODO: This might be optimised
238 }
239 
240 void GraphicsView::Private::slotRowsAboutToBeRemoved( const QModelIndex& parent, int start, int end )
241 {
242  //qDebug() << "GraphicsView::Private::slotRowsAboutToBeRemoved("<<parent<<start<<end<<")";
243  for ( int row = start; row <= end; ++row ) {
244  for ( int col = 0; col < scene.summaryHandlingModel()->columnCount( parent ); ++col ) {
245  //qDebug() << "removing "<<scene.summaryHandlingModel()->index( row, col, parent );
246  scene.removeItem( scene.summaryHandlingModel()->index( row, col, parent ) );
247  }
248  }
249 }
250 
251 void GraphicsView::Private::slotRowsRemoved( const QModelIndex& parent, int start, int end )
252 {
253  //qDebug() << "GraphicsView::Private::slotRowsRemoved("<<parent<<start<<end<<")";
254  // TODO
255  Q_UNUSED( parent );
256  Q_UNUSED( start );
257  Q_UNUSED( end );
258 
259  q->updateScene();
260 }
261 
262 void GraphicsView::Private::slotItemClicked( const QModelIndex& idx )
263 {
264  QModelIndex sidx = idx;//scene.summaryHandlingModel()->mapToSource( idx );
265  emit q->clicked( sidx );
266  if (q->style()->styleHint(QStyle::SH_ItemView_ActivateItemOnSingleClick, 0, q))
267  emit q->activated( sidx );
268 }
269 
270 void GraphicsView::Private::slotItemDoubleClicked( const QModelIndex& idx )
271 {
272  QModelIndex sidx = idx;//scene.summaryHandlingModel()->mapToSource( idx );
273  emit q->doubleClicked( sidx );
274  if (!q->style()->styleHint(QStyle::SH_ItemView_ActivateItemOnSingleClick, 0, q))
275  emit q->activated( sidx );
276 }
277 
278 void GraphicsView::Private::slotHeaderContextMenuRequested( const QPoint& pt )
279 {
280  emit q->headerContextMenuRequested( headerwidget.mapToGlobal( pt ) );
281 }
282 
304 GraphicsView::GraphicsView( QWidget* parent )
305  : QGraphicsView( parent ), _d( new Private( this ) )
306 {
307 
308 #if defined KDAB_EVAL
309  EvalDialog::checkEvalLicense( "KD Gantt" );
310 #endif
311  connect( horizontalScrollBar(), SIGNAL(valueChanged(int)),
312  this, SLOT(slotHorizontalScrollValueChanged(int)) );
313  connect( &_d->scene, SIGNAL(gridChanged()),
314  this, SLOT(slotGridChanged()) );
315  connect( &_d->scene, SIGNAL(entered(QModelIndex)),
316  this, SIGNAL(entered(QModelIndex)) );
317  connect( &_d->scene, SIGNAL(pressed(QModelIndex)),
318  this, SIGNAL(pressed(QModelIndex)) );
319  connect( &_d->scene, SIGNAL(clicked(QModelIndex)),
320  this, SLOT(slotItemClicked(QModelIndex)) );
321  connect( &_d->scene, SIGNAL(doubleClicked(QModelIndex)),
322  this, SLOT(slotItemDoubleClicked(QModelIndex)) );
323  connect( &_d->scene, SIGNAL(sceneRectChanged(QRectF)),
324  this, SLOT(updateSceneRect()) );
325  connect( &_d->headerwidget, SIGNAL(customContextMenuRequested(QPoint)),
326  this, SLOT(slotHeaderContextMenuRequested(QPoint)) );
327  setScene( &_d->scene );
328 
329  // HACK!
330  setSummaryHandlingModel( _d->scene.summaryHandlingModel() );
331 
332  //setCacheMode( CacheBackground );
333 }
334 
336 GraphicsView::~GraphicsView()
337 {
338  delete _d;
339 }
340 
341 #define d d_func()
342 
356 void GraphicsView::setModel( QAbstractItemModel* model )
357 {
358  if ( d->scene.model() ) {
359  disconnect( d->scene.model() );
360  }
361 
362  d->scene.setModel( model );
363  connect( model, SIGNAL(dataChanged(QModelIndex,QModelIndex)),
364  this, SLOT(updateSceneRect()) );
365  updateScene();
366 }
367 
370 QAbstractItemModel* GraphicsView::model() const
371 {
372  return d->scene.model();
373 }
374 
375 void GraphicsView::setSummaryHandlingModel( QAbstractProxyModel* proxyModel )
376 {
377  disconnect( d->scene.summaryHandlingModel() );
378  d->scene.setSummaryHandlingModel( proxyModel );
379 
380  /* Connections. We have to rely on the treeview
381  * to receive the signals before we do(!)
382  */
383  connect( proxyModel, SIGNAL(columnsInserted(QModelIndex,int,int)),
384  this, SLOT(slotColumnsInserted(QModelIndex,int,int)) );
385  connect( proxyModel, SIGNAL(columnsRemoved(QModelIndex,int,int)),
386  this, SLOT(slotColumnsRemoved(QModelIndex,int,int)) );
387  connect( proxyModel, SIGNAL(dataChanged(QModelIndex,QModelIndex)),
388  this, SLOT(slotDataChanged(QModelIndex,QModelIndex)) );
389  connect( proxyModel, SIGNAL(layoutChanged()),
390  this, SLOT(slotLayoutChanged()) );
391  connect( proxyModel, SIGNAL(modelReset()),
392  this, SLOT(slotModelReset()) );
393  connect( proxyModel, SIGNAL(rowsInserted(QModelIndex,int,int)),
394  this, SLOT(slotRowsInserted(QModelIndex,int,int)) );
395  connect( proxyModel, SIGNAL(rowsAboutToBeRemoved(QModelIndex,int,int)),
396  this, SLOT(slotRowsAboutToBeRemoved(QModelIndex,int,int)) );
397  connect( proxyModel, SIGNAL(rowsRemoved(QModelIndex,int,int)),
398  this, SLOT(slotRowsRemoved(QModelIndex,int,int)) );
399 
400  updateScene();
401 }
402 
406 void GraphicsView::setConstraintModel( ConstraintModel* cmodel )
407 {
408  d->scene.setConstraintModel( cmodel );
409 }
410 
413 ConstraintModel* GraphicsView::constraintModel() const
414 {
415  return d->scene.constraintModel();
416 }
417 
420 QAbstractProxyModel* GraphicsView::summaryHandlingModel() const
421 {
422  return d->scene.summaryHandlingModel();
423 }
424 
428 void GraphicsView::setRootIndex( const QModelIndex& idx )
429 {
430  d->scene.setRootIndex( idx );
431 }
432 
435 QModelIndex GraphicsView::rootIndex() const
436 {
437  return d->scene.rootIndex();
438 }
439 
443 void GraphicsView::setSelectionModel( QItemSelectionModel* model )
444 {
445  d->scene.setSelectionModel( model );
446 }
447 
450 QItemSelectionModel* GraphicsView::selectionModel() const
451 {
452  return d->scene.selectionModel();
453 }
454 
458 void GraphicsView::setItemDelegate( ItemDelegate* delegate )
459 {
460  d->scene.setItemDelegate( delegate );
461 }
462 
465 ItemDelegate* GraphicsView::itemDelegate() const
466 {
467  return d->scene.itemDelegate();
468 }
469 
475 void GraphicsView::setRowController( AbstractRowController* rowcontroller )
476 {
477  d->rowcontroller = rowcontroller;
478  d->scene.setRowController( rowcontroller );
479  updateScene();
480 }
481 
485 AbstractRowController* GraphicsView::rowController() const
486 {
487  return d->rowcontroller;
488 }
489 
495 void GraphicsView::setGrid( AbstractGrid* grid )
496 {
497  d->scene.setGrid( grid );
498  d->slotGridChanged();
499 }
500 
503 AbstractGrid* GraphicsView::grid() const
504 {
505  return d->scene.grid();
506 }
507 
511 void GraphicsView::setReadOnly( bool ro )
512 {
513  d->scene.setReadOnly( ro );
514 }
515 
518 bool GraphicsView::isReadOnly() const
519 {
520  return d->scene.isReadOnly();
521 }
522 
532 void GraphicsView::setHeaderContextMenuPolicy( Qt::ContextMenuPolicy p )
533 {
534  d->headerwidget.setContextMenuPolicy( p );
535 }
536 
539 Qt::ContextMenuPolicy GraphicsView::headerContextMenuPolicy() const
540 {
541  return d->headerwidget.contextMenuPolicy();
542 }
543 
552 void GraphicsView::addConstraint( const QModelIndex& from,
553  const QModelIndex& to,
554  Qt::KeyboardModifiers modifiers )
555 {
556  if ( isReadOnly() ) return;
557  ConstraintModel* cmodel = constraintModel();
558  assert( cmodel );
559  Constraint c( from, to, ( modifiers&Qt::ShiftModifier )?Constraint::TypeHard:Constraint::TypeSoft );
560  if ( cmodel->hasConstraint( c ) ) cmodel->removeConstraint( c );
561  else cmodel->addConstraint( c );
562 }
563 
564 void GraphicsView::resizeEvent( QResizeEvent* ev )
565 {
566  d->updateHeaderGeometry();
567  QRectF r = scene()->itemsBoundingRect();
568  // To scroll more to the left than the actual item start, bug #4516
569  r.setLeft( qMin<qreal>( 0.0, r.left() ) );
570  // TODO: take scrollbars into account (if not always on)
571  // The scene should be at least the size of the viewport
572  QSizeF size = viewport()->size();
573  //TODO: why -2 below? size should be ex. frames etc?
574  if ( size.width() > r.width() ) {
575  r.setWidth( size.width() - 2 );
576  }
577  if ( size.height() > r.height() ) {
578  r.setHeight( size.height() - 2 );
579  }
580  const int totalh = rowController()->totalHeight();
581  if ( r.height() < totalh ) {
582  r.setHeight( totalh );
583  }
584 
585  scene()->setSceneRect( r );
586 
587  QGraphicsView::resizeEvent( ev );
588 }
589 
596 QModelIndex GraphicsView::indexAt( const QPoint& pos ) const
597 {
598  QGraphicsItem* item = itemAt( pos );
599  if ( GraphicsItem* gitem = qgraphicsitem_cast<GraphicsItem*>( item ) ) {
600  return d->scene.summaryHandlingModel()->mapToSource( gitem->index() );
601  } else {
602  return QModelIndex();
603  }
604 }
605 
607 void GraphicsView::clearItems()
608 {
609  d->scene.clearItems();
610 }
611 
613 void GraphicsView::updateRow( const QModelIndex& idx )
614 {
615  d->scene.updateRow( d->scene.summaryHandlingModel()->mapFromSource( idx ) );
616 }
617 
621 void GraphicsView::updateSceneRect()
622 {
623  /* What to do with this? We need to shrink the view to
624  * make collapsing items work
625  */
626  qreal range = horizontalScrollBar()->maximum()-horizontalScrollBar()->minimum();
627  const qreal hscroll = horizontalScrollBar()->value()/( range>0?range:1 );
628  QRectF r = d->scene.itemsBoundingRect();
629  // To scroll more to the left than the actual item start, bug #4516
630  r.setTop( 0. );
631  r.setLeft( qMin<qreal>( 0.0, r.left() ) );
632  r.setSize( r.size().expandedTo( viewport()->size() ) );
633  const int totalh = rowController()->totalHeight();
634  if ( r.height() < totalh ) r.setHeight( totalh );
635  d->scene.setSceneRect( r );
636 
637  /* set scrollbar to keep the same time in view */
638  range = horizontalScrollBar()->maximum()-horizontalScrollBar()->minimum();
639  if ( range>0 ) horizontalScrollBar()->setValue( qRound( hscroll*range ) );
640 
641  /* We have to update here to adjust for any rows with no
642  * information because they are painted with a different
643  * background brush
644  */
645  d->scene.invalidate( QRectF(), QGraphicsScene::BackgroundLayer );
646 }
647 
651 void GraphicsView::updateScene()
652 {
653  clearItems();
654  if( !model()) return;
655  if( !rowController()) return;
656  QModelIndex idx = model()->index( 0, 0, rootIndex() );
657  do {
658  updateRow( idx );
659  } while ( ( idx = rowController()->indexBelow( idx ) ) != QModelIndex() && rowController()->isRowVisible(idx) );
660  //constraintModel()->cleanup();
661  //qDebug() << constraintModel();
662  updateSceneRect();
663  if ( scene() ) scene()->invalidate( QRectF(), QGraphicsScene::BackgroundLayer );
664 }
665 
667 GraphicsItem* GraphicsView::createItem( ItemType type ) const
668 {
669  return d->scene.createItem( type );
670 }
671 
673 void GraphicsView::deleteSubtree( const QModelIndex& idx )
674 {
675  d->scene.deleteSubtree( d->scene.summaryHandlingModel()->mapFromSource( idx ) );
676 }
677 
684 void GraphicsView::print( QPrinter* printer, bool drawRowLabels )
685 {
686  d->scene.print( printer, drawRowLabels );
687 }
688 
699 void GraphicsView::print( QPrinter* printer, qreal start, qreal end, bool drawRowLabels )
700 {
701  d->scene.print( printer, start, end, drawRowLabels );
702 }
703 
708 void GraphicsView::print( QPainter* painter, const QRectF& targetRect, bool drawRowLabels )
709 {
710  d->scene.print(painter,targetRect,drawRowLabels);
711 }
712 
721 void GraphicsView::print( QPainter* painter, qreal start, qreal end,
722  const QRectF& targetRect, bool drawRowLabels )
723 {
724  d->scene.print(painter, start, end, targetRect, drawRowLabels);
725 }
726 
727 
728 #include "moc_kdganttgraphicsview.cpp"
729 #include "moc_kdganttgraphicsview_p.cpp"
KDGantt::ItemDelegate
Class used to render gantt items in a KDGantt::GraphicsView.
Definition: kdganttitemdelegate.h:39
KDGantt::DateTimeGrid::ScaleHour
Definition: kdganttdatetimegrid.h:74
KDGantt::GraphicsView::Private::slotHeaderContextMenuRequested
void slotHeaderContextMenuRequested(const QPoint &pt)
Definition: kdganttgraphicsview.cpp:278
KDGantt::GraphicsView::setConstraintModel
void setConstraintModel(ConstraintModel *)
Definition: kdganttgraphicsview.cpp:406
KDGantt::GraphicsView::itemDelegate
ItemDelegate * itemDelegate() const
Definition: kdganttgraphicsview.cpp:465
kdganttgraphicsview_p.h
KDGantt::GraphicsView
The GraphicsView class provides a model/view implementation of a gantt chart.
Definition: kdganttgraphicsview.h:44
KDGantt::GraphicsView::Private::slotGridChanged
void slotGridChanged()
Definition: kdganttgraphicsview.cpp:172
KDGantt::GraphicsView::constraintModel
ConstraintModel * constraintModel() const
Definition: kdganttgraphicsview.cpp:413
KDGantt::GraphicsView::print
void print(QPrinter *printer, bool drawRowLabels=true)
Definition: kdganttgraphicsview.cpp:684
KDGantt::GraphicsView::grid
AbstractGrid * grid() const
Definition: kdganttgraphicsview.cpp:503
QGraphicsItem
KDGantt::GraphicsView::entered
void entered(const QModelIndex &index)
QWidget
KDGantt::ItemType
ItemType
Definition: kdganttglobal.h:211
KDGantt::GraphicsView::clearItems
void clearItems()
Definition: kdganttgraphicsview.cpp:607
KDGantt::GraphicsView::pressed
void pressed(const QModelIndex &index)
KDGantt::GraphicsView::setSelectionModel
void setSelectionModel(QItemSelectionModel *)
Definition: kdganttgraphicsview.cpp:443
KDGantt::GraphicsView::~GraphicsView
virtual ~GraphicsView()
Definition: kdganttgraphicsview.cpp:336
KDGantt::GraphicsView::Private::slotLayoutChanged
void slotLayoutChanged()
Definition: kdganttgraphicsview.cpp:220
KDGantt::GraphicsView::Private::slotRowsInserted
void slotRowsInserted(const QModelIndex &parent, int start, int end)
Definition: kdganttgraphicsview.cpp:232
KDGantt::DateTimeGrid::dayWidth
qreal dayWidth() const
Definition: kdganttdatetimegrid.cpp:319
KDGantt::HeaderWidget::view
GraphicsView * view() const
Definition: kdganttgraphicsview_p.h:41
KDGantt::HeaderWidget::contextMenuEvent
void contextMenuEvent(QContextMenuEvent *ev)
Definition: kdganttgraphicsview.cpp:75
KDGantt::GraphicsView::selectionModel
QItemSelectionModel * selectionModel() const
Definition: kdganttgraphicsview.cpp:450
KDGantt::Constraint::TypeHard
Definition: kdganttconstraint.h:44
KDGantt::GraphicsView::model
QAbstractItemModel * model() const
Definition: kdganttgraphicsview.cpp:370
KDGantt::GraphicsView::rowController
AbstractRowController * rowController() const
Definition: kdganttgraphicsview.cpp:485
KDGantt::GraphicsView::Private::slotModelReset
void slotModelReset()
Definition: kdganttgraphicsview.cpp:226
KDGantt::GraphicsView::isReadOnly
bool isReadOnly() const
Definition: kdganttgraphicsview.cpp:518
KDGantt::HeaderWidget::paintEvent
void paintEvent(QPaintEvent *ev)
Definition: kdganttgraphicsview.cpp:68
KDGantt::DateTimeGrid::ScaleAuto
Definition: kdganttdatetimegrid.h:73
KDGantt::GraphicsView::Private::Private
Private(GraphicsView *_q)
Definition: kdganttgraphicsview.cpp:158
KDGantt::GraphicsView::setItemDelegate
void setItemDelegate(ItemDelegate *delegate)
Definition: kdganttgraphicsview.cpp:458
KDGantt::GraphicsView::Private::slotDataChanged
void slotDataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight)
Definition: kdganttgraphicsview.cpp:211
KDGantt::AbstractGrid
Abstract baseclass for grids. A grid is used to convert between QModelIndex'es and gantt chart values...
Definition: kdganttabstractgrid.h:40
KDGantt::GraphicsView::Private::slotItemDoubleClicked
void slotItemDoubleClicked(const QModelIndex &idx)
Definition: kdganttgraphicsview.cpp:270
KDGantt::GraphicsView::headerContextMenuPolicy
Qt::ContextMenuPolicy headerContextMenuPolicy() const
Definition: kdganttgraphicsview.cpp:539
KDGantt::GraphicsView::updateRow
void updateRow(const QModelIndex &)
Definition: kdganttgraphicsview.cpp:613
KDGantt::GraphicsView::Private::slotItemClicked
void slotItemClicked(const QModelIndex &idx)
Definition: kdganttgraphicsview.cpp:262
KDGantt::GraphicsView::deleteSubtree
void deleteSubtree(const QModelIndex &)
Definition: kdganttgraphicsview.cpp:673
KDGantt::GraphicsView::setRootIndex
void setRootIndex(const QModelIndex &)
Definition: kdganttgraphicsview.cpp:428
KDGantt::GraphicsView::Private::slotHorizontalScrollValueChanged
void slotHorizontalScrollValueChanged(int val)
Definition: kdganttgraphicsview.cpp:180
KDGantt::DateTimeGrid::ScaleDay
Definition: kdganttdatetimegrid.h:75
KDGantt::GraphicsView::doubleClicked
void doubleClicked(const QModelIndex &index)
KDGantt::GraphicsView::setGrid
void setGrid(AbstractGrid *)
Definition: kdganttgraphicsview.cpp:495
KDGantt::HeaderWidget::~HeaderWidget
virtual ~HeaderWidget()
Definition: kdganttgraphicsview.cpp:56
KDGantt::DateTimeGrid::setDayWidth
void setDayWidth(qreal)
Definition: kdganttdatetimegrid.cpp:342
KDGantt::GraphicsView::setSummaryHandlingModel
void setSummaryHandlingModel(QAbstractProxyModel *model)
Definition: kdganttgraphicsview.cpp:375
QAbstractProxyModel
kdganttgraphicsview.h
KDGantt::HeaderWidget::HeaderWidget
HeaderWidget(GraphicsView *parent)
Definition: kdganttgraphicsview.cpp:50
KDGantt::GraphicsView::indexAt
QModelIndex indexAt(const QPoint &pos) const
Definition: kdganttgraphicsview.cpp:596
KDGantt::GraphicsView::setReadOnly
void setReadOnly(bool)
Definition: kdganttgraphicsview.cpp:511
KDGantt::GraphicsView::setModel
void setModel(QAbstractItemModel *)
Definition: kdganttgraphicsview.cpp:356
KDGantt::GraphicsView::Private::slotColumnsInserted
void slotColumnsInserted(const QModelIndex &parent, int start, int end)
Definition: kdganttgraphicsview.cpp:190
kdganttgraphicsitem.h
kdganttabstractrowcontroller.h
KDGantt::GraphicsView::Private::slotRowsRemoved
void slotRowsRemoved(const QModelIndex &parent, int start, int end)
Definition: kdganttgraphicsview.cpp:251
KDGantt::GraphicsView::updateScene
void updateScene()
Definition: kdganttgraphicsview.cpp:651
KDGantt::Constraint
A class used to represent a dependency.
Definition: kdganttconstraint.h:38
KDGantt::GraphicsView::setRowController
void setRowController(AbstractRowController *)
Definition: kdganttgraphicsview.cpp:475
KDGantt::GraphicsView::summaryHandlingModel
QAbstractProxyModel * summaryHandlingModel() const
Definition: kdganttgraphicsview.cpp:420
KDGantt::GraphicsView::resizeEvent
void resizeEvent(QResizeEvent *)
Definition: kdganttgraphicsview.cpp:564
KDGantt::GraphicsView::addConstraint
virtual void addConstraint(const QModelIndex &from, const QModelIndex &to, Qt::KeyboardModifiers modifiers)
Definition: kdganttgraphicsview.cpp:552
KDGantt::GraphicsView::Private::slotColumnsRemoved
void slotColumnsRemoved(const QModelIndex &parent, int start, int end)
Definition: kdganttgraphicsview.cpp:202
KDGantt::GraphicsView::clicked
void clicked(const QModelIndex &index)
KDGantt::AbstractRowController::totalHeight
virtual int totalHeight() const =0
KDGantt::DateTimeGrid::setScale
void setScale(Scale s)
Definition: kdganttdatetimegrid.cpp:354
KDGantt::AbstractGrid::paintHeader
virtual void paintHeader(QPainter *painter, const QRectF &headerRect, const QRectF &exposedRect, qreal offset, QWidget *widget=0)=0
KDGantt::DateTimeGrid::scale
Scale scale() const
Definition: kdganttdatetimegrid.cpp:366
KDGantt::GraphicsView::Private::updateHeaderGeometry
void updateHeaderGeometry()
Definition: kdganttgraphicsview.cpp:163
QGraphicsView
KDGantt::GraphicsView::Private
Definition: kdganttgraphicsview_p.h:54
KDGantt::ConstraintModel::addConstraint
void addConstraint(const Constraint &c)
Definition: kdganttconstraintmodel.cpp:101
KDGantt::GraphicsView::GraphicsView
GraphicsView(QWidget *parent=0)
Definition: kdganttgraphicsview.cpp:304
KDGantt::ConstraintModel::hasConstraint
bool hasConstraint(const Constraint &c) const
Definition: kdganttconstraintmodel.cpp:196
d
#define d
Definition: kdganttgraphicsview.cpp:341
KDGantt::ConstraintModel::removeConstraint
bool removeConstraint(const Constraint &c)
Definition: kdganttconstraintmodel.cpp:122
KDGantt::HeaderWidget::scrollTo
void scrollTo(int)
Definition: kdganttgraphicsview.cpp:60
KDGantt::GraphicsView::updateSceneRect
void updateSceneRect()
Definition: kdganttgraphicsview.cpp:621
kdganttconstraintmodel.h
KDGantt::GraphicsView::setHeaderContextMenuPolicy
void setHeaderContextMenuPolicy(Qt::ContextMenuPolicy)
Definition: kdganttgraphicsview.cpp:532
KDGantt::GraphicsItem
Definition: kdganttgraphicsitem.h:42
KDGantt::AbstractRowController
Abstract baseclass for row controllers. A row controller is used by the GraphicsView to nagivate the ...
Definition: kdganttabstractrowcontroller.h:34
KDGantt::GraphicsView::Private::slotRowsAboutToBeRemoved
void slotRowsAboutToBeRemoved(const QModelIndex &parent, int start, int end)
Definition: kdganttgraphicsview.cpp:240
KDGantt::DateTimeGrid
Definition: kdganttdatetimegrid.h:69
KDGantt::GraphicsView::rootIndex
QModelIndex rootIndex() const
Definition: kdganttgraphicsview.cpp:435
KDGantt::ConstraintModel
Definition: kdganttconstraintmodel.h:35
KDGantt::Constraint::TypeSoft
Definition: kdganttconstraint.h:43
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