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. using shiboken to wrap non-QObject classes

using shiboken to wrap non-QObject classes

Scheduled Pinned Locked Moved Unsolved Language Bindings
shiboken
4 Posts 2 Posters 1.7k 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.
  • P Offline
    P Offline
    phtaylor
    wrote on last edited by
    #1

    hi, I'm just looking into Shiboken and have a question.
    From reading the history of shiboken, I had thought that it could be used to wrap any C++ classes for Python, even those not derived from QObject.

    I realize that to support signals, a class must derive from QObject, but in the case of simple math types, is this still necessary?
    Can I wrap simple class hierarchies and eliminate the dependency on Qt? (hypothetical question).

    Thanks
    Phil

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

      Hi and welcome to devnet,

      I haven't used shiboken yet but is it that what that question answers ?

      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
      • P Offline
        P Offline
        phtaylor
        wrote on last edited by phtaylor
        #3

        Hi SGaist, Thanks!.
        Yes, that does answer my question, and in fact I had been skimming through the docs and read those parts already.

        The source of my confusion came from reading this tutorial

        http://wiki.qt.io/PySide_Binding_Generation_Tutorial:_Module_1_Creating_the_foo_library

        In the example, Math inherits from QObject which didn't seem necessary based on the docs. It could be a simple C++ class with no ancestors. So I thought that maybe in the end there was some dependency on Qt and decided to double-check.

        class Math : public QObject
        

        There is another tutorial on your website that also covers Shiboken, and I can clearly see that FooClass is not derived from QObject, which confirms your answer.
        https://wiki.qt.io/PySide_Shiboken_Tutorial

        class FOOLIBSHARED_EXPORT FooClass
        

        I hadn't downloaded the source code for that tutorial till now.
        Thanks for the quick answer.

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

          You're welcome !

          Since everything is ok, please mark the thread as solved using the "Topic Tool" button so other forum users may know a solution has been found :)

          Also, while browsing the forum, consider up-voting answers that helped you. That will make them easier to find for other people :)

          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