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/koagendaitem.cpp | |
parent | 11edc920afe4f274c0964436633aa632c8288a40 (diff) | |
download | kdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.zip kdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.tar.gz kdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.tar.bz2 |
initial public commit of qt4 portp1
-rw-r--r-- | korganizer/koagendaitem.cpp | 70 |
1 files changed, 40 insertions, 30 deletions
diff --git a/korganizer/koagendaitem.cpp b/korganizer/koagendaitem.cpp index 407424d..0f9a38f 100644 --- a/korganizer/koagendaitem.cpp +++ b/korganizer/koagendaitem.cpp @@ -21,9 +21,19 @@ #include <qlayout.h> -#include <qhbox.h> -#include <qvbox.h> +#include <q3hbox.h> +#include <q3vbox.h> #include <qtooltip.h> -#include <qwhatsthis.h> -#include <qdragobject.h> +#include <q3whatsthis.h> +#include <q3dragobject.h> #include <qdrawutil.h> #include <qpainter.h> +#include <QDesktopWidget> +//Added by qt3to4: +#include <Q3PtrList> +#include <QPixmap> +#include <QDragEnterEvent> +#include <QDropEvent> +#include <QResizeEvent> +#include <QMouseEvent> +#include <QEvent> +#include <QPaintEvent> @@ -59,6 +69,6 @@ QToolTipGroup *KOAgendaItem::mToolTipGroup = 0; -class KOAgendaItemWhatsThis :public QWhatsThis +class KOAgendaItemWhatsThis :public Q3WhatsThis { public: - KOAgendaItemWhatsThis( KOAgendaItem* view ) : QWhatsThis( view ),_view (view) { }; + KOAgendaItemWhatsThis( KOAgendaItem* view ) : Q3WhatsThis( view ),_view (view) { }; @@ -74,3 +84,3 @@ private: KOAgendaItem::KOAgendaItem(Incidence *incidence, QDate qd, QWidget *parent,bool allday, - const char *name,WFlags) : + const char *name,Qt::WFlags) : QWidget(parent, name), mIncidence(incidence), mDate(qd) @@ -81,4 +91,4 @@ KOAgendaItem::KOAgendaItem(Incidence *incidence, QDate qd, QWidget *parent,bool mKOAgendaItemWhatsThis = new KOAgendaItemWhatsThis(this); - int wflags = getWFlags() |WRepaintNoErase;// WResizeNoErase - setWFlags ( wflags); + Qt::WindowFlags wflags = windowFlags() |Qt::WRepaintNoErase;// WResizeNoErase + setWindowFlags ( wflags); mAllDay = allday; @@ -105,3 +115,3 @@ void KOAgendaItem::initColor () ((static_cast<Todo*>(mIncidence))->dtDue().date() <= QDate::currentDate()) ) ) { - if ( (static_cast<Todo*>(mIncidence))->dtDue() < QDateTime::currentDateTime().date()) + if ( (static_cast<Todo*>(mIncidence))->dtDue() < (QDateTime)QDateTime::currentDateTime().date()) mBackgroundColor = KOPrefs::instance()->mTodoOverdueColor ; @@ -134,3 +144,3 @@ void KOAgendaItem::initColor () BackgroundColor.dark(),BackgroundColor.light(), - BackgroundColor.dark(),BackgroundColor, black, BackgroundColor) ; + BackgroundColor.dark(),BackgroundColor, Qt::black, BackgroundColor) ; setBackgroundColor( mBackgroundColor ); @@ -230,3 +240,3 @@ bool KOAgendaItem::updateIcons(QPainter * p, bool horLayout) if (mIncidence->isAlarmEnabled() && mIncidence->alarmEnabled()) { - p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, red ); + p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, Qt::red ); if ( horLayout ) @@ -237,3 +247,3 @@ bool KOAgendaItem::updateIcons(QPainter * p, bool horLayout) if (mIncidence->doesRecur()) { - p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, blue ); + p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, Qt::blue ); if ( horLayout ) @@ -244,3 +254,3 @@ bool KOAgendaItem::updateIcons(QPainter * p, bool horLayout) if (mIncidence->description().length() > 0) { - p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, darkGreen ); + p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, Qt::darkGreen ); if ( horLayout ) @@ -251,3 +261,3 @@ bool KOAgendaItem::updateIcons(QPainter * p, bool horLayout) if (mIncidence->isReadOnly()) { - p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, white ); + p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, Qt::white ); if ( horLayout ) @@ -261,3 +271,3 @@ bool KOAgendaItem::updateIcons(QPainter * p, bool horLayout) if (mIncidence->organizer() == KOPrefs::instance()->email()) { - p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, black ); + p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, Qt::black ); if ( horLayout ) @@ -272,3 +282,3 @@ bool KOAgendaItem::updateIcons(QPainter * p, bool horLayout) } else { - p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, yellow ); + p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, Qt::yellow ); if ( horLayout ) @@ -279,3 +289,3 @@ bool KOAgendaItem::updateIcons(QPainter * p, bool horLayout) } - p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, darkYellow ); + p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, Qt::darkYellow ); if ( horLayout ) @@ -422,5 +432,5 @@ void KOAgendaItem::paintMe( bool selected, QPainter* paint ) #ifndef DESKTOP_VERSION - align = ( AlignLeft|WordBreak|AlignTop); + align = ( Qt::AlignLeft|Qt::TextWordWrap|Qt::AlignTop); #else - align = ( AlignLeft|BreakAnywhere|WordBreak|AlignTop); + align = ( Qt::AlignLeft|Qt::TextWrapAnywhere|Qt::TextWordWrap|Qt::AlignTop); #endif @@ -437,3 +447,3 @@ void KOAgendaItem::paintMe( bool selected, QPainter* paint ) if ( mWhiteText ) - paint->setPen ( white); + paint->setPen ( Qt::white); if ( x < 0 ) { @@ -446,5 +456,5 @@ void KOAgendaItem::paintMe( bool selected, QPainter* paint ) #ifndef DESKTOP_VERSION - align = ( AlignHCenter|WordBreak|AlignTop); + align = ( Qt::AlignHCenter|Qt::TextWordWrap|Qt::AlignTop); #else - align = ( AlignHCenter|BreakAnywhere|WordBreak|AlignTop); + align = ( Qt::AlignHCenter|Qt::TextWrapAnywhere|Qt::TextWordWrap|Qt::AlignTop); #endif @@ -563,3 +573,3 @@ void KOAgendaItem::paintEvent ( QPaintEvent *e ) //qDebug("%d %d %d %d %d %d %d",rx, ry, paintFrom, xx ,yPaintCoord+ry, rw, rh); - bitBlt (this, rx, ry, paintFrom, xx ,yPaintCoord+ry, rw, rh ,CopyROP); + bitBlt (this, rx, ry, paintFrom, xx ,yPaintCoord+ry, rw, rh ,QPainter::CompositionMode_Source); } @@ -630,3 +640,3 @@ void KOAgendaItem::computeText() } - QToolTip::add(this,tipText,toolTipGroup(),""); + QToolTip::add(this,tipText /*TODO:hacker: ,toolTipGroup(),"" */); #endif @@ -797,3 +807,3 @@ QToolTipGroup *KOAgendaItem::toolTipGroup() { - if (!mToolTipGroup) mToolTipGroup = new QToolTipGroup(0); + /* TODO:hacker: if (!mToolTipGroup) mToolTipGroup = new QToolTipGroup(0); */ return mToolTipGroup; @@ -805,3 +815,3 @@ void KOAgendaItem::dragEnterEvent( QDragEnterEvent *e ) if ( ICalDrag::canDecode( e ) || VCalDrag::canDecode( e ) || - !QTextDrag::canDecode( e ) ) { + !Q3TextDrag::canDecode( e ) ) { e->ignore(); @@ -817,3 +827,3 @@ void KOAgendaItem::dropEvent( QDropEvent *e ) QString text; - if(QTextDrag::decode(e,text)) + if(Q3TextDrag::decode(e,text)) { @@ -835,3 +845,3 @@ void KOAgendaItem::dropEvent( QDropEvent *e ) -QPtrList<KOAgendaItem> KOAgendaItem::conflictItems() +Q3PtrList<KOAgendaItem> KOAgendaItem::conflictItems() { @@ -840,3 +850,3 @@ QPtrList<KOAgendaItem> KOAgendaItem::conflictItems() -void KOAgendaItem::setConflictItems(QPtrList<KOAgendaItem> ci) +void KOAgendaItem::setConflictItems(Q3PtrList<KOAgendaItem> ci) { |