-rw-r--r-- | libkdepim/kdateedit.cpp | 40 |
1 files changed, 22 insertions, 18 deletions
diff --git a/libkdepim/kdateedit.cpp b/libkdepim/kdateedit.cpp index bf38479..28c88d4 100644 --- a/libkdepim/kdateedit.cpp +++ b/libkdepim/kdateedit.cpp @@ -29,2 +29,5 @@ #include <qpushbutton.h> +//Added by qt3to4: +#include <Q3Frame> +#include <QKeyEvent> @@ -38,2 +41,3 @@ #include <qpalette.h> +#include <QDesktopWidget> @@ -43,3 +47,3 @@ KDateEdit::KDateEdit(QWidget *parent, const char *name, bool withoutDP ) - : QHBox(parent, name) + : Q3HBox(parent, name) { @@ -74,5 +78,5 @@ KDateEdit::KDateEdit(QWidget *parent, const char *name, bool withoutDP ) - mDateFrame = new QVBox(0,0,WType_Popup); + mDateFrame = new Q3VBox(0,0,Qt::WType_Popup); // mDateFrame->setFrameStyle(QFrame::PopupPanel | QFrame::Raised); - mDateFrame->setFrameStyle( QFrame::WinPanel |QFrame::Raised ); + mDateFrame->setFrameStyle( Q3Frame::WinPanel |Q3Frame::Raised ); mDateFrame->setLineWidth(3); @@ -88,3 +92,3 @@ KDateEdit::KDateEdit(QWidget *parent, const char *name, bool withoutDP ) connect(nowButton,SIGNAL(clicked()),SLOT(goToNow())); - mDateButton->setFocusPolicy( QWidget::NoFocus ); + mDateButton->setFocusPolicy( Qt::NoFocus ); mDateButton->setAutoDefault( false ); @@ -227,6 +231,6 @@ void KDateEdit::setDate( QDate date,int *cpos,const int key ,const bool dateForm case 'A': - if(key == Key_Up) { + if(key == Qt::Key_Up) { setDate( date.addDays( 1 ) ); } - else if(key == Key_Down) { + else if(key == Qt::Key_Down) { setDate( date.addDays( -1 ) ); @@ -238,3 +242,3 @@ void KDateEdit::setDate( QDate date,int *cpos,const int key ,const bool dateForm case 'B': - if(key == Key_Up) { + if(key == Qt::Key_Up) { int year = ((date.month()+1)>12)?date.year()+1:date.year(); @@ -243,3 +247,3 @@ void KDateEdit::setDate( QDate date,int *cpos,const int key ,const bool dateForm setDate( QDate( year, month, day ) ); - } else if(key == Key_Down) { + } else if(key == Qt::Key_Down) { int year = ((date.month()-1)<1)?date.year()-1:date.year(); @@ -252,6 +256,6 @@ void KDateEdit::setDate( QDate date,int *cpos,const int key ,const bool dateForm case 'Y': - if(key == Key_Up) { + if(key == Qt::Key_Up) { setDate( QDate( date.year() + 1, date.month() , date.day()) ); } - else if(key == Key_Down) { + else if(key == Qt::Key_Down) { setDate( QDate( date.year() - 1, date.month() , date.day()) ); @@ -346,8 +350,8 @@ void KDateEdit::keyPressEvent(QKeyEvent *e) { - case Key_Escape: + case Qt::Key_Escape: mDateEdit->deselect(); - case Key_Tab: - QHBox::keyPressEvent(e); + case Qt::Key_Tab: + Q3HBox::keyPressEvent(e); break; - case Key_Up: + case Qt::Key_Up: // when date invalid then set to currend and return @@ -362,5 +366,5 @@ void KDateEdit::keyPressEvent(QKeyEvent *e) } - setDate(date, &cpos, Key_Up, dateFormShort); + setDate(date, &cpos, Qt::Key_Up, dateFormShort); break; - case Key_Down: + case Qt::Key_Down: // when date invalid then set to current and return @@ -375,6 +379,6 @@ void KDateEdit::keyPressEvent(QKeyEvent *e) } - setDate(date, &cpos, Key_Down, dateFormShort); + setDate(date, &cpos, Qt::Key_Down, dateFormShort); break; default: - QHBox::keyPressEvent(e); + Q3HBox::keyPressEvent(e); break; |