Qt Forum

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

    Update: Forum Guidelines & Code of Conduct

    Qt creator(2.5.0) doesnt interpret "Try catch" block in constructor.

    Tools
    2
    2
    1167
    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.
    • N
      nikCoder last edited by

      Consider the below pseudo code, I added a try catch block for the constructor , which i am sure is valid.
      @C::C()
      try
      : A ( /.../ )
      , b( /.../ )
      {
      }
      catch( ... )
      {

      }@

      For some strange reason Qt creator doesn't understand this syntax and underlines the "try" line and the "catch" block in red.

      Qt creator version :2.5.0.

      The code compiles without any error. Please let me know if any one has a solution for this. Thanks!

      --Nikhil

      1 Reply Last reply Reply Quote 0
      • T
        Tannin last edited by

        That's not exactly strange, it's a very uncommon syntax. The qt syntax parser is not 100% conformant so it won't understand the more exotic constructs. That's true for almost every IDE I know of.
        I don't think there is a lot one can do beyond submitting a patch.

        1 Reply Last reply Reply Quote 0
        • First post
          Last post