Yours UPDATE query updates ALL record in database and the message shows that there can only be one record for a given number in the database. The WHERE condition is probably missing.
Yours UPDATE query updates ALL record in database and the message shows that there can only be one record for a given number in the database. The WHERE condition is probably missing.
rahulvishwakarma (8th April 2020)
And sending a pointer to a local variable as a signal argument is a very bad programming practice. If a slot tries to store that pointer, it will result in a crash later because after the clicked() slot exits, the local variable is gone.
Why don't you simply send the QString itself? You aren't optimizing anything by sending the address of the QString, because the QString implementation will not copy the string until it is modified, so it will not be copied if it is sent as an argument.
<=== The Great Pumpkin says ===>
Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.
Bookmarks