equal
deleted
inserted
replaced
1531 |
1531 |
1532 StyleSheet defaultSs; |
1532 StyleSheet defaultSs; |
1533 QHash<const void *, StyleSheet>::const_iterator defaultCacheIt = styleSheetCache->constFind(baseStyle()); |
1533 QHash<const void *, StyleSheet>::const_iterator defaultCacheIt = styleSheetCache->constFind(baseStyle()); |
1534 if (defaultCacheIt == styleSheetCache->constEnd()) { |
1534 if (defaultCacheIt == styleSheetCache->constEnd()) { |
1535 defaultSs = getDefaultStyleSheet(); |
1535 defaultSs = getDefaultStyleSheet(); |
1536 styleSheetCache->insert(baseStyle(), defaultSs); |
1536 QStyle *bs = baseStyle(); |
|
1537 styleSheetCache->insert(bs, defaultSs); |
|
1538 QObject::connect(bs, SIGNAL(destroyed(QObject*)), this, SLOT(styleDestroyed(QObject*)), Qt::UniqueConnection); |
1537 } else { |
1539 } else { |
1538 defaultSs = defaultCacheIt.value(); |
1540 defaultSs = defaultCacheIt.value(); |
1539 } |
1541 } |
1540 styleSelector.styleSheets += defaultSs; |
1542 styleSelector.styleSheets += defaultSs; |
1541 |
1543 |
2656 hasStyleRuleCache->remove((const QWidget *)o); |
2658 hasStyleRuleCache->remove((const QWidget *)o); |
2657 renderRulesCache->remove((const QWidget *)o); |
2659 renderRulesCache->remove((const QWidget *)o); |
2658 customPaletteWidgets->remove((const QWidget *)o); |
2660 customPaletteWidgets->remove((const QWidget *)o); |
2659 styleSheetCache->remove((const QWidget *)o); |
2661 styleSheetCache->remove((const QWidget *)o); |
2660 autoFillDisabledWidgets->remove((const QWidget *)o); |
2662 autoFillDisabledWidgets->remove((const QWidget *)o); |
|
2663 } |
|
2664 |
|
2665 void QStyleSheetStyle::styleDestroyed(QObject *o) |
|
2666 { |
|
2667 styleSheetCache->remove(o); |
2661 } |
2668 } |
2662 |
2669 |
2663 /*! |
2670 /*! |
2664 * Make sure that the cache will be clean by connecting destroyed if needed. |
2671 * Make sure that the cache will be clean by connecting destroyed if needed. |
2665 * return false if the widget is not stylable; |
2672 * return false if the widget is not stylable; |