本文整理汇总了C++中Bond::deleteLater方法的典型用法代码示例。如果您正苦于以下问题:C++ Bond::deleteLater方法的具体用法?C++ Bond::deleteLater怎么用?C++ Bond::deleteLater使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Bond
的用法示例。
在下文中一共展示了Bond::deleteLater方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: removeBond
void Molecule::removeBond(unsigned long id)
{
if (id < m_bonds.size()) {
Q_D(Molecule);
if (m_bonds[id] == 0)
return;
d->invalidRings = true;
m_invalidPartialCharges = true;
m_invalidAromaticity = true;
Bond *bond = m_bonds[id];
m_bonds[id] = 0;
// Delete the bond from the list and reorder the remaining bonds
int index = bond->index();
m_bondList.removeAt(index);
for (int i = index; i < m_bondList.size(); ++i) {
m_bondList[i]->setIndex(i);
}
// Also delete the bond from the attached atoms
if (m_atoms.size() > bond->beginAtomId()) {
if (m_atoms[bond->beginAtomId()])
m_atoms[bond->beginAtomId()]->removeBond(id);
}
if (m_atoms.size() > bond->endAtomId()) {
if (m_atoms[bond->endAtomId()])
m_atoms[bond->endAtomId()]->removeBond(id);
}
disconnect(bond, SIGNAL(updated()), this, SLOT(updateBond()));
emit bondRemoved(bond);
bond->deleteLater();
}
}