Results 1 to 3 of 3

Thread: Subclass

  1. #1
    Join Date
    Jan 2007
    Posts
    326
    Thanks
    42
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X

    Default Subclass

    Hi all

    I am new to Qt3.1(Linux OS). Can anybody Explain How to use the Subclass with an Example.


    Thanx
    Merry

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Subclass

    This has nothing to do with Qt.
    Here is a link to a good C++ book: http://www.mindview.net/Books/TICPP/...ngInCPP2e.html

    and a simple example:
    Qt Code:
    1. class A {
    2. public:
    3. virtual void methodA(){ std::cout << "Method A::A" << std::endl; }
    4. };
    5. class B : public class A {
    6. public:
    7. void methodA(){ std::cout << "Method B::A" << std::endl; }
    8. };
    To copy to clipboard, switch view to plain text mode 

    B is a subclass of A and reimplements a virtual method "methodA".

    BTW. This is related to this thread.

  3. #3
    Join Date
    Jan 2007
    Posts
    326
    Thanks
    42
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X

    Default Re: Subclass

    Yaa after sending you the new thread I Viewed that solution .

    Thanx
    Merry

Similar Threads

  1. QAbstractSpinBox Subclass exhibits wierd behavour
    By sunil.thaha in forum Qt Programming
    Replies: 6
    Last Post: 22nd February 2007, 12:30
  2. Replies: 1
    Last Post: 2nd February 2007, 08:42
  3. problem of subclass QTableItem
    By hesummar in forum Qt Programming
    Replies: 1
    Last Post: 4th November 2006, 09:41
  4. QT4: Sorting in QTreeWidget (subclass)
    By Michiel in forum Qt Programming
    Replies: 21
    Last Post: 29th March 2006, 18:08
  5. QFrame subclass does not reparent
    By high_flyer in forum Qt Programming
    Replies: 2
    Last Post: 21st March 2006, 22:15

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.