本文整理汇总了C++中CalendarEvent::endTime方法的典型用法代码示例。如果您正苦于以下问题:C++ CalendarEvent::endTime方法的具体用法?C++ CalendarEvent::endTime怎么用?C++ CalendarEvent::endTime使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CalendarEvent
的用法示例。
在下文中一共展示了CalendarEvent::endTime方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
bool CalendarEvent::operator==(const CalendarEvent &other) const
{
// Storing a QDateTime to QSettings seems to lose time zone information. Lets ignore the time zone when
// comparing or we'll never find ourselves again.
QDateTime thisStartTime = m_startTime;
if (other.startTime().timeSpec() == Qt::TimeZone)
thisStartTime.setTimeZone(other.startTime().timeZone());
QDateTime thisEndTime = m_endTime;
if (other.endTime().timeSpec() == Qt::TimeZone)
thisEndTime.setTimeZone(other.endTime().timeZone());
QDateTime thisReminder = m_reminder;
if (other.reminder().timeSpec() == Qt::TimeZone)
thisReminder.setTimeZone(other.reminder().timeZone());
return m_id == other.id()
&& m_title == other.title()
&& m_description == other.description()
&& thisStartTime == other.startTime()
&& thisEndTime == other.endTime()
&& thisReminder == other.reminder()
&& m_location == other.location()
&& m_calendar == other.calendar()
&& m_comment == other.comment()
&& m_guests == other.guests()
&& m_recurring == other.recurring()
&& m_isAllDay == other.isAllDay();
}
示例2: diff
void CalendarEvent::diff(const CalendarEvent &other) const {
QDateTime thisStartTime = m_startTime;
if (other.startTime().timeSpec() == Qt::TimeZone)
thisStartTime.setTimeZone(other.startTime().timeZone());
QDateTime thisEndTime = m_endTime;
if (other.endTime().timeSpec() == Qt::TimeZone)
thisEndTime.setTimeZone(other.endTime().timeZone());
QDateTime thisReminder = m_reminder;
if (other.reminder().timeSpec() == Qt::TimeZone)
thisReminder.setTimeZone(other.reminder().timeZone());
if (m_id != other.id()) qDebug() << "id: " << m_id << " <> " << other.id();
if (m_title != other.title()) qDebug() << "title: " << m_title << " <> " << other.title();
if (m_description != other.description()) qDebug() << "description: " << m_description << " <> " << other.description();
if (thisStartTime != other.startTime()) qDebug() << "startTime: " << thisStartTime << " <> " << other.startTime();
if (thisEndTime != other.endTime()) qDebug() << "endTime: " << thisEndTime << " <> " << other.endTime();
if (thisReminder != other.reminder()) qDebug() << "reminder: " << thisReminder << " <> " << other.reminder();
if (m_location != other.location()) qDebug() << "location: " << m_location << " <> " << other.location();
if (m_calendar != other.calendar()) qDebug() << "calendar: " << m_calendar << " <> " << other.calendar();
if (m_comment != other.comment()) qDebug() << "comment: " << m_comment << " <> " << other.comment();
if (m_guests != other.guests()) qDebug() << "guests: " << m_guests << " <> " << other.guests();
if (m_recurring != other.recurring()) qDebug() << "recurring: " << m_recurring << " <> " << other.recurring();
if (m_isAllDay != other.isAllDay()) qDebug() << "isAllDay: " << m_isAllDay << " <> " << other.isAllDay();
}
示例3: QVariant
// Iterate over the list of events
foreach (const CalendarEvent &event, events2) {
// Copy the data into a model entry
QVariantMap entry;
entry["myType"] = QVariant(trUtf8("tomorrow"));
entry["eventId"] = event.id();
entry["accountId"] = event.accountId();
entry["subject"] = event.subject().replace('&', "&").replace('<', "<").replace('>', ">").replace('"', """);
entry["order"] = order++;
entry["startTime"] = event.startTime();
entry["endTime"] = event.endTime();
entry["timeString"] = "";
entry["account"] = event.accountId();
std::stringstream keyStream;
keyStream << event.accountId() << event.folderId();
std::string key = keyStream.str();
entry["color24"] = QString::number(accountColor[key], 16);
qDebug() << "FMI ######### key:" << QString::fromStdString(key) << "=" << accountColor[key];
qDebug() << "FMI ######### id:" << event.id() << " subject" << event.subject() << " startTime:" << event.startTime().toString(Qt::DefaultLocaleShortDate);
entries.append(entry);
}
示例4: loadEvent
//! [2]
void EventEditor::loadEvent(const EventKey &eventKey)
{
m_eventKey = eventKey;
// Load the event from the persistent storage
const CalendarEvent event = m_calendarService->event(m_eventKey.accountId(), m_eventKey.eventId());
// Update the properties with the data from the event
m_subject = event.subject();
m_location = event.location();
m_startTime = event.startTime();
m_endTime = event.endTime();
m_folderId = event.folderId();
m_accountId = event.accountId();
// Emit the change notifications
emit subjectChanged();
emit locationChanged();
emit startTimeChanged();
emit endTimeChanged();
emit folderIdChanged();
emit accountIdChanged();
}