Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. Breakpoint with QString Condition in QtCreator
QtWS25 Last Chance

Breakpoint with QString Condition in QtCreator

Scheduled Pinned Locked Moved Solved Qt Creator and other tools
6 Posts 6 Posters 3.5k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Y Offline
    Y Offline
    yeckel
    wrote on 20 Oct 2015, 12:23 last edited by yeckel
    #1

    Hi, is there a way how to set up more complex condition for breakpoint in QtCreator? At least comparing the QStrings. Integer comparsion like in tutorials works fine, but how about:

    void foo(QString bar){
     qDebug() << bar;
    }
    

    breakpoint on qDebug line and condition:
    bar == "BAR", or bar.equals("BAR")

    Is it possible, or just basic data types are available? If so, how?

    Thanks

    1 Reply Last reply
    0
    • A Offline
      A Offline
      Arthapz
      wrote on 23 May 2017, 21:58 last edited by
      #2

      Hi,
      Bump with same question.

      1 Reply Last reply
      0
      • E Offline
        E Offline
        Eddy
        wrote on 24 May 2017, 13:40 last edited by
        #3

        Hi,

        Can you elaborate on this? What is it you want exactly?

        Eddy

        Qt Certified Specialist
        www.edalsolutions.be

        1 Reply Last reply
        0
        • D Offline
          D Offline
          Dark.Rider
          wrote on 16 Nov 2017, 15:35 last edited by
          #4

          I think I have the same problem. The condition does not seem to be evaluated. I have something like this in the condition field of my breakpoint:

          qstringVar.compare("some value") == 0
          

          However, the breakpoint is hit every iteration on that line although the qstringVar is not equal to the "some value". Why is that?

          1 Reply Last reply
          0
          • C Offline
            C Offline
            cantappa
            wrote on 24 Jan 2018, 10:41 last edited by cantappa
            #5

            I got the same problem with a std::string. For instance using tmp.compare("some-value") == 0 with tmp being a std::string in the condition field does not work, i.e., the program stops whenever the breakpoint is reached even if the condition is not true.

            Is this a bug? I am using QtCreator 4.5.0.

            1 Reply Last reply
            0
            • K Offline
              K Offline
              koahnig
              wrote on 21 Sept 2018, 09:46 last edited by
              #6

              To anyone stumbling over this thread, there has been a similar thread started which resulted in a bug report on JIRA.

              Check out this thread for more details. The bug report has been closed immediately, but gives details on restrictions on breakpoint conditions.

              Vote the answer(s) that helped you to solve your issue(s)

              1 Reply Last reply
              3

              • Login

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Search
              • Get Qt Extensions
              • Unsolved