Results 1 to 2 of 2

Thread: How do I read a line from a .txt or .csv file in qml

  1. #1
    Join Date
    Sep 2011
    Location
    Bangalore
    Posts
    254
    Thanks
    92
    Thanked 16 Times in 16 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Windows

    Default How do I read a line from a .txt or .csv file in qml

    I need to display a string on a simulation screen. For that I'm supposed to read the text from an existing Filename.txt/Filename.csv file.

    Qt Code:
    1. MarqueeText {
    2. id:scrolltext
    3. width: 255
    4. height: 48
    5. anchors.verticalCenter: parent.horizontalCenter
    6. text: //i need to display the string in text file here
    7. }
    To copy to clipboard, switch view to plain text mode 

    Please help me with this. Thank you

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: How do I read a line from a .txt or .csv file in qml

    QtQuick doesn't allow you to read from files directly. You need to implement that in C++ and then transfer the result to your QtQuick runtime.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. The following user says thank you to wysota for this useful post:

    rawfool (23rd January 2012)

Similar Threads

  1. Replies: 8
    Last Post: 8th May 2012, 09:39
  2. Read gzip file line-by-line
    By The_Fallen in forum Qt Programming
    Replies: 4
    Last Post: 6th September 2011, 13:41
  3. Read a specific line from a file
    By rleojoseph in forum Qt Programming
    Replies: 11
    Last Post: 21st March 2011, 11:58
  4. How to read line number in a text file
    By grsandeep85 in forum Qt Programming
    Replies: 7
    Last Post: 31st July 2009, 09:09
  5. How to read line from file
    By Krishnacins in forum Newbie
    Replies: 10
    Last Post: 1st June 2006, 23:14

Tags for this Thread

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.