summaryrefslogtreecommitdiff
path: root/core/pim/datebook/modules/weeklst/datebookweeklstview.cpp
Unidiff
Diffstat (limited to 'core/pim/datebook/modules/weeklst/datebookweeklstview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/datebook/modules/weeklst/datebookweeklstview.cpp49
1 files changed, 40 insertions, 9 deletions
diff --git a/core/pim/datebook/modules/weeklst/datebookweeklstview.cpp b/core/pim/datebook/modules/weeklst/datebookweeklstview.cpp
index efb4c01..82b9c6d 100644
--- a/core/pim/datebook/modules/weeklst/datebookweeklstview.cpp
+++ b/core/pim/datebook/modules/weeklst/datebookweeklstview.cpp
@@ -19,2 +19,18 @@ DateBookWeekLstView::DateBookWeekLstView(QValueList<EffectiveEvent> &ev,
19{ 19{
20 childs.clear();
21 m_MainLayout = new QVBoxLayout( this );
22 setEvents(ev,d,onM);
23}
24
25void DateBookWeekLstView::setEvents(QValueList<EffectiveEvent> &ev, const QDate &d, bool onM)
26{
27 QValueList<QObject*>::Iterator wIter;
28 for (wIter=childs.begin();wIter!=childs.end();++wIter) {
29 QObject*w = (*wIter);
30 delete w;
31 }
32 childs.clear();
33
34 setUpdatesEnabled(false);
35// m_MainLayout->deleteAllItems();
20 Config config("DateBook"); 36 Config config("DateBook");
@@ -28,4 +44,2 @@ DateBookWeekLstView::DateBookWeekLstView(QValueList<EffectiveEvent> &ev,
28 44
29 QVBoxLayout *layout = new QVBoxLayout( this );
30
31 qBubbleSort(ev); 45 qBubbleSort(ev);
@@ -48,4 +62,9 @@ DateBookWeekLstView::DateBookWeekLstView(QValueList<EffectiveEvent> &ev,
48 for (int i=0; i<7; i++) { 62 for (int i=0; i<7; i++) {
63 QWidget*w = new QWidget(this);
64 w->setSizePolicy(QSizePolicy(QSizePolicy::Expanding,QSizePolicy::Expanding));
65 w->setPalette(white);
66 QVBoxLayout * tlayout = new QVBoxLayout(w);
67 childs.append(w);
49 // Header 68 // Header
50 DateBookWeekLstDayHdr *hdr=new DateBookWeekLstDayHdr(d.addDays(i-dayoffset), bStartOnMonday,this); 69 DateBookWeekLstDayHdr *hdr=new DateBookWeekLstDayHdr(d.addDays(i-dayoffset), bStartOnMonday,w);
51 connect(hdr, SIGNAL(showDate(int,int,int)), this, SIGNAL(showDate(int,int,int))); 70 connect(hdr, SIGNAL(showDate(int,int,int)), this, SIGNAL(showDate(int,int,int)));
@@ -53,3 +72,3 @@ DateBookWeekLstView::DateBookWeekLstView(QValueList<EffectiveEvent> &ev,
53 this, SIGNAL(addEvent(const QDateTime&,const QDateTime&,const QString&,const QString&))); 72 this, SIGNAL(addEvent(const QDateTime&,const QDateTime&,const QString&,const QString&)));
54 layout->addWidget(hdr); 73 tlayout->addWidget(hdr);
55 74
@@ -58,4 +77,4 @@ DateBookWeekLstView::DateBookWeekLstView(QValueList<EffectiveEvent> &ev,
58 if(!(((*it).end().hour()==0) && ((*it).end().minute()==0) && ((*it).startDate()!=(*it).date()))) { // Skip events ending at 00:00 starting at another day. 77 if(!(((*it).end().hour()==0) && ((*it).end().minute()==0) && ((*it).startDate()!=(*it).date()))) { // Skip events ending at 00:00 starting at another day.
59 DateBookWeekLstEvent *l=new DateBookWeekLstEvent(*it,weeklistviewconfig,this); 78 DateBookWeekLstEvent *l=new DateBookWeekLstEvent(*it,weeklistviewconfig,w);
60 layout->addWidget(l); 79 tlayout->addWidget(l);
61 connect (l, SIGNAL(editEvent(const Event&)), this, SIGNAL(editEvent(const Event&))); 80 connect (l, SIGNAL(editEvent(const Event&)), this, SIGNAL(editEvent(const Event&)));
@@ -68,6 +87,18 @@ DateBookWeekLstView::DateBookWeekLstView(QValueList<EffectiveEvent> &ev,
68 } 87 }
69 layout->addItem(new QSpacerItem(1,1, QSizePolicy::Minimum, QSizePolicy::Expanding)); 88 tlayout->addItem(new QSpacerItem(1,1, QSizePolicy::Minimum, QSizePolicy::Expanding));
89 m_MainLayout->addWidget(w);
90/*
91 QSpacerItem * tmp = new QSpacerItem(1,1, QSizePolicy::Minimum, QSizePolicy::Expanding);
92 m_MainLayout->addItem(tmp);
93*/
70 } 94 }
95 setUpdatesEnabled(true);
96}
97
98DateBookWeekLstView::~DateBookWeekLstView()
99{}
100
101void DateBookWeekLstView::keyPressEvent(QKeyEvent *e)
102{
103 e->ignore();
71} 104}
72DateBookWeekLstView::~DateBookWeekLstView(){}
73void DateBookWeekLstView::keyPressEvent(QKeyEvent *e) {e->ignore();}