summaryrefslogtreecommitdiffstats
path: root/tdeui/kdatetimewidget.cpp
diff options
context:
space:
mode:
authorTimothy Pearson <[email protected]>2011-11-06 15:56:40 -0600
committerTimothy Pearson <[email protected]>2011-11-06 15:56:40 -0600
commite16866e072f94410321d70daedbcb855ea878cac (patch)
treeee3f52eabde7da1a0e6ca845fb9c2813cf1558cf /tdeui/kdatetimewidget.cpp
parenta58c20c1a7593631a1b50213c805507ebc16adaf (diff)
downloadtdelibs-e16866e072f94410321d70daedbcb855ea878cac.tar.gz
tdelibs-e16866e072f94410321d70daedbcb855ea878cac.zip
Actually move the kde files that were renamed in the last commit
Diffstat (limited to 'tdeui/kdatetimewidget.cpp')
-rw-r--r--tdeui/kdatetimewidget.cpp74
1 files changed, 74 insertions, 0 deletions
diff --git a/tdeui/kdatetimewidget.cpp b/tdeui/kdatetimewidget.cpp
new file mode 100644
index 000000000..d7b677af9
--- /dev/null
+++ b/tdeui/kdatetimewidget.cpp
@@ -0,0 +1,74 @@
+#include <tqlayout.h>
+
+#include "kdatewidget.h"
+#include "kdebug.h"
+#include "kdialog.h"
+#include "ktimewidget.h"
+
+#include "kdatetimewidget.h"
+
+class KDateTimeWidget::KDateTimeWidgetPrivate
+{
+public:
+ KDateWidget * dateWidget;
+ KTimeWidget * timeWidget;
+};
+
+KDateTimeWidget::KDateTimeWidget(TQWidget * parent, const char * name)
+ : TQWidget(parent, name)
+{
+ init();
+}
+
+KDateTimeWidget::KDateTimeWidget(const TQDateTime & datetime,
+ TQWidget * parent, const char * name)
+ : TQWidget(parent, name)
+{
+ init();
+
+ setDateTime(datetime);
+}
+
+KDateTimeWidget::~KDateTimeWidget()
+{
+ delete d;
+}
+
+void KDateTimeWidget::init()
+{
+ d = new KDateTimeWidgetPrivate;
+
+ TQHBoxLayout *layout = new TQHBoxLayout(this, 0, KDialog::spacingHint());
+ layout->setAutoAdd(true);
+
+ d->dateWidget = new KDateWidget(this);
+ d->timeWidget = new KTimeWidget(this);
+
+ connect(d->dateWidget, TQT_SIGNAL(changed(TQDate)),
+ TQT_SLOT(slotValueChanged()));
+ connect(d->timeWidget, TQT_SIGNAL(valueChanged(const TQTime &)),
+ TQT_SLOT(slotValueChanged()));
+}
+
+void KDateTimeWidget::setDateTime(const TQDateTime & datetime)
+{
+ d->dateWidget->setDate(TQT_TQDATE_OBJECT(datetime.date()));
+ d->timeWidget->setTime(TQT_TQTIME_OBJECT(datetime.time()));
+}
+
+TQDateTime KDateTimeWidget::dateTime() const
+{
+ return TQDateTime(d->dateWidget->date(), d->timeWidget->time());
+}
+
+void KDateTimeWidget::slotValueChanged()
+{
+ TQDateTime datetime(d->dateWidget->date(),
+ d->timeWidget->time());
+
+ kdDebug() << "slotValueChanged(): " << datetime << "\n";
+
+ emit valueChanged(datetime);
+}
+
+#include "kdatetimewidget.moc"