bmpix
5th December 2011, 19:12
Hi,
A really newbie question.
QPushButton* buttonRun = new QPushButton(QString("Run"));
QGridLayout* layout_ = new QGridLayout;
layout_->addWidget(buttonRun,1,0);
widget->setLayout(layout_);
connect(buttonRun,SIGNAL(clicked()),this,SLOT(runA lgorithm()));
connect() returns true, but the slot is never called. I'm pretty sure the signal is emitted, because
connect(buttonRun,SIGNAL(clicked()),qApp,SLOT(abou tQt()));
works. I also think that the slot is defined properly, because if I do something like:
QObject::connect(this,SIGNAL(runThisBastard()),thi s,SLOT(runAlgorithm()));
emit runThisBastard();
the slot is called properly.
Just in case here's my definition of the class:
class A: public QObject, public IHasPropertiesPage
{
Q_OBJECT
public:
....
public slots:
void runAlgorithm ();
...
};
Any help would be greatly appreciated.
A really newbie question.
QPushButton* buttonRun = new QPushButton(QString("Run"));
QGridLayout* layout_ = new QGridLayout;
layout_->addWidget(buttonRun,1,0);
widget->setLayout(layout_);
connect(buttonRun,SIGNAL(clicked()),this,SLOT(runA lgorithm()));
connect() returns true, but the slot is never called. I'm pretty sure the signal is emitted, because
connect(buttonRun,SIGNAL(clicked()),qApp,SLOT(abou tQt()));
works. I also think that the slot is defined properly, because if I do something like:
QObject::connect(this,SIGNAL(runThisBastard()),thi s,SLOT(runAlgorithm()));
emit runThisBastard();
the slot is called properly.
Just in case here's my definition of the class:
class A: public QObject, public IHasPropertiesPage
{
Q_OBJECT
public:
....
public slots:
void runAlgorithm ();
...
};
Any help would be greatly appreciated.