You cannot pass argument values to Signal/Slot connects, the arguments are always provided by the signal and passed to the slot.
In your case, where you have a signal without argument and want the slot to be called with a single string argument, the best way forward is to use QSignalMapper.
Create a QSignalMapper instance and use it as the receiver for addAction(), using SLOT(map()).
Then add a mapping from your action to the desired string and connection the signal mapper's mapped(QString) signal to your slot
Something like this
connect( mapper,
SIGNAL(mapped
(QString)),
this,
SLOT(addGraph
(QString)) );
QAction *action
= menu
->addAction
( "Curve 1", mapper,
SLOT(map
()) );
mapper->setMapping( action, "Curve 1" );
QSignalMapper *mapper = new QSignalMapper( this );
connect( mapper, SIGNAL(mapped(QString)), this, SLOT(addGraph(QString)) );
QAction *action = menu->addAction( "Curve 1", mapper, SLOT(map()) );
mapper->setMapping( action, "Curve 1" );
To copy to clipboard, switch view to plain text mode
Cheers,
_
Bookmarks