Urgent pleeease - paging in a qtablewidget [SOLVED]
-
Hi,
I need to load a huge log file in my project, suppose 10^6 rows.
If I don't use paging it gets too slow.
So I must use paging, every page about 10^3 - 10^4 rows.How can I do it with QTableWidget?
(In c# there is no problem with the datagridview - it has a property for enabling paging)
I've googled but didn't found anything about it.Please help.
Thank you very much -
I think you'll need to use MVC and QTableView. This will not be easy, though.
-
I concur with sierdzio, you're gonna need to subclass "QAbstractTableModel":http://qt-project.org/doc/qt-4.8/qabstracttablemodel.html and re-implement the "fetchMore":http://qt-project.org/doc/qt-4.8/qabstractitemmodel.html#fetchMore and "canFetchMore":http://qt-project.org/doc/qt-4.8/qabstractitemmodel.html#canFetchMore methods to get the data from the file in manageable chunks as the user navigates to it (from a "QTableView":http://qt-project.org/doc/qt-4.8/qtableview.html rather than QTableWidget).
-
I don't have any idea what you mean - what's MVC, and how it can help with QTableView?
Any code sample of adding 100 records and splitting it in real time into 10 pages for example?Isn't there anyone who encountered this need ever so he could supply a little more detailed way with code?
Thank you very much though for the idea.
-
Ok, MVC stands for "Model View Controller":http://en.wikipedia.org/wiki/Model–view–controller, google would have answered that question for you (faster than posting here) as its a core design principle.
Yes, many people have encountered this issue and thats why you were directed to the MVC solution, Qt is very good at this and there are many examples (all of which contain code) included with the framework. A good place to start would be to read "this":http://qt-project.org/doc/qt-4.8/model-view-programming.html primer and look at examples referenced at the bottom.