Dear everyone!
the code is as follows;
struct txtsc
{
QString text1;
QColor fg,bg;
QFont Font;
}t12;
int dlgTextScroller:bOpen_clicked()
{
QString file=QFileDialog::getOpenFileName("/home/anurag/MCP/textscroller/","All Files (*)", this, "TextScroller Open File dialg","Select a file") ;
struct txtsc t;
leFileName->setText(file);
//read data
ifstream inf(file,ios::in|ios::binary);
if(!inf)
{
cout<<"Cann't Open read File";
return 1;
}
inf.read((char *)&t,sizeof(struct txtsc));
txtScrollEdit->setText(t.text1);
inf.close();
return 0;
}
it gives segmentation fault.
Bookmarks