[Qt-interest] problem with signal/slot

prashant bhutani prashant.bhutani.cse08 at itbhu.ac.in
Tue Dec 21 13:47:13 CET 2010


On Tue, Dec 21, 2010 at 5:27 PM, Robert Escott <robert at binarylogic.co.za>wrote:

> This is normally happens because MOC is not being run to generate the
> 'moc_myheader.cpp' file, or being rerun, or the MOC output is not being
> linked into your final executable. It's not a problem with your coding.
> Check your compilation settings.
>
> -----Original Message-----
> From: qt-interest-bounces+robert=binarylogic.co.za at qt.nokia.com
> [mailto:qt-interest-bounces+robert <qt-interest-bounces%2Brobert>=
> binarylogic.co.za at qt.nokia.com] On Behalf
> Of AK
> Sent: 21 December 2010 11:04
> To: Mahendra G.R
> Cc: qt-interest at trolltech.com
> Subject: Re: [Qt-interest] problem with signal/slot
>
> Perhaps you forgot to call the Base class constructor.
> Rest of the code looks perfect to me.
>
> On Wed, Dec 8, 2010 at 10:05 PM, Mahendra G.R <mahendra at mahendragr.com>
> wrote:
> > Hi guys,
> >
> > i have a small problem with signal/slot, though i have defined my slot
> > method, i get runtime message saying   Object::connect: No such slot
> > CustomScene::updateAlphaValue()  , i have defined the method
> > updateAlphaValue() in the customScene class
> >
> > this is my code :
> >
> > class CustomScene : public QGraphicsScene
> > {
> >
> >     Q_OBJECT
> >     public:
> >         CustomScene()
> >         {
> >               alphaSlider = new QSlider(Qt::Horizontal);
> >             alphaSlider->setTickInterval(1);
> >             alphaSlider->setRange(0,255);
> >             alphaSlider->setMinimumSize(105,20);
> >             alphaSlider->move(6,222);
> >             alphaSlider->setToolTip("Opacity");
> >             connect( alphaSlider, SIGNAL(valueChanged(int)),
> > SLOT(updateAlphaValue()) );
>
Sorry but shouldn't this connect method refer to second object?
like connect(&obj1, signal, &obj2, slot)

> >          //some other stuff
> >      }
> >
> > public slots :
> >             void updateAlphaValue();
> >
> > };
> > --
> > http://www.mahendragr.com
> >
> > _______________________________________________
> > Qt-interest mailing list
> > Qt-interest at trolltech.com
> > http://lists.trolltech.com/mailman/listinfo/qt-interest
> >
> >
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at qt.nokia.com
> http://lists.qt.nokia.com/mailman/listinfo/qt-interest
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at qt.nokia.com
> http://lists.qt.nokia.com/mailman/listinfo/qt-interest
>

Prashant Bhutani
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20101221/f22c9d6a/attachment.html 


More information about the Qt-interest-old mailing list