[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    Problem with derived class function name the same as base class
From:       Stephen Allewell <stephen () mirramar ! fsnet ! co ! uk>
Date:       2002-06-29 19:42:16
[Download RAW message or body]

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 <<
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic