0

I have an interface MyInterface:

class MyInterface
{

public:
    virtual ~MyInterface() {}

    virtual QMap<QString, QString> *inputsMap() const = 0;
};

I have a class MyImplementingClass that implements MyInterface. However, I'm unable to get the text from QLineEdit *fullNames:

QLineEdit *fullNames = new QLineEdit();

QMap<QString, QString> *MyImplementingClass::inputsMap() const
{
    QMap<QString, QString> *map = new QMap<QString, QString>();
    map -> insert("fullNames", this -> fullNames -> text());
    map -> insert("coolText", "This works OK");
    return map;
}

In ImplementorsCollector is where I gather all the plugins that implement MyInterface:

void ImplementorsCollector :: initImplementors(QObject *plugin)
{
    MyInterface *iMyInterface = qobject_cast<MyInterface *>(plugin);
    if (iMyInterface)
        myObject = iMyInterface -> inputsMap();
}

However, still in ImplementorsCollector:

/* This prints nothing. Nothing gets passed from **QLineEdit *fullNames** */

if (myObject -> contains("fullNames"))
qDebug() << "fullNames : " << myObject -> value("fullNames");

/* This prints OK */

if (myObject -> contains("coolText"))
qDebug() << "coolText : " << myObject -> value("coolText");

How can I go about getting the text input from **QLineEdit *fullNames** from a different plugin?

Thank you all in advance.

Program-Me-Rev
  • 6,184
  • 18
  • 58
  • 142

0 Answers0