matthieuheitz
5/7/2015 - 8:13 PM

Custom slots to debug signals, verify if they are fired

Custom slots to debug signals, verify if they are fired

#include <QMessageBox>

class myClass:
{
// Insert those slots in your myClass.h
public slots:
  void displaySignal(QString);
  void displaySignal(int);
  void displaySignal(float);
  void displaySignal(double);
  void displaySignal(bool);
}

// Insert implementation in myClass.cpp

void myClass::displaySignal(QString arg)
{
  QMessageBox::information(this,"Signal received",arg,QMessageBox::Ok);
}

void myClass::displaySignal(int arg)
{
  QMessageBox::information(this,"Signal received",QString::number(arg),QMessageBox::Ok);
}

void myClass::displaySignal(float arg)
{
  QMessageBox::information(this,"Signal received",QString::number(arg),QMessageBox::Ok);
}

void myClass::displaySignal(double arg)
{
  QMessageBox::information(this,"Signal received",QString::number(arg), QMessageBox::Ok);
}

void myClass::displaySignal(bool arg)
{
  QMessageBox::information(this,"Signal received",QString::number(arg),QMessageBox::Ok);
}