C++ (Qt)void moveValue(Storage & storage, double from_time, double value, double to_time ){ storage.erase(from_time); storage.emplace(to_time, value);}
C++ (Qt) UserAction move_value{ bind(&moveValue, ref(storage), 5, 7, 9) , bind(&moveValue, ref(storage), 9, 7, 5) }; actions.push_back(move_value);
C++ (Qt)typedef QMap<double, CData> TMap;typedef TMap::iterator TIter;typedef QVector<TIter> TMapSelection; void MoveSelection( TMap & map, TMapSelection & selection, double dx, double dy ){ for (int i = 0; i < selection.size(); ++i) { TIter & it = selection[i]; CData temp = it.value() + dy; double time = it.key() + dx; map.erase(itime); it = map.insert(time, temp); }}