hi
i am currently doing a dialog in which i created 2 check-box, Ok and Cancel button. On press of Ok button 3 signals are emitted communicating state of choices on dialog as shoown below(class is named CockGui). Through this signal i want to choose whether to put my pic on canvas on not. My problem is slot to which signal is connected is not getting executed while there is no reporting of error.


/*in cockgui.cpp*/
void CockGui:bnOK_clicked()
{
hide();
emit enableCock(cBoxAllow->isChecked());
emit enableCockAgain(cBoxAgain->isChecked());
emit needToRefresh();
done(1);
}


These are connected to slots of different class Cock which uses CockGui.



void Cock::run()
{
CockGui *myPluginGui=new CockGui(mQGisApp, QgisGui::ModalDialogFlags);
//listen for when the layer has been made so we can draw it
myPluginGui->setBox(mEnable);
connect(myPluginGui, SIGNAL(drawRasterLayer(QString)), this, SLOT(drawRasterLayer(QString)));
connect(myPluginGui, SIGNAL(drawVectorLayer(QString,QString,QString)), this, SLOT(drawVectorLayer(QString,QString,QString)));
connect(myPluginGui,SIGNAL(enableCock(bool)),this, SLOT(setEnabled(bool)));
connect(myPluginGui, SIGNAL(needToRefresh()), this, SLOT(refreshCanvas()));
connect(myPluginGui,SIGNAL(enableCockAgain(bool)), this,SLOT(setEnabled(bool)));
// refreshCanvas();
myPluginGui->show();
}


void Cock::setEnabled(bool theBool)
{
mEnable=theBool;
QgsProject::instance()->writeEntry("Cock","/Enabled", mEnable );
if(mEnable)
cout<<"\nEnable is enabled";
else
cout<<"\n not enabled";
}


Here none of the cout statement are being displayed on terminal. I traced down to it. Slot setEnabled is not being called so whatever was inital state of mEnable remains.
Code which will render output on canvas is...

void Cock::renderCock(QPainter *theQPainter)
{
if (mEnable)
{
QPixmap myQPixmap; //to store the north arrow image in
QString myFileNameQString= "/home1/qgis/images/cock/cock.png";
if (myQPixmap.load(myFileNameQString))
{

double centerXDouble = myQPixmap.width()/2;
double centerYDouble = myQPixmap.height()/2;
theQPainter->save();

int myHeight = theQPainter->device()->height();
int myWidth = theQPainter->device()->width();

#ifdef QGISDEBUG
std::cout << "Rendering n-arrow at " << mPlacementLabels.at(mPlacementIndex).toLocal8Bit() .data() << std::endl;

theQPainter->setRenderHint(QPainter::SmoothPixmapTransform);
theQPainter->drawPixmap(25,25,myQPixmap);
//unrotate the canvas again
theQPainter->restore();
cout<<"\n rendered";
}
else
{
QFont myQFont("time", 32, QFont::Bold);
theQPainter->setFont(myQFont);
theQPainter->setPen(Qt::black);
theQPainter->drawText(10, 30, QString(tr("Pixmap1 Not Found")));
}
}

else
cout<<"\nCock Not enabled";

}

Everytime i refresh i gets "Cock Not enabled"

i couldn't where problem lies. Please help me in it