473,320 Members | 1,949 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

QT issues

Hi Guys,

I declared a QFile* and QTextStream* pointers in a class called
HistoricalInfo, then I instantiated them and the following function:
Expand|Select|Wrap|Line Numbers
  1. int HistoricalInfo::Load(const QString & strFilename)
  2. {
  3.  
  4. file = new QFile(strFilename);    //create new file, attached to a
  5. file name
  6.  
  7. reader = new QTextStream(file);    //point reader to the file
  8.  
  9. if (!file->open(IO_ReadOnly | IO_Translate))    //test that file
  10. is opens sucessfully
  11. {
  12. errno = ENOENT;        //exit if not opened correctly
  13. return 0;
  14. }
  15.  
  16. reader->setDevice(file); //set device
  17. ....
  18. }
Then, I call following function (HistricalData_Read()) ), which was
called by another function ...

Expand|Select|Wrap|Line Numbers
  1. void HistoricalInfo::HistoricData_Read()
  2. {
  3. QString line;
  4. while (!(line = reader->readLine()).isNull())    //read lines from
  5. the file until there is no more data
  6. {
  7. if (line.isEmpty())    //if line is empty then go to the next
  8. line
  9. continue;
  10. if(line == "*")        //if line is a star(delimiter) then ...
  11. {            //we have found a whole data set then break
  12. break;
  13. }
  14. if(!Extractinfo(line, recSpeed))  //we can parse the line
  15. printf("error occured while extracting historical data
  16. \n");    //or error out!
  17. }
  18. LoadHistoricalinfo();    //load segement data into a list
  19. }
  20.  
I keep getting a segmentation fault in the
Expand|Select|Wrap|Line Numbers
  1.  while (!(line =
  2. reader->readLine()).isNull()) ..line.
  3.  
Can anyone please help me ?
Aug 7 '08 #1
0 918

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Tom Loredo | last post by:
Hi folks- I'm about to move from a Solaris 8/SPARC environment to a Dell running RedHat 9. Are there any issues I need to be aware of in bringing my Python code over (mostly scientific...
28
by: grahamd | last post by:
Who are the appropriate people to report security problems to in respect of a module included with the Python distribution? I don't feel it appropriate to be reporting it on general mailing lists.
5
by: sandy | last post by:
Hi All, I am a newbie to MySQL and Python. At the first place, I would like to know what are the general performance issues (if any) of using MySQL with Python. By performance, I wanted to...
2
by: malcolm | last post by:
Hello, We have a robust (.NET 1.1 c# winforms) client-server application that utilizes many typed DataSets, typed DataTables and typed DataRows. Our application is a series of windows and popup...
1
by: Aliandro | last post by:
Hi Does any one know where I can find information regarding any issues with SQL and IIS being run under windows XP SP2? as I am in the process of programmning in Dot net and neet some way of...
7
by: David Laub | last post by:
I have stumbled across various Netscape issues, none of which appear to be solvable by tweaking the clientTarget or targetSchema properties. At this point, I'm not even interested in "solving"...
2
by: G2 | last post by:
Hi We are dealing with significant browser compatibility issues with Netscape 5.x+ browsers and Mac IE. I am sure most web developers have faced similar issues in the past. Can anyone give me their...
1
by: GaryDean | last post by:
We have been developing all of our .net applications on 32 bit windows using 32 bit SQL Server. We are being asked to now deploy to servers running 64bit windows and 64bit SQL Server. Are there...
3
by: eschneider | last post by:
Just some common issues with WS: Using custom objects: When objects change, seems you are always fixing some issue. Update references, which sometimes does not work. Deployment: Weird errors...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.