Results 1 to 6 of 6

Thread: Crash on QString assignment

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Apr 2013
    Location
    Prague
    Posts
    258
    Thanks
    3
    Thanked 65 Times in 59 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Crash on QString assignment

    IMO, the problem isn't in Q_OBJECT (as long as AutochargeData does not use "Qt extras" - it is not an UI object, it declares no properties, slots or signals, etc.) The setOrderID() method is innocent. IMO, the problem is somewhere in the database. For starters, I recommend splitting the setOrderID() statement and seeing whether you pass and what values will the debugger show. Therefore:
    Qt Code:
    1. QVariant val = query.value("increment_id"); // does it pass?
    2. QString str = val.toString(); // does it pass? What is in str?
    3.  
    4. setOrderID(str); // does it pass? What happens?
    To copy to clipboard, switch view to plain text mode 
    Pleas, post your findings.

  2. #2
    Join Date
    Nov 2015
    Location
    Vermont
    Posts
    52
    Thanks
    15
    Thanked 1 Time in 1 Post
    Qt products
    Qt5
    Platforms
    MacOS X Windows

    Default Re: Crash on QString assignment

    I got this figured out shortly before you posted. As predicted, it was something obvious that I was missing. I had created an instance of AutochargeData in the Mainwindow class, but was trying to use it in a different class without creating another instance of it. So it was invalid, as was guessed by the other posts in this thread. Thanks everyone!

Similar Threads

  1. QString exception while executing assignment operation
    By Giox79 in forum Qt Programming
    Replies: 1
    Last Post: 2nd March 2015, 12:30
  2. Replies: 6
    Last Post: 29th December 2011, 18:37
  3. Comparing QString causes the program to crash .
    By ladiesfinger in forum Qt Programming
    Replies: 9
    Last Post: 6th November 2010, 17:17
  4. QString assignment
    By valgaba in forum Qt Programming
    Replies: 4
    Last Post: 25th April 2010, 17:31
  5. Crash on QString Destructor
    By ToddAtWSU in forum Qt Programming
    Replies: 1
    Last Post: 14th June 2007, 14:28

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.