We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 81520c5 commit cc18af7Copy full SHA for cc18af7
src/widgets/dtabbar.cpp
@@ -687,6 +687,7 @@ void DTabBarPrivate::layoutTab(int index)
687
Q_ASSERT(index >= 0);
688
QTabBarPrivate *d = reinterpret_cast<QTabBarPrivate *>(qGetPtrHelper(d_ptr));
689
QTabBarPrivate::Tab *tab = d->at(index);
690
+ Q_ASSERT(tab);
691
bool vertical = dtk_verticalTabs(d->shape);
692
693
if (!(tab->leftWidget || tab->rightWidget))
@@ -1279,7 +1280,7 @@ void DTabBarPrivate::paintEvent(QPaintEvent *e)
1279
1280
}
1281
1282
// Draw the selected tab last to get it "on top"
- if (selected >= 0) {
1283
+ if (selected >= 0 && d->validIndex(selected)) {
1284
QStyleOptionTab tab;
1285
initStyleOption(&tab, selected);
1286
// 强制让文本居中
0 commit comments