Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. International
  3. French
  4. [QXmlQuery] problème lors de la compilation QT 5.15
Forum Updated to NodeBB v4.3 + New Features

[QXmlQuery] problème lors de la compilation QT 5.15

Scheduled Pinned Locked Moved Unsolved French
6 Posts 2 Posters 1.0k 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.
  • Bozo The GeekB Offline
    Bozo The GeekB Offline
    Bozo The Geek
    wrote on last edited by Bozo The Geek
    #1

    Bonjour à tous,

    Je suis sous Ubuntu 23.10 / QT Creator 12.0.1 et j'utilise QT 5.15.2 (pour l'instant je ne peux passer en 6 pour mon projet ;-)... J'utilise habituellement QDomDocument et QXmlStreamReader pour utiliser du xml, mais cette fois, j'ai voulu utiliser Xpath et donc utiliser QXmlQuery. Comme conseillé dans le documentation, j'ai rajouté dans mon fichier projet .pro "xmlpatterns" comme ceci, voici la ligne que j'ai à ce jour :

    QT += qml quick sql xmlpatterns xml
    

    Dans mon code, j'ai rajouté cette include pour pouvoir l'utiliser:

    #include <QXmlQuery>
    

    Je le retrouve bien aussi dans mes includes dans l'OS avec QT installé dans mon home:
    8d534c0f-98c6-42d6-834b-feccdb48e943-image.png

    Pas d'erreur dans le code dans QT creator et cela semble bien reconnu :
    ff46625f-dacf-413d-b7a6-1693527cd348-image.png

    Mais quand je compile (même après des cleans, des restarts de l'OS, de qt creator, testé sur 2 pc installés avec 2 versions de linux (l'autre est sous une ancien version de QT Creator et QT 5.15.1) , je tombe toujours sur les mêmes erreurs lors de la compilation (je suis en debug pour le moment) :
    f5b98b34-5062-4330-817a-ff5962939698-image.png

    Qu'est ce que j'ai pu louper ? j'ai même essayé de rajouter des packages de xmlpatterns manuellement, mais je pense que je l'avais déjà avec l'installation standard de QT, non ?

    Merci d'avance pour votre aide
    Et bonne journée

    P.S: voici les lignes du code principal où j'utilise QXmlQuery:

        //using xpath to isolate games of a system
        QXmlQuery query;
     
       QString res;
     
    
        /*
         * Use QXmlQuery to execute and XPath query. 
         * 
         */
        query.setFocus(&xmlFile);
        query.setQuery("/root/system/platform[test()='" + sysentry.shortname + "']/../games/game[@tested='ok']/name");
        if ( ! query.isValid()){
            return 0;
        }
        query.evaluateTo(&res);
    
    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Bonjour et bienvenue,

      L'image montre les sources mais qu'est-ce que les fichiers sont trouvable dans l'installation ?

      D'ailleurs, est-ce que Qt est installé avec le manager de packages de la distribution ou avec l'installateur online ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      Bozo The GeekB 1 Reply Last reply
      0
      • SGaistS SGaist

        Bonjour et bienvenue,

        L'image montre les sources mais qu'est-ce que les fichiers sont trouvable dans l'installation ?

        D'ailleurs, est-ce que Qt est installé avec le manager de packages de la distribution ou avec l'installateur online ?

        Bozo The GeekB Offline
        Bozo The GeekB Offline
        Bozo The Geek
        wrote on last edited by Bozo The Geek
        #3

        @SGaist je confirme que c'est installé avec l'installateur offline, qu'est ce que je peux donc vérifier en plus dans mon installation ?

        j'ai déjà regardé pour les libs, elles sont bien là, il me semble... pour la partie XML...

        8f71c261-92bf-438e-bd91-5e80f6388efc-image.png

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Ça semble bon. Serait-il possible de voir le contenu du fichier .pro ?

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          Bozo The GeekB 1 Reply Last reply
          0
          • SGaistS SGaist

            Ça semble bon. Serait-il possible de voir le contenu du fichier .pro ?

            Bozo The GeekB Offline
            Bozo The GeekB Offline
            Bozo The Geek
            wrote on last edited by
            #5

            @SGaist Voici le fichier .pro de la partie backend de ce projet qu'habituellement je modifie quand j'ai besoin:

            TEMPLATE = lib
            
            QT += core qml quick sql xmlpatterns xml
            CONFIG += c++17 staticlib warn_on exceptions debug
            android: QT += androidextras
            
            !isEmpty(USE_SDL_GAMEPAD)|!isEmpty(USE_SDL_POWER): include($${TOP_SRCDIR}/thirdparty/link_to_sdl.pri)
            
            isEmpty(USE_SDL_GAMEPAD): QT += gamepad
            
            !isEmpty(NO_LEGACY_SDL): DEFINES *= WITHOUT_LEGACY_SDL
            
            !isEmpty(INSIDE_FLATPAK): DEFINES *= PEGASUS_INSIDE_FLATPAK
            msvc: DEFINES *= _USE_MATH_DEFINES
            
            DEFINES *= HAVE_CDROM
            
            SOURCES += \
                Backend.cpp \
                DownloadManager.cpp \
                FrontendLayer.cpp \
                GamepadAxisNavigation.cpp \
                PegasusAssets.cpp \
                ProcessLauncher.cpp \
                ScriptRunner.cpp \
                Paths.cpp \
                AppSettings.cpp \
                Log.cpp \
                GamepadButtonNavigation.cpp \
                RootFolders.cpp \
                ScriptManager.cpp
            
            
            HEADERS += \
                Backend.h \
                CliArgs.h \
                DownloadManager.h \
                FrontendLayer.h \
                GamepadAxisNavigation.h \
                PegasusAssets.h \
                ProcessLauncher.h \
                ScriptRunner.h \
                Paths.h \
                AppSettings.h \
                Log.h \
                GamepadButtonNavigation.h \
                RootFolders.h \
                ScriptManager.h \
                KeyEmitter.h
            
            include(imggen/imggen.pri)
            include(model/model.pri)
            include(parsers/parsers.pri)
            include(platform/platform.pri)
            include(providers/providers.pri)
            include(types/types.pri)
            include(utils/utils.pri)
            include(audio/audio.pri)
            include(hardware/hardware.pri)
            include(storage/storage.pri)
            
            
            DEFINES *= $${COMMON_DEFINES}
            
            include($${TOP_SRCDIR}/thirdparty/thirdparty.pri)
            include($${TOP_SRCDIR}/thirdparty/link_to_pulse.pri)
            include($${TOP_SRCDIR}/thirdparty/link_to_zip.pri)
            

            merci d'avance ;-)

            SGaistS 1 Reply Last reply
            0
            • Bozo The GeekB Bozo The Geek

              @SGaist Voici le fichier .pro de la partie backend de ce projet qu'habituellement je modifie quand j'ai besoin:

              TEMPLATE = lib
              
              QT += core qml quick sql xmlpatterns xml
              CONFIG += c++17 staticlib warn_on exceptions debug
              android: QT += androidextras
              
              !isEmpty(USE_SDL_GAMEPAD)|!isEmpty(USE_SDL_POWER): include($${TOP_SRCDIR}/thirdparty/link_to_sdl.pri)
              
              isEmpty(USE_SDL_GAMEPAD): QT += gamepad
              
              !isEmpty(NO_LEGACY_SDL): DEFINES *= WITHOUT_LEGACY_SDL
              
              !isEmpty(INSIDE_FLATPAK): DEFINES *= PEGASUS_INSIDE_FLATPAK
              msvc: DEFINES *= _USE_MATH_DEFINES
              
              DEFINES *= HAVE_CDROM
              
              SOURCES += \
                  Backend.cpp \
                  DownloadManager.cpp \
                  FrontendLayer.cpp \
                  GamepadAxisNavigation.cpp \
                  PegasusAssets.cpp \
                  ProcessLauncher.cpp \
                  ScriptRunner.cpp \
                  Paths.cpp \
                  AppSettings.cpp \
                  Log.cpp \
                  GamepadButtonNavigation.cpp \
                  RootFolders.cpp \
                  ScriptManager.cpp
              
              
              HEADERS += \
                  Backend.h \
                  CliArgs.h \
                  DownloadManager.h \
                  FrontendLayer.h \
                  GamepadAxisNavigation.h \
                  PegasusAssets.h \
                  ProcessLauncher.h \
                  ScriptRunner.h \
                  Paths.h \
                  AppSettings.h \
                  Log.h \
                  GamepadButtonNavigation.h \
                  RootFolders.h \
                  ScriptManager.h \
                  KeyEmitter.h
              
              include(imggen/imggen.pri)
              include(model/model.pri)
              include(parsers/parsers.pri)
              include(platform/platform.pri)
              include(providers/providers.pri)
              include(types/types.pri)
              include(utils/utils.pri)
              include(audio/audio.pri)
              include(hardware/hardware.pri)
              include(storage/storage.pri)
              
              
              DEFINES *= $${COMMON_DEFINES}
              
              include($${TOP_SRCDIR}/thirdparty/thirdparty.pri)
              include($${TOP_SRCDIR}/thirdparty/link_to_pulse.pri)
              include($${TOP_SRCDIR}/thirdparty/link_to_zip.pri)
              

              merci d'avance ;-)

              SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              @Bozo-The-Geek Est-ce que la variable QT est modifiée dans un des autres fichier ?

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              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