本文整理汇总了C++中TimeStamp::getID方法的典型用法代码示例。如果您正苦于以下问题:C++ TimeStamp::getID方法的具体用法?C++ TimeStamp::getID怎么用?C++ TimeStamp::getID使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TimeStamp
的用法示例。
在下文中一共展示了TimeStamp::getID方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: on_pushButton_manualTrigger_clicked
void MainWindow::on_pushButton_manualTrigger_clicked()
{
TimeStamp* ts = new TimeStamp(0, getTimeBaseTime(), TimeStamp::M);
competition()->addTimeStamp(ts);
assignmentManager.tryToAssignTimeStampToRun(ts->getID());
}
示例2: on_buttonBox_accepted
void DialogEditTime::on_buttonBox_accepted()
{
// workaround for missing leading zero bug: prepend a "0", if it is missing
QString tStr = ui->lineEdit->text();
QStringList helper = tStr.split(":");
if(helper.first().length() == 1){
tStr.prepend("0");
}
// end of workaround
QTime t = QTime::fromString(tStr);
qDebug() << "zeit: " << t.toString();
TimeStamp* ts =0;
if(myRun){// ignore runns with Nullpointer
if(myTimeType == TT_START){
if(myRun->getStartTimeID() == 0){ // if no TS exists, create a new one
ts = new TimeStamp(0, t, TimeStamp::E);
MainWindow::competition()->addTimeStamp(ts);
ts->setRunID(myRun->getID());
myRun->setStartTimeID(ts->getID());
}else{
ts = MainWindow::competition()->getTimeStamp(myRun->getStartTimeID());
}
}else{ // goal
if(myRun->getGoalTimeID() == 0){ // if no TS exists, create a new one
ts = new TimeStamp(0, t, TimeStamp::E);
MainWindow::competition()->addTimeStamp(ts);
ts->setRunID(myRun->getID());
myRun->setGoalTimeID(ts->getID());
}else{
ts = MainWindow::competition()->getTimeStamp(myRun->getGoalTimeID());
}
}
// if new time != old time
// compare strings, because of sub-0.01s differences, which should be ignored
if(MainWindow::convertTimeToString(ts->getTime()) != MainWindow::convertTimeToString(t)){
ts->setTime(t);
ts->setSource(TimeStamp::E);
emit timeEdited(myRun);
}
}
hide();
}