Trolltech Home | Qtopia-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 1

Qtopia-interest Archive, November 2006
Dynamically changing the text of lable


Message 1 in thread

Hi Freinds,
Using designer i created a widget and in that i created a lable.NAME as text
and with name as NAME_LBL.
It is there in ABC.h (which is created by ABC.ui)
In ABC class it is there as
QLabel*  NAME_LBL;
And in ABC.cpp it is implemented as

NAME_LBL = new QLabel( this, "NAME_LBL" );
NAME_LBL->setText( tr( "NAME" ) );

I then inherited the ABC class in my implementation file as
class XYZ:public ABC

So now in this implementation file
In one of the function i wanted to change the name of the Lable to WXY.
I tryed as

XYZ mppt     //Class object declaration in global

 mppt .NAME_LBL->setText( "WXY" );

But when i compile this it is not compiling and it is giving as forward
declaration error.....

But this is the usual C++ approach no? Acceesing using class object.

Am i doing any thing wrong?
I wanted to change the lables dynamically in run time .that is the reason i
am trying this basic one.
Kindly suggest me if i am doing anything wrong.

Thanks in advance

Regards,
Harsha