Changeset View
Changeset View
Standalone View
Standalone View
kstyle/animations/breezetransitionwidget.cpp
Show First 20 Lines • Show All 206 Lines • ▼ Show 20 Line(s) | 35 | { | |||
---|---|---|---|---|---|
207 | void TransitionWidget::grabBackground( QPixmap& pixmap, QWidget* widget, QRect& rect ) const | 207 | void TransitionWidget::grabBackground( QPixmap& pixmap, QWidget* widget, QRect& rect ) const | ||
208 | { | 208 | { | ||
209 | if( !widget ) return; | 209 | if( !widget ) return; | ||
210 | 210 | | |||
211 | QWidgetList widgets; | 211 | QWidgetList widgets; | ||
212 | if( widget->autoFillBackground() ) | 212 | if( widget->autoFillBackground() ) | ||
213 | { widgets.append( widget ); } | 213 | { widgets.append( widget ); } | ||
214 | 214 | | |||
215 | QWidget *parent(0); | 215 | QWidget *parent(nullptr); | ||
216 | 216 | | |||
217 | // get highest level parent | 217 | // get highest level parent | ||
218 | for( parent = widget->parentWidget(); parent; parent = parent->parentWidget() ) | 218 | for( parent = widget->parentWidget(); parent; parent = parent->parentWidget() ) | ||
219 | { | 219 | { | ||
220 | 220 | | |||
221 | if( !( parent->isVisible() && parent->rect().isValid() ) ) continue; | 221 | if( !( parent->isVisible() && parent->rect().isValid() ) ) continue; | ||
222 | 222 | | |||
223 | // store in list | 223 | // store in list | ||
Show All 33 Lines | |||||
257 | } | 257 | } | ||
258 | 258 | | |||
259 | // draw all widgets in parent list | 259 | // draw all widgets in parent list | ||
260 | // backward | 260 | // backward | ||
261 | QPaintEvent event(rect); | 261 | QPaintEvent event(rect); | ||
262 | for( int i = widgets.size() - 1; i>=0; i-- ) | 262 | for( int i = widgets.size() - 1; i>=0; i-- ) | ||
263 | { | 263 | { | ||
264 | QWidget* w = widgets.at(i); | 264 | QWidget* w = widgets.at(i); | ||
265 | w->render( &p, -widget->mapTo( w, rect.topLeft() ), rect, 0 ); | 265 | w->render( &p, -widget->mapTo( w, rect.topLeft() ), rect, nullptr ); | ||
266 | } | 266 | } | ||
267 | 267 | | |||
268 | // end | 268 | // end | ||
269 | p.end(); | 269 | p.end(); | ||
270 | 270 | | |||
271 | } | 271 | } | ||
272 | 272 | | |||
273 | //________________________________________________ | 273 | //________________________________________________ | ||
Show All 36 Lines |