Results 1 to 8 of 8

Thread: Visual Studio 2010 Conditional Breakpoint + QString

  1. #1
    Join Date
    Apr 2012
    Posts
    3
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Visual Studio 2010 Conditional Breakpoint + QString

    Hello, I am using visual studio 2010 and Qt 4.8. I read this article regarding conditional breakpoints and std:string
    http://blogs.msdn.com/b/habibh/archi...eakpoints.aspx

    Is it possible to achieve the same with a QString? It seems that breakpoint isn't activated when I set a codition regarding a specific value of a QString variable. For example I want to set a breakpoint to stop if variable aa = "test".

  2. #2
    Join Date
    Apr 2012
    Posts
    3
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Visual Studio 2010 Conditional Breakpoint + QString

    Any help on that?

  3. #3
    Join Date
    Nov 2010
    Posts
    82
    Thanked 9 Times in 9 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Visual Studio 2010 Conditional Breakpoint + QString

    if the you can't do aa == "test" maybe you can try to use wsccmp((const wchar_t*)aa.utf16(), L"test") == 0 like in the exemple
    (i always work with unicode but you can use strcmp())

  4. #4
    Join Date
    Sep 2011
    Posts
    1,241
    Thanks
    3
    Thanked 127 Times in 126 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Visual Studio 2010 Conditional Breakpoint + QString

    I doubt it will work because the only method evaluation that is supported are mentioned in the article. Using methods on QString (e.g. utf16()), therefore, I believe wont work. You would have to directly access the data pointer in QString.
    If you have a problem, CUT and PASTE your code. Do not retype or simplify it. Give a COMPLETE and COMPILABLE example of your problem. Otherwise we are all guessing the problem from a fabrication where relevant details are often missing.

  5. #5
    Join Date
    Nov 2010
    Posts
    82
    Thanked 9 Times in 9 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Visual Studio 2010 Conditional Breakpoint + QString

    you mean like :

    wchar_t* str_ptr = (const wchar_t*)aa.utf16();
    and then put the breakpoint test to :
    wsccmp(str_ptr, L"test") == 0;
    ?

  6. #6
    Join Date
    Sep 2011
    Posts
    1,241
    Thanks
    3
    Thanked 127 Times in 126 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Visual Studio 2010 Conditional Breakpoint + QString

    That isn't what you said in your previous post. I was stating my doubt that

    wsccmp((const wchar_t*)aa.utf16(), L"test") == 0

    would work due to utf16() method.
    If you have a problem, CUT and PASTE your code. Do not retype or simplify it. Give a COMPLETE and COMPILABLE example of your problem. Otherwise we are all guessing the problem from a fabrication where relevant details are often missing.

  7. #7
    Join Date
    Nov 2010
    Posts
    82
    Thanked 9 Times in 9 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Visual Studio 2010 Conditional Breakpoint + QString

    oh but that work i m sure of it
    utf16() retrun the wide char pointer to the qstring

  8. #8
    Join Date
    Sep 2011
    Posts
    1,241
    Thanks
    3
    Thanked 127 Times in 126 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Visual Studio 2010 Conditional Breakpoint + QString

    It appears you are missing my point again. My point being that visual studio wont support it on a break line conditional.
    (my untested belief based on the fact MS are very happy to shout about supporting basic string free functions)
    If you have a problem, CUT and PASTE your code. Do not retype or simplify it. Give a COMPLETE and COMPILABLE example of your problem. Otherwise we are all guessing the problem from a fabrication where relevant details are often missing.

Similar Threads

  1. Replies: 0
    Last Post: 27th July 2011, 16:59
  2. Visual studio 2010 interference
    By The physicist in forum Installation and Deployment
    Replies: 3
    Last Post: 14th January 2011, 09:43
  3. Qt and Visual Studio 2010
    By SixDegrees in forum Qt Programming
    Replies: 6
    Last Post: 15th November 2010, 19:56
  4. Visual Studio Plugin (1.1.6) crashes Visual Studio (2010)
    By mboeni in forum Installation and Deployment
    Replies: 0
    Last Post: 11th October 2010, 16:46
  5. Plan for Visual Studio 2010 (MSVC 2010)?
    By Vinzz in forum Qt Programming
    Replies: 1
    Last Post: 18th April 2010, 17:42

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.