Hello QT Experts 
I have searched and searched and searched, I know you hear that from everyone. Please just point me in the right direction and I will leave you alone
I have form, it has a textEdit on it labeled textEdit, among other things such as a couple of spin boxes and a lineEdit as well. The user can enter text into the lineEdit box and change the values of the spinbox and click a push button, when clicked it displays the values into textEdit. At the same time it will create a file in c:\ and write "You did something" into the file.
What I can't find is how to take the values of ANY of those form elements such as textEdit and write that value to the file. I know how to write to file I know how to write the value to the textEdit I just can't seem to find an example of how to one into the other.
I have a header file called mywrite.h it has all my void write () in it that create the file and write the information to file. Within this file I have the following:
{
qDebug() << "could not open file";
return;
}
stream >> ui->textEdit->text();
}
void Write2(QString Filename2){
QFile mfile2(Filename2);
if (!mfile2.open(QIODevice::WriteOnly | QIODevice::Text))
{
qDebug() << "could not open file";
return;
}
QTextStream stream(&mfile2);
stream >> ui->textEdit->text();
}
To copy to clipboard, switch view to plain text mode
Instead of the word stream I have tried "out" and that doesn't make any difference I get the following three errors:
C:\QTDEVDAY\1262012\MyFirstApp\myqtapp.cpp:72: error: C2065: 'ui' : undeclared identifier
C:\QTDEVDAY\1262012\MyFirstApp\myqtapp.cpp:72: error: C2227: left of '->textEdit' must point to class/struct/union/generic type
type is ''unknown-type''
C:\QTDEVDAY\1262012\MyFirstApp\myqtapp.cpp:72: error: C2227: left of '->text' must point to class/struct/union/generic type
I am sure it is something simple, like needing a signal/slot of some sort or something, or just a simple syntax change, I just don't know what that would be and can't seem to find an example.
If you can just simple past a link to an exact example of how to write the ui lineEdit or textEdit to a file that would be great, that is all I really want to do. This is a test example for me, I have a form with 20 lineEdits on it that I want to write to a file when button is pushed, that is really all I need to do.
thank you for your help in advance!!
Doc
Bookmarks