Results 1 to 3 of 3

Thread: How to make a very long [8000X1] dynamic table?

  1. #1
    Join Date
    Jul 2015
    Posts
    4
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default How to make a very long [8000X1] dynamic table?

    Hello People, please need some help again.
    I have a file.txt with 8000 Lines and try to copy each lines in a dynamic [8000X1] Table.
    The operation crashs because the number of rows is very long. A file with just 700 lines makes no problem.
    I need please some help .


    window.h
    QString *inputFileTableDATA;


    window.cpp
    QFile Fileout(file);
    if (!Fileout.open(QIODevice::ReadOnly|QIODevice::Text ))
    MessageBox::critical(this,"Problem","The file could not be found!");
    else
    {
    int LinetotaL=0;
    int NbrOfLine=8000;
    QTextStream File_lines(&Fileout);
    QString mylines = File_lines.readLine();

    inputFileTableDATA = new QString [NbrOfLine];
    while (!mylines.isNull())
    {
    mylines = File_lines.readLine();
    inputFileTableDATA[LinetotaL]=mylines; ___<-------------------------//simulation stops here
    LinetotaL++;
    }

    }

  2. #2
    Join Date
    Mar 2008
    Location
    Kraków, Poland
    Posts
    1,536
    Thanked 284 Times in 279 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to make a very long [8000X1] dynamic table?

    I think that file have more then 8000 lines and You are reading to the end of file not 8000 lines.
    Why You don't use some dynamic structure like QVector or QList ?

  3. #3
    Join Date
    Jul 2015
    Posts
    4
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: How to make a very long [8000X1] dynamic table?

    Okay.. thank you Lesiok,
    I dont really know how QVector/Qlist works , but i will try it tomorrow at the work .
    Than u

Similar Threads

  1. What is best way to print multiple pages long table?
    By squizzz in forum Qt Programming
    Replies: 2
    Last Post: 20th February 2012, 20:34
  2. dynamic table creaton
    By baluk in forum Newbie
    Replies: 10
    Last Post: 30th November 2010, 16:48
  3. [QTableWidget] clearing a big table takes so long!
    By punkypogo in forum Qt Programming
    Replies: 4
    Last Post: 5th August 2010, 13:52
  4. Long text inside a table cell
    By TheKing in forum Qwt
    Replies: 0
    Last Post: 15th December 2009, 20:35
  5. Dynamic updates to a table widget
    By guiGuy in forum Qt Programming
    Replies: 6
    Last Post: 1st June 2006, 20:24

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.