-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCalendarWidget.cpp
38 lines (31 loc) · 897 Bytes
/
CalendarWidget.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
//
// CalendarWidget.cpp
// Scheduler
//
// Created by David Flores on 1/23/16.
// Copyright © 2016 David Flores. All rights reserved.
//
#include "stdafx.h"
#include "CalendarWidget.h"
#include "CalendarWidgetDelegate.h"
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
CalendarWidget::CalendarWidget(QWidget* pParentWidget) :
QCalendarWidget(pParentWidget),
m_pDelegate(nullptr)
{
connect(this, SIGNAL(selectionChanged()), this, SLOT(SelectionChanged()));
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
void
CalendarWidget::SetDelegate(CalendarWidgetDelegate* pDelegate)
{
m_pDelegate = pDelegate;
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
void
CalendarWidget::SelectionChanged()
{
if ( m_pDelegate == nullptr )
return;
m_pDelegate->DisplayingDate(selectedDate());
}