0

Next answers not responding my question: C++ How to pass member function pointer to another class? (2 answers) How can I pass a member function where a free function is expected? (9 answers) Calling C++ class methods via a function pointer (10 answers)

I have two classes:

typedef void (*pPrintContent)(QPainter& painter, bool friendly);

class KonsolePrintManager : QWidget
{
    Q_OBJECT
public:
    explicit KonsolePrintManager(QWidget *parent = nullptr) : QWidget(parent){}
    void printRequest(pPrintContent pContent, QWidget *parent);

And:

class TerminalDisplay : public QWidget
{
    Q_OBJECT
public:
    void printContent(QPainter &painter, bool friendly);
    void printScreen();

In printScreen () I intend to do something like:

void TerminalDisplay::printScreen()
{
    KonsolePrintManager pManager(this);
    pManager.printRequest(printContent, this); #Here the error occurs
}

And the error occurs when passing the printContent () function as a parameter of printRequest.

How could I resolve this issue?

0 Answers0