• 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
kdganttabstractgrid.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 "kdganttabstractgrid.h"
26 #include "kdganttabstractgrid_p.h"
27 
28 using namespace KDGantt;
29 
41 AbstractGrid::AbstractGrid( QObject* parent )
42  : QObject( parent ),
43  _d( new Private )
44 {
45 }
46 
48 AbstractGrid::~AbstractGrid()
49 {
50  delete _d;
51 }
52 
53 #define d d_func()
54 
58 void AbstractGrid::setModel( QAbstractItemModel* model )
59 {
60  d->model = model;
61 }
62 
64 QAbstractItemModel* AbstractGrid::model() const
65 {
66  return d->model;
67 }
68 
72 void AbstractGrid::setRootIndex( const QModelIndex& idx )
73 {
74  d->root = idx;
75 }
76 
78 QModelIndex AbstractGrid::rootIndex() const
79 {
80  return d->root;
81 }
82 
86 bool AbstractGrid::isSatisfiedConstraint( const Constraint& c ) const
87 {
88  // First check if the data is valid,
89  // TODO: review if true is the right choice
90  if ( !c.startIndex().isValid() || !c.endIndex().isValid() ) return true;
91 
92  Span ss = mapToChart( c.startIndex() );
93  Span es = mapToChart( c.endIndex() );
94  return ( ss.end() <= es.start() );
95 }
96 
130 #include "moc_kdganttabstractgrid.cpp"
131 
KDGantt::AbstractGrid::model
QAbstractItemModel * model() const
Definition: kdganttabstractgrid.cpp:64
KDGantt::AbstractGrid::setModel
virtual void setModel(QAbstractItemModel *model)
Definition: kdganttabstractgrid.cpp:58
KDGantt::Constraint::endIndex
QModelIndex endIndex() const
Definition: kdganttconstraint.cpp:113
kdganttabstractgrid.h
KDGantt::Constraint::startIndex
QModelIndex startIndex() const
Definition: kdganttconstraint.cpp:107
QObject
KDGantt::Span::end
qreal end() const
Definition: kdganttglobal.h:234
KDGantt::Span
A class representing a start point and a length.
Definition: kdganttglobal.h:220
KDGantt::AbstractGrid::~AbstractGrid
virtual ~AbstractGrid()
Definition: kdganttabstractgrid.cpp:48
KDGantt::AbstractGrid::Private
Definition: kdganttabstractgrid_p.h:35
d
#define d
Definition: kdganttabstractgrid.cpp:53
KDGantt::AbstractGrid::setRootIndex
virtual void setRootIndex(const QModelIndex &idx)
Definition: kdganttabstractgrid.cpp:72
kdganttabstractgrid_p.h
KDGantt::AbstractGrid::isSatisfiedConstraint
bool isSatisfiedConstraint(const Constraint &c) const
Definition: kdganttabstractgrid.cpp:86
KDGantt::AbstractGrid::mapToChart
virtual Span mapToChart(const QModelIndex &idx) const =0
KDGantt::Constraint
A class used to represent a dependency.
Definition: kdganttconstraint.h:38
KDGantt::AbstractGrid::rootIndex
QModelIndex rootIndex() const
Definition: kdganttabstractgrid.cpp:78
KDGantt::AbstractGrid::AbstractGrid
AbstractGrid(QObject *parent=0)
Definition: kdganttabstractgrid.cpp:41
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