I used Qt Designer to set a
actionTest->setCheckable(true);
actionTest->setChecked(true);
QAction *actionTest;
actionTest->setCheckable(true);
actionTest->setChecked(true);
To copy to clipboard, switch view to plain text mode
which is connected to my own action function
QObject::connect(ui.
actionTest,
SIGNAL(activated
()),
this,
SLOT(checkTest
()));
QObject::connect(ui.actionTest, SIGNAL(activated()), this, SLOT(checkTest()));
To copy to clipboard, switch view to plain text mode
and my checkTest() is as follows:
void someClass::checkTest()
{
if(ui.actionTest->isChecked())
ui.actionTest>setChecked ( false );
else
{
........ // That is where I always jump into
}
}
void someClass::checkTest()
{
if(ui.actionTest->isChecked())
ui.actionTest>setChecked ( false );
else
{
........ // That is where I always jump into
}
}
To copy to clipboard, switch view to plain text mode
As we can see, although
actionTest->setChecked(true);
has already been set checked, the connected slot function can't see it at all.
What's wrong? Urgent....
please help.
Cheers
JIA
Bookmarks