63 mIsAtomicScroll(true), |
63 mIsAtomicScroll(true), |
64 mView(NULL), |
64 mView(NULL), |
65 mCurrentRow(-100), |
65 mCurrentRow(-100), |
66 mIsNonActiveDayFocused(false), |
66 mIsNonActiveDayFocused(false), |
67 mIgnoreItemActivated(false), |
67 mIgnoreItemActivated(false), |
68 mGridBorderColor(Qt::gray) |
68 mGridLineColor(HbColorScheme::color("qtc_cal_grid_line")), |
|
69 mActiveDatesSet(false) |
69 { |
70 { |
70 OstTraceFunctionEntry0( CALENMONTHGRID_CALENMONTHGRID_ENTRY ); |
71 OstTraceFunctionEntry0( CALENMONTHGRID_CALENMONTHGRID_ENTRY ); |
71 |
72 |
72 setScrollDirections(Qt::Vertical); |
73 setScrollDirections(Qt::Vertical); |
73 setRowCount(KNumOfVisibleRows); |
74 setRowCount(KNumOfVisibleRows); |
79 setVerticalScrollBarPolicy(HbScrollArea::ScrollBarAlwaysOff); |
80 setVerticalScrollBarPolicy(HbScrollArea::ScrollBarAlwaysOff); |
80 setClampingStyle(HbScrollArea::StrictClamping); |
81 setClampingStyle(HbScrollArea::StrictClamping); |
81 setEnabledAnimations(HbAbstractItemView::None); |
82 setEnabledAnimations(HbAbstractItemView::None); |
82 setFrictionEnabled(false); |
83 setFrictionEnabled(false); |
83 setFlag(QGraphicsItem::ItemHasNoContents, false); |
84 setFlag(QGraphicsItem::ItemHasNoContents, false); |
|
85 |
|
86 // Disable the rows and columns swapping on orientation change |
|
87 setSwapDimensionsOnOrientationChange(false); |
|
88 |
84 resetTransform(); |
89 resetTransform(); |
85 |
90 |
86 // Get the content widget of the scroll area to draw the grid lines |
91 // Get the content widget of the scroll area to draw the grid lines |
87 mContentWidget = contentWidget(); |
92 mContentWidget = contentWidget(); |
88 |
93 |
89 // Get the all required colors |
|
90 // Color of the grid lines |
|
91 mGridLineColor = HbColorScheme::color("qtc_cal_grid_line"); |
|
92 |
|
93 // Get the localised dates well before |
94 // Get the localised dates well before |
94 // TODO: Need to update the mLocalisedDates when user changes the |
95 // TODO: Need to update the mLocalisedDates when user changes the |
95 // phone language keeping calendar application in background |
96 // phone language keeping calendar application in background |
96 HbExtendedLocale locale = HbExtendedLocale::system(); |
97 HbExtendedLocale locale = HbExtendedLocale::system(); |
97 for (int i = 1; i <= 31; i++) { |
98 for (int i = 1; i <= 31; i++) { |
99 } |
100 } |
100 |
101 |
101 // Connect to scrolling finished signal |
102 // Connect to scrolling finished signal |
102 connect(this, SIGNAL(scrollingEnded()), this, |
103 connect(this, SIGNAL(scrollingEnded()), this, |
103 SLOT(scrollingFinished())); |
104 SLOT(scrollingFinished())); |
|
105 |
|
106 connect( |
|
107 HbTheme::instance(), SIGNAL(changed()), |
|
108 this, SLOT(handleThemeChange())); |
|
109 |
|
110 // Disable the haptic feedback for the month grid during scrolling |
|
111 setAttribute(Hb::InteractionDisabled); |
104 |
112 |
105 OstTraceFunctionExit0( CALENMONTHGRID_CALENMONTHGRID_EXIT ); |
113 OstTraceFunctionExit0( CALENMONTHGRID_CALENMONTHGRID_EXIT ); |
106 } |
114 } |
107 |
115 |
108 /*! |
116 /*! |
216 } |
224 } |
217 mModel->itemFromIndex(currentIndex)->setData(itemData); |
225 mModel->itemFromIndex(currentIndex)->setData(itemData); |
218 } |
226 } |
219 |
227 |
220 if (isFirstTime) { |
228 if (isFirstTime) { |
221 // Color of the today indicator |
|
222 QColor todayIndColor = HbColorScheme::color("qtc_cal_month_current_day"); |
|
223 // Color of the active dates |
|
224 QColor mActiveTextColor = |
|
225 HbColorScheme::color("qtc_cal_month_active_dates"); |
|
226 // Color of the inactive dates |
|
227 QColor mInActiveTextColor = |
|
228 HbColorScheme::color("qtc_cal_month_notactive_dates"); |
|
229 |
229 |
230 // Create the prototype |
230 // Create the prototype |
231 CalenGridItemPrototype* gridItemPrototype = new CalenGridItemPrototype( |
231 CalenGridItemPrototype* gridItemPrototype = new CalenGridItemPrototype(this); |
232 todayIndColor, mActiveTextColor, mInActiveTextColor, this); |
232 |
233 |
233 connect( |
|
234 HbTheme::instance(), SIGNAL(changed()), |
|
235 gridItemPrototype, SLOT(handleThemeChange())); |
|
236 |
234 // Set the mode and the prototype |
237 // Set the mode and the prototype |
235 setModel(mModel,gridItemPrototype); |
238 setModel(mModel,gridItemPrototype); |
236 |
239 |
237 // Register the widgetml and css files |
240 // Register the widgetml and css files |
238 HbStyleLoader::registerFilePath(":/"); |
241 HbStyleLoader::registerFilePath(":/"); |
337 void CalenMonthGrid::downGesture() |
340 void CalenMonthGrid::downGesture() |
338 { |
341 { |
339 OstTraceFunctionEntry0( CALENMONTHGRID_DOWNGESTURE_ENTRY ); |
342 OstTraceFunctionEntry0( CALENMONTHGRID_DOWNGESTURE_ENTRY ); |
340 |
343 |
341 // Make sure that content widget is properly placed |
344 // Make sure that content widget is properly placed |
|
345 // We are doing this as tapping on inactive date of previous month is leading to |
|
346 // position the grid at wrong place after scrolling down. Hence, set the grid |
|
347 // at proper position before we start actual scrolling |
342 if (mIsNonActiveDayFocused) { |
348 if (mIsNonActiveDayFocused) { |
343 mIsAtomicScroll = true; |
349 mIsAtomicScroll = true; |
344 int itemToBeScrolled = mView->rowsInPrevMonth() * KCalenDaysInWeek; |
350 int itemToBeScrolled = mView->rowsInPrevMonth() * KCalenDaysInWeek; |
345 QModelIndex indexToBeScrolled = mModel->index(itemToBeScrolled, 0); |
351 QModelIndex indexToBeScrolled = mModel->index(itemToBeScrolled, 0); |
346 scrollTo(indexToBeScrolled); |
352 scrollTo(indexToBeScrolled); |
347 } |
353 } |
|
354 |
|
355 // Set the required flags |
348 mDirection = down; |
356 mDirection = down; |
349 mIsAtomicScroll = false; |
357 mIsAtomicScroll = false; |
350 setAttribute(Hb::InteractionDisabled); |
358 |
|
359 // Set the active and inactive dates |
|
360 QDateTime activeMonth = mView->getActiveDay(); |
|
361 // For previous month, substract one month to the current month |
|
362 setActiveDates(activeMonth.addMonths(-1).date()); |
|
363 mActiveDatesSet = true; |
|
364 // Set the focus to proper date before scrolling to avoid somekind of |
|
365 // jerkiness |
|
366 if (!mIsNonActiveDayFocused) { |
|
367 setFocusToProperDay(); |
|
368 } |
|
369 |
|
370 // Start the scrolling |
351 QPointF targetPos(0.0, 0.0); |
371 QPointF targetPos(0.0, 0.0); |
352 scrollContentsTo(targetPos,500); |
372 scrollContentsTo(targetPos,500); |
353 |
373 |
354 OstTraceFunctionExit0( CALENMONTHGRID_DOWNGESTURE_EXIT ); |
374 OstTraceFunctionExit0( CALENMONTHGRID_DOWNGESTURE_EXIT ); |
355 } |
375 } |
359 */ |
379 */ |
360 void CalenMonthGrid::upGesture() |
380 void CalenMonthGrid::upGesture() |
361 { |
381 { |
362 OstTraceFunctionEntry0( CALENMONTHGRID_UPGESTURE_ENTRY ); |
382 OstTraceFunctionEntry0( CALENMONTHGRID_UPGESTURE_ENTRY ); |
363 |
383 |
364 // Make sure that content widget is properly placed |
384 |
365 if (mIsNonActiveDayFocused) { |
385 // Set the required flags |
366 mIsAtomicScroll = true; |
|
367 int itemToBeScrolled = mView->rowsInPrevMonth() * KCalenDaysInWeek; |
|
368 itemToBeScrolled += KNumOfVisibleRows * KCalenDaysInWeek; |
|
369 QModelIndex indexToBeScrolled = mModel->index(itemToBeScrolled, 0); |
|
370 scrollTo(indexToBeScrolled); |
|
371 } |
|
372 mDirection = up; |
386 mDirection = up; |
373 mIsAtomicScroll = false; |
387 mIsAtomicScroll = false; |
374 setAttribute(Hb::InteractionDisabled); |
388 |
|
389 // Set the active and inactive dates |
|
390 QDateTime activeMonth = mView->getActiveDay(); |
|
391 // For next month, add one month to the current month |
|
392 setActiveDates(activeMonth.addMonths(1).date()); |
|
393 mActiveDatesSet = true; |
|
394 // Set the focus to proper date before scrolling to avoid somekind of |
|
395 // jerkiness |
|
396 if (!mIsNonActiveDayFocused) { |
|
397 setFocusToProperDay(); |
|
398 } |
|
399 |
|
400 // Start the scrolling |
375 QPointF targetPos(0.0, mStartPos.y() - size().height()); |
401 QPointF targetPos(0.0, mStartPos.y() - size().height()); |
376 scrollContentsTo(-targetPos,500); |
402 scrollContentsTo(-targetPos,500); |
377 |
403 |
378 OstTraceFunctionExit0( CALENMONTHGRID_UPGESTURE_EXIT ); |
404 OstTraceFunctionExit0( CALENMONTHGRID_UPGESTURE_EXIT ); |
379 } |
405 } |
418 { |
444 { |
419 OstTraceFunctionEntry0( CALENMONTHGRID_GESTUREEVENT_ENTRY ); |
445 OstTraceFunctionEntry0( CALENMONTHGRID_GESTUREEVENT_ENTRY ); |
420 |
446 |
421 if(HbPanGesture *gesture = qobject_cast<HbPanGesture *>(event->gesture(Qt::PanGesture))) { |
447 if(HbPanGesture *gesture = qobject_cast<HbPanGesture *>(event->gesture(Qt::PanGesture))) { |
422 if (gesture->state() == Qt::GestureStarted) { |
448 if (gesture->state() == Qt::GestureStarted) { |
423 setAttribute(Hb::InteractionDisabled); |
|
424 mIsAtomicScroll = false; |
449 mIsAtomicScroll = false; |
425 if (!mIsPanGesture) { |
450 if (!mIsPanGesture) { |
426 mDirection = invalid; |
451 mDirection = invalid; |
427 mStartPos = mContentWidget->pos(); |
452 mStartPos = mContentWidget->pos(); |
428 // TODO: This work aroung till framework provides an api |
453 // TODO: This work around till framework provides an api |
429 // to know the direciton of the pan, until then we need |
454 // to know the direciton of the pan, until then we need |
430 // calculate the direction explicitly |
455 // calculate the direction explicitly |
431 // Get to know the direction of the gesture |
456 // Get to know the direction of the gesture |
432 // Use our defined threshold temporarily till scrollarea |
457 // Use our defined threshold temporarily till scrollarea |
433 // frm orbit side is made clever enough not to scroll in other direction |
458 // frm orbit side is made clever enough not to scroll in other direction |
476 } |
501 } |
477 } |
502 } |
478 } |
503 } |
479 } else if(HbSwipeGesture *gesture = qobject_cast<HbSwipeGesture *>(event->gesture(Qt::SwipeGesture))) { |
504 } else if(HbSwipeGesture *gesture = qobject_cast<HbSwipeGesture *>(event->gesture(Qt::SwipeGesture))) { |
480 if (gesture->state() == Qt::GestureStarted) { |
505 if (gesture->state() == Qt::GestureStarted) { |
481 setAttribute(Hb::InteractionDisabled); |
|
482 mIsAtomicScroll = false; |
506 mIsAtomicScroll = false; |
483 mDirection = invalid; |
507 mDirection = invalid; |
484 if (gesture->sceneVerticalDirection() == QSwipeGesture::Down) { |
508 if (gesture->sceneVerticalDirection() == QSwipeGesture::Down) { |
485 mDirection = down; |
509 mDirection = down; |
486 } else if (gesture->sceneVerticalDirection() == QSwipeGesture::Up) { |
510 } else if (gesture->sceneVerticalDirection() == QSwipeGesture::Up) { |
522 if (mIsPanGesture) { |
546 if (mIsPanGesture) { |
523 handlePanGestureFinished(); |
547 handlePanGestureFinished(); |
524 } else if(!mIsAtomicScroll) { |
548 } else if(!mIsAtomicScroll) { |
525 QDateTime activeDate = mView->getActiveDay(); |
549 QDateTime activeDate = mView->getActiveDay(); |
526 if(mDirection == down) { // down gesture |
550 if(mDirection == down) { // down gesture |
527 if (!mIsNonActiveDayFocused) { |
551 if (!mActiveDatesSet) { |
528 setActiveDates(activeDate.addMonths(-1).date()); |
552 setActiveDates(activeDate.addMonths(-1).date()); |
|
553 setFocusToProperDay(); |
529 } |
554 } |
530 prependRows(); |
555 prependRows(); |
531 } else if (mDirection == up) { //up gesture |
556 } else if (mDirection == up) { //up gesture |
532 if (!mIsNonActiveDayFocused) { |
557 if (!mActiveDatesSet) { |
533 setActiveDates(activeDate.addMonths(1).date()); |
558 setActiveDates(activeDate.addMonths(1).date()); |
|
559 setFocusToProperDay(); |
534 } |
560 } |
535 appendRows(); |
561 appendRows(); |
536 } |
562 } |
537 mDirection = invalid; |
563 mDirection = invalid; |
|
564 mActiveDatesSet = false; |
538 } else { |
565 } else { |
539 mIsAtomicScroll = false; |
566 mIsAtomicScroll = false; |
540 mDirection = invalid; |
567 mDirection = invalid; |
541 } |
568 } |
542 mIgnoreItemActivated = false; |
569 mIgnoreItemActivated = false; |
543 setAttribute(Hb::InteractionDisabled, false); |
|
544 |
570 |
545 OstTraceFunctionExit0( CALENMONTHGRID_SCROLLINGFINISHED_EXIT ); |
571 OstTraceFunctionExit0( CALENMONTHGRID_SCROLLINGFINISHED_EXIT ); |
546 } |
572 } |
547 |
573 |
548 /*! |
574 /*! |
579 upGesture(); |
605 upGesture(); |
580 } else { |
606 } else { |
581 // we should again show the current month by scrolling downwards |
607 // we should again show the current month by scrolling downwards |
582 mDirection = down; |
608 mDirection = down; |
583 mIsAtomicScroll = true; |
609 mIsAtomicScroll = true; |
584 setAttribute(Hb::InteractionDisabled); |
|
585 scrollContentsTo(-mStartPos,500); |
610 scrollContentsTo(-mStartPos,500); |
586 } |
611 } |
587 } else if (month == prevMonth.date().month()) { |
612 } else if (month == prevMonth.date().month()) { |
588 // first visible item belongs to previous month |
613 // first visible item belongs to previous month |
589 // Check if the date is more than half of the previous month |
614 // Check if the date is more than half of the previous month |
590 if (date.date().day() > (prevMonth.date().daysInMonth()) / 2) { |
615 if (date.date().day() > (prevMonth.date().daysInMonth()) / 2) { |
591 // we should again show the current month by scrolling upwards |
616 // we should again show the current month by scrolling upwards |
592 mDirection = up; |
617 mDirection = up; |
593 mIsAtomicScroll = true; |
618 mIsAtomicScroll = true; |
594 setAttribute(Hb::InteractionDisabled); |
|
595 scrollContentsTo(-mStartPos,500); |
619 scrollContentsTo(-mStartPos,500); |
596 } else { |
620 } else { |
597 // down gesture to show the previous month |
621 // down gesture to show the previous month |
598 downGesture(); |
622 downGesture(); |
599 } |
623 } |
607 if (date.date().day() > (nextMonth.date().daysInMonth()) / 2) { |
631 if (date.date().day() > (nextMonth.date().daysInMonth()) / 2) { |
608 // up gesture to bring the next month |
632 // up gesture to bring the next month |
609 upGesture(); |
633 upGesture(); |
610 } else { |
634 } else { |
611 // we should again show the current month by scrolling upwards |
635 // we should again show the current month by scrolling upwards |
612 mDirection = invalid; |
636 mDirection = up; |
613 setAttribute(Hb::InteractionDisabled); |
|
614 scrollContentsTo(-mStartPos,500); |
637 scrollContentsTo(-mStartPos,500); |
615 } |
638 } |
616 } else if (month == nextMonth.addMonths(1).date().month()) { |
639 } else if (month == nextMonth.addMonths(1).date().month()) { |
617 // first visible date belongs to next to next month |
640 // first visible date belongs to next to next month |
618 // hence, scroll up to show the next month |
641 // hence, scroll up to show the next month |
627 to the model |
650 to the model |
628 */ |
651 */ |
629 void CalenMonthGrid::prependRows() |
652 void CalenMonthGrid::prependRows() |
630 { |
653 { |
631 OstTraceFunctionEntry0( CALENMONTHGRID_PREPENDROWS_ENTRY ); |
654 OstTraceFunctionEntry0( CALENMONTHGRID_PREPENDROWS_ENTRY ); |
632 |
|
633 // Before we do anything, set the focus to proper date |
|
634 // Set it only when non active day was focussed. When inactive day |
|
635 // was focussed, we need to focus the same day |
|
636 if (!mIsNonActiveDayFocused) { |
|
637 setFocusToProperDay(); |
|
638 } |
|
639 |
655 |
640 // Block the signals generated by model, this is being done as |
656 // Block the signals generated by model, this is being done as |
641 // we want to avoid the overload of view listening to signals |
657 // we want to avoid the overload of view listening to signals |
642 mModel->blockSignals(true); |
658 mModel->blockSignals(true); |
643 |
659 |
754 to the model |
770 to the model |
755 */ |
771 */ |
756 void CalenMonthGrid::appendRows() |
772 void CalenMonthGrid::appendRows() |
757 { |
773 { |
758 OstTraceFunctionEntry0( CALENMONTHGRID_APPENDROWS_ENTRY ); |
774 OstTraceFunctionEntry0( CALENMONTHGRID_APPENDROWS_ENTRY ); |
759 |
|
760 // Before we do anything, set the focus to proper date |
|
761 // Set it only when non active day was focussed. When inactive day |
|
762 // was focussed, we need to focus the same day |
|
763 if (!mIsNonActiveDayFocused) { |
|
764 setFocusToProperDay(); |
|
765 } |
|
766 |
775 |
767 // Block the signals generated by model, this is being done as |
776 // Block the signals generated by model, this is being done as |
768 // we want to avoid the overload of view listening to signals |
777 // we want to avoid the overload of view listening to signals |
769 mModel->blockSignals(true); |
778 mModel->blockSignals(true); |
770 |
779 |
922 int month = activeMonth.date().month(); |
931 int month = activeMonth.date().month(); |
923 QList<CalenMonthData >& monthDataList = mView->monthDataList(); |
932 QList<CalenMonthData >& monthDataList = mView->monthDataList(); |
924 if(month != monthDataList[mCurrentRow].Day().date().month()){ |
933 if(month != monthDataList[mCurrentRow].Day().date().month()){ |
925 // Set the flag |
934 // Set the flag |
926 mIsNonActiveDayFocused = true; |
935 mIsNonActiveDayFocused = true; |
927 mNonActiveFocusedDay = monthDataList[mCurrentRow].Day(); |
936 QDateTime nonActiveFocusedDay = monthDataList[mCurrentRow].Day(); |
928 |
937 |
929 // Add one month to active month |
938 // Add one month to active month |
930 activeMonth = activeMonth.addMonths(1); |
939 activeMonth = activeMonth.addMonths(1); |
931 if (activeMonth.date().month() == |
940 if (activeMonth.date().month() == |
932 mNonActiveFocusedDay.date().month()) { |
941 nonActiveFocusedDay.date().month()) { |
933 mDirection = up; |
942 mDirection = up; |
934 // up gesture |
943 // up gesture |
935 upGesture(); |
944 upGesture(); |
936 setActiveDates(activeMonth.date()); |
|
937 } else { |
945 } else { |
938 mDirection = down; |
946 mDirection = down; |
939 // down gesture |
947 // down gesture |
940 downGesture(); |
948 downGesture(); |
941 setActiveDates(activeMonth.addMonths(-2).date()); |
|
942 } |
949 } |
943 } |
950 } |
944 mView->setContextForActiveDay(index.row()); |
951 mView->setContextForActiveDay(index.row()); |
945 } |
952 } |
946 |
953 |
1023 activeDate.daysInMonth()); |
1030 activeDate.daysInMonth()); |
1024 // Number of days frm start of the grid to end of the month |
1031 // Number of days frm start of the grid to end of the month |
1025 end = firstDateInGrid.daysTo(endOfActiveMonth); |
1032 end = firstDateInGrid.daysTo(endOfActiveMonth); |
1026 |
1033 |
1027 // Set the active text color |
1034 // Set the active text color |
1028 for (int i = start; i < end; i++) { |
1035 if (start >= 0 && end < monthDataList.count()) { |
1029 QModelIndex index = mModel->index(i,0); |
1036 for (int i = start; i < end; i++) { |
1030 QVariant itemData = index.data(Qt::UserRole + 1); |
1037 QModelIndex index = mModel->index(i,0); |
1031 QVariantList list = itemData.toList(); |
1038 QVariant itemData = index.data(Qt::UserRole + 1); |
1032 list.replace(CalendarNamespace::CalendarMonthTextColorRole, true); |
1039 QVariantList list = itemData.toList(); |
1033 mModel->itemFromIndex(index)->setData(list); |
1040 list.replace(CalendarNamespace::CalendarMonthTextColorRole, true); |
|
1041 mModel->itemFromIndex(index)->setData(list); |
|
1042 } |
1034 } |
1043 } |
1035 |
1044 |
1036 // Now set the inactive text color to those which were active before the swipe |
1045 // Now set the inactive text color to those which were active before the swipe |
1037 if (mDirection == invalid) { |
1046 if (mDirection == invalid) { |
1038 // no need to do anything as other dates will be in inactive dates color |
1047 // no need to do anything as other dates will be in inactive dates color |
1069 // Number of days frm start of the grid to end of the month |
1078 // Number of days frm start of the grid to end of the month |
1070 end = firstDateInGrid.daysTo(endOfActiveMonth); |
1079 end = firstDateInGrid.daysTo(endOfActiveMonth); |
1071 } |
1080 } |
1072 |
1081 |
1073 // Set the inactive text color |
1082 // Set the inactive text color |
1074 for (int i = start; i < end; i++) { |
1083 if (start >= 0 && end < monthDataList.count()) { |
1075 QModelIndex index = mModel->index(i,0); |
1084 for (int i = start; i < end; i++) { |
1076 QVariant itemData = index.data(Qt::UserRole + 1); |
1085 QModelIndex index = mModel->index(i,0); |
1077 QVariantList list = itemData.toList(); |
1086 QVariant itemData = index.data(Qt::UserRole + 1); |
1078 list.replace(CalendarNamespace::CalendarMonthTextColorRole, false); |
1087 QVariantList list = itemData.toList(); |
1079 mModel->itemFromIndex(index)->setData(list); |
1088 list.replace(CalendarNamespace::CalendarMonthTextColorRole, false); |
|
1089 mModel->itemFromIndex(index)->setData(list); |
|
1090 } |
1080 } |
1091 } |
1081 |
1092 |
1082 OstTraceFunctionExit0( DUP1_CALENMONTHGRID_SETACTIVEDATES_EXIT ); |
1093 OstTraceFunctionExit0( DUP1_CALENMONTHGRID_SETACTIVEDATES_EXIT ); |
1083 } |
1094 } |
1084 |
1095 |
1160 HbDeviceProfile deviceProf; |
1171 HbDeviceProfile deviceProf; |
1161 qreal unitValue = deviceProf.unitValue(); |
1172 qreal unitValue = deviceProf.unitValue(); |
1162 qreal widthInPixels = GRIDLINE_WIDTH * unitValue; |
1173 qreal widthInPixels = GRIDLINE_WIDTH * unitValue; |
1163 pen.setStyle(Qt::SolidLine); |
1174 pen.setStyle(Qt::SolidLine); |
1164 pen.setWidth(widthInPixels); |
1175 pen.setWidth(widthInPixels); |
1165 if (mGridLineColor.isValid()) { |
1176 pen.setBrush(mGridLineColor); |
1166 pen.setBrush(mGridLineColor); |
1177 |
1167 } else { |
|
1168 pen.setBrush(mGridBorderColor); |
|
1169 } |
|
1170 // Store the old pen |
1178 // Store the old pen |
1171 QPen oldPen = painter->pen(); |
1179 QPen oldPen = painter->pen(); |
1172 |
1180 |
1173 // Set the new pen to the painter |
1181 // Set the new pen to the painter |
1174 painter->setPen(pen); |
1182 painter->setPen(pen); |