Why is that a problem that the framework calls rowCount() of every top-level item? Do you get noticable slowdowns because of that? The only "solution" I can see is to file a bug.
Why is that a problem that the framework calls rowCount() of every top-level item? Do you get noticable slowdowns because of that? The only "solution" I can see is to file a bug.
yes, There is a delay in populating data (I have populated 30 million rows with column count > 10).
One more problem:
And rowCount() is calling for all top level items when I emit headerDataChanged() signal which leads to further delay in selecting item & changing header.
Item is not getting selected until header data changes. there is a considerable delay in changing header data after that only item is getting selected.
my post related to this issue : http://www.qtcentre.org/threads/6307...ure?highlight=
Thanks :-)
Maybe you can populate the model in batches? I think you could use canFetchMore() && fetchMore() for the invalid model index.
One more problem:
Think how to avoid changing the header too often. You can always show a custom header instead of the default one.And rowCount() is calling for all top level items when I emit headerDataChanged() signal which leads to further delay in selecting item & changing header.
Sorry I could not get you properly.
You mean populating model with half data.
Actually I have more than 100 million of rows (would be more also) because of this BUG (https://bugreports.qt.io/browse/QTBUG-28631), I went for pages (I will have combo box top of the view with 0 - totalRows/30 million ranges), so each time I chose a number I am building a tree of respective range and showing that tree so that I am showing 30 million of rows at a time in view, but this is also causing performance problems.
with fetchMore() & canFetchMore() i will have scroll bar problem I think, when I come to end of the scroll then only I would come to know there is more elements and then I will load the data and then the scroll bar will adjust according to that, I don't want this behavior scroll bar size should be decide at first instance only(This is the reason I am not using fetchMore functionality in my app).
You mean, you want me to customize the header also ?One more problem:
Think how to avoid changing the header too often. You can always show a custom header instead of the default one.
Can you be more verbose for the above 2 statements :-)
Thanks :-)
I mean populate as much as is currently useful for you. If the user scrolls down, populate more, etc.
You are out of luck thenwith fetchMore() & canFetchMore() i will have scroll bar problem I think, when I come to end of the scroll then only I would come to know there is more elements and then I will load the data and then the scroll bar will adjust according to that, I don't want this behavior scroll bar size should be decide at first instance only(This is the reason I am not using fetchMore functionality in my app).You can file a bug or provide a patch for the (IMO incorrect) behaviour.
You can hide the original header and replace it with your own instance of QHeaderView that is not tied to the model as I understand you want your header to reflect the current view state rather than the model's data.You mean, you want me to customize the header also ?
Can you be more verbose for the above 2 statements :-)
I report a bug in Qt bug tracker for this.
I want my header to be changed depends on the row I clicked (for ex: if I click on a even row (index.row()%2 == 0 ) I put one header set & for odd row I put another header set).
in this case how a customized header can help me ?
And I could not see any function for setting data (if I customize QHeaderView) rather than QHeaderView::setRootIndex(QModelIndex);
Thanks.
Last edited by prasad_N; 15th July 2015 at 19:39.
Thanks :-)
The header takes its data from headerData() method of the model. Simply provide a custom model for it. It can even be empty just make it return whatever you need from headerData().
prasad_N (16th July 2015)
Bookmarks