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. [closed] how to inherit QObject type class from template type class.??
Forum Updated to NodeBB v4.3 + New Features

[closed] how to inherit QObject type class from template type class.??

Scheduled Pinned Locked Moved General and Desktop
4 Posts 3 Posters 5.9k 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.
  • A Offline
    A Offline
    aekam
    wrote on last edited by
    #1

    Hello everyone,

    As a requirement, i need to inherit [derive] a class, which has signal-slot functionality [i.e inherited from QObject], from a template type class.
    when i wrote a code for this but compiler gave me an error.

    is this not possible.???

    If you take care of inches, you won't have to worry about miles... :)

    1 Reply Last reply
    0
    • K Offline
      K Offline
      koahnig
      wrote on last edited by
      #2

      You might be interested in "this thread":http://developer.qt.nokia.com/forums/viewthread/14058/
      It looks like you try to do the same thing.

      Vote the answer(s) that helped you to solve your issue(s)

      1 Reply Last reply
      0
      • A Offline
        A Offline
        aekam
        wrote on last edited by
        #3

        this is my older thread. :P

        hmmm, yeah the problem is same... i know the solution like to create a class [derived from QObject] and then to derive a template class from it.

        but my question is regarding the reverse situation. to derive a class from QObject and from template class.

        @
        // -- template class header file ----------------------------
        template <typename T>
        class templateClass
        {

        }

        // -- derived class header file ------------------------------
        #include <QObject>

        class derivedClass : public QObject, public templateClass
        {
        Q_OBJECT

        signals:
        someSignals

        public slots:
        someSlots
        }
        @

        Edit: please use @ tags around code sections; Andre

        If you take care of inches, you won't have to worry about miles... :)

        1 Reply Last reply
        0
        • A Offline
          A Offline
          andre
          wrote on last edited by
          #4

          I am closing this topic. You already have a topic on this question, and that topic clearly explains why this is not possible. Just opening another topic with the same question is not going to help you solve this. Continue the older topic if you have more questions left.

          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