PDA

View Full Version : What will happen if re-implementing non-virtual functions?



nifei
17th February 2009, 03:33
for example if i re-implement
QPushButton: : setText(const QString &) in subclass of QPushButton like this, what will happen?


void MyPushButton::setText(const QString &text)
{
QPushButton::setText(text);
//do sth. i would like
{
.....
}
}

talk2amulya
17th February 2009, 03:37
go ahead and do whatever u want..QT is C++ after all....

nifei
17th February 2009, 04:16
I'm also new in c++. Thank you!

aamer4yu
17th February 2009, 04:23
Read about function overloading and overriding in classes in c++ , you will get your answer