Results 1 to 6 of 6

Thread: Read values from text file after clicking a button

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Dec 2011
    Location
    Bangalore,India
    Posts
    38
    Thanks
    14
    Qt products
    Qt4
    Platforms
    Windows

    Smile Read values from text file after clicking a button

    Hi frns,
    The below code is for reading values from text files and display it in the text box and i get some errors in the below code . kindly please help me out.. thanks in advance..

    void MainWindow::slotTimer()
    {
    QFile file("Heartrate.txt");
    if (!file.open(QIODevice::ReadOnly | QIODevice::Text))
    return;

    QTextStream in(&file);
    while (!in.atEnd())
    {
    QString line = in.readLine();
    TEhr(line);// displays the value of heartrate in Textbox
    }

    }

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Read values from text file after clicking a button

    You will have to tell us what the error messages are or we will be guessing all night.

  3. #3
    Join Date
    Dec 2011
    Location
    Bangalore,India
    Posts
    38
    Thanks
    14
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Read values from text file after clicking a button

    Hi,
    Thanks,the error is that the variable TEhr is a textedit box and it show that it accepts only one parameter...i the last line..

Similar Threads

  1. How to read the text of a pdf file?
    By Momergil in forum Newbie
    Replies: 4
    Last Post: 22nd January 2016, 10:45
  2. Read Text file using structure..
    By umulingu in forum Qt Programming
    Replies: 7
    Last Post: 14th September 2009, 11:22
  3. How to read line number in a text file
    By grsandeep85 in forum Qt Programming
    Replies: 7
    Last Post: 31st July 2009, 09:09
  4. Continuous read of text from an input file
    By ttvo in forum Qt Programming
    Replies: 1
    Last Post: 2nd June 2009, 00:09
  5. How to read text only as it is from file
    By thomasjoy in forum Qt Programming
    Replies: 3
    Last Post: 9th August 2007, 08:47

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.