0
votes

I am trying to connect two slots with on signal. here is my header file where I have defined my signals

class loginChecker : public QObject
{
Q_OBJECT

public:
static loginChecker *instance(void);
signals:
void loginid();
void loginemail();

 private:
loginChecker(void) {}
~loginChecker(void) {}

 private:
static loginChecker *s_instance;

};

it is sigalton class. here is my slot which is another signalton class named as loginProcess the slot name in this class in getUserData(QString& userData)

in The loginChecker.cpp I am trying to connect these declared signals with getUserData(QString userData) slot

    loginProcess *lp;
   lp = loginProcess::instance();

here I am accessing instance of loginProcess signalton class which has slot

These are two ways I am trying to connect these signal and slot but none are working

     QObject::connect(s_instance, SIGNAL(loginid()), es, SLOT(getUserData(userid))); 

this is throwing no such slot error at runtime

    `QObject::connect(s_instance, &esCoreAuthenticator::loginid, es, &loginProcess::getUserData(uid));` 

this is thworing this error cannot call member function 'void loginProcess::getUserData(const QString&)' without object at compile time

1

1 Answers

0
votes

Since your signal has no arguments you can't connect it to slot which has some.

And also it seems to me that in first case you should try SLOT(getUserData(QString&)) and in second case just &loginProcess::getUserData without any parenthesis.