You are not logged in.

Dear visitor, welcome to QtForum.org. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

hpcpg

Beginner

  • "hpcpg" started this thread

Posts: 2

Location: Czech republic

  • Send private message

1

Tuesday, February 17th 2004, 12:21pm

Problems with inheritance

I've got a little problem. I don't know how can I rewrite a method form base class. I rewrote it, but it isn't called. Could you tell me what I'm doing wrong? Compilation was done without errors or warnings.
Thanx.
hpcpg has attached the following file:
  • main.cpp (1.22 kB - 165 times downloaded - latest: May 28th 2011, 1:24pm)
C is nothing more than a portable assembler.

e8johan

Professional

  • "e8johan" is male

Posts: 1,195

Location: Sweden

  • Send private message

2

Tuesday, February 17th 2004, 1:04pm

RE: Problems with inheritance

In order to override a method the declaration must be exactly the same. That is probably the reason to your problem. From a brief peak at your code the only such problem I can spot if that your event handling methods are not protected as in the class that you inherit. I do not know if this is the problem though.

Beo

Beginner

Posts: 44

Location: Austria

  • Send private message

3

Tuesday, February 17th 2004, 1:40pm

No the problem in your code is that you don't create the view widget with new.

write:
new View(this);

instead of:
View v(this);

The problem is that after the constructor your object does not exist anymore, and this is why it is not showed at all.
[QT] Beo