[Qt-interest] can any body point out my error here
Malyushytsky, Alex
alex at wai.com
Sat Sep 12 00:13:10 CEST 2009
Debugger is your friend.
From: qt-interest-bounces at trolltech.com [mailto:qt-interest-bounces at trolltech.com] On Behalf Of Yuvaraj R
Sent: Thursday, September 10, 2009 11:32 PM
To: qt-interest
Subject: [Qt-interest] can any body point out my error here
Hi All
i am emitting the signal, but some times two times slot is called
my code is
void MainWindow::on_listWidget_itemDoubleClicked(QListWidgetItem* item)
{
QSettings settings(username,"maxxtel");
qDebug() << item->text();
QString data = item->text();
QString data1;
int j=0;
for(int j=0;j<data.size();j++)
{
qDebug() <<j;
if(data[j] == QChar('\t'))
{
qDebug() << "yuvaraj" << data1;
if((active_call_count == 0))
{
Form *dia = new Form();
QObject::connect(dia,SIGNAL(send_call_history(QString,int)),this,SLOT(update_call_history(QString,int)));
QObject::connect(dia,SIGNAL(accept(int)),this,SLOT(callaccept(int)));
QObject::connect(dia,SIGNAL(endcall(int )),this,SLOT(on_endcall_clicked(int )));
QObject::connect(this,SIGNAL(callbuddyname(QString)),dia,SLOT(outgoingbuddy(QString)));
QObject::connect(dia,SIGNAL(callrequested(QString)),this,SLOT(outgoingcall(QString)));
QObject::connect(dia,SIGNAL(set_mic_level(int)),this,SLOT(set_mic_level(int)));
QObject::connect(dia,SIGNAL(set_speaker_level(int)),this,SLOT(set_speaker_level(int)));
QObject::connect(this,SIGNAL(conference_guest_responce(QString)),dia,SLOT(show_participants(QString)));
QObject::connect(this,SIGNAL(emitbuddyname(QString)),dia,SLOT(setbuddyname(QString)));
QObject::connect(this,SIGNAL(setCall(QString)),dia,SLOT(setCallState(QString)));
QObject::connect(dia,SIGNAL(hold_call_status(int,int)),this,SLOT(hold_call(int,int)));
call_form_list << dia;
dia->setCallState("Calling");
qDebug() << "addu1";
emit callbuddyname(data1);
qDebug() << "addue3";
active_call_count = active_call_count +1;
dia->call_id=call_id;
return;
}
else
{
QMessageBox::information(0,"",QString("Already one active call is there"));
}
data1.clear();
data.clear();
return;
}
data1.append(data[j]);
qDebug() << data1;
}
}
void Form::outgoingbuddy(QString buddy)
{
out_going_buddy = buddy;
m_ui->Accept->hide();
m_ui->label->setText(buddy);
emit callrequested(buddy);
this->setWindowTitle(buddy);
this->show();
}
Can u please help me why two slots is called, when i am clicking item
Thanks
Yuvaraj R
---------------------------------------------------------------------------------------------------
Weidlinger Associates, Inc. made the following annotations.
"This message and any attachments are solely for the intended recipient and may contain confidential or privileged information. If you are not the intended recipient, any disclosure, copying, use, or distribution of the information included in this message and any attachments is prohibited. If you have received this communication in error, please notify us by reply e-mail and immediately and permanently delete this message and any attachments. Thank you."
"Please consider our environment before printing this email."
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090911/bccc7770/attachment.html
More information about the Qt-interest-old
mailing list