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. QStringLiteral with older compilers?
Forum Updated to NodeBB v4.3 + New Features

QStringLiteral with older compilers?

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 3.4k 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.
  • U Offline
    U Offline
    utcenter
    wrote on last edited by
    #1

    I noticed that using the QStringLiteral macro with non lambda supporting compilers results in an error. This mandates the usage of ifdefs and more code.

    Shouldn't the macro just result in something that is either ignored or compatible with older compilers? Ignoring the macro completely lives a string literal, which is implicitly converted to a QString in places that expect a QString. I think it will be a good idea to do so instead of having to have different lines of code and ifdefs.

    1 Reply Last reply
    0
    • Q Offline
      Q Offline
      qwetee
      wrote on last edited by
      #2

      Hello utcenter,

      I am facing a similar problem.
      I have compiled my application using qmake 3.0, however when I try to cross compile it using qmake 2.01a, it gives me an error telling 'QStringLiteral' is not defined in the scope.

      Should I substitute it with 'QString'?

      Please suggest any other appropriate action.

      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