当前位置: 首页>>代码示例>>C++>>正文


C++ setDate函数代码示例

本文整理汇总了C++中setDate函数的典型用法代码示例。如果您正苦于以下问题:C++ setDate函数的具体用法?C++ setDate怎么用?C++ setDate使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了setDate函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: parseCommandLine

seqan::ArgumentParser::ParseResult
parseCommandLine(MasonMaterializerOptions & options, int argc, char const ** argv)
{
    // Setup ArgumentParser.
    seqan::ArgumentParser parser("mason_materializer");
    // Set short description, version, and date.
    setShortDescription(parser, "VCF Materialization");
    setVersion(parser, "2.0");
    setDate(parser, "July 2012");
    setCategory(parser, "Simulators");

    // Define usage line and long description.
    addUsageLine(parser,
                 "[OPTIONS] \\fB-ir\\fP \\fIIN.fa\\fP \\fB-iv\\fP \\fIIN.vcf\\fP \\fB-o\\fP \\fIOUT.fa\\fP ");
    addDescription(parser,
                   "Apply variants from \\fIIN.vcf\\fP to \\fIIN.fa\\fP and write the results to \\fIout.fa\\fP.");

    // Add option and text sections.
    options.addOptions(parser);
    options.addTextSections(parser);

    // Parse command line.
    seqan::ArgumentParser::ParseResult res = seqan::parse(parser, argc, argv);

    // Only extract  options if the program will continue after parseCommandLine()
    if (res != seqan::ArgumentParser::PARSE_OK)
        return res;

    options.getOptionValues(parser);

    return seqan::ArgumentParser::PARSE_OK;
}
开发者ID:CVroland,项目名称:seqan,代码行数:32,代码来源:mason_materializer.cpp

示例2: QWidget

DateWidget::DateWidget(QWidget *parent) : QWidget(parent),
	calendarWidget(new QCalendarWidget())
{
	setDate(QDate::currentDate());
	setMinimumSize(QSize(80, 64));
	setFocusPolicy(Qt::StrongFocus);
	calendarWidget->setWindowFlags(Qt::FramelessWindowHint);
	calendarWidget->setFirstDayOfWeek(getLocale().firstDayOfWeek());
	calendarWidget->setVerticalHeaderFormat(QCalendarWidget::NoVerticalHeader);

	connect(calendarWidget, SIGNAL(activated(QDate)), calendarWidget, SLOT(hide()));
	connect(calendarWidget, SIGNAL(clicked(QDate)), calendarWidget, SLOT(hide()));
	connect(calendarWidget, SIGNAL(activated(QDate)), this, SLOT(setDate(QDate)));
	connect(calendarWidget, SIGNAL(clicked(QDate)), this, SLOT(setDate(QDate)));
	calendarWidget->installEventFilter(this);
}
开发者ID:hardik91,项目名称:subsurface,代码行数:16,代码来源:simplewidgets.cpp

示例3: _pStoreFactory

MailMessage::MailMessage(PartStoreFactory* pStoreFactory): 
	_pStoreFactory(pStoreFactory)
{
	Poco::Timestamp now;
	setDate(now);
	setContentType("text/plain");
}
开发者ID:1514louluo,项目名称:poco,代码行数:7,代码来源:MailMessage.cpp

示例4: main

int main(void) {
	xplained_init();
	fprintf(COMM_LCD, G_NAME);
	setDate(2013, 1, 15, 11, 32, 50);
// 250 ms Timer siehe app3b.c ~ 0,09% Fehler

// Top Wert
	TCC0.PER = 32031;
// Prescaler
	TCC0.CTRLA = TC_CLKSEL_DIV256_gc;

	mcu_enable_interrupt();

	while (1) {
		if (update) {
			clearRow(LCD_ROW1);
			fprintf(COMM_LCD, "%.2i:%.2i:%.2i", hour, min, s);

			//Ganz komischer Fehler mit clearRow(LCD_ROW2), irgendwie wird LCD_ROW0 zum teil überschrieben, deshalb so:
			st7036_goto(LCD_ROW2, 0);
			fprintf(COMM_LCD, "             ");
			st7036_goto(LCD_ROW2, 0);
			fprintf(COMM_LCD, "%i.%i.%i", day, month, year);
			update = false;
		}
	}
	return 0;
}
开发者ID:Tandrial,项目名称:AI-SE-Bsc,代码行数:28,代码来源:app3c.c

示例5: foreach

    foreach (const QString &headerRow, headerLines) {
        QRegExp messageIdRx("^Message-ID: (.*)$", Qt::CaseInsensitive);
        QRegExp fromRx("^From: (.*)$", Qt::CaseInsensitive);
        QRegExp toRx("^To: (.*)$", Qt::CaseInsensitive);
        QRegExp ccRx("^Cc: (.*)$", Qt::CaseInsensitive);
        QRegExp subjectRx("^Subject: (.*)$", Qt::CaseInsensitive);
        QRegExp dateRx("^Date: (.*)$", Qt::CaseInsensitive);
        QRegExp mimeVerstionRx("^MIME-Version: (.*)$", Qt::CaseInsensitive);
        QRegExp contentTransferEncodingRx("^Content-Transfer-Encoding: (.*)$", Qt::CaseInsensitive);
        QRegExp contentTypeRx("^Content-Type: (.*)$", Qt::CaseInsensitive);

        if (messageIdRx.indexIn(headerRow) != -1)
            setMessageId(messageIdRx.cap(1));
        else if (fromRx.indexIn(headerRow) != -1)
            setFrom(headerDecode(fromRx.cap(1)));
        else if (toRx.indexIn(headerRow) != -1)
            setTo(headerDecode(toRx.cap(1)));
        else if (ccRx.indexIn(headerRow) != -1)
            setCc(headerDecode(ccRx.cap(1)));
        else if (subjectRx.indexIn(headerRow) != -1)
            setSubject(headerDecode(subjectRx.cap(1)));
        else if (dateRx.indexIn(headerRow) != -1) {
            QDateTime date = QDateTime::fromString(dateRx.cap(1), Qt::RFC2822Date);
            setDate(date);
        } else if (mimeVerstionRx.indexIn(headerRow) != -1)
            setMimeVersion(mimeVerstionRx.cap(1));
        else if (contentTransferEncodingRx.indexIn(headerRow) != -1)
            setContentTransferEncoding(IqPostmanAbstractContent::contentTransferEncodingFromString(headerRow));
        else if (contentTypeRx.indexIn(headerRow) != -1)
            setContentType(IqPostmanAbstractContentType::createFromString(headerRow));
    }
开发者ID:ItQuasarOrg,项目名称:IqPostman,代码行数:31,代码来源:iqpostmanmailheader.cpp

示例6: switch

void CalendarDatePrivate::onClicked(CalendarItem* item) {
    if (NULL == item) {
        return;
    }
    ItemType itemOpt = item->getType();
    int itemData = item->getValue();

    int newYear = m_selectedYear;
    int newMonth = m_selectedMonth;
    int newDayOfMonth = m_selectedDayOfMonth;

    switch (m_viewType) {
    case VIEWTYPE_DAY:
        break;
    case VIEWTYPE_MONTH:
        g_return_if_fail(ITEMTYPE_MONTH == itemOpt);
        newMonth = itemData;
        updateDayView(FALSE, 0);
        break;
    case VIEWTYPE_YEAR:
        g_return_if_fail(ITEMTYPE_YEAR == itemOpt);
        newYear = itemData;
        updateMonthView(FALSE, 0);
        break;
    default:
        break;
    }

    GDateTime * newDate = g_date_time_new_local(newYear, newMonth, newDayOfMonth, 0, 0, 0);
    setDate(newDate, FALSE, 0);
    g_date_time_unref(newDate);
}
开发者ID:jimline,项目名称:TestProjects,代码行数:32,代码来源:CalendarDate.cpp

示例7: KPopupFrame

void
kMyMoneyCalendar::selectWeekClicked()
{
  const KCalendarSystem* calendar = KGlobal::locale()->calendar();

  KPopupFrame *popup = new KPopupFrame(this);
  KDatePickerPrivateWeekSelector *picker = new KDatePickerPrivateWeekSelector(calendar, date(), popup);
  picker->resize(picker->sizeHint());
  picker->setWeek(weekOfYear(date()));
  picker->selectAll();
  popup->setMainWidget(picker);
  connect(picker, SIGNAL(closeMe(int)), popup, SLOT(close(int)));
  picker->setFocus();

  if (popup->exec(d->selectWeek->mapToGlobal(QPoint(0, d->selectWeek->height())))) {
    QDate newDate;
    int week = picker->week();
    // check if new week will lead to a valid date
    calendar->setDate(newDate, calendar->year(date()), 1, 1);
    while (weekOfYear(newDate) > 50)
      newDate = newDate.addDays(1);
    while (weekOfYear(newDate) < week && (week != 53 || (week == 53 &&
                                          (weekOfYear(newDate) != 52 || weekOfYear(newDate.addDays(1)) != 1))))
      newDate = newDate.addDays(1);
    if (week == 53 && weekOfYear(newDate) == 52)
      while (weekOfYear(newDate.addDays(-1)) == 52)
        newDate = newDate.addDays(-1);

    // Set the date, if it's invalid in any way then alert user and don't update
    if (!setDate(newDate)) {
      KNotification::beep();
    }
  }
  delete popup;
}
开发者ID:CGenie,项目名称:kmymoney,代码行数:35,代码来源:kmymoneycalendar.cpp

示例8: set

 void Date::set(UInt month, UInt day, UInt year)
 {
   if (!setDate(year, month, day))
   {
     throw Exception::ParseError(__FILE__, __LINE__, __PRETTY_FUNCTION__, String(year) + "-" + String(month) + "-" + String(day), "Invalid date");
   }
 }
开发者ID:chahuistle,项目名称:OpenMS,代码行数:7,代码来源:Date.cpp

示例9: setDate

void Settings::BirthdayPage::checkDate()
{
    QDate parsedDate = m_locale->readDate(m_dateInput->text());
    if (parsedDate != QDate()) {
        setDate(parsedDate);
    }
}
开发者ID:astifter,项目名称:kphotoalbum-astifter-branch,代码行数:7,代码来源:BirthdayPage.cpp

示例10: setEditorData

void DateEditDelegate::setEditorData(QWidget *editor, const QModelIndex &index) const
{
    auto date = index.model()->data(index, Qt::EditRole).toDate();

    auto dateEdit = static_cast<QDateEdit*>(editor);
    dateEdit->setDate(date);
}
开发者ID:vitalik7888,项目名称:milk_app,代码行数:7,代码来源:DateEditDelegate.cpp

示例11: setRTCFromText

void setRTCFromText(char *time) {
	// This function parses the date and or time using any of the following format:
	//  1. #h#m#s
	//  2. #m#d
	//  3. #m#d#h#m#s
	//  where '#' represents any valid positive integer.  
	//  Note that 'm' is used for month and for minute. 'm' will mean month, unless it follows an 'h'.
	//  Note that year is not set because it is used to indicate the time period (see cold_start code)
	
	int month = -1, date = -1, hour = -1, min = -1, sec = -1;
	char *ptr;
	
	if ((ptr = findTimePart(time,'m'))) {
		month = strToInt(ptr);
		if ((ptr = findTimePart(time,'d')))
			date = strToInt(ptr);
		else 
			month = -1;
	}
	if ((ptr = findTimePart(time,'h'))) {
		hour = strToInt(ptr);
		if ((ptr = findTimePart(ptr,'m')))
			min = strToInt(ptr);
		if ((ptr = findTimePart(ptr,'s')))
			sec = strToInt(ptr);
	}
	if (month >= 1 && date >= 1)
		setDate(month,date);
	if (hour >= 0 && min >= 0 && sec >= 0)
		setRTC(hour,min,sec);
}
开发者ID:billev,项目名称:literacybridge,代码行数:31,代码来源:device.c

示例12: DatePickDialog

void AgendaPlug::selectDay()
{
    DatePickDialog *dpd = new DatePickDialog(DatePickDialog::Day, this->date, this);
    if (dpd->exec() == QDialog::Accepted)
        setDate(dpd->date());
    delete dpd;
}
开发者ID:Rusto,项目名称:qalendar,代码行数:7,代码来源:AgendaPlug.cpp

示例13: handleTick

static void handleTick(struct tm *tick_time, TimeUnits units_changed) {
	calcAngles(tick_time);
	if (units_changed & DAY_UNIT) {
		setDate(tick_time);
	}
	layer_mark_dirty(layer);
}
开发者ID:linuxq,项目名称:Arc_2.0,代码行数:7,代码来源:Arc_2.0.c

示例14: setSourceInfoUrl

void Tv::setAttribute( QDomAttr &attr) {
  if(attr.localName().compare("SourceInfoUrl", Qt::CaseInsensitive)==0) {
    setSourceInfoUrl(attr.value());
    return;
  }
  if(attr.localName().compare("SourceDataUrl", Qt::CaseInsensitive)==0) {
    setSourceDataUrl(attr.value());
    return;
  }
  if(attr.localName().compare("Date", Qt::CaseInsensitive)==0) {
    setDate(attr.value());
    return;
  }
  if(attr.localName().compare("GeneratorInfoName", Qt::CaseInsensitive)==0) {
    setGeneratorInfoName(attr.value());
    return;
  }
  if(attr.localName().compare("SourceInfoName", Qt::CaseInsensitive)==0) {
    setSourceInfoName(attr.value());
    return;
  }
  if(attr.localName().compare("GeneratorInfoUrl", Qt::CaseInsensitive)==0) {
    setGeneratorInfoUrl(attr.value());
    return;
  }
}
开发者ID:juriad,项目名称:tvp,代码行数:26,代码来源:Tv.cpp

示例15: setService

void PluginTrack::loadTrack(const QString &service, const QVariantMap &track) {
    setService(service);
    setArtist(track.value("artist").toString());
    setArtistId(track.value("artistId").toString());
    setDate(track.value("date").toString());
    setDescription(track.value("description").toString());
    setDownloadable(track.value("downloadable", true).toBool());
    setFormat(track.value("format").toString());
    setGenre(track.value("genre").toString());
    setId(track.value("id").toString());
    setLargeThumbnailUrl(track.value("largeThumbnailUrl").toString());
    setPlayCount(track.value("playCount").toLongLong());
    setStreamUrl(track.value("streamUrl").toString());
    setThumbnailUrl(track.value("thumbnailUrl").toString());
    setTitle(track.value("title").toString());
    setUrl(track.value("url").toString());
        
    if (track.value("duration").type() == QVariant::String) {
        setDurationString(track.value("duration").toString());
    }
    else {
        setDuration(track.value("duration").toLongLong());
    }
    
    if (track.value("size").type() == QVariant::String) {
        setSizeString(track.value("size").toString());
    }
    else {
        setSize(track.value("size").toLongLong());
    }
}
开发者ID:vakkov,项目名称:musikloud2,代码行数:31,代码来源:plugintrack.cpp


注:本文中的setDate函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。