Qt Forum

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

    Qmake contains() function

    General and Desktop
    2
    3
    4448
    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.
    • A
      azarubkin last edited by

      Hello all,

      How do I check two strings for equality in .pro file? I tried modifying the example given in help file:
      @drivers = trrr
      network = aqqq
      contains(drivers, $$network)
      {
      message($$drivers)
      message("contains!")
      }@

      But it always replies "contains!", which is not what I want. What is the correct syntax to check for strings equality or inclusion?

      Regards,
      Alexandr.

      1 Reply Last reply Reply Quote 0
      • A
        Asperamanca last edited by

        The opening curly bracket must be in the same line as the 'contains'. Well, that's at least one error I can spot right away.

        1 Reply Last reply Reply Quote 0
        • A
          azarubkin last edited by

          Thanks, that helped. I should have read qmake manuals more thoroughly.

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