Skip to content

Instantly share code, notes, and snippets.

@matthieuheitz
Last active August 29, 2015 14:20
Show Gist options
  • Save matthieuheitz/caf1cdac19f36bf523c8 to your computer and use it in GitHub Desktop.
Save matthieuheitz/caf1cdac19f36bf523c8 to your computer and use it in GitHub Desktop.
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);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment