summaryrefslogtreecommitdiffstats
path: root/libkdeedu/extdate/testwidget.cpp
blob: a6489cce86d85002e34dda46be3c25f2f22225a7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
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 <tqlayout.h>
#include <tqlabel.h>

#include "extdatepicker.h"
#include "extdatewidget.h"
#include "testwidget.h"

TestWidget::TestWidget( TQWidget *p=0, const char *name=0 ) : KMainWindow( p, name ) {
	TQWidget *w = new TQWidget(this);

	glay = new TQGridLayout(w, 3, 2);

	TQLabel *kdpLabel = new TQLabel( TQString("KDatePicker"), w );
	TQLabel *edpLabel = new TQLabel( TQString("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( TQDate::tqcurrentDate(), w );
	edw = new ExtDateWidget( ExtDate::tqcurrentDate(), 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, TQT_SIGNAL( dateChanged(TQDate) ), this, TQT_SLOT( slotKDateChanged(TQDate) ) );
	connect( edp, TQT_SIGNAL( dateChanged(const ExtDate&) ), this, TQT_SLOT( slotExtDateChanged(const ExtDate&) ) );
}

void TestWidget::slotKDateChanged(TQDate d) {
	kdpEdit->setText( d.toString() );
}

void TestWidget::slotExtDateChanged(const ExtDate &d) {
	edpEdit->setText( d.toString() );
}

#include "testwidget.moc"