本文整理汇总了C++中Transition::Print方法的典型用法代码示例。如果您正苦于以下问题:C++ Transition::Print方法的具体用法?C++ Transition::Print怎么用?C++ Transition::Print使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Transition
的用法示例。
在下文中一共展示了Transition::Print方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AcceptTrans
void TransWidget::AcceptTrans()
{
if(edited==NULL)
{
emit reportError(QString("Please, select a transition to edit, edit it and then press OK."));
OKButton->setDisabled(true);
sourceNameCombo->clear();
destNameCombo->clear();
return;
}
if(!mod->checkTransitonExists(edited))
{
emit reportError(QString("The Transition You have been editing has been deleted"));
edited=NULL;
OKButton->setDisabled(true);
sourceNameCombo->clear();
destNameCombo->clear();
return;
}
if (edited->startItem()->getName()==sourceNameCombo->currentText() && edited->endItem()->getName()==destNameCombo->currentText())
{
if(mod->checkTransCondAvailabe(edited, conditionLineEdit->text()))
{
edited->setCondition(conditionLineEdit->text());
edited->setSubtask(mod->getState(stateCombo->currentText()));
OKButton->setDisabled(false);
edited->setToolTip(QString().fromStdString(edited->Print()));
}
else //that condition is already used for the source state
{
emit reportError(QString("The condition you specified is already in use for the source state."));
}
}
else if( ( edited->startItem()->getName() == sourceNameCombo->currentText() && mod->checkTransCondAvailabe(edited, conditionLineEdit->text()) )
||mod->checkTransCondAvailabe(mod->getState(sourceNameCombo->currentText()), conditionLineEdit->text()))
{
QString subtaskName = mod->getSubNameOfTrans(edited);
QGraphicsScene * scene = edited->getScene();
/*if(edited->startItem()->getName()!=sourceNameCombo->currentText())
{
mod->changeSourceStateofTrans(edited, sourceNameCombo->currentText());
}else{}
if(edited->endItem()->getName()!=destNameCombo->currentText())
{
mod->changeDestStateofTrans(edited, destNameCombo->currentText());
}else{}
edited->setCondition(conditionLineEdit->text());
edited->setSubtask(mod->getState(stateCombo->currentText()));
OKButton->setDisabled(false);
edited->setToolTip(QString().fromStdString(edited->Print()));*/
Transition * todelete = edited;
mod->deleteTransition(edited);
scene->removeItem(todelete);
delete todelete;//?
Transition * tr = new Transition(mod->getState(sourceNameCombo->currentText(), subtaskName), mod->getState(destNameCombo->currentText(), subtaskName));
tr->setScene(scene);
tr->setCondition(conditionLineEdit->text());
tr->setSubtask(mod->getState(stateCombo->currentText()));
tr->startItem()->addTransition(tr);
if(tr->startItem()!=tr->endItem())tr->endItem()->addTransition(tr);
tr->setZValue(-1000.0);
tr->updatePosition();
tr->setToolTip(QString().fromStdString(tr->Print()));
scene->addItem(tr);
bool test = mod->tryInsertTransition(tr);
this->TransSelected(tr);
}
else
{
emit reportError(QString("The condition you specified is already in use for the source state."));
}
}