1 /****************************************************************************
2 ** Copyright (C) 2001-2006 Klarälvdalens Datakonsult AB. All rights reserved.
4 ** This file is part of the KD Gantt library.
6 ** This file may be used under the terms of the GNU General Public
7 ** License versions 2.0 or 3.0 as published by the Free Software
8 ** Foundation and appearing in the files LICENSE.GPL2 and LICENSE.GPL3
9 ** included in the packaging of this file. Alternatively you may (at
10 ** your option) use any later version of the GNU General Public
11 ** License if such license has been publicly approved by
12 ** Klarälvdalens Datakonsult AB (or its successors, if any).
14 ** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
15 ** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
16 ** A PARTICULAR PURPOSE. Klarälvdalens Datakonsult AB reserves all rights
17 ** not expressly granted herein.
19 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
20 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
22 **********************************************************************/
23 #include "kdganttstyleoptionganttitem.h"
25 using namespace KDGantt
;
27 /*!\class KDGantt::StyleOptionGanttItem kdganttstyleoptionganttitem.h KDGanttStyleOptionGanttItem
29 * \brief QStyleOption subclass for gantt items.
32 typedef QStyleOptionViewItem BASE
;
34 /*! Constructor. Sets grid to 0. */
35 StyleOptionGanttItem::StyleOptionGanttItem()
39 type
= QStyleOption::SO_CustomBase
+89;
43 /*! Copy constructor. Creates a copy of \a other */
44 StyleOptionGanttItem::StyleOptionGanttItem( const StyleOptionGanttItem
& other
)
50 /*! Assignment operator */
51 StyleOptionGanttItem
& StyleOptionGanttItem::operator=( const StyleOptionGanttItem
& other
)
53 BASE::operator=( other
);
54 boundingRect
= other
.boundingRect
;
55 itemRect
= other
.itemRect
;
56 displayPosition
= other
.displayPosition
;
62 #ifndef QT_NO_DEBUG_STREAM
64 QDebug
operator<<( QDebug dbg
, const KDGantt::StyleOptionGanttItem
& s
)
66 dbg
<< "KDGantt::StyleOptionGanttItem[ boundingRect="<<s
.boundingRect
67 <<", itemRect="<<s
.itemRect
68 <<", displayPosition="<<s
.displayPosition
75 #endif /* QT_NO_DEBUG_STREAM */
78 /*!\enum KDGantt::StyleOptionGanttItem::Position
79 * This enum is used to describe where the Qt::DisplayRole
80 * (the label) should be located relative to the item itself.
83 /*!\var StyleOptionGanttItem::boundingRect
84 * Contains the bounding rectangle for the item
87 /*!\var StyleOptionGanttItem::itemRect
88 * Contains the "active" item rectangle that corresponds
89 * to the values from the model.
92 /*!\var StyleOptionGanttItem::displayPosition
93 * \see StyleOptionGanttItem::Position.
96 /*!\var StyleOptionGanttItem::grid
97 * Contains a pointer to the AbstractGrid used by the view
100 /*!\var StyleOptionGanttItem::text
101 * Contains a string printed to the item