author | Michael Krelin <hacker@klever.net> | 2007-07-04 11:23:42 (UTC) |
---|---|---|
committer | Michael Krelin <hacker@klever.net> | 2007-07-04 11:23:42 (UTC) |
commit | a08aff328d4393031d5ba7d622c2b05705a89d73 (patch) (side-by-side diff) | |
tree | 8ee90d686081c52e7c69b5ce946e9b1a7d690001 /korganizer/komonthview.cpp | |
parent | 11edc920afe4f274c0964436633aa632c8288a40 (diff) | |
download | kdepimpi-p1.zip kdepimpi-p1.tar.gz kdepimpi-p1.tar.bz2 |
initial public commit of qt4 portp1
-rw-r--r-- | korganizer/komonthview.cpp | 218 |
1 files changed, 115 insertions, 103 deletions
diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp index 85e9166..ca55c43 100644 --- a/korganizer/komonthview.cpp +++ b/korganizer/komonthview.cpp @@ -16,24 +16,36 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include <qpopupmenu.h> +#include <q3popupmenu.h> #include <qfont.h> #include <qfontmetrics.h> -#include <qkeycode.h> -#include <qhbox.h> -#include <qvbox.h> -#include <qwidgetstack.h> +#include <qnamespace.h> +#include <q3hbox.h> +#include <q3vbox.h> +#include <q3widgetstack.h> #include <qpushbutton.h> #include <qtooltip.h> #include <qpainter.h> #include <qtimer.h> -#include <qwhatsthis.h> +#include <q3whatsthis.h> #ifndef DESKTOP_VERSION #include <qpe/qpeapplication.h> #else #include <qapplication.h> +#include <QDesktopWidget> +//Added by qt3to4: +#include <QResizeEvent> +#include <QLabel> +#include <QPixmap> +#include <QFocusEvent> +#include <QMouseEvent> +#include <QKeyEvent> +#include <Q3VBoxLayout> +#include <Q3Frame> +#include <Q3PointArray> +#include <Q3PtrList> #endif #include <kdebug.h> #include <klocale.h> @@ -58,12 +70,12 @@ #define PIXMAP_SIZE 5 #ifdef DESKTOP_VERSION QToolTipGroup *MonthViewCell::mToolTipGroup = 0; #endif -class KNOWhatsThis :public QWhatsThis +class KNOWhatsThis :public Q3WhatsThis { public: - KNOWhatsThis( KNoScrollListBox* sbox ) : QWhatsThis( sbox ), _wid( sbox) { }; + KNOWhatsThis( KNoScrollListBox* sbox ) : Q3WhatsThis( sbox ), _wid( sbox) { }; //~KNOWhatsThis( ) {qDebug("~KNOWhatsThis( ) "); }; protected: virtual QString text( const QPoint& p) @@ -76,18 +88,18 @@ private: }; KNoScrollListBox::KNoScrollListBox(QWidget *parent,const char *name) - : QListBox(parent, name, WRepaintNoErase) + : Q3ListBox(parent, name, Qt::WNoAutoErase) { #ifndef DESKTOP_VERSION QPEApplication::setStylusOperation( viewport(), QPEApplication::RightOnHold ); #endif mBlockDeselect = false; mWT = new KNOWhatsThis(this); resetOnFocusIn = true; - setVScrollBarMode(QScrollView::AlwaysOff); - setHScrollBarMode(QScrollView::AlwaysOff); + setVScrollBarMode(Q3ScrollView::AlwaysOff); + setHScrollBarMode(Q3ScrollView::AlwaysOff); } KNoScrollListBox::~KNoScrollListBox() { #if QT_VERSION >= 0x030000 @@ -99,9 +111,9 @@ KNoScrollListBox::~KNoScrollListBox() void KNoScrollListBox::focusInEvent ( QFocusEvent * e ) { - QListBox::focusInEvent ( e ); + Q3ListBox::focusInEvent ( e ); if ( count() ){ int ci = currentItem(); if ( ci < 0 ) ci = 0; @@ -111,26 +123,26 @@ void KNoScrollListBox::focusInEvent ( QFocusEvent * e ) resetOnFocusIn = true; if ( KOPrefs::instance()->mEnableMonthScroll || KOPrefs::instance()->mMonthViewWeek ) { - QListBoxItem *fi = firstItem (); + Q3ListBoxItem *fi = firstItem (); if (fi ) { int ihei = fi->height( this ); int hei = numRows () * ihei; if ( hei < height() - horizontalScrollBar()->height () ) { - setVScrollBarMode(QScrollView::AlwaysOff); + setVScrollBarMode(Q3ScrollView::AlwaysOff); } else - setVScrollBarMode(QScrollView::Auto); + setVScrollBarMode(Q3ScrollView::Auto); if ( ihei *3 > height() ) { - setHScrollBarMode(QScrollView::AlwaysOff); + setHScrollBarMode(Q3ScrollView::AlwaysOff); } else { - setHScrollBarMode(QScrollView::Auto); + setHScrollBarMode(Q3ScrollView::Auto); } } else { - setVScrollBarMode(QScrollView::Auto); - setHScrollBarMode(QScrollView::Auto); + setVScrollBarMode(Q3ScrollView::Auto); + setHScrollBarMode(Q3ScrollView::Auto); } } } } @@ -140,20 +152,20 @@ void KNoScrollListBox::focusOutEvent ( QFocusEvent * e ) int i = currentItem (); if ( i >= 0 ) { setSelected ( i, false ); } - QListBox::focusOutEvent ( e ); + Q3ListBox::focusOutEvent ( e ); } - setVScrollBarMode(QScrollView::AlwaysOff); - setHScrollBarMode(QScrollView::AlwaysOff); + setVScrollBarMode(Q3ScrollView::AlwaysOff); + setHScrollBarMode(Q3ScrollView::AlwaysOff); if ( ! mBlockDeselect ) emit highlightIncidence( 0, (MonthViewCell*)this, 0 ); mBlockDeselect = false; } QString KNoScrollListBox::getWhatsThisText(QPoint p) { - QListBoxItem* item = itemAt ( p ); + Q3ListBoxItem* item = itemAt ( p ); if ( ! item ) { return i18n("Click in the cell\nto add an event!"); } return KIncidenceFormatter::instance()->getFormattedText(((MonthViewItem*) item)->incidence(), @@ -164,25 +176,25 @@ QString KNoScrollListBox::getWhatsThisText(QPoint p) void KNoScrollListBox::keyPressEvent(QKeyEvent *e) { //qDebug("KNoScrollListBox::keyPressEvent "); switch(e->key()) { - case Key_Right: + case Qt::Key_Right: if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) { e->ignore(); return; } scrollBy(10,0); break; - case Key_Left: + case Qt::Key_Left: if (e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) { e->ignore(); return; } scrollBy(-10,0); break; - case Key_Up: + case Qt::Key_Up: if( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton) { e->ignore(); break; } @@ -200,9 +212,9 @@ void KNoScrollListBox::keyPressEvent(QKeyEvent *e) } } } break; - case Key_Down: + case Qt::Key_Down: if(e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton) { e->ignore(); break; } @@ -220,14 +232,14 @@ void KNoScrollListBox::keyPressEvent(QKeyEvent *e) } } } break; - case Key_I: + case Qt::Key_I: QTimer::singleShot( 1, this, SLOT ( oneDown() ) ); e->ignore(); break; - case Key_Return: - case Key_Enter: + case Qt::Key_Return: + case Qt::Key_Enter: { if ( currentItem() >= 0 ) { emit doubleClicked( item( currentItem() ) ); e->accept(); @@ -235,9 +247,9 @@ void KNoScrollListBox::keyPressEvent(QKeyEvent *e) e->ignore(); } } break; - case Key_Shift: + case Qt::Key_Shift: emit shiftDown(); break; default: e->ignore(); @@ -265,9 +277,9 @@ void KNoScrollListBox::oneDown() } void KNoScrollListBox::keyReleaseEvent(QKeyEvent *e) { switch(e->key()) { - case Key_Shift: + case Qt::Key_Shift: emit shiftUp(); break; default: break; @@ -275,17 +287,17 @@ void KNoScrollListBox::keyReleaseEvent(QKeyEvent *e) } void KNoScrollListBox::mousePressEvent(QMouseEvent *e) { - QListBox::mousePressEvent(e); + Q3ListBox::mousePressEvent(e); - if(e->button() == RightButton) { + if(e->button() == Qt::RightButton) { emit rightClick(); } } MonthViewItem::MonthViewItem( Incidence *incidence, const QString & s) - : QListBoxItem() + : Q3ListBoxItem() { mblockRepaint = true; isWeekItem = KOPrefs::instance()->mMonthViewWeek; recycle( incidence, s ); @@ -394,16 +406,16 @@ void MonthViewItem::paint(QPainter *p) int sizeM = size+2; p->setBrush( QBrush( textColor ) ); p->drawLine ( x+1, yyy, x +sizeM +sizeM/2-1, yyy ) ; if ( mMultiday == 2 || mMultiday == 3 ) { - QPointArray pa ( 3 ); + Q3PointArray pa ( 3 ); pa.setPoint (0, x, yyy ); pa.setPoint (1, x+sizeM/2, yyy+sizeM/2 ); pa.setPoint (2, x+sizeM/2, yyy-sizeM/2 ); p->drawPolygon( pa ); } if ( mMultiday == 2 || mMultiday == 1 ) { - QPointArray pa ( 3 ); + Q3PointArray pa ( 3 ); pa.setPoint (0, x+sizeM +sizeM/2, yyy ); pa.setPoint (1, x+sizeM, yyy+sizeM/2 ); pa.setPoint (2, x+sizeM, yyy-sizeM/2 ); p->drawPolygon( pa ); @@ -461,17 +473,17 @@ void MonthViewItem::paint(QPainter *p) } } } -int MonthViewItem::height(const QListBox *lb) const +int MonthViewItem::height(const Q3ListBox *lb) const { int ret = 10; if ( lb ) ret = lb->fontMetrics().lineSpacing()+1; return ret; } -int MonthViewItem::width(const QListBox *lb) const +int MonthViewItem::width(const Q3ListBox *lb) const { if( KOPrefs::instance()->mEnableMonthScroll || isWeekItem ) { int size = PIXMAP_SIZE; if ( QApplication::desktop()->width() < 300 ) @@ -513,12 +525,12 @@ MonthViewCell::MonthViewCell( KOMonthView *parent,QWidget* par ) //mLabel->setFrameStyle( QFrame::Panel | QFrame::Plain ); //mLabel->setLineWidth( 1 ); //mLabel->setAlignment( AlignCenter ); mLabel->setFlat( true ); - mLabel->setFocusPolicy(NoFocus); + mLabel->setFocusPolicy(Qt::NoFocus); //mItemList = new KNoScrollListBox( this ); setMinimumSize( 10, 10 ); - setFrameStyle( QFrame::Panel | QFrame::Plain ); + setFrameStyle( Q3Frame::Panel | Q3Frame::Plain ); setLineWidth( 1 ); //topLayout->addWidget( mItemList ); mLabel->raise(); // QColor( 0,0,255 ) QColor( 160,1600,255 ) @@ -528,15 +540,15 @@ MonthViewCell::MonthViewCell( KOMonthView *parent,QWidget* par ) enableScrollBars( false ); updateConfig(); //connect( mLabel, SIGNAL( clicked( )), SLOT( newEvent() )); connect( mLabel, SIGNAL( clicked( )), SLOT( showDay() )); - connect( this , SIGNAL( doubleClicked( QListBoxItem *) ), - SLOT( defaultAction( QListBoxItem * ) ) ); - connect( this, SIGNAL( rightButtonPressed( QListBoxItem *, + connect( this , SIGNAL( doubleClicked( Q3ListBoxItem *) ), + SLOT( defaultAction( Q3ListBoxItem * ) ) ); + connect( this, SIGNAL( rightButtonPressed( Q3ListBoxItem *, const QPoint &) ), - SLOT( contextMenu( QListBoxItem * ) ) ); - connect( this, SIGNAL( highlighted( QListBoxItem *) ), - SLOT( selection( QListBoxItem * ) ) ); + SLOT( contextMenu( Q3ListBoxItem * ) ) ); + connect( this, SIGNAL( highlighted( Q3ListBoxItem *) ), + SLOT( selection( Q3ListBoxItem * ) ) ); /* connect( this, SIGNAL( clicked( QListBoxItem * ) ), SLOT( selection( QListBoxItem * ) ) ); @@ -544,9 +556,9 @@ MonthViewCell::MonthViewCell( KOMonthView *parent,QWidget* par ) } #ifdef DESKTOP_VERSION QToolTipGroup *MonthViewCell::toolTipGroup() { - if (!mToolTipGroup) mToolTipGroup = new QToolTipGroup(0); + /* TODO:hacker: if (!mToolTipGroup) mToolTipGroup = new QToolTipGroup(0); */ return mToolTipGroup; } #endif @@ -636,9 +648,9 @@ void MonthViewCell::setHoliday( const QString &holiday ) void MonthViewCell::startUpdateCell() { blockSignals( true ); mdayCount = 0; - setFocusPolicy(NoFocus); + setFocusPolicy(Qt::NoFocus); if ( !mMonthView->isUpdatePossible() ) return; MonthViewItem *mitem = (MonthViewItem*) firstItem (); while ( mitem ) { @@ -691,9 +703,9 @@ int MonthViewCell::insertEvent(Event *event) #ifndef DESKTOP_VERSION useToolTips = false; #endif QString mToolTipText; - setFocusPolicy(WheelFocus); + setFocusPolicy(Qt::WheelFocus); if ( !(event->doesRecur() == Recurrence::rNone) ) { if ( !KOPrefs::instance()->mMonthDailyRecur && event->doesRecur() == Recurrence::rDaily ) return mdayCount; else @@ -833,9 +845,9 @@ int MonthViewCell::insertEvent(Event *event) itcount = 0; } for ( i = pos; i < itcount;++i ) { // qDebug("i %d mday %u count %d ",i,itcount,mdayCount ); - QListBoxItem* it = this->item ( i ); + Q3ListBoxItem* it = this->item ( i ); if ( it && text < it->text() ) { pos = i; break; } @@ -849,9 +861,9 @@ int MonthViewCell::insertEvent(Event *event) return mdayCount; } void MonthViewCell::insertTodo(Todo *todo) { - setFocusPolicy(WheelFocus); + setFocusPolicy(Qt::WheelFocus); QString text; if (todo->hasDueDate()) { if (!todo->doesFloat()) { text += KGlobal::locale()->formatTime(todo->dtDue().time()); @@ -921,9 +933,9 @@ void MonthViewCell::finishUpdateCell() #ifdef DESKTOP_VERSION if (mToolTip.count() > 0 ) { mToolTip.sort(); - QToolTip::add(this,mToolTip.join("\n"),toolTipGroup(),""); + /* TODO: hacker: QToolTip::add(this,mToolTip.join("\n"),toolTipGroup(),""); */ } #endif //sort(); //setMyPalette(); @@ -937,15 +949,15 @@ void MonthViewCell::updateCell() if ( !mMonthView->isUpdatePossible() ) return; startUpdateCell(); //mLabel->setMaximumWidth( width() - mItemList->lineWidth()*2); - QPtrList<Event> events = mMonthView->calendar()->events( mDate, true ); + Q3PtrList<Event> events = mMonthView->calendar()->events( mDate, true ); Event *event; for( event = events.first(); event; event = events.next() ) { // for event insertEvent(event); } // insert due todos - QPtrList<Todo> todos = mMonthView->calendar()->todos( mDate ); + Q3PtrList<Todo> todos = mMonthView->calendar()->todos( mDate ); Todo *todo; for(todo = todos.first(); todo; todo = todos.next()) { insertTodo( todo ); } @@ -991,30 +1003,30 @@ void MonthViewCell::enableScrollBars( bool enabled ) { return; if ( enabled ) { - QListBoxItem *fi = firstItem (); + Q3ListBoxItem *fi = firstItem (); if (fi ) { int ihei = fi->height( this ); int hei = numRows () * ihei; if ( hei < height() - horizontalScrollBar()->height () ) { - setVScrollBarMode(QScrollView::AlwaysOff); + setVScrollBarMode(Q3ScrollView::AlwaysOff); } else - setVScrollBarMode(QScrollView::Auto); + setVScrollBarMode(Q3ScrollView::Auto); if ( ihei *3 > height() ) { - setHScrollBarMode(QScrollView::AlwaysOff); + setHScrollBarMode(Q3ScrollView::AlwaysOff); } else { - setHScrollBarMode(QScrollView::Auto); + setHScrollBarMode(Q3ScrollView::Auto); } } else { - setVScrollBarMode(QScrollView::Auto); - setHScrollBarMode(QScrollView::Auto); + setVScrollBarMode(Q3ScrollView::Auto); + setHScrollBarMode(Q3ScrollView::Auto); } } else { - setVScrollBarMode(QScrollView::AlwaysOff); - setHScrollBarMode(QScrollView::AlwaysOff); + setVScrollBarMode(Q3ScrollView::AlwaysOff); + setHScrollBarMode(Q3ScrollView::AlwaysOff); } } Incidence *MonthViewCell::selectedIncidence() @@ -1082,9 +1094,9 @@ void MonthViewCell::resizeEvent ( QResizeEvent * e ) if ( e ) KNoScrollListBox::resizeEvent ( e ); } -void MonthViewCell::defaultAction( QListBoxItem *item ) +void MonthViewCell::defaultAction( Q3ListBoxItem *item ) { if ( !item ) { QDateTime dt( date(), QTime( KOPrefs::instance()->mStartTime, 0 ) ); @@ -1104,9 +1116,9 @@ void MonthViewCell::newEvent() { QDateTime dt( date(), QTime( KOPrefs::instance()->mStartTime, 0 ) ); emit newEventSignal( dt ); } -void MonthViewCell::cellClicked( QListBoxItem *item ) +void MonthViewCell::cellClicked( Q3ListBoxItem *item ) { mMonthView->setSelectedCell( this ); if ( item == 0 ) { QDateTime dt( date(), QTime( KOPrefs::instance()->mStartTime, 0 ) ); @@ -1115,9 +1127,9 @@ void MonthViewCell::cellClicked( QListBoxItem *item ) } } -void MonthViewCell::contextMenu( QListBoxItem *item ) +void MonthViewCell::contextMenu( Q3ListBoxItem *item ) { mMonthView->setPopupCell( this ); if ( !item ) { mMonthView->showContextMenu( 0 ); @@ -1132,9 +1144,9 @@ void MonthViewCell::contextMenu( QListBoxItem *item ) mMonthView->showContextMenu( incidence ); } } -void MonthViewCell::selection( QListBoxItem *item ) +void MonthViewCell::selection( Q3ListBoxItem *item ) { if ( !item ) { emit highlightIncidence( 0 , this, 0 ); return; @@ -1184,10 +1196,10 @@ KOMonthView::KOMonthView(Calendar *calendar, QWidget *parent, const char *name) skipResize = false; clPending = true; mPopupCell = 0; mNavigatorBar = new NavigatorBar( QDate::currentDate(), this, "useBigPixmaps" ); - mWidStack = new QWidgetStack( this ); - QVBoxLayout* hb = new QVBoxLayout( this ); + mWidStack = new Q3WidgetStack( this ); + Q3VBoxLayout* hb = new Q3VBoxLayout( this ); mMonthView = new QWidget( mWidStack ); mWeekView = new QWidget( mWidStack ); #if QT_VERSION >= 0x030000 mWidStack->addWidget(mMonthView ); @@ -1214,53 +1226,53 @@ KOMonthView::KOMonthView(Calendar *calendar, QWidget *parent, const char *name) for( i = 0; i < mDaysPerWeek; i++ ) { QLabel *label = new QLabel( mMonthView ); label->setFont(bfont); - label->setFrameStyle(QFrame::Panel|QFrame::Raised); + label->setFrameStyle(Q3Frame::Panel|Q3Frame::Raised); label->setLineWidth(1); - label->setAlignment(AlignCenter); + label->setAlignment(Qt::AlignCenter); mDayLabels.insert( i, label ); label = new QLabel( mWeekView ); label->setFont(bfont); - label->setFrameStyle(QFrame::Panel|QFrame::Raised); + label->setFrameStyle(Q3Frame::Panel|Q3Frame::Raised); label->setLineWidth(1); - label->setAlignment(AlignCenter); + label->setAlignment(Qt::AlignCenter); mDayLabelsW.insert( i, label ); } bfont.setBold( false ); mWeekLabels.resize( mNumWeeks+1 ); mWeekLabelsW.resize( 2 ); for( i = 0; i < mNumWeeks+1; i++ ) { KOWeekButton *label = new KOWeekButton( mMonthView ); - label->setFocusPolicy(NoFocus); + label->setFocusPolicy(Qt::NoFocus); label->setFont(bfont); connect( label, SIGNAL( selectWeekNum ( int )),this, SLOT( selectInternalWeekNum ( int )) ); label->setFlat(true); - QWhatsThis::add(label,i18n("Click on the week number to\nshow week zoomed")); + Q3WhatsThis::add(label,i18n("Click on the week number to\nshow week zoomed")); //label->setFrameStyle(QFrame::Panel|QFrame::Raised); //label->setLineWidth(1); //label->setAlignment(AlignCenter); mWeekLabels.insert( i, label ); } mWeekLabels[mNumWeeks]->setText( i18n("W")); - mWeekLabels[mNumWeeks]->setFocusPolicy(WheelFocus); - QWhatsThis::add(mWeekLabels[mNumWeeks],i18n("Click on this to\nselect week number")); + mWeekLabels[mNumWeeks]->setFocusPolicy(Qt::WheelFocus); + Q3WhatsThis::add(mWeekLabels[mNumWeeks],i18n("Click on this to\nselect week number")); for( i = 0; i < 1+1; i++ ) { KOWeekButton *label = new KOWeekButton( mWeekView ); - label->setFocusPolicy(NoFocus); + label->setFocusPolicy(Qt::NoFocus); label->setFont(bfont); connect( label, SIGNAL( selectWeekNum ( int )),this, SLOT( selectInternalWeekNum ( int )) ); label->setFlat(true); - QWhatsThis::add(label,i18n("Click on the week number to\nshow week zoomed")); + Q3WhatsThis::add(label,i18n("Click on the week number to\nshow week zoomed")); //label->setFrameStyle(QFrame::Panel|QFrame::Raised); //label->setLineWidth(1); //label->setAlignment(AlignCenter); mWeekLabelsW.insert( i, label ); } mWeekLabelsW[1]->setText( i18n("W")); - mWeekLabelsW[1]->setFocusPolicy(WheelFocus); + mWeekLabelsW[1]->setFocusPolicy(Qt::WheelFocus); int row, col; mCells.resize( mNumCells ); @@ -1304,15 +1316,15 @@ KOMonthView::KOMonthView(Calendar *calendar, QWidget *parent, const char *name) } //connect( mWeekLabels[mNumWeeks], SIGNAL( clicked() ), SLOT( switchView() ) ); mContextMenu = eventPopup(); - mContextMenu->addAdditionalItem(QIconSet(QPixmap()), + mContextMenu->addAdditionalItem(QIcon(QPixmap()), i18n("New Event..."),this, SLOT(slotNewEvent()),false); - mContextMenu->addAdditionalItem(QIconSet(QPixmap()), + mContextMenu->addAdditionalItem(QIcon(QPixmap()), i18n("New Todo..."),this, SLOT(slotNewTodo()),false); - mContextMenu->addAdditionalItem(QIconSet(QPixmap()), + mContextMenu->addAdditionalItem(QIcon(QPixmap()), i18n("Journal"),this, SLOT(slotEditJournal()),false); connect (mContextMenu ,SIGNAL(categoryChanged( Incidence * )),this, @@ -1324,9 +1336,9 @@ KOMonthView::KOMonthView(Calendar *calendar, QWidget *parent, const char *name) if ( QApplication::desktop()->width() < 480 ) pathString += "icons16/"; } else pathString += "iconsmini/"; - mNewItemMenu = new QPopupMenu( this ); + mNewItemMenu = new Q3PopupMenu( this ); mNewItemMenu->insertItem( SmallIcon( pathString +"newevent" ), i18n("New Event..."),this, SLOT(slotNewEvent())); mNewItemMenu->insertItem( SmallIcon( pathString +"newtodo" ),i18n("New Todo..."),this,SLOT(slotNewTodo()),false); mNewItemMenu->insertItem( SmallIcon( pathString +"journal" ),i18n("Journal"),this,SLOT(slotEditJournal()),false); @@ -1396,9 +1408,9 @@ void KOMonthView::incidenceHighlighted( Incidence * inc , MonthViewCell* mc, int index = i; break; } } - QPtrVector<MonthViewCell> *cells; + Q3PtrVector<MonthViewCell> *cells; if ( weekview ) cells = &mCellsW; else { for (uint i = 0; i < mCells.count(); ++i) { @@ -1494,11 +1506,11 @@ int KOMonthView::currentDateCount() { return mNumCells; } -QPtrList<Incidence> KOMonthView::selectedIncidences() +Q3PtrList<Incidence> KOMonthView::selectedIncidences() { - QPtrList<Incidence> selected; + Q3PtrList<Incidence> selected; if ( mSelectedCell ) { Incidence *incidence = mSelectedCell->selectedIncidence(); if ( incidence ) selected.append( incidence ); @@ -1560,17 +1572,17 @@ void KOMonthView::updateConfig() for (uint i = 0; i < mCellsW.count(); ++i) { mCellsW[i]->updateConfig(KOPrefs::instance()->mMonthViewUsesBigFont); } #ifdef DESKTOP_VERSION - MonthViewCell::toolTipGroup()->setEnabled(KOPrefs::instance()->mEnableToolTips); + /* TODO:hacker: MonthViewCell::toolTipGroup()->setEnabled(KOPrefs::instance()->mEnableToolTips); */ #endif updateView(); } void KOMonthView::updateDayLabels() { - QPtrVector<QLabel> *mDayLabelsT; + Q3PtrVector<QLabel> *mDayLabelsT; mDayLabelsT = &mDayLabelsW; for (int i = 0; i < 7; i++) { { @@ -1609,11 +1621,11 @@ void KOMonthView::clearList() void KOMonthView::showDates(const QDate &start, const QDate &) { // kdDebug() << "KOMonthView::showDates(): " << start.toString() << endl; - QPtrVector<MonthViewCell> *cells; - QPtrVector<QLabel> *dayLabels; - QPtrVector<KOWeekButton> *weekLabels; + Q3PtrVector<MonthViewCell> *cells; + Q3PtrVector<QLabel> *dayLabels; + Q3PtrVector<KOWeekButton> *weekLabels; uint weekNum = 6; mStartDate = start; if ( mShowWeekView ) { weekNum = 1; @@ -1667,9 +1679,9 @@ void KOMonthView::showDates(const QDate &start, const QDate &) } updateView(); } -void KOMonthView::showEvents(QPtrList<Event>) +void KOMonthView::showEvents(Q3PtrList<Event>) { qDebug("KOMonthView::selectEvents is not implemented yet. "); } @@ -1689,9 +1701,9 @@ void KOMonthView::updateView() //qDebug("UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU "); //QTime ti; //ti.start(); clearSelection(); - QPtrVector<MonthViewCell> *cells; + Q3PtrVector<MonthViewCell> *cells; if ( mShowWeekView ) { cells = &mCellsW; } else { cells = &mCells; @@ -1704,9 +1716,9 @@ void KOMonthView::updateView() for( i = 0; i < timeSpan + 1; ++i ) { (*cells)[i]->startUpdateCell(); } - QPtrList<Event> events = calendar()->events(); + Q3PtrList<Event> events = calendar()->events(); Event *event; QDateTime dt; QDate endDate = mStartDate.addDays( timeSpan ); for( event = events.first(); event; event = events.next() ) { // for event @@ -1768,9 +1780,9 @@ void KOMonthView::updateView() } } } // insert due todos - QPtrList<Todo> todos = calendar()->todos( ); + Q3PtrList<Todo> todos = calendar()->todos( ); Todo *todo; for(todo = todos.first(); todo; todo = todos.next()) { //insertTodo( todo ); if ( todo->hasDueDate() ) { @@ -2224,9 +2236,9 @@ void KOMonthView::setSelectedCell( MonthViewCell *cell ) } void KOMonthView::processSelectionChange() { - QPtrList<Incidence> incidences = selectedIncidences(); + Q3PtrList<Incidence> incidences = selectedIncidences(); if (incidences.count() > 0) { emit incidenceSelected( incidences.first() ); } else { emit incidenceSelected( 0 ); @@ -2260,9 +2272,9 @@ void KOMonthView::keyPressEvent ( QKeyEvent * e ) } if (! e->isAutoRepeat() ) mFlagKeyPressed = true; switch(e->key()) { - case Key_Up: + case Qt::Key_Up: { if ( mShowWeekView ) { emit selectWeekNum ( currentWeek() - 1 ); } @@ -2271,9 +2283,9 @@ void KOMonthView::keyPressEvent ( QKeyEvent * e ) } } e->accept(); break; - case Key_Down: + case Qt::Key_Down: { if ( mShowWeekView ) { emit selectWeekNum ( currentWeek() +1); } @@ -2283,16 +2295,16 @@ void KOMonthView::keyPressEvent ( QKeyEvent * e ) } e->accept(); break; - case Key_Return: - case Key_Enter: + case Qt::Key_Return: + case Qt::Key_Enter: { selectInternalWeekNum ( currentWeek() ); } e->accept(); break; - case Key_D: + case Qt::Key_D: if ( mSelectedCell ) { mSelectedCell->showDay(); e->accept(); } else { |