paceholder / nodeeditor

Qt Node Editor. Dataflow programming framework

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Port nickmanes?

oddcitizenape opened this issue · comments

Hello and thanks for the great tool. I'm very positively surprised that work on it is now being continued (v.3 with dynamic ports, a decent documentation and above all "headless mode" - I'm really excited about that).
I was confronted with the following requirement in my project: I would like to be able to assign additional nicknames to the individual ports (see image), since they sometimes have the same data types but serve different purposes. Do you have an idea how I could implement this and what do you think about including this as a feature for the future in the project.
nicknames

You can refer to the SubtractionModel.hpp in the example calculator

virtual QString portCaption(PortType portType, PortIndex portIndex) const override
{
    switch (portType)
    {
    case PortType::In :
        if (portIndex == 0)
            return QStringLiteral("Minuend");
        else if (portIndex == 1)
            return QStringLiteral("Subtrahend");

        break;

    case PortType::Out :
        return QStringLiteral("Result");

    default :
        break;
    }
    return QString();
}

Hope this helps you

@QianMoth oh, that wat an easy one! Thank you :)