Well, the connect call doesn't translate to much, but if we add a signal emit also, you'll get something like this:
CLASS B;
CLASS A
{
public:
B *bptr;
void somefunc();
};
CLASS B
{
public:
};
void A::somefunc()
{
bptr->slotReturnUserInput("sometext","sometext");
}
{
some code
}
CLASS B;
CLASS A
{
public:
B *bptr;
void somefunc();
};
CLASS B
{
public:
slotReturnUserInput(QString qs1, QString qs2);
};
void A::somefunc()
{
bptr->slotReturnUserInput("sometext","sometext");
}
void B::slotReturnUserInput(QString qs1, QString qs2)
{
some code
}
To copy to clipboard, switch view to plain text mode
Personally however, if your going along that route, I'd use "getUserInput" in class A and get class B to call it, rather than having class A call back class B, which is just nasty and not self-contained.
Bookmarks