Quantcast
Channel: Qt DevNet forums: Qt Quick 1283365070**
Viewing all articles
Browse latest Browse all 4972

Issues with signal and slot- Qt4

$
0
0
I have created a GUI which involves selection of topics from one ComboBox (evaluation_box) leading to load all the topics related to that particular topic into another ComboBox (sequence_combo_box). The code used for SIGNAL/SLOT is as follows:   connect(ui_.evaluation_box, SIGNAL(currentIndexChanged(QString)), ui_.sequence_combo_box, SLOT(readSequenceFile(char *,char *,struct dirent *)));   The header file includes the following: #ifndef rqt_get_sequence_feeder__GetSequenceFeeder_H #define rqt_get_sequence_feeder__GetSequenceFeeder_H   #include <rqt_gui_cpp/plugin.h>   #include <ui_get_sequence_feeder.h> #include <dirent.h> #include <image_transport/image_transport.h>     #include <sensor_msgs/Image.h>     #include <opencv2/core/core.hpp>     #include <QImage> #include <QList> #include <QMutex> #include <QString> #include <QSize> #include <QWidget> #include <vector>       namespace rqt_get_sequence_feeder {       class GetSequenceFeeder       : public rqt_gui_cpp::Plugin      {         Q_OBJECT         public:            GetSequenceFeeder();           protected slots:                       virtual void onFrameChanged(int);           virtual void readSequenceFile(char *folder,char *sequence,struct dirent *select);                                           .                                           .                                           .        protected:              Ui::GetSequenceFeederWidget ui_;        };     } And the .cpp is as follows: using namespace std; namespace rqt_get_sequence_feeder {   GetSequenceFeeder::GetSequenceFeeder()   : rqt_gui_cpp::Plugin()   , widget_(0) {   setObjectName("GetSequenceFeeder"); }     void GetSequenceFeeder::initPlugin(qt_gui_cpp::PluginContext& context) {     connect(ui_.evaluation_box, SIGNAL(currentIndexChanged(QString)),ui_.sequence_combo_box, SLOT(readSequenceFile(char *,char *,struct dirent *)));                                         .                                       .                                       . }   void GetSequenceFeeder::readSequenceFile(char *folder ,char *sequenceFile,struct dirent *select) {                                      .                                      .                                      . } But, on doing so I get the following error message: Object::connect: No such slot QComboBox::readSequenceFile(char *,char *,struct dirent *) Object::connect:  (sender name:   'evaluation_box') Object::connect:  (receiver name: 'sequence_combo_box') I have the function readSequenceFile(char *folder,char *sequence,struct dirent *select); declared in the header file as protected slots: I also tried declaring it as public slot:, did not work. I don’t understand what am I doing wrong.

Viewing all articles
Browse latest Browse all 4972

Trending Articles