You are not logged in.

Dear visitor, welcome to QtForum.org. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

1

Thursday, October 9th 2014, 9:46pm

How to get a string insert thru a QLineEdit and put it into a char variable???

I'm new into C++ programming and QT Creator. I'm trying to get a string insert thru a QLineEdit and put it into a char variable and then I'll print a file with some other stuff.

The thing is, I already can print a file, but I can't get the string from a QLineEdit and put it into a char variable.

Do I have to declare my variable with some other kind or the way I'm trying to get the string is wrong.

This is the part that I'm trying to get the string:

char id[40];

QLineEdit inID = id->text();

And this is the error the keeps appearing:

"request for member 'text' in '*(char*)(& id)', which is of non-class type 'char'"

Any help I appreciate...