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. deriving abstract classes from qt concrete classes
Forum Updated to NodeBB v4.3 + New Features

deriving abstract classes from qt concrete classes

Scheduled Pinned Locked Moved Unsolved General and Desktop
7 Posts 3 Posters 596 Views 3 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.
  • U Offline
    U Offline
    user4592357
    wrote on 13 Aug 2019, 18:36 last edited by
    #1

    i need to define interfaces for the application. these interfaces must work with widgets such as tree view, table view, etc. i wanna know how logical it is to derive classes from qt concrete classes (e.g. QTreeView) and make that class abstract?

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 13 Aug 2019, 18:41 last edited by
      #2

      Hi,

      What exact interface do you want to add ?
      Can you explain the context for creating such an abstract class ?

      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
      2
      • M Offline
        M Offline
        mrjj
        Lifetime Qt Champion
        wrote on 13 Aug 2019, 18:42 last edited by mrjj
        #3

        Hi
        I think you have to explain in more detail the requirements as
        QTreeView already derive from the abstract class
        QAbstractItemView
        https://doc.qt.io/qt-5/qabstractitemview.html
        So it would seem odd to abstract the concrete class implementation. (imo) :)

        update: too slow ;)

        1 Reply Last reply
        2
        • U Offline
          U Offline
          user4592357
          wrote on 13 Aug 2019, 18:45 last edited by
          #4

          i need, for example, a populate() method which will populate the top level of the tree.

          1 Reply Last reply
          0
          • S Offline
            S Offline
            SGaist
            Lifetime Qt Champion
            wrote on 13 Aug 2019, 18:50 last edited by
            #5

            Then the question is: is it a class that you will provide through a library ?

            In any case, nothing stops you from creating an abstract subclass with that method as pure virtual.

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

            U 1 Reply Last reply 13 Aug 2019, 18:58
            0
            • S SGaist
              13 Aug 2019, 18:50

              Then the question is: is it a class that you will provide through a library ?

              In any case, nothing stops you from creating an abstract subclass with that method as pure virtual.

              U Offline
              U Offline
              user4592357
              wrote on 13 Aug 2019, 18:58 last edited by
              #6

              @sgaist
              yeah it is going to be some kind of library, and that's why i need to make the abstractions...

              1 Reply Last reply
              0
              • S Offline
                S Offline
                SGaist
                Lifetime Qt Champion
                wrote on 13 Aug 2019, 19:06 last edited by
                #7

                Then, as the logo says: Just do it :-)

                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
                2

                2/7

                13 Aug 2019, 18:41

                topic:navigator.unread, 5
                • Login

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