diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-04-13 00:46:47 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-04-13 00:46:47 +0000 |
commit | 67e29a054cfcb1b0d2fe6b0a316cf6b3eec087b7 (patch) | |
tree | 5f52a9eada2e9f3654fc327d7c14dfef570a6ecb /libkdepim/kdateedit.cpp | |
parent | 2ee4bf4fd5eff93b2fbef0ff8e8063edffc5da5c (diff) | |
download | tdepim-67e29a054cfcb1b0d2fe6b0a316cf6b3eec087b7.tar.gz tdepim-67e29a054cfcb1b0d2fe6b0a316cf6b3eec087b7.zip |
Initial conversion of kdepim to TQt
This will probably require some tweaking before it will build under Qt4,
however Qt3 builds are OK. Any alterations this commit makes to kdepim
behaviour under Qt3 are unintentional and should be fixed.
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1227832 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'libkdepim/kdateedit.cpp')
-rw-r--r-- | libkdepim/kdateedit.cpp | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/libkdepim/kdateedit.cpp b/libkdepim/kdateedit.cpp index c4221556c..1d54920d6 100644 --- a/libkdepim/kdateedit.cpp +++ b/libkdepim/kdateedit.cpp @@ -34,11 +34,11 @@ #include "kdateedit.h" -class DateValidator : public QValidator +class DateValidator : public TQValidator { public: - DateValidator( const TQStringList &keywords, TQWidget* parent, const char* name = 0 ) - : TQValidator( parent, name ), mKeywords( keywords ) + DateValidator( const TQStringList &keywords, TQWidget* tqparent, const char* name = 0 ) + : TQValidator( tqparent, name ), mKeywords( keywords ) {} virtual State validate( TQString &str, int& ) const @@ -64,8 +64,8 @@ class DateValidator : public QValidator TQStringList mKeywords; }; -KDateEdit::KDateEdit( TQWidget *parent, const char *name ) - : TQComboBox( true, parent, name ), +KDateEdit::KDateEdit( TQWidget *tqparent, const char *name ) + : TQComboBox( true, tqparent, name ), mReadOnly( false ), mDiscardNextMousePress( false ) { @@ -163,7 +163,7 @@ void KDateEdit::popup() // The combo box is now shown pressed. Make it show not pressed again // by causing its (invisible) list box to emit a 'selected' signal. - // First, ensure that the list box tqcontains the date currently displayed. + // First, ensure that the list box contains the date currently displayed. TQDate date = parseDate(); assignDate( date ); updateView(); @@ -171,7 +171,7 @@ void KDateEdit::popup() TQListBox *lb = listBox(); if (lb) { lb->setCurrentItem(0); - TQKeyEvent* keyEvent = new TQKeyEvent(TQEvent::KeyPress, Qt::Key_Enter, 0, 0); + TQKeyEvent* keyEvent = new TQKeyEvent(TQEvent::KeyPress, TQt::Key_Enter, 0, 0); TQApplication::postEvent(lb, keyEvent); } } @@ -191,12 +191,12 @@ void KDateEdit::dateSelected( TQDate date ) void KDateEdit::lineEnterPressed() { - bool tqreplaced = false; + bool replaced = false; - TQDate date = parseDate( &tqreplaced ); + TQDate date = parseDate( &replaced ); if (assignDate( date ) ) { - if ( tqreplaced ) + if ( replaced ) updateView(); emit dateChanged( date ); @@ -204,13 +204,13 @@ void KDateEdit::lineEnterPressed() } } -TQDate KDateEdit::parseDate( bool *tqreplaced ) const +TQDate KDateEdit::parseDate( bool *replaced ) const { TQString text = currentText(); TQDate result; - if ( tqreplaced ) - (*tqreplaced) = false; + if ( replaced ) + (*replaced) = false; if ( text.isEmpty() ) result = TQDate(); @@ -235,8 +235,8 @@ TQDate KDateEdit::parseDate( bool *tqreplaced ) const } result = today.addDays( i ); - if ( tqreplaced ) - (*tqreplaced) = true; + if ( replaced ) + (*replaced) = true; } else { result = KGlobal::locale()->readDate( text ); } @@ -256,15 +256,15 @@ bool KDateEdit::eventFilter( TQObject *object, TQEvent *event ) // Up and down arrow keys step the date TQKeyEvent* keyEvent = (TQKeyEvent*)event; - if ( keyEvent->key() == Qt::Key_Return ) { + if ( keyEvent->key() == TQt::Key_Return ) { lineEnterPressed(); return true; } int step = 0; - if ( keyEvent->key() == Qt::Key_Up ) + if ( keyEvent->key() == TQt::Key_Up ) step = 1; - else if ( keyEvent->key() == Qt::Key_Down ) + else if ( keyEvent->key() == TQt::Key_Down ) step = -1; // TODO: If it's not an input key, but something like Return, Enter, Tab, etc..., don't eat the keypress, but handle it through to the default eventfilter! if ( step && !mReadOnly ) { @@ -307,7 +307,7 @@ bool KDateEdit::eventFilter( TQObject *object, TQEvent *event ) void KDateEdit::mousePressEvent( TQMouseEvent *event ) { - if ( event->button() == Qt::LeftButton && mDiscardNextMousePress ) { + if ( event->button() == TQt::LeftButton && mDiscardNextMousePress ) { mDiscardNextMousePress = false; return; } |