Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Language Bindings
  4. Shiboken - Building bindings with headers in subfolders

Shiboken - Building bindings with headers in subfolders

Scheduled Pinned Locked Moved Solved Language Bindings
8 Posts 5 Posters 1.4k Views
  • 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.
  • S Offline
    S Offline
    snkaupe
    wrote on 3 Apr 2019, 14:17 last edited by snkaupe 4 Mar 2019, 14:21
    #1

    Greetings!

    I'm currently building bindings to a Qt-based library, but I'm running into a problem when it comes to headers being placed in subfolders (but still sharing a single namespace). An example:

    The library I'm wrapping contains a number of header files, many of those being placed in subfolders. Take the following wrappedclasses.h, which is used to feed header files to the Shiboken2 generator:

    #ifndef WRAPPEDCLASSES_H
    #define WRAPPEDCLASSES_H
    
    #include <../model/file.h>
    #include <../model/disk.h>
    #include <../model/filesystem.h>
    
    #endif // WRAPPEDCLASSES_H
    

    As you can see, all headers are in the model directory, which is the base directory for the library (and added to the INCLUDEPATH of my binding's qmake file). Building a binding using these classes works without problems.

    However, when I add a header file from a subfolder, things get messy. Let's add the point.h file from the common subfolder:

    #ifndef WRAPPEDCLASSES_H
    #define WRAPPEDCLASSES_H
    
    #include <../model/file.h>
    #include <../model/disk.h>
    #include <../model/filesystem.h>
    #include <../model/common/point.h>
    
    #endif // WRAPPEDCLASSES_H
    

    Now, when I try to build my binding library, the compilation process is aborted because the compiler cannot find point.h. As it turns out, the wrapper files created by Shiboken2 reference the header file simply as point.h instead of common/point.h, which results in the file not being found:

    // bje_model_point_wrapper.h, generated by shiboken
    #ifndef SBK_BJE_MODEL_POINT_H
    #define SBK_BJE_MODEL_POINT_H
    
    #define protected public
    
    #include <point.h> // <-- this should be common/point.h
    
    #endif // SBK_BJE_MODEL_POINT_H
    

    The project builds when I modify the include paths in the generated files to include the subfolder (as in, replace point.h with common/point.h), but this is not an option due to the number of files being involved.

    Is this a known problem with an already existing solution?

    1 Reply Last reply
    0
    • S Offline
      S Offline
      sierdzio
      Moderators
      wrote on 3 Apr 2019, 19:16 last edited by
      #2

      This looks like something shiboken people should look into, not Qt.

      (Z(:^

      J 1 Reply Last reply 4 Apr 2019, 11:43
      0
      • S Offline
        S Offline
        snkaupe
        wrote on 4 Apr 2019, 08:24 last edited by snkaupe 4 Apr 2019, 08:25
        #3

        Thanks, I'll be trying to contact the devs directly using IRC or whatever else they offer.
        (Do they not use the official Qt forums, even though it's a Qt project and there's a dedicated section for PySide2 here?)

        1 Reply Last reply
        0
        • C Offline
          C Offline
          CristianMaureira
          wrote on 4 Apr 2019, 08:47 last edited by
          #4

          Just a couple of things if someone end up here:

          • This seems to be a bug in shiboken2 https://bugreports.qt.io/browse/PYSIDE-975
          • Visiting #qt-pyside on IRC is faster to reach the devs.

          PS: Shiboken people is Qt people, the thing is that most of the people in the forums is not really experience with shiboken nor pyside, that's why IRC is better ;)

          1 Reply Last reply
          3
          • S sierdzio
            3 Apr 2019, 19:16

            This looks like something shiboken people should look into, not Qt.

            J Online
            J Online
            JKSH
            Moderators
            wrote on 4 Apr 2019, 11:43 last edited by
            #5

            @sierdzio said in Shiboken - Building bindings with headers in subfolders:

            This looks like something shiboken people should look into, not Qt.

            To expand on @CristianMaureira's comment that "Shiboken people is Qt people": https://blog.qt.io/blog/2018/05/24/qt-for-python-under-the-hood/

            Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

            1 Reply Last reply
            2
            • S Offline
              S Offline
              sierdzio
              Moderators
              wrote on 4 Apr 2019, 11:50 last edited by
              #6

              Cool, I had no idea, thanks for info.

              (Z(:^

              1 Reply Last reply
              0
              • S Offline
                S Offline
                snkaupe
                wrote on 4 Apr 2019, 12:22 last edited by
                #7

                I've contacted the devs using their Gitter and they've been quite helpful. In fact, there's a patch now fixing this problem. Thanks for the help!

                1 Reply Last reply
                0
                • S Offline
                  S Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on 4 Apr 2019, 21:01 last edited by
                  #8

                  Hi,

                  Thanks for the feedback ! Can you post the link to said patch ?

                  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
                  1

                  6/8

                  4 Apr 2019, 11:50

                  • Login

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