diff options
author | lbartoletti <l.bartoletti@free.fr> | 2019-10-22 21:48:42 +0200 |
---|---|---|
committer | lbartoletti <l.bartoletti@free.fr> | 2019-10-22 21:48:42 +0200 |
commit | 42513d8e48e2f433bba46a0384e1ed391de6dc70 (patch) | |
tree | 74df602d4de2520e361cd1cf809c80c80da27d79 /src-qt5/core-utils | |
parent | fix warning: 'created' is deprecated: Use either birthTime() or metadataChang... (diff) | |
download | lumina-42513d8e48e2f433bba46a0384e1ed391de6dc70.tar.gz lumina-42513d8e48e2f433bba46a0384e1ed391de6dc70.tar.bz2 lumina-42513d8e48e2f433bba46a0384e1ed391de6dc70.zip |
fix warning: 'rects' is deprecated
Diffstat (limited to 'src-qt5/core-utils')
-rw-r--r-- | src-qt5/core-utils/lumina-xconfig/MainUI.cpp | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/src-qt5/core-utils/lumina-xconfig/MainUI.cpp b/src-qt5/core-utils/lumina-xconfig/MainUI.cpp index cbec6443..9abc30b2 100644 --- a/src-qt5/core-utils/lumina-xconfig/MainUI.cpp +++ b/src-qt5/core-utils/lumina-xconfig/MainUI.cpp @@ -259,20 +259,19 @@ void MainUI::tileScreensY(bool activeonly){ while(overlap){ QRegion tmp(cur->pos().x(), newy, cur->width(), cur->height()); QRegion diff = tmp.subtracted(total); - overlap = (diff.boundingRect()!=tmp.boundingRect() || diff.rects().length()>1); + overlap = (diff.boundingRect()!=tmp.boundingRect() || diff.rectCount()>1); //qDebug() << "Check Y Overlap:" << newy << overlap << tmp.boundingRect() << diff.boundingRect(); if(overlap){ - QVector<QRect> rects = diff.rects(); QRect bound = diff.boundingRect(); //qDebug() << " - got Y overlap:" << bound << rects; - if( bound.isNull() || rects.isEmpty() ){ newy+=cur->height(); } + if( bound.isNull() || diff.rectCount() == 0 ){ newy+=cur->height(); } else{ int orig = newy; newy = bound.top(); - for(int i=0; i<rects.length(); i++){ + for( const QRect &rect : diff ){ //qDebug() << " - Check Rect:" << newy << rects[i] << cur->height(); - if(rects[i].height()==cur->height()){ continue; } //skip this one - just the same height - if(rects[i].top()>newy || newy==bound.bottom()){ newy=rects[i].top(); } + if(rect.height()==cur->height()){ continue; } //skip this one - just the same height + if(rect.top()>newy || newy==bound.bottom()){ newy=rect.top(); } } if(orig==newy){ newy = bound.bottom()+1; } //make sure it always changes - no infinite loops!! } @@ -316,20 +315,19 @@ void MainUI::tileScreensX(bool activeonly){ while(overlap){ QRegion tmp(newx, cur->pos().y(), cur->width(), cur->height()); QRegion diff = tmp.subtracted(total); - overlap = (diff.boundingRect()!=tmp.boundingRect() || diff.rects().length()>1); + overlap = (diff.boundingRect()!=tmp.boundingRect() || diff.rectCount()>1); //qDebug() << "Check X Overlap:" << newx << overlap << total.rects() << tmp.boundingRect() << diff.boundingRect(); if(overlap){ - QVector<QRect> rects = diff.rects(); QRect bound = diff.boundingRect(); //qDebug() << " - got X overlap:" << bound << rects; - if( bound.isNull() || rects.isEmpty() ){ newx+=cur->width(); } + if( bound.isNull() || diff.rectCount() == 0 ){ newx+=cur->width(); } else{ int orig = newx; newx = bound.left(); - for(int i=0; i<rects.length(); i++){ + for( const QRect &rect : diff ) { //qDebug() << " - Check Rect:" << newx << rects[i] << cur->width(); - if(rects[i].width()==cur->width()){ continue; } //skip this one - just the same width - if(rects[i].left()>newx || newx==bound.right()){ newx=rects[i].left(); } + if(rect.width()==cur->width()){ continue; } //skip this one - just the same width + if(rect.left()>newx || newx==bound.right()){ newx=rect.left(); } } if(orig==newx){ newx = bound.right()+1; } //make sure it always changes - no infinite loops!! } |