starttime->setDisplayFormat(tr("ddd MMMM d yyyy, h:mm ap","time format"));
starttime->setCalendarPopup(true);
starttime->setDateTime(QDateTime::fromTime_t(event.startTime()));
+ connect(starttime,SIGNAL(dateTimeChanged(const QDateTime&)),this,SLOT(startTimeChanged(const QDateTime&)));
gl->addWidget(lab=new QLabel(tr("End Time:")),++lctr,0);
lab->setAlignment(Qt::AlignRight|Qt::AlignVCenter);
endtime->setDisplayFormat(tr("ddd MMMM d yyyy, h:mm ap","time format"));
endtime->setCalendarPopup(true);
endtime->setDateTime(QDateTime::fromTime_t(event.endTime()));
+ connect(endtime,SIGNAL(dateTimeChanged(const QDateTime&)),this,SLOT(endTimeChanged(const QDateTime&)));
gl->addWidget(lab=new QLabel(tr("Room/Place:")),++lctr,0);
lab->setAlignment(Qt::AlignRight|Qt::AlignVCenter);
room->setText(rid);
}
}
+
+void MEventEditor::startTimeChanged(const QDateTime&st)
+{
+ QDateTime et=endtime->dateTime();
+ if(et<st)endtime->setDateTime(st);
+}
+
+void MEventEditor::endTimeChanged(const QDateTime&et)
+{
+ QDateTime st=starttime->dateTime();
+ if(st>et)starttime->setDateTime(et);
+}