--- a/calendarui/views/src/calenthicklinesdrawer.cpp Tue Jul 06 14:14:56 2010 +0300
+++ b/calendarui/views/src/calenthicklinesdrawer.cpp Wed Aug 18 09:47:38 2010 +0300
@@ -24,6 +24,11 @@
// User includes
#include "calenthicklinesdrawer.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "calenthicklinesdrawerTraces.h"
+#endif
+
// CONSTANTS
#define CALENTHICKLINEWIDTH 0.15 // Units
@@ -42,9 +47,13 @@
QGraphicsItem* parent):
HbWidget(parent)
{
+ OstTraceFunctionEntry0( CALENTHICKLINESDRAWER_CALENTHICKLINESDRAWER_ENTRY );
+
typeOfWidget = type;
mGridBorderColor = HbColorScheme::color("qtc_cal_grid_line");
setFlag(QGraphicsItem::ItemHasNoContents, false);
+
+ OstTraceFunctionExit0( CALENTHICKLINESDRAWER_CALENTHICKLINESDRAWER_EXIT );
}
/*!
@@ -52,7 +61,9 @@
*/
CalenThickLinesDrawer::~CalenThickLinesDrawer()
{
+ OstTraceFunctionEntry0( DUP1_CALENTHICKLINESDRAWER_CALENTHICKLINESDRAWER_ENTRY );
+ OstTraceFunctionExit0( DUP1_CALENTHICKLINESDRAWER_CALENTHICKLINESDRAWER_EXIT );
}
/*!
@@ -62,6 +73,8 @@
const QStyleOptionGraphicsItem* option,
QWidget* widget)
{
+ OstTraceFunctionEntry0( CALENTHICKLINESDRAWER_PAINT_ENTRY );
+
Q_UNUSED(option);
Q_UNUSED(widget);
QPen pen;
@@ -74,6 +87,10 @@
qreal widthInPixels = CALENTHICKLINEWIDTH * unitValue;
pen.setWidth(widthInPixels);
pen.setBrush(mGridBorderColor);
+
+ // Store the old pen
+ QPen oldPen = painter->pen();
+
painter->setPen(pen);
QRectF controlRect = this->boundingRect();
@@ -82,6 +99,8 @@
// Calculate the seperation to be added so that line coincides with
// top border of the grid
qreal seperation = CALENDAYNAMEANDGRIDSEPERATOR * unitValue;
+ // Adjust the seperation with the thickness of the line
+ seperation = seperation - widthInPixels;
// Get the start point and end point to draw the line
QPointF startPoint(controlRect.bottomLeft().x(), controlRect.bottomLeft().y() + seperation);
QPointF endPoint(controlRect.bottomRight().x(), controlRect.bottomRight().y() + seperation);
@@ -95,6 +114,11 @@
painter->drawLine(startPoint, endPoint);
}
}
+
+ // Set the old pen back
+ painter->setPen(oldPen);
+
+ OstTraceFunctionExit0( CALENTHICKLINESDRAWER_PAINT_EXIT );
}
// End of file --Don't remove this.