Results 1 to 3 of 3

Thread: How to understand 'Reimplemented' in qt document with 'override' 'overload' in c++

  1. #1
    Join Date
    Oct 2009
    Posts
    22
    Thanks
    8
    Thanked 4 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default How to understand 'Reimplemented' in qt document with 'override' 'overload' in c++

    When i read the qt document,i don't understand means of 'Reimplemented'.
    eg (QLabel Class Reference) :
    Reimplemented Protected Functionsvirtual
    void changeEvent ( QEvent * ev )
    ...

    what's means is there?overload or override?

    Sorry,my English is poor.
    I want to write a label's mouse-click event .eg,show some messages.

  2. #2
    Join Date
    Dec 2007
    Posts
    628
    Thanks
    3
    Thanked 89 Times in 87 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: How to understand 'Reimplemented' in qt document with 'override' 'overload' in c+

    Quote Originally Posted by rainspider View Post
    When i read the qt document,i don't understand means of 'Reimplemented'.
    eg (QLabel Class Reference) :
    Reimplemented Protected Functionsvirtual
    void changeEvent ( QEvent * ev )
    ...

    what's means is there?overload or override?

    Sorry,my English is poor.
    I want to write a label's mouse-click event .eg,show some messages.
    It means override

  3. The following user says thank you to yogeshgokul for this useful post:

    rainspider (5th December 2009)

  4. #3
    Join Date
    Aug 2009
    Location
    Greece, Chania
    Posts
    63
    Thanked 11 Times in 11 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60

    Default Re: How to understand 'Reimplemented' in qt document with 'override' 'overload' in c+

    It's all about virtual functions in C++. When you inherit from a class that has a virtual function you can reimplement it to suit the needs of the new class.
    That means when you call the method from an object of the derived class the reimplemented version will be called instead of that in the base class.
    It's different from overloading functions on how they get called and when they get resolved.
    Misha R.evolution - High level Debugging IDE

    Programming is about 2 basic principles: KISS and RTFM!!!

  5. The following user says thank you to Archimedes for this useful post:

    rainspider (5th December 2009)

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.