Navigation

    Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Search
    • Unsolved
    1. Home
    2. Tags
    3. read
    Log in to post

    • SOLVED How to parse such a complex json file
      General and Desktop • qt5 json read • • deleted286  

      10
      0
      Votes
      10
      Posts
      346
      Views

      @suslucoder The "Plan" array is a little unusual because the objects it contains are not all of the same structure. Usually, arrays should contain a sequence of elements of the same type. However, it is legal JSON. If you are certain that the first element of the "Plan" array will have the structure as in your example above, you can perhaps rely on the others to all have the 2nd type structure. Otherwise, you might need to check for the existence of certain keys -- for example, by using the function QJsonObject::contains() to determine which kind of object it is.
    • UNSOLVED Assign specific value to axis
      General and Desktop • charts read axis • • deleted286  

      2
      0
      Votes
      2
      Posts
      111
      Views

      @suslucoder said in Assign specific value to axis: I want to assign axis Y the 3rd column. How can i do it? The axis does not know anything about that file and columns inside it. You simply need to read your file and put data from that third column as data for Y axis. See https://doc.qt.io/qt-5/qxyseries.html If you read documentation https://doc.qt.io/qt-5/qxyseries.html#append you will see that you have to provide X AND Y...
    • UNSOLVED How can I add txt file datas in QLineSeries?
      General and Desktop • file chart read • • deleted286  

      2
      0
      Votes
      2
      Posts
      133
      Views

      @suslucoder As the error message tells you addSeries takes a QAbstractSeries, not a string list as parameter. You have to pass it one of the QAreaSeries, QBoxPlotSeries, QCandlestickSeries, QPieSeries, and QXYSeries. You also should tell us what data your file actually contains? If it contains x/y values then you first have to convert the data to numbers and create a QXYSeries instance and fill it with that data (https://doc.qt.io/qt-5/qxyseries.html#append).
    • UNSOLVED How can i add timer to my code?
      General and Desktop • chart read timer • • deleted286  

      2
      0
      Votes
      2
      Posts
      90
      Views

      Already asked and answered here: https://forum.qt.io/topic/122197
    • SOLVED QSerialPort - Cannot read more than 64 bytes - Windows - CP2102
      General and Desktop • qserialport read • • Guillaume Girardot  

      7
      0
      Votes
      7
      Posts
      369
      Views

      @hskoglund thanks for the help! I did not try your solution, but I guess it should work because the solution from @KroMignon works and you have the same diagnostic.
    • SOLVED Getting a specific text from a text file and inserting to a QStringList!
      General and Desktop • qt creator read value textfile • • Lasith  

      10
      0
      Votes
      10
      Posts
      2691
      Views

      @Lasith said in Getting a specific text from a text file and inserting to a QStringList!: I use Qt 5.2 That's not supported anymore. Is it feasible for you to upgrade to a newer version? (Qt 5.10.0 was released last week)
    • SOLVED Uploading an xml file to Qt app
      General and Desktop • file xml read upload • • Lasith  

      7
      0
      Votes
      7
      Posts
      1675
      Views

      @koahnig Thanx mate
    • UNSOLVED QSerialPort reading using QByteArray
      General and Desktop • qserialport qbytearray read • • michelson  

      3
      0
      Votes
      3
      Posts
      1920
      Views

      So does the QT appends '\0' terminator after every append? ( For QByteArray - No.
    • SOLVED Reading file byte by byte
      General and Desktop • read hex format • • jelicicm  

      9
      0
      Votes
      9
      Posts
      11768
      Views

      @SGaist You're right. Now it works. Thanks a lot!
    • Read textfile and display on QLabel [SOLVED]
      General and Desktop • c++ linux read textfile • • marlenet15  

      3
      0
      Votes
      3
      Posts
      10576
      Views

      Thank you!! I changed it to the following and it works!!!! QFile file("test.txt"); QLabel *testLabel= new QLabel; QString line; if (file.open(QIODevice::ReadOnly | QIODevice::Text)){ QTextStream stream(&file); while (!stream.atEnd()){ line.append(stream.readLine()+"\n"); } testLabel->setText(line); } file.close();
    • Problem with using QIODevice.read inherited by QSerialPort
      General and Desktop • serial port read qiodevice.read • • PabloF  

      11
      0
      Votes
      11
      Posts
      2944
      Views

      Thanks for your reply... I agree that may be my code is not the best practice, as i learn Qt by myself only with doc and tutorials... but the program was working perfectly when i delivered it to the researchers... In fact, is working perfectly if i compile it on windows... few hour ago i borrowed a windows machine, installed qt, compiled the same project and worked just fine... So i doubt is really a code problem, because it should appear in both Windows and Linux, as the code is exactly the same... I'm starting to think that is a linux driver problem, so i will try in another linux when i get the chance... If someone has ubuntu 15.04 and is kind enough to reproduce this problem and tell me i would be very happy! If anybody else reproduce this problem in other linux machine i will start a bug report
    • [Solved] How to read sysfs entries from qt and put it into qprogressbar?
      Mobile and Embedded • read qt 5.2.1 sysfs • • Ajith_P_V  

      6
      0
      Votes
      6
      Posts
      3450
      Views

      Nice to hear that it works now :-)
    • Arduino Serial Port Communications - Can't Open Arduino
      General and Desktop • serial port serialport read arduino write • • MagicalJourney  

      6
      0
      Votes
      6
      Posts
      3406
      Views

      Workaround: Start an application (QProcess) that pipes the serialport to a localhost socket.
    • Read website data from a custom port? (not 80 http)
      General and Desktop • http read data custom website port get • • Arty.McLabin  

      5
      0
      Votes
      5
      Posts
      2462
      Views

      @mcosta i am able to view the page inside the browser tho, why can't Qt read it then?
    • (SOLVED) Read everything after an specific keyword
      General and Desktop • qt4 qstring qfile file qt4.8 read • • jjan  

      16
      0
      Votes
      16
      Posts
      9152
      Views

      @jjan Just for an iteration the code reads line by line. As long as the search text is found, it will provide the remainder of the line. There is real dependency to the content as long as it is displayble (probably also some non-displayable characters). There are some special characters marking the end of lines (line feed (LF) and carriage return (CR) are those at least).
    • QDataStream read a structure
      General and Desktop • read qdatastream bytes big endian • • dridk2  

      2
      0
      Votes
      2
      Posts
      1804
      Views

      I am not sure I completely understand the problem since I do not see any structure in your read/write code. But normal way to deal with structures (the same as with classes) is to write/read every member separate in their natural form with provided by QDataStream functionality. And you certainly need to know type of the data written to the file to read it properly. Your problem (as far as I can understand) is related to using wrong function to read integer data, cause you read it as char data,