Results 1 to 3 of 3

Thread: Desperate QString problem

  1. #1

    Default Desperate QString problem

    I have been spending hours on solving the problem, searched doc and google, but cant find a valid solution
    Qt Code:
    1. int a=0;
    2. while (a<2)
    3. {
    4. //infos.stops is point to one array, called abc[10]
    5.  
    6. output = output + QString::fromStdString(*infos.stops)+ "." ;
    7.  
    8. infos.stops++;
    9. a++;
    10. }
    11. ui->showMsg->setText(output);
    To copy to clipboard, switch view to plain text mode 
    the problem is infos.stops did show, but some funny characters appear like link removed.

    i have uploaded all my source code which is designed in QT Designer link removed the problem line is at manager.cpp line 133
    [1]:
    Last edited by high_flyer; 31st January 2011 at 10:17. Reason: code tags

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Desperate QString problem

    Please use [code] tags around code in these forums.
    Please upload any images/files to this forum rather than linking to external sites. Linking to external sites is likely to leave this post without any supporting image/file if the other site goes away or stops service because QtCentre is leaching off their bandwidth (this is probably why the links were removed).

    Without the linked information you don't provide enough information about the type of info.stops or abc[10] for us to make sense of what you are trying to do.

    My guess is that info.stops either does not point to a C string at all, or only does so until you increment the pointer after the first run through the loop.

  3. #3
    Join Date
    Dec 2008
    Location
    Istanbul, TURKEY
    Posts
    537
    Thanks
    14
    Thanked 13 Times in 13 Posts
    Qt products
    Qt4
    Platforms
    Windows Android

    Default Re: Desperate QString problem

    Hi,

    I think the problem is in appending. You may use append(..) function instead '+' operator.

Similar Threads

  1. Desperate for help~~~ Qt 4.6.2 deployment
    By MorrisLiang in forum Installation and Deployment
    Replies: 1
    Last Post: 30th September 2010, 19:19
  2. White background in window, getting desperate!
    By dictoon in forum Qt Programming
    Replies: 19
    Last Post: 31st December 2009, 08:35
  3. problem in QString
    By wagmare in forum Qt Programming
    Replies: 4
    Last Post: 23rd December 2008, 13:28
  4. QString problem?
    By raphaelf in forum Newbie
    Replies: 7
    Last Post: 24th June 2008, 09:12
  5. Replies: 4
    Last Post: 31st January 2008, 20:44

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.