Important: Please read the Qt Code of Conduct -

Qmake contains() function

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

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


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

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

Log in to reply