Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Special Interest Groups
  3. C++ Gurus
  4. abstract class

abstract class

Scheduled Pinned Locked Moved Solved C++ Gurus
3 Posts 2 Posters 924 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.
  • W Offline
    W Offline
    Weichao Wang
    wrote on last edited by
    #1

    Dear all,
    Is the following design correct (method2 is defined already in the abstract class which calls the virtual method1 which will be defined in a derived concrete class)?
    class AbsClass {
    virtual void method1() = 0;
    void method2();
    };
    void AbsClass::method2() {
    ......
    method1();
    ......
    }
    Weichao

    jsulmJ 1 Reply Last reply
    0
    • W Weichao Wang

      Dear all,
      Is the following design correct (method2 is defined already in the abstract class which calls the virtual method1 which will be defined in a derived concrete class)?
      class AbsClass {
      virtual void method1() = 0;
      void method2();
      };
      void AbsClass::method2() {
      ......
      method1();
      ......
      }
      Weichao

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @Weichao-Wang said in abstract class:

      Is the following design correct

      Yes, it is.
      You can very easy check that...

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      W 1 Reply Last reply
      1
      • jsulmJ jsulm

        @Weichao-Wang said in abstract class:

        Is the following design correct

        Yes, it is.
        You can very easy check that...

        W Offline
        W Offline
        Weichao Wang
        wrote on last edited by
        #3

        @jsulm
        Thank you! I'm going to use this mothode. The code would be a little extensive and I want to avoid the situation that it turns out to be not workable.

        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