Hello,
Have a look at C++ syntax for function pointers (especially pointers-to-member-functions).
For the new version of QObject::connect() with 4 arguments, the arguments are:
Pointer to the object that emits the signal
Pointer to the member-function that acts as the signal
Pointer to the object that receives the signal
Pointer to the member-function that acts as the slot
Your example uses a version with 3 arguments, which are:
Pointer to the object that emits the signal
Pointer to the member-function that acts as the signal
Pointer to the non-member-function to be invoked
[quote author="nostrora" date="1356603974"]in the doc here is the syntax
@connect (sender, & Sender :: valueChanged,
receiver, Receiver & updateValue ::);@
[/quote]Be careful -- You have an extra "::" at the end
[quote author="nostrora" date="1356603974"]
@QObject :: connect (m_actionQuitter, and QAction :: triggered, creerMenu ());@
[/quote]Don't write "and". In C++, "&" has special meanings.
If creerMenu() doesn't belong to a class, there are two correct ways to write it:
@
QObject::connect(m_actionQuitter, &QAction::triggered, creerMenu);
QObject::connect(m_actionQuitter, &QAction::triggered, &creerMenu);
@
But, if creerMenu() belongs to a class, use Jake007's version.