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)
    {
    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.



  • 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
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.