From bb392a72fd6071e76ca0c103637d6bb9eed59d3a Mon Sep 17 00:00:00 2001 From: zecke Date: Tue, 25 Jun 2002 18:18:59 +0000 Subject: Fixing QPE bugs isn't good for my health.... But I guess judging of the amount already fixed bugs that there isn't much to come --- diff --git a/core/pim/datebook/datebook.cpp b/core/pim/datebook/datebook.cpp index 7dd93a6..e10842a 100644 --- a/core/pim/datebook/datebook.cpp +++ b/core/pim/datebook/datebook.cpp @@ -58,6 +58,7 @@ #include #include #include +#include #include #include #include @@ -86,6 +87,7 @@ DateBook::DateBook( QWidget *parent, const char *, WFlags f ) inSearch(FALSE), alarmCounter(0) { + bool needEvilHack= false; // if we need an Evil Hack QTime t; t.start(); db = new DateBookDBHack; @@ -181,7 +183,7 @@ DateBook::DateBook( QWidget *parent, const char *, WFlags f ) if (current==DAY) a->setOn(true), viewDay(); ag->insert(a); a = new QAction( tr( "Week" ), QString::null, 0, 0, 0, true ); - if (current==WEEK) a->setOn(true), viewWeek(); + if (current==WEEK) a->setOn(true), /*viewWeek(),*/ needEvilHack = true; ag->insert(a); a = new QAction( tr( "WeekLst" ), QString::null, 0, 0, 0, true ); if (current==WEEKLST) a->setOn(true), viewWeekLst(); @@ -219,7 +221,24 @@ DateBook::DateBook( QWidget *parent, const char *, WFlags f ) #endif qDebug("done t=%d", t.elapsed() ); - + + /* + * Here is a problem description: + * When Weekview is the default view + * a DateBookWeekView get's created + * redraw() get's called. So what? + * Remember that we're still in the c'tor + * and no final layout has happened? Ok + * now all Events get arranged. Their x + * position get's determined by a QHeader + * position. But the QHeader isn't layouted or + * at the right position. redraw() is a slot + * so we'll call it then via a singleShot + * from view() + */ + if( needEvilHack ){ + QTimer::singleShot( 500, this, SLOT(viewWeek()) ); + } } void DateBook::receive( const QCString &msg, const QByteArray &data ) -- cgit v0.9.0.2