Hi, I don't understand why this don't compile; any suggests?
Code:
#include <qlabel.h> //mylabel.h public: //~myLabel(): };
Printable View
Hi, I don't understand why this don't compile; any suggests?
Code:
#include <qlabel.h> //mylabel.h public: //~myLabel(): };
The way you call the constructor doesn't match any QLabel's constructor.
http://doc.trolltech.com/4.1/qlabel.html
If you are creating classes with KDevelop 3.3 be carefull that it creates Qt classes in a way not suited fot Qt4.
Could you post the exact error message?
Code:
mylabel.cpp(3): error C2511: 'myLabel::myLabel(QWidget *,const char *)' : overloaded member function not found in 'myLabel' mylabel.cpp(7): fatal error C1004: unexpected end of file found mylabel.h(8): error C2226: syntax error : unexpected type 'QWidget' mylabel.h(8): error C2238: unexpected token(s) preceding ';' mylabel.h(8): error C3209: 'name' : Unicode identifiers are not yet supported mylabel.h(8): error C3209: 'parent' : Unicode identifiers are not yet supported
In what encoding did you save that file?Quote:
Originally Posted by mickey
in the same way I saved the others, with .NET2003; what's happen?
Does this file look normal when you open it in notepad?Quote:
Originally Posted by mickey
yes, they appear like text files; I tried to delete the file and create new files; but don't change.....After I've subclassed QPopupmenu and it don't get any problems....
I haven't change nothing and the errors changed so:
If I take out costructor class in .ccp (taking <include>) it compile and link!Code:
mylabel.cpp(2): error C2062: type 'char' unexpected mylabel.cpp(2): error C2065: 'parent' : undeclared identifier mylabel.cpp(2): error C2065: 'QWidget' : undeclared identifier mylabel.cpp(2): error C2653: 'myLabel' : is not a class or namespace name mylabel.cpp(3): error C2065: 'name' : undeclared identifier mylabel.cpp(3): error C2448: 'QLabel' : function-style initializer appears to be a function definition mylabel.cpp(3): error C3861: 'parent': identifier not found, even with argument-dependent lookup
Should the compiler get me an error without costructor???
I don't understand what was happen; but I founded in .h 'cosnt' instead const!!
Before I cuted and pasted but I see that in the first post const is true; this below works and it seems thae same of the first post;
:confused:
When you do the following
you take the parameters from specified in your myLabel constructor and try to call the original QLabel's constructor with those parameters. But in fact none of QLabel's constructors accept both QWidget and const char*. You are trying to call this constructor
but it has