aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Noldor2011-01-15 17:11:20 +0000
committerGravatar Noldor2011-01-15 17:11:20 +0000
commit1be0f5b95612ef18a2d4b917cefafc13506edecb (patch)
tree76006080edcbeedc2b84d53fc5e62f7be76f3202
parentlogviewer: fixed view of files inside subdirectories; (diff)
downloadKVIrc-1be0f5b95612ef18a2d4b917cefafc13506edecb.tar.gz
KVIrc-1be0f5b95612ef18a2d4b917cefafc13506edecb.tar.bz2
KVIrc-1be0f5b95612ef18a2d4b917cefafc13506edecb.zip
More work on datetime kvs class(wip)
git-svn-id: https://svn.kvirc.de/svn/trunk/kvirc@5367 17fca916-40b9-46aa-a4ea-0a15b648b75c
-rw-r--r--src/modules/objects/KvsObject_dateTimeEdit.cpp53
-rw-r--r--src/modules/objects/KvsObject_dateTimeEdit.h11
2 files changed, 58 insertions, 6 deletions
diff --git a/src/modules/objects/KvsObject_dateTimeEdit.cpp b/src/modules/objects/KvsObject_dateTimeEdit.cpp
index e992d69d7..77f4b02e5 100644
--- a/src/modules/objects/KvsObject_dateTimeEdit.cpp
+++ b/src/modules/objects/KvsObject_dateTimeEdit.cpp
@@ -84,6 +84,10 @@ KVSO_BEGIN_REGISTERCLASS(KvsObject_dateTimeEdit,"datetimeedit","widget")
KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_dateTimeEdit,setTime)
KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_dateTimeEdit,time)
+ KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_dateTimeEdit,timeChangedEvent)
+ KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_dateTimeEdit,dateTimeChangedEvent)
+ KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_dateTimeEdit,dateChangedEvent)
+
KVSO_END_REGISTERCLASS(KvsObject_dateTimeEdit)
KVSO_BEGIN_CONSTRUCTOR(KvsObject_dateTimeEdit,KvsObject_widget)
@@ -99,7 +103,11 @@ bool KvsObject_dateTimeEdit::init(KviKvsRunTimeContext *,KviKvsVariantList *)
{
QDateTimeEdit *obj=new QDateTimeEdit(QDate::currentDate(),parentScriptWidget());
obj->setObjectName(getName());
- setObject(obj,true);
+ connect(obj,SIGNAL(dateChanged(const QDate &)),this,SLOT(slotDateChanged(const QDate &)));
+ connect(obj,SIGNAL(dateTimeChanged(const QDateTime & )),this,SLOT(slotDateTimeChanged(const QDateTime &)));
+ connect(obj,SIGNAL(timeChanged(const QTime &)),this,SLOT(slotTimeChanged(const QTime &)));
+
+ setObject(obj,true);
return true;
}
@@ -157,6 +165,49 @@ KVSO_CLASS_FUNCTION(dateTimeEdit,setTime)
((QDateTimeEdit *)widget())->setTime(time);
return true;
}
+
+// slots
+void KvsObject_dateTimeEdit::slotDateTimeChanged(const QDateTime &)
+{
+ KviKvsVariantList *params=0;
+ callFunction(this,"dateTimeChangedEvent",params);
+}
+
+
+KVSO_CLASS_FUNCTION(dateTimeEdit,dateTimeChangedEvent)
+{
+ emitSignal("dateTimeChanged",c);
+ return true;
+}
+
+
+
+KVSO_CLASS_FUNCTION(dateTimeEdit,timeChangedEvent)
+{
+ emitSignal("timeChanged",c);
+ return true;
+}
+
+// slots
+void KvsObject_dateTimeEdit::slotTimeChanged(const QTime &)
+{
+ KviKvsVariantList *params=0;
+ callFunction(this,"timeChangedEvent",params);
+}
+
+KVSO_CLASS_FUNCTION(dateTimeEdit,dateChangedEvent)
+{
+ emitSignal("dateChanged",c);
+ return true;
+}
+
+// slots
+void KvsObject_dateTimeEdit::slotDateChanged(const QDate &)
+{
+ KviKvsVariantList *params=0;
+ callFunction(this,"dateChangedEvent",params);
+}
+
#ifndef COMPILE_USE_STANDALONE_MOC_SOURCES
#include "m_KvsObject_dateTimeEdit.moc"
#endif //COMPILE_USE_STANDALONE_MOC_SOURCES
diff --git a/src/modules/objects/KvsObject_dateTimeEdit.h b/src/modules/objects/KvsObject_dateTimeEdit.h
index fc2963a8f..8cff7c45e 100644
--- a/src/modules/objects/KvsObject_dateTimeEdit.h
+++ b/src/modules/objects/KvsObject_dateTimeEdit.h
@@ -44,13 +44,14 @@ protected:
bool time(KviKvsObjectFunctionCall *c);
bool setTime(KviKvsObjectFunctionCall *c);
- /* bool text(KviKvsObjectFunctionCall *c);
+ bool timeChangedEvent(KviKvsObjectFunctionCall *c);
+ bool dateTimeChangedEvent(KviKvsObjectFunctionCall *c);
+ bool dateChangedEvent(KviKvsObjectFunctionCall *c);
- bool setImage(KviKvsObjectFunctionCall *c);
- bool clickEvent(KviKvsObjectFunctionCall *c);
-*/
protected slots:
- //void slotClicked();
+ void slotDateTimeChanged(const QDateTime &);
+ void slotDateChanged(const QDate &);
+ void slotTimeChanged(const QTime &);
};
#endif // !_CLASS_datetimeedit_H_