Ejemplo n.º 1
0
bool SES_AddNetLabel::updateLabel(Schematic& schematic, const Point& pos) noexcept
{
    Q_ASSERT(mUndoCmdActive == true);

    try
    {
        // get netline under cursor
        QList<SI_NetLine*> lines = schematic.getNetLinesAtScenePos(pos);
        if (!lines.isEmpty()) mEditCmd->setNetSignal(lines.first()->getNetSignal(), true);
        mEditCmd->setPosition(pos, true);
        return true;
    }
    catch (Exception& e)
    {
        QMessageBox::critical(&mEditor, tr("Error"), e.getUserMsg());
        return false;
    }
}