[Qt-interest] signal mapping on pushbutton signal clicked

chandrasekar wagmare sekarwagmare at gmail.com
Tue Mar 17 07:56:31 CET 2009


hi friends,
i try to set the QPushButton() signal *clicked()* to connect
a slot *changeIndex(int)*

so i try signal Mapper so i do
mapping .h

#include <QSignalMapper>

signals:
        void clicked(int value);

public Q_SLOTS:
      void changeIndex(int index);

private:
        QSignalMapper
<http://doc.trolltech.com/latest/QSignalMapper.html> *signalMapper;

in mapping.cpp

/* signal Mapper*/
        mapValue[i] = 2;
        connect(cicsButton, SIGNAL(clicked()), signalMapper, SLOT(map()));
        signalMapper->setMapping(cicsButton, mapValue[1]);

        connect(signalMapper, SIGNAL(mapped(int)), this, SIGNAL(clicked(int)));
        connect(this, SIGNAL(clicked(int)), this, SLOT(changeIndex(int)));
        int mapValue[10];

it compiled perfectly but when i run core dumped
when i try execute it gives *Segmentation fault ....*

i dont know where i d

connect(cicsButton, SIGNAL(clicked()), signalMapper, SLOT(map()));

please help ...


please help .... why in run time it give seg. fault ....

..


-- 
CHANDRU
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090317/ad33ea8f/attachment.html 


More information about the Qt-interest-old mailing list