Results 1 to 14 of 14

Thread: toStdString is returning an empty string !!!!

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows
    Thanks
    21
    Thanked 418 Times in 411 Posts

    Default Re: toStdString is returning an empty string !!!!

    can you show the following several lines too?
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  2. #2
    Join Date
    Oct 2010
    Posts
    95
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows
    Thanks
    2

    Default Re: toStdString is returning an empty string !!!!

    Thanks,

    I have this problem since several months !

    Here is the complete method :

    Qt Code:
    1. void psMainWindow::on_Menu_Save()
    2. {
    3. if (_currentFilePath.length() < 1)
    4. {
    5. on_Menu_SaveAs();
    6. return;
    7. }
    8.  
    9. UpdatePanelWidget::Start();
    10.  
    11. pureGraph::IE::Exporter exporter;
    12. string file = _currentFilePath.toStdString();
    13. exporter.Export(GlobalContext::Scene, file);
    14.  
    15. UpdatePanelWidget::Stop();
    16. }
    To copy to clipboard, switch view to plain text mode 

  3. #3
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows
    Thanks
    21
    Thanked 418 Times in 411 Posts

    Default Re: toStdString is returning an empty string !!!!

    and you say that when you stand on line 13 in the debugger, '_currentFilePath' has a valid string in it, and 'file' is an empty string?
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

Similar Threads

  1. QLineEdit empty string
    By zgulser in forum Newbie
    Replies: 4
    Last Post: 3rd August 2010, 15:18
  2. QString::toStdString in PyQt Question
    By di_zou in forum Newbie
    Replies: 1
    Last Post: 2nd November 2009, 21:09
  3. QSplitter::saveState returns empty string
    By miraks in forum Qt Programming
    Replies: 2
    Last Post: 21st September 2008, 22:30
  4. returning a string
    By mickey in forum General Programming
    Replies: 2
    Last Post: 3rd February 2008, 20:41
  5. QString .toStdString heap bug
    By bpetty in forum Qt Programming
    Replies: 1
    Last Post: 3rd October 2006, 18:10

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.