Re: Problem: Undefined reference
If I understand correctly, TestCls is your own class, that you created yourself, and are trying to use it in a Qt-designer created form. Undefined reference is usually a linker error, when the linker can't find the object code, or the actual implementation (definition) of classes, methods, functions, etc... (or something like that, not completely sure).
So I am guessing you have TestCls.h and TestCls.cpp. In your TestCls you declare your classes and functions, and in the .cpp file you define them. Make sure you actually implement everything declared in your TestCls.h file in your TestCls.cpp file. Then also make sure that in your project file, TestCls.h is listed under HEADERS, and TestCls.cpp is listed under SOURCES. Then try a make clean, qmake, make.
If this doesn't work, please provide more information, such as your .pro file, and what platform you are using and how you are building this, and more details how files are orginised.
Bojan
The march of progress:
C:
printf("%10.2f", x);
C++:
cout << setw(10) << setprecision(2) << showpoint << x;
Java:
java.text.NumberFormat formatter = java.text.NumberFormat.getNumberInstance();
formatter.setMinimumFractionDigits(2);
formatter.setMaximumFractionDigits(2);
String s = formatter.format(x);
for (int i = s.length(); i < 10; i++) System.out.print(' ');
System.out.print(s);
Bookmarks