Documentation: Completed Backup section, update menu.
[kdepim.git] / kdgantt2 / kdganttstyleoptionganttitem.cpp
blob802672b4fee9085ffc5f437224eb9159c68f7010
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.
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.
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.
18 ** See http://www.kdab.net/kdgantt for
19 ** information about KD Gantt Commercial License Agreements.
21 ** Contact info@kdab.net if any conditions of this
22 ** licensing are not clear to you.
24 **********************************************************************/
25 #include "kdganttstyleoptionganttitem.h"
27 using namespace KDGantt;
29 /*!\class KDGantt::StyleOptionGanttItem kdganttstyleoptionganttitem.h KDGanttStyleOptionGanttItem
30 * \ingroup KDGantt
31 * \brief QStyleOption subclass for gantt items.
34 typedef QStyleOptionViewItem BASE;
36 /*! Constructor. Sets grid to 0. */
37 StyleOptionGanttItem::StyleOptionGanttItem()
38 : BASE(),
39 grid( 0 )
41 type = QStyleOption::SO_CustomBase+89;
42 version = 1;
45 /*! Copy constructor. Creates a copy of \a other */
46 StyleOptionGanttItem::StyleOptionGanttItem( const StyleOptionGanttItem& other )
47 : BASE(other)
49 operator=( other );
52 /*! Assignment operator */
53 StyleOptionGanttItem& StyleOptionGanttItem::operator=( const StyleOptionGanttItem& other )
55 BASE::operator=( other );
56 boundingRect = other.boundingRect;
57 itemRect = other.itemRect;
58 displayPosition = other.displayPosition;
59 grid = other.grid;
60 text = other.text;
61 return *this;
64 #ifndef QT_NO_DEBUG_STREAM
65 QDebug operator<<( QDebug dbg, KDGantt::StyleOptionGanttItem::Position p)
67 switch( p ) {
68 case KDGantt::StyleOptionGanttItem::Left: dbg << "KDGantt::StyleOptionGanttItem::Left"; break;
69 case KDGantt::StyleOptionGanttItem::Right: dbg << "KDGantt::StyleOptionGanttItem::Right"; break;
70 case KDGantt::StyleOptionGanttItem::Center: dbg << "KDGantt::StyleOptionGanttItem::Center"; break;
71 default: dbg << static_cast<int>( p );
73 return dbg;
76 QDebug operator<<( QDebug dbg, const KDGantt::StyleOptionGanttItem& s )
78 dbg << "KDGantt::StyleOptionGanttItem[ boundingRect="<<s.boundingRect
79 <<", itemRect="<<s.itemRect
80 <<", displayPosition="<<s.displayPosition
81 <<", grid="<<s.grid
82 <<", text="<<s.text
83 <<"]";
84 return dbg;
87 #endif /* QT_NO_DEBUG_STREAM */
90 /*!\enum KDGantt::StyleOptionGanttItem::Position
91 * This enum is used to describe where the Qt::DisplayRole
92 * (the label) should be located relative to the item itself.
95 /*!\var StyleOptionGanttItem::boundingRect
96 * Contains the bounding rectangle for the item
99 /*!\var StyleOptionGanttItem::itemRect
100 * Contains the "active" item rectangle that corresponds
101 * to the values from the model.
104 /*!\var StyleOptionGanttItem::displayPosition
105 * \see StyleOptionGanttItem::Position.
108 /*!\var StyleOptionGanttItem::grid
109 * Contains a pointer to the AbstractGrid used by the view
112 /*!\var StyleOptionGanttItem::text
113 * Contains a string printed to the item