@@ -446,7 +446,9 @@ void SARibbonCategoryLayout::doLayout()
446
446
int debug_i__ (0 );
447
447
qDebug () << " SARibbonCategoryLayout::doLayout(),name=" << category->categoryName ();
448
448
#endif
449
- for (SARibbonCategoryLayoutItem* item : qAsConst (d_ptr->mItemList )) {
449
+ const int itemsize = d_ptr->mItemList .size ();
450
+ for (int i = 0 ; i < itemsize; ++i) {
451
+ SARibbonCategoryLayoutItem* item = d_ptr->mItemList [ i ];
450
452
if (item->isEmpty ()) {
451
453
hideWidgets << item->widget ();
452
454
if (item->separatorWidget ) {
@@ -466,7 +468,12 @@ void SARibbonCategoryLayout::doLayout()
466
468
showWidgets << item->widget ();
467
469
if (item->separatorWidget ) {
468
470
item->separatorWidget ->setGeometry (item->mWillSetSeparatorGeometry );
469
- showWidgets << item->separatorWidget ;
471
+ if (i == itemsize - 1 ) {
472
+ // 最后一个pannel的分割线隐藏
473
+ hideWidgets << item->separatorWidget ;
474
+ } else {
475
+ showWidgets << item->separatorWidget ;
476
+ }
470
477
}
471
478
#if SARibbonCategoryLayout_DEBUG_PRINT
472
479
qDebug () << " |-[" << debug_i__ << " ]pannelName(" << item->toPannelWidget ()->pannelName ()
@@ -496,6 +503,7 @@ void SARibbonCategoryLayout::doLayout()
496
503
w->hide ();
497
504
}
498
505
}
506
+ // 最后一个分割线隐藏
499
507
}
500
508
501
509
/* *
@@ -658,8 +666,8 @@ void SARibbonCategoryLayout::scrollToByAnimate(int targetX)
658
666
return ; // 已经是目标位置
659
667
}
660
668
// 计算边界
661
- const int availableWidth = categoryContentSize ().width ();
662
- const int minBase = qMin (availableWidth - d_ptr->mTotalWidth , 0 );
669
+ const int availableWidth = categoryContentSize ().width ();
670
+ const int minBase = qMin (availableWidth - d_ptr->mTotalWidth , 0 );
663
671
d_ptr->mTargetScrollPosition = qBound (minBase, targetX, 0 );
664
672
665
673
// 如果动画正在进行,停止当前动画
0 commit comments