QTDataVisualization only draw certain rows/cols of the QAbstractTableModel
-
Hello, I am trying to visualize a table model using QTDatavisualization. I used existing example files and here is the code:
m_Proxy = new QSurfaceDataProxy(); m_Series = new QSurface3DSeries(m_Proxy); QItemModelSurfaceDataProxy *proxy = new QItemModelSurfaceDataProxy(model); proxy->setUseModelCategories(true); m_Series = new QSurface3DSeries(proxy); m_Series->setDrawMode(QSurface3DSeries::DrawSurfaceAndWireframe); m_graph->addSeries(m_sqrtSinSeries);
where model is QAbstractTableModel
This plots all the rows/cols interactively.
Question is: how can I make it only plot certain range of rows/cols from model? I know that I can set range for max/min in axis but that's not what I am looking for, I want to for instance remove first row and column data when plotting the graph, while the table should show those.
Thank you for your help.
-
Hi,
What comes to mind is to put a proxy model between your original model and the QItemModelSurfaceDataProxy. That proxy would only return the data that you want to be shown.