Results 1 to 3 of 3

Thread: duplicate field value in query.

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Mar 2008
    Location
    Kraków, Poland
    Posts
    1,540
    Thanked 284 Times in 279 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: duplicate field value in query.

    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.

  2. The following user says thank you to Lesiok for this useful post:

    rahulvishwakarma (8th April 2020)

  3. #2
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,315
    Thanks
    314
    Thanked 870 Times in 857 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: duplicate field value in query.

    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.

Similar Threads

  1. tabWidget duplicate frames
    By ilmandorlone in forum Qt Programming
    Replies: 9
    Last Post: 16th March 2016, 10:33
  2. Replies: 7
    Last Post: 16th April 2015, 17:11
  3. duplicate recordset
    By sepehr in forum Qt Programming
    Replies: 2
    Last Post: 4th February 2009, 10:44
  4. Duplicate SLOTS
    By ^NyAw^ in forum Qt Programming
    Replies: 1
    Last Post: 26th February 2008, 12:32

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.