I am using Qt code in a ROS node. I have declared a static function setLabel()
in my class. The role of this function is to put an image into a QLabel. Now, I want to call this function when I click a button using a signal/slot connection. Please tell me what should I put at place of the question mark.
class ImageDisplay: public QObject
{
Q_OBJECT
public slots:
void setLabel();
public:
static void imageCallback( );
};
void ImageDisplay::setLabel()
{
QLabel* selectLabel= new QLabel();
selectLabel->setText("hi");
selectLabel->show();
}
void imageDisplay::imageCallBack()
{
ImageDisplay obj;
QObject::connect(selectButton, SIGNAL(clicked()),&obj, SLOT(setLabel()));
}