Fix crash on populating style data to tabbar without parent

This resolves Bug 1966
pull/2/head
Slávek Banko 11 years ago
parent 1afc62ef88
commit 3d29992e94

@ -468,6 +468,7 @@ const QStyleControlElementData &populateControlElementDataFromWidget(const QWidg
ceData.tabBarData.identIndexMap[currentTab->identifier()] = tb->indexOf(currentTab->identifier()); ceData.tabBarData.identIndexMap[currentTab->identifier()] = tb->indexOf(currentTab->identifier());
} }
} }
if ( tb->parent() ) {
updateObjectTypeListIfNeeded(tb->parent()); updateObjectTypeListIfNeeded(tb->parent());
if ((const_cast<QObject*>(tb->parent())->controlElementDataPrivateObject())->isQTabWidget) { if ((const_cast<QObject*>(tb->parent())->controlElementDataPrivateObject())->isQTabWidget) {
const QTabWidget *tw = static_cast<const QTabWidget*>(tb->parent()); const QTabWidget *tw = static_cast<const QTabWidget*>(tb->parent());
@ -507,6 +508,7 @@ const QStyleControlElementData &populateControlElementDataFromWidget(const QWidg
} }
} }
} }
}
if (ceDataPrivate->isQToolBox) { if (ceDataPrivate->isQToolBox) {
const QToolBox *tb = static_cast<const QToolBox*>(widget); const QToolBox *tb = static_cast<const QToolBox*>(widget);
if (tb) { if (tb) {

Loading…
Cancel
Save