Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Qmake contains() function
Qt 6.11 is out! See what's new in the release blog

Qmake contains() function

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 5.5k Views 1 Watching
  • 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 Offline
    A Offline
    azarubkin
    wrote on last edited by
    #1

    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
    0
    • A Offline
      A Offline
      Asperamanca
      wrote on last edited by
      #2

      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
      0
      • A Offline
        A Offline
        azarubkin
        wrote on last edited by
        #3

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

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved