本文整理汇总了C++中Marker::getName方法的典型用法代码示例。如果您正苦于以下问题:C++ Marker::getName方法的具体用法?C++ Marker::getName怎么用?C++ Marker::getName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Marker
的用法示例。
在下文中一共展示了Marker::getName方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: sl_onTypeChanged
void EditMarkerGroupDialog::sl_onTypeChanged(int newTypeIndex) {
if (newTypeIndex == currentTypeIndex) {
return;
}
MarkerDataType oldType = MarkerTypes::getDataTypeById(marker->getType());
MarkerDataType newType = MarkerTypes::getDataTypeById(typeIds.at(newTypeIndex));
bool changeMarker = false;
if (1 == marker->getValues().size()) { // contains only "rest"
changeMarker = true;
} else {
if (oldType == newType) {
changeMarker = true;
} else {
changeMarker = (QMessageBox::Ok == QMessageBox::question(this, tr("Warning"), tr("Are you really want to change marker's type? Some data can be lost!"), QMessageBox::Ok | QMessageBox::Cancel));
}
}
if (changeMarker) {
Marker *oldMarker = marker;
marker = MarkerFactory::createInstanse(typeIds.at(newTypeIndex), addParamEdit->text());
{
marker->setName(oldMarker->getName());
MarkerDataType oldType = MarkerTypes::getDataTypeById(oldMarker->getType());
MarkerDataType newType = MarkerTypes::getDataTypeById(marker->getType());
if (oldType == newType) {
foreach (const QString &key, oldMarker->getValues().keys()) {
marker->addValue(key, oldMarker->getValues().value(key));
}
} else {
marker->addValue(MarkerUtils::REST_OPERATION, oldMarker->getValues().value(MarkerUtils::REST_OPERATION));
}
}
示例2: removeRows
bool MarkerGroupListCfgModel::removeRows(int row, int count, const QModelIndex &) {
if (1 != count) {
return true;
}
Marker *toRemove = markers.at(row);
QString markerName = toRemove->getName();
beginRemoveRows(QModelIndex(), row, row+count-1);
markers.removeAt(row);
endRemoveRows();
emit si_markerRemoved(markerName);
return true;
}
示例3: sl_onMarkerAdded
void MarkerEditor::sl_onMarkerAdded(const QString &markerName) {
Marker *marker = markerModel->getMarker(markerName);
SAFE_POINT(NULL != marker, "NULL marker", );
{ // TODO: make common way to get marked object output port
assert(1 == cfg->getOutputPorts().size());
Port *outPort = cfg->getOutputPorts().at(0);
assert(outPort->getOutputType()->isMap());
QMap<Descriptor, DataTypePtr> outTypeMap = outPort->getOutputType()->getDatatypesMap();
Descriptor newSlot = MarkerSlots::getSlotByMarkerType(marker->getType(), marker->getName());
outTypeMap[newSlot] = BaseTypes::STRING_TYPE();
DataTypePtr newType(new MapDataType(dynamic_cast<Descriptor&>(*(outPort->getType())), outTypeMap));
outPort->setNewType(newType);
}
}
示例4: data
QVariant MarkerGroupListCfgModel::data(const QModelIndex &index, int role) const {
if (Qt::DisplayRole == role || Qt::ToolTipRole == role) {
Marker *m = *(markers.begin()+index.row());
if (NULL == m) {
return QVariant();
}
if (0 == index.column()) {
return m->getName();
} else if (1 == index.column()) {
return m->toString();
}
} else {
return QVariant();
}
return QVariant();
}