diff options
author | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
---|---|---|
committer | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
commit | ce599e4f9f94b4eb00c1b5edb85bce5431ab3df2 (patch) | |
tree | d3bb9f5d25a2dc09ca81adecf39621d871534297 /libkdeedu/extdate/testwidget.cpp | |
download | tdeedu-ce599e4f9f94b4eb00c1b5edb85bce5431ab3df2.tar.gz tdeedu-ce599e4f9f94b4eb00c1b5edb85bce5431ab3df2.zip |
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdeedu@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'libkdeedu/extdate/testwidget.cpp')
-rw-r--r-- | libkdeedu/extdate/testwidget.cpp | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/libkdeedu/extdate/testwidget.cpp b/libkdeedu/extdate/testwidget.cpp new file mode 100644 index 00000000..4dcd91c8 --- /dev/null +++ b/libkdeedu/extdate/testwidget.cpp @@ -0,0 +1,68 @@ +/*************************************************************************** + testwidget.h - description + ------------------- + begin : Sun Apr 11 2004 + copyright : (C) 2004 by Jason Harris + email : kstars@30doradus.org + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#include <kdatepicker.h> +#include <kdatewidget.h> +#include <klineedit.h> +#include <qlayout.h> +#include <qlabel.h> + +#include "extdatepicker.h" +#include "extdatewidget.h" +#include "testwidget.h" + +TestWidget::TestWidget( QWidget *p=0, const char *name=0 ) : KMainWindow( p, name ) { + QWidget *w = new QWidget(this); + + glay = new QGridLayout(w, 3, 2); + + QLabel *kdpLabel = new QLabel( QString("KDatePicker"), w ); + QLabel *edpLabel = new QLabel( QString("ExtDatePicker"), w ); + kdp = new KDatePicker(w); + edp = new ExtDatePicker(w); + kdpEdit = new KLineEdit(w); + kdpEdit->setReadOnly( TRUE ); + edpEdit = new KLineEdit(w); + edpEdit->setReadOnly( TRUE ); + + kdw = new KDateWidget( QDate::currentDate(), w ); + edw = new ExtDateWidget( ExtDate::currentDate(), w ); + + glay->addWidget( kdpLabel, 0, 0 ); + glay->addWidget( edpLabel, 0, 1 ); + glay->addWidget( kdp, 1, 0 ); + glay->addWidget( edp, 1, 1 ); + glay->addWidget( kdpEdit, 2, 0 ); + glay->addWidget( edpEdit, 2, 1 ); + glay->addWidget( kdw, 3, 0 ); + glay->addWidget( edw, 3, 1 ); + + setCentralWidget(w); + + connect( kdp, SIGNAL( dateChanged(QDate) ), this, SLOT( slotKDateChanged(QDate) ) ); + connect( edp, SIGNAL( dateChanged(const ExtDate&) ), this, SLOT( slotExtDateChanged(const ExtDate&) ) ); +} + +void TestWidget::slotKDateChanged(QDate d) { + kdpEdit->setText( d.toString() ); +} + +void TestWidget::slotExtDateChanged(const ExtDate &d) { + edpEdit->setText( d.toString() ); +} + +#include "testwidget.moc" |