Reputation: 4480
I am using a QtLine Edit and setting some text to it using lineEdit->settext("Test"). This works fine but when i set data from my Structure and convert it from Wide Char array it does not set it.
lineEdit->setText(QString::fromWCharArray(pUserInfo.LastName,MAX_NAME_SIZE));
pUserInfo is a structure Last Name is of Type wchar_t ,LastName[MAX_NAME_SIZE];
I resolved it using
QString::fromWCharArray(pUserInfo.FirstName,wcslen(pUserInfo.FirstName));
Any help is appreciated. Thanks.
Upvotes: 0
Views: 1074
Reputation: 4480
I resolved it using
QString::fromWCharArray(pUserInfo.FirstName,wcslen(pUserInfo.FirstName));
Upvotes: 1