Hi everybody !
I have a database which contains all Menu Items ,and I set up a connection to load all these items to Menu The code is :
.....
for(int x = 0; x < myResults->record().count(); x++)
{
QString fieldName
=myResults
->value
(x
).
toString();
mAction
= new QAction(QIcon(myIconPath
+"/mCollectPatrol.png"), tr
(fieldName
),
this);
...
if(x==3)
[B]connect(mAction, SIGNAL(triggered()), this, SLOT(fieldName));[/B]
....
.....
for(int x = 0; x < myResults->record().count(); x++)
{
QString fieldName=myResults->value(x).toString();
mAction= new QAction(QIcon(myIconPath+"/mCollectPatrol.png"), tr(fieldName), this);
...
if(x==3)
[B]connect(mAction, SIGNAL(triggered()), this, SLOT(fieldName));[/B]
....
To copy to clipboard, switch view to plain text mode
It's successfully loaded item into my menu ,but the Slot doesnot work ! I also looked for QMETAOBJECT but i don't understand it .I'm using QT 4.3.1 .Can anyone help me to find the solution of this problem ?
Thank for help!
Le Son
------------
Software Developer -Hanoi University of Science
Bookmarks