[Qt-interest] can any body point out my error here

Yuvaraj R yuvaraj at ongobiz.com
Fri Sep 11 08:32:27 CEST 2009


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090911/236c6d1b/attachment.html 


More information about the Qt-interest-old mailing list