PDA

View Full Version : qinputdialog strange behaviour



dreamer
10th May 2008, 21:53
I use the static method



QInputDialog::getText ( QWidget * parent, const QString & title, const QString & label,
QLineEdit::EchoMode mode = QLineEdit::Normal,
const QString & text = QString(), bool * ok = 0, Qt::WindowFlags f = 0 )


I use it, into a slot. This slot is called, when an action emits the triggered() signal. This Action is activated in a contextmenu.

The strange behaviour, is that the slot is called two times for each mouse press........i have other slots in the same contextmenu that work well.

jpn
11th May 2008, 19:29
Make sure that you don't establish the connection twice by accident (for example in a loop) and that the slot is not using the naming convention of automatic connections (http://doc.trolltech.com/4.4/designer-using-a-component.html#automatic-connections):


void on_<widget name>_<signal name>(<signal parameters>);