PDA

View Full Version : How to display a QChar* object using a QLineEdit object



ashken
30th July 2010, 23:34
Hi i have filled a QChar* object with some values and i need to display them using QLineEdit object.Is there a way i can do that?.I have tried QLineEdit::setText() but it only takes a const QString object.any way around this will be highly appreciated.
here is a some code to what am trying to do


QChar* geti;

QChar* idata = ime->text().data();

geti[0] = idata[0];
geti[1] = idata[3];
geti[2] = idata[5];
geti[3] = idata[7];

displ->setText(geti);

GreenScape
31st July 2010, 00:05
QChar* idata = ime->text().data();
QString str;
while(idata)
{
str.append(*idata);
++idata;
}
displ->setText(str);

but better would be



displ->setText(ime->text());