Skip to content

Commit

Permalink
Merge pull request #2009 from zenustech/func-stamp
Browse files Browse the repository at this point in the history
[fix] size overflow when meet large number of rows, so adjust section…
  • Loading branch information
zhouhang95 authored Sep 29, 2024
2 parents 314b3a4 + 4c1ad70 commit e4ce443
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions ui/zenoedit/panel/zenospreadsheet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,21 @@ void ZenoSpreadsheet::setPrim(std::string primid) {
.arg(num_attrs)
.arg(num_uvs);
pStatusBar->setText(statusInfo);

//如果条目数过多(比如几千万级别),会导致qheaderview内部计算视图高度时溢出(整型数上限)
//这时候要缩小section size.
int adjust_sec_size = 42;
if (num_vert > 10000000) {
int maxVSize = 2000000000;
int secsz = maxVSize / num_vert;
if (secsz > 0) {
adjust_sec_size = secsz;
}
}

prim_attr_view->verticalHeader()->setMinimumSectionSize(adjust_sec_size);
prim_attr_view->verticalHeader()->setDefaultSectionSize(adjust_sec_size);

this->dataModel->setModelData(obj);
}
}
Expand Down

0 comments on commit e4ce443

Please sign in to comment.