Important: Please read the Qt Code of Conduct -

Breakpoint with QString Condition in QtCreator

  • 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?


  • Hi,
    Bump with same question.

  • Hi,

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


  • 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:"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?

  • I got the same problem with a std::string. For instance using"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.

  • 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.

Log in to reply