Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct


    Qt World Summit: Early-Bird Tickets

    Solved Breakpoint with QString Condition in QtCreator

    Tools
    6
    6
    2851
    Loading More Posts
    • 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.
    • yeckel
      yeckel last edited by yeckel

      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 Reply Quote 0
      • A
        Arthapz last edited by

        Hi,
        Bump with same question.

        1 Reply Last reply Reply Quote 0
        • E
          Eddy last edited by

          Hi,

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

          Eddy

          Qt Certified Specialist
          www.edalsolutions.be

          1 Reply Last reply Reply Quote 0
          • D
            Dark.Rider last edited by

            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 Reply Quote 0
            • C
              cantappa last edited by cantappa

              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 Reply Quote 0
              • K
                koahnig last edited by

                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 Reply Quote 3
                • First post
                  Last post