[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: KDE/kdepim/kontact/plugins/planner
From: Allen Winter <winter () kde ! org>
Date: 2008-02-03 19:33:33
Message-ID: 1202067213.231330.3940.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 770451 by winterz:
Q3Support--
M +13 -11 planner.cpp
M +7 -8 planner.h
--- trunk/KDE/kdepim/kontact/plugins/planner/planner.cpp #770450:770451
@@ -55,7 +55,7 @@
#include <qlabel.h>
#include <qlayout.h>
#include <qtooltip.h>
-#include <Q3GridLayout>
+#include <QGridLayout>
#include <QPixmap>
#include <QEvent>
#include <Q3VBoxLayout>
@@ -70,10 +70,10 @@
KIconLoader::Desktop, KIconLoader::SizeMedium );
QWidget *header = createHeader( this, icon, i18n( "Planner" ) );
mainLayout->addWidget( header );
+ mainLayout->addStretch();
- mLayout = new Q3GridLayout( mainLayout, 8, 5, 3 );
+ mLayout = new QGridLayout( mainLayout, 8, 5, 3 );
mLayout->setRowStretch( 6, 1 );
- mainLayout->addStretch();
mCalendar = KOrg::StdCalendar::self();
mCalendar->load();
@@ -394,7 +394,6 @@
KGlobal::locale()->formatDate( sD.addDays( span-1 ) );
label = new QLabel( datestr, this );
label->setAlignment( Qt::AlignLeft | Qt::AlignTop );
- label->setPaletteForegroundColor( colorGroup().text() );
mPlannerGrid->addWidget( label, counter, 3 );
mLabels.append( label );
}
@@ -462,9 +461,9 @@
void Planner::updateView()
{
- mLabels.setAutoDelete( true );
- mLabels.clear();
- mLabels.setAutoDelete( false );
+ while ( !mLabels.isEmpty() ) {
+ delete mLabels.takeFirst();
+ }
KIconLoader loader( "kdepim" );
@@ -519,7 +518,7 @@
label = new QLabel( datestr, this );
label->setAlignment( Qt::AlignLeft | Qt::AlignTop );
- label->setPaletteBackgroundColor( Qt::lightGray );
+ label->setBackgroundRole( QPalette::Midlight );
if ( makeBold ){
QFont font = label->font();
font.setBold( true );
@@ -530,7 +529,7 @@
++counter;
Q3VBoxLayout *todoLayout = new Q3VBoxLayout( this, 3, 3 );
- mPlannerGrid = new Q3GridLayout ( todoLayout, 7, 6, 3 );
+ mPlannerGrid = new QGridLayout ( todoLayout, 7, 6, 3 );
mPlannerGrid->setRowStretch( 6, 1 );
todoLayout->addStretch();
mLayout->addMultiCellLayout( todoLayout, counter, counter, 0, 4 );
@@ -554,8 +553,11 @@
mLabels.append( noEvents );
}
- for ( label = mLabels.first(); label; label = mLabels.next() ) {
- label->show();
+ QListIterator<QLabel *> i( mLabels );
+ QLabel *l;
+ while ( i.hasNext() ) {
+ l = i.next();
+ l->show();
}
}
--- trunk/KDE/kdepim/kontact/plugins/planner/planner.h #770450:770451
@@ -29,13 +29,12 @@
#include <kcal/calendarresources.h>
#include <libkholidays/kholidays.h>
-#include <q3ptrlist.h>
-#include <qwidget.h>
-#include <Q3GridLayout>
-#include <QEvent>
+#include <QList>
#include <QLabel>
-class Q3GridLayout;
+class QWidget;
+class QEvent;
+class QGridLayout;
class QLabel;
namespace Kontact {
@@ -96,9 +95,9 @@
bool mShowSd;
Kontact::Plugin *mPlugin;
- Q3GridLayout *mLayout;
- Q3GridLayout *mPlannerGrid;
- Q3PtrList<QLabel> mLabels;
+ QGridLayout *mLayout;
+ QGridLayout *mPlannerGrid;
+ QList<QLabel *> mLabels;
KCal::CalendarResources *mCalendar;
KCal::Todo::List mTodos;
QString initStateText( const KCal::Todo *todo, const QDate &date );
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic