I am trying to put several lines in a file. But want to insert end of line after every message. I have tried endl and \n but it doesnot work
the code is as
void steg::imagefileopen()
{
QString datafilename
=ui.
datalineEdit->text
();
QString s
= QFileDialog::getOpenFileName(this,
"Choose a IMAGE file to open",
"image_bank",
"All Files (*.*)");
ui.imagelineEdit->insert(s);
QString yes
="THE DATA FILE CAN BE HIDDEN IN THE SELECTED IMAGE FILE ";
QString no
="THE DATA FILE IS TOO LARGE TO BE HIDDEN IN THE SELECTED " "IMAGE FILE.CHOOSE LARGER IMAGE FILE ELSE CHOOSE SMALLER DATA FILE";
QString u
= " The size of the image file is ";
v.setValue(info.size());
u.append(t);
u.append(y);
if ( (0.10* info.size())>=(info1.size()))
u.append(yes);
else
u.append (no);
size_file.setFileName("sizeofdatafile.html");
out << u;
size_file.close();
ui.textBrowser->clear();
myurl5
=QUrl::fromLocalFile( "sizeofdatafile.html" ) ;
ui.textBrowser->setSource(myurl5);
}
void steg::imagefileopen()
{
QString datafilename=ui.datalineEdit->text();
QFileInfo info1(datafilename);
QFileDialog* fd = new QFileDialog( this);
fd->setFileMode( QFileDialog::AnyFile );
QString s = QFileDialog::getOpenFileName(this,"Choose a IMAGE file to open","image_bank","All Files (*.*)");
ui.imagelineEdit->insert(s);
QFileInfo info(s);
QString yes="THE DATA FILE CAN BE HIDDEN IN THE SELECTED IMAGE FILE ";
QString no ="THE DATA FILE IS TOO LARGE TO BE HIDDEN IN THE SELECTED "
"IMAGE FILE.CHOOSE LARGER IMAGE FILE ELSE CHOOSE SMALLER DATA FILE";
QString u = " The size of the image file is ";
QVariant v;
v.setValue(info.size());
QString t = v.toString();
QString y = " bytes";
u.append(t);
u.append(y);
if ( (0.10* info.size())>=(info1.size()))
u.append(yes);
else
u.append (no);
QFile size_file;
size_file.setFileName("sizeofdatafile.html");
size_file.open(QIODevice::Append);
QTextStream out(&size_file);
out << u;
size_file.close();
ui.textBrowser->clear();
QUrl myurl5;
myurl5=QUrl::fromLocalFile( "sizeofdatafile.html" ) ;
ui.textBrowser->setSource(myurl5);
}
To copy to clipboard, switch view to plain text mode
am I missing something.
i know it should be easy
But somehow I am not ableto get it
Bookmarks