undefined
01-02-2006, 11:34
Gibt es unter QT4 eine Möglichkeit den SIGNAL Sender zu ermitteln?
Wenn jetzt ui.bin_* editingFinished() Sendet. Kann ich Irgendwie herausfinden welcher der drei Objecte das Signal gesendet hat?
#include <QMessageBox>
#include "qotrdecoder.h"
qotrdecoder::qotrdecoder()
{
ui.setupUi(this);
// connect( ui.btn_cancel, SIGNAL( clicked() ), this, SLOT( SlotTester() ) );
// connect( ui.btn_decode, SIGNAL( clicked() ), this, SLOT( SlotTester() ) );
// connect( ui.btn_open_bin, SIGNAL( clicked() ), this, SLOT( SlotTester() ) );
// connect( ui.btn_open_key, SIGNAL( clicked() ), this, SLOT( SlotTester() ) );
// connect( ui.btn_open_dir, SIGNAL( clicked() ), this, SLOT( SlotTester() ) );
connect( ui.inp_bin, SIGNAL( editingFinished() ), this, SLOT( SlotStringTester() ) );
connect( ui.inp_key_file, SIGNAL( editingFinished() ), this, SLOT( SlotStringTester() ) );
connect( ui.inp_output, SIGNAL( editingFinished() ), this, SLOT( SlotStringTester() ) );
}
void qotrdecoder::SlotTester()
{
QMessageBox::warning( new QWidget(), "SlotTester", QString( "Slot Tester" ) );
}
void qotrdecoder::SlotStringTester()
{
QString in;
// Hier wuerde ich jetzt gerne das Object des Signal Handlers ermitteln
in.append( ui.inp_bin->text() );
QMessageBox::warning( new QWidget(), "SlotStringTester", in );
}
qotrdecoder::~qotrdecoder()
{}
Wenn jetzt ui.bin_* editingFinished() Sendet. Kann ich Irgendwie herausfinden welcher der drei Objecte das Signal gesendet hat?
#include <QMessageBox>
#include "qotrdecoder.h"
qotrdecoder::qotrdecoder()
{
ui.setupUi(this);
// connect( ui.btn_cancel, SIGNAL( clicked() ), this, SLOT( SlotTester() ) );
// connect( ui.btn_decode, SIGNAL( clicked() ), this, SLOT( SlotTester() ) );
// connect( ui.btn_open_bin, SIGNAL( clicked() ), this, SLOT( SlotTester() ) );
// connect( ui.btn_open_key, SIGNAL( clicked() ), this, SLOT( SlotTester() ) );
// connect( ui.btn_open_dir, SIGNAL( clicked() ), this, SLOT( SlotTester() ) );
connect( ui.inp_bin, SIGNAL( editingFinished() ), this, SLOT( SlotStringTester() ) );
connect( ui.inp_key_file, SIGNAL( editingFinished() ), this, SLOT( SlotStringTester() ) );
connect( ui.inp_output, SIGNAL( editingFinished() ), this, SLOT( SlotStringTester() ) );
}
void qotrdecoder::SlotTester()
{
QMessageBox::warning( new QWidget(), "SlotTester", QString( "Slot Tester" ) );
}
void qotrdecoder::SlotStringTester()
{
QString in;
// Hier wuerde ich jetzt gerne das Object des Signal Handlers ermitteln
in.append( ui.inp_bin->text() );
QMessageBox::warning( new QWidget(), "SlotStringTester", in );
}
qotrdecoder::~qotrdecoder()
{}