Re: Run a slot only it has received x number of signals
Not possible to do what you suggest, however, if I were going to design this, I would disable the push button to execute the query (and I presume complete the dialog) until the line edit containing the query passed validation, which in this case would require that all 5 line edits contained valid values.
You could also test for successful database connection when any of the line edits send the QLineEdit::editingFinished signal (or any of the other QLineEdit signals if you prefer). If the connection is successful, enable to OK button or whatever button you use to complete the dialog. If the connection fails, then leave the button disabled and cancel is the only option, etc.
Alternatively, provide a "Test" pushbutton that you use to test the connection, etc.
Lots of ways to accomplish what you want without having to do something like count signals, etc.
Good luck.
I write the best type of code possible, code that I want to write, not code that someone tells me to write!
Bookmarks