[Qt-interest] can any body point out my error here
Colleen Vermillion
cvermillion at bibblelabs.com
Wed Sep 16 21:41:52 CEST 2009
QObject::connect(this,SIGNAL(callbuddyname(QString)),dia,SLOT(outgoingbuddy(
QString)));
Here youre connecting the signal from MainWindow to every new form, so I
would suspect you have multiple forms when you only expected to have one?
Also, if I understand what youre doing correctly, you could use
QStringList buddyList = item->text().split(\t, QString::SkipEmptyParts);
for (int j=0; j<buddyList.count(); j++)
{
data1 = buddyList.at(j);
}
to make the code a little simpler.
-Colleen
From: qt-interest-bounces at trolltech.com
[mailto:qt-interest-bounces at trolltech.com] On Behalf Of Yuvaraj R
Sent: Friday, September 11, 2009 11:13 PM
To: Malyushytsky, Alex
Cc: qt-interest
Subject: Re: [Qt-interest] can any body point out my error here
On Sat, Sep 12, 2009 at 3:43 AM, Malyushytsky, Alex <alex at wai.com> wrote:
Debugger is your friend.
I tried with debugger, i don't get any thing there?
But i am sure ,slot is called two times .though only one signal is emitted
also.
Thanks
Yuvaraj R
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(Q
String)));
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_le
vel(int)));
QObject::connect(this,SIGNAL(conference_guest_responce(QString)),dia,SLOT(sh
ow_participants(QString)));
QObject::connect(this,SIGNAL(emitbuddyname(QString)),dia,SLOT(setbuddyname(Q
String)));
QObject::connect(this,SIGNAL(setCall(QString)),dia,SLOT(setCallState(QString
)));
QObject::connect(dia,SIGNAL(hold_call_status(int,int)),this,SLOT(hold_call(i
nt,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.
_______________________________________________
Qt-interest mailing list
Qt-interest at trolltech.com
http://lists.trolltech.com/mailman/listinfo/qt-interest
More information about the Qt-interest-old
mailing list