summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/datebook/datebookdayallday.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/core/pim/datebook/datebookdayallday.cpp b/core/pim/datebook/datebookdayallday.cpp
index 6014eca..2294f3c 100644
--- a/core/pim/datebook/datebookdayallday.cpp
+++ b/core/pim/datebook/datebookdayallday.cpp
@@ -31,74 +31,76 @@
31 */ 31 */
32DatebookdayAllday::DatebookdayAllday(DateBookDB* db, QWidget* parent, const char* name, WFlags ) 32DatebookdayAllday::DatebookdayAllday(DateBookDB* db, QWidget* parent, const char* name, WFlags )
33 : QScrollView( parent, name ),item_count(0),dateBook(db) 33 : QScrollView( parent, name ),item_count(0),dateBook(db)
34{ 34{
35 if ( !name ) 35 if ( !name )
36 setName( "DatebookdayAllday" ); 36 setName( "DatebookdayAllday" );
37 setMinimumSize( QSize( 0, 0 ) ); 37 setMinimumSize( QSize( 0, 0 ) );
38 setMaximumHeight(3* (QFontMetrics(font()).height()+4) ); 38 setMaximumHeight(3* (QFontMetrics(font()).height()+4) );
39 39
40 m_MainFrame = new QFrame(viewport()); 40 m_MainFrame = new QFrame(viewport());
41 m_MainFrame->setFrameStyle(QFrame::NoFrame|QFrame::Plain); 41 m_MainFrame->setFrameStyle(QFrame::NoFrame|QFrame::Plain);
42 setFrameStyle(QFrame::NoFrame|QFrame::Plain); 42 setFrameStyle(QFrame::NoFrame|QFrame::Plain);
43 setResizePolicy( QScrollView::AutoOneFit ); 43 setResizePolicy( QScrollView::Default );
44 setHScrollBarMode( AlwaysOff );
44 addChild(m_MainFrame); 45 addChild(m_MainFrame);
45 46
46 datebookdayalldayLayout = new QVBoxLayout( m_MainFrame ); 47 datebookdayalldayLayout = new QVBoxLayout( m_MainFrame );
47 datebookdayalldayLayout->setSpacing( 0 ); 48 datebookdayalldayLayout->setSpacing( 0 );
48 datebookdayalldayLayout->setMargin( 0 ); 49 datebookdayalldayLayout->setMargin( 0 );
49 50
50 lblDesc = new DatebookEventDesc(parent->parentWidget(),""); 51 lblDesc = new DatebookEventDesc(parent->parentWidget(),"");
51 lblDesc->setBackgroundColor(Qt::yellow); 52 lblDesc->setBackgroundColor(Qt::yellow);
52 lblDesc->hide(); 53 lblDesc->hide();
53 subWidgets.setAutoDelete(true); 54 subWidgets.setAutoDelete(true);
54} 55}
55 56
56/* 57/*
57 * Destroys the object and frees any allocated resources 58 * Destroys the object and frees any allocated resources
58 */ 59 */
59DatebookdayAllday::~DatebookdayAllday() 60DatebookdayAllday::~DatebookdayAllday()
60{ 61{
61 // no need to delete child widgets, Qt does it all for us 62 // no need to delete child widgets, Qt does it all for us
62} 63}
63 64
64DatebookAlldayDisp* DatebookdayAllday::addEvent(const EffectiveEvent&ev) 65DatebookAlldayDisp* DatebookdayAllday::addEvent(const EffectiveEvent&ev)
65{ 66{
66 DatebookAlldayDisp * lb; 67 DatebookAlldayDisp * lb;
67 lb = new DatebookAlldayDisp(dateBook,ev,m_MainFrame,NULL); 68 lb = new DatebookAlldayDisp(dateBook,ev,m_MainFrame,NULL);
69 lb->show();
68 datebookdayalldayLayout->addWidget(lb); 70 datebookdayalldayLayout->addWidget(lb);
69 subWidgets.append(lb); 71 subWidgets.append(lb);
70 72
71 connect(lb,SIGNAL(displayMe(const Event &)),lblDesc,SLOT(disp_event(const Event&))); 73 connect(lb,SIGNAL(displayMe(const Event &)),lblDesc,SLOT(disp_event(const Event&)));
72 ++item_count; 74 ++item_count;
73 75
74 return lb; 76 return lb;
75} 77}
76 78
77void DatebookdayAllday::removeAllEvents() 79void DatebookdayAllday::removeAllEvents()
78{ 80{
79 subWidgets.clear(); 81 subWidgets.clear();
80 item_count = 0; 82 item_count = 0;
81} 83}
82 84
83DatebookAlldayDisp::DatebookAlldayDisp(DateBookDB *db,const EffectiveEvent& ev, 85DatebookAlldayDisp::DatebookAlldayDisp(DateBookDB *db,const EffectiveEvent& ev,
84 QWidget* parent,const char* name,WFlags f) 86 QWidget* parent,const char* name,WFlags f)
85 : QLabel(parent,name,f),m_Ev(ev),dateBook(db) 87 : QLabel(parent,name,f),m_Ev(ev),dateBook(db)
86{ 88{
87 QString strDesc = m_Ev.description(); 89 QString strDesc = m_Ev.description();
88 strDesc = strDesc.replace(QRegExp("<"),"&#60;"); 90 strDesc = strDesc.replace(QRegExp("<"),"&#60;");
89 setBackgroundColor(yellow); 91 setBackgroundColor(yellow);
90 setText(strDesc); 92 setText(strDesc);
91 setFrameStyle(QFrame::Raised|QFrame::Panel); 93 setFrameStyle(QFrame::Raised|QFrame::Panel);
92 94
93 int s = QFontMetrics(font()).height()+4; 95 int s = QFontMetrics(font()).height()+4;
94 setMaximumHeight( s ); 96 setMaximumHeight( s );
95 setMinimumSize( QSize( 0, s ) ); 97 setMinimumSize( QSize( 0, s ) );
96} 98}
97 99
98DatebookAlldayDisp::~DatebookAlldayDisp() 100DatebookAlldayDisp::~DatebookAlldayDisp()
99{ 101{
100} 102}
101 103
102void DatebookAlldayDisp::beam_single_event() 104void DatebookAlldayDisp::beam_single_event()
103{ 105{
104 // create an Event and beam it... 106 // create an Event and beam it...