summaryrefslogtreecommitdiff
path: root/core/pim/datebook/modules/weeklst/datebookweeklstview.cpp
Side-by-side diff
Diffstat (limited to 'core/pim/datebook/modules/weeklst/datebookweeklstview.cpp') (more/less context) (show 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,
{
+ childs.clear();
+ m_MainLayout = new QVBoxLayout( this );
+ setEvents(ev,d,onM);
+}
+
+void DateBookWeekLstView::setEvents(QValueList<EffectiveEvent> &ev, const QDate &d, bool onM)
+{
+ QValueList<QObject*>::Iterator wIter;
+ for (wIter=childs.begin();wIter!=childs.end();++wIter) {
+ QObject*w = (*wIter);
+ delete w;
+ }
+ childs.clear();
+
+ setUpdatesEnabled(false);
+// m_MainLayout->deleteAllItems();
Config config("DateBook");
@@ -28,4 +44,2 @@ DateBookWeekLstView::DateBookWeekLstView(QValueList<EffectiveEvent> &ev,
- QVBoxLayout *layout = new QVBoxLayout( this );
-
qBubbleSort(ev);
@@ -48,4 +62,9 @@ DateBookWeekLstView::DateBookWeekLstView(QValueList<EffectiveEvent> &ev,
for (int i=0; i<7; i++) {
+ QWidget*w = new QWidget(this);
+ w->setSizePolicy(QSizePolicy(QSizePolicy::Expanding,QSizePolicy::Expanding));
+ w->setPalette(white);
+ QVBoxLayout * tlayout = new QVBoxLayout(w);
+ childs.append(w);
// Header
- DateBookWeekLstDayHdr *hdr=new DateBookWeekLstDayHdr(d.addDays(i-dayoffset), bStartOnMonday,this);
+ DateBookWeekLstDayHdr *hdr=new DateBookWeekLstDayHdr(d.addDays(i-dayoffset), bStartOnMonday,w);
connect(hdr, SIGNAL(showDate(int,int,int)), this, SIGNAL(showDate(int,int,int)));
@@ -53,3 +72,3 @@ DateBookWeekLstView::DateBookWeekLstView(QValueList<EffectiveEvent> &ev,
this, SIGNAL(addEvent(const QDateTime&,const QDateTime&,const QString&,const QString&)));
- layout->addWidget(hdr);
+ tlayout->addWidget(hdr);
@@ -58,4 +77,4 @@ DateBookWeekLstView::DateBookWeekLstView(QValueList<EffectiveEvent> &ev,
if(!(((*it).end().hour()==0) && ((*it).end().minute()==0) && ((*it).startDate()!=(*it).date()))) { // Skip events ending at 00:00 starting at another day.
- DateBookWeekLstEvent *l=new DateBookWeekLstEvent(*it,weeklistviewconfig,this);
- layout->addWidget(l);
+ DateBookWeekLstEvent *l=new DateBookWeekLstEvent(*it,weeklistviewconfig,w);
+ tlayout->addWidget(l);
connect (l, SIGNAL(editEvent(const Event&)), this, SIGNAL(editEvent(const Event&)));
@@ -68,6 +87,18 @@ DateBookWeekLstView::DateBookWeekLstView(QValueList<EffectiveEvent> &ev,
}
- layout->addItem(new QSpacerItem(1,1, QSizePolicy::Minimum, QSizePolicy::Expanding));
+ tlayout->addItem(new QSpacerItem(1,1, QSizePolicy::Minimum, QSizePolicy::Expanding));
+ m_MainLayout->addWidget(w);
+/*
+ QSpacerItem * tmp = new QSpacerItem(1,1, QSizePolicy::Minimum, QSizePolicy::Expanding);
+ m_MainLayout->addItem(tmp);
+*/
+ }
+ setUpdatesEnabled(true);
}
+
+DateBookWeekLstView::~DateBookWeekLstView()
+{}
+
+void DateBookWeekLstView::keyPressEvent(QKeyEvent *e)
+{
+ e->ignore();
}
-DateBookWeekLstView::~DateBookWeekLstView(){}
-void DateBookWeekLstView::keyPressEvent(QKeyEvent *e) {e->ignore();}