Changeset View
Changeset View
Standalone View
Standalone View
kstyle/breezeshadowhelper.h
Show First 20 Lines • Show All 148 Lines • ▼ Show 20 Line(s) | 77 | { | |||
---|---|---|---|---|---|
149 | 149 | | |||
150 | //* helper | 150 | //* helper | ||
151 | Helper& _helper; | 151 | Helper& _helper; | ||
152 | 152 | | |||
153 | //* registered widgets | 153 | //* registered widgets | ||
154 | QSet<QWidget*> _widgets; | 154 | QSet<QWidget*> _widgets; | ||
155 | 155 | | |||
156 | //* managed shadows | 156 | //* managed shadows | ||
157 | QMap<QWidget*, KWindowShadow*> _shadows; | 157 | QMap<QWidget*, QPointer<KWindowShadow>> _shadows; | ||
apol: if this is a thing, maybe it would make sense to actually try and remove the KWindowShadows… | |||||
We have a connection to destroyed for the widget which isn't reached when a window is destroyed on QApplication teardown, so I think the same might be true for the window, I would still prefer this over a QPointer. broulik: We have a connection to `destroyed` for the `widget` which isn't reached when a window is… | |||||
zzag: > so I think the same might be true for the window
No, it works fine. | |||||
Yes, that's a better idea. zzag: > if this is a thing, maybe it would make sense to actually try and remove the KWindowShadows… | |||||
158 | 158 | | |||
159 | //* tileset | 159 | //* tileset | ||
160 | TileSet _shadowTiles; | 160 | TileSet _shadowTiles; | ||
161 | 161 | | |||
162 | //* number of tiles | 162 | //* number of tiles | ||
163 | enum { numTiles = 8 }; | 163 | enum { numTiles = 8 }; | ||
164 | 164 | | |||
165 | //* shared shadow tiles | 165 | //* shared shadow tiles | ||
166 | QVector<KWindowShadowTile::Ptr> _tiles; | 166 | QVector<KWindowShadowTile::Ptr> _tiles; | ||
167 | 167 | | |||
168 | }; | 168 | }; | ||
169 | 169 | | |||
170 | } | 170 | } | ||
171 | 171 | | |||
172 | #endif | 172 | #endif |
if this is a thing, maybe it would make sense to actually try and remove the KWindowShadows upon destruction?
Something like connect(newshadow, &QObject::destroyed, this, [this, widget] { _shadows.remove(widget); });