From kde-devel Sat Jun 29 19:42:16 2002 From: Stephen Allewell Date: Sat, 29 Jun 2002 19:42:16 +0000 To: kde-devel Subject: Problem with derived class function name the same as base class X-MARC-Message: https://marc.info/?l=kde-devel&m=102537973609642 I have a class 'Editor' that is derived from QScrollView. QScrollView has the function QPoint contentsToViewport(const QPoint &p) to convert content coordinates to viewport coordinates. I also require to convert a QRect so I wrote the function: QRect Editor::contentsToViewport(QRect &r) { return QRect(contentsToViewport(r.topLeft()),contentsToViewport(r.bottomRight())); } but when compiling I get the error that there is no matching function for contentsToViewport(QPoint &) unless I explicitly use QScrollView::contentsToViewport(...) which then compiles and works as intended. I thought that it was possible to have different functions with the same name as long as the parameters where different. Anyone have any idea why this doesn't work? Steve >> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<