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. fatal error: QStringRef: No such file or directory
Forum Updated to NodeBB v4.3 + New Features

fatal error: QStringRef: No such file or directory

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 4 Posters 1.1k 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.
  • K Offline
    K Offline
    kuntumalla
    wrote on last edited by VRonin
    #1

    Hi all,
    I'm developing an application using Qt 6.2.4 compiled and build by myself.
    Now I need to:
    #include <QStringRef>
    but I get the error in the title of post:
    QStringRef: No such file or directory

    I have installed qt in windows. What do you think is the problem?

    1 Reply Last reply
    1
    • C Offline
      C Offline
      ChrisW67
      wrote on last edited by
      #2

      QStringRef is removed in Qt 6. You can write your code to use the Qt 6 classes from the start (preferred) or using the compatibility module.

      1 Reply Last reply
      3
      • K Offline
        K Offline
        kuntumalla
        wrote on last edited by
        #3

        Thanks You!

        Mr. Chris,

        I have used the compatibility module it was worked.

        1 Reply Last reply
        0
        • VRoninV Offline
          VRoninV Offline
          VRonin
          wrote on last edited by
          #4

          Don't use the compatibility module on new code, use QStringView instead

          "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
          ~Napoleon Bonaparte

          On a crusade to banish setIndexWidget() from the holy land of Qt

          1 Reply Last reply
          3
          • V Offline
            V Offline
            varshneydevansh
            wrote on last edited by
            #5

            What I did is I installed the Qt5 as I wasn't able to get away with the error

            /home/devansh/repo/src/libs/languageserverprotocol/jsonkeys.h:6:10: fatal error: QLatin1StringView: No such file or directory
                6 | #include <QLatin1StringView>
                  |          ^~~~~~~~~~~~~~~~~~~
            compilation terminated.
            [76/2753] Building CXX object src/libs/extensionsystem/CMakeFiles/ExtensionSystem.dir/pluginmanager.cpp.o
            ninja: build stopped: subcommand failed.
            
            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