Results 1 to 2 of 2

Thread: QString exception while executing assignment operation

  1. #1
    Join Date
    Mar 2011
    Posts
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default QString exception while executing assignment operation

    Good morning,
    I have a problem using QT 4.7.1 on a Wince Arm platform (pxa270).
    I cross compiled some year ago the qt libraries, and I'm using them for the business logic section of my SW project.
    I use the Qstring class in many sections of my code, but sometimes I get an exception at run time.

    I found, for example, that this line of code

    QString createdDateString= QDate::currentDate().toString();

    Sometimes generates an exception.
    If I modify my source code (also different section of the SW), the exception sometimes disappear.
    Similar errors appear at run time when I use code initializations like that

    QString a = "test"

    Do you have any hint about this topic?
    It seems a memory leak bug in my code, but I can't find where.
    Best regards
    Giovanni

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,419
    Thanks
    37
    Thanked 1,546 Times in 1,496 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: QString exception while executing assignment operation

    In most cases when something like this happens, the object this code runs on, i.e. the object for which the surrounding method is called, is not valid (anymore).

    Cheers,
    _

Similar Threads

  1. Replies: 3
    Last Post: 27th December 2013, 19:04
  2. c++ code assignment
    By alexrat1996 in forum Qt Programming
    Replies: 5
    Last Post: 15th February 2013, 20:01
  3. Replies: 6
    Last Post: 29th December 2011, 19:37
  4. QString assignment
    By valgaba in forum Qt Programming
    Replies: 4
    Last Post: 25th April 2010, 18:31

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.