Details
-
Bug
-
Resolution: Fixed
-
P3: Somewhat important
-
6.0.0, 6.9.0 FF
-
None
-
577946c1f (dev), 3f1a644ee (dev), 24fb49232 (dev), 8e7847bc3 (dev), b89634bc2 (dev), f277c2182 (dev)
Description
I suppect newly (Qt6) introduced mirror function was made like mirrored to be similar, but to be very honest believe this is a step in the wrong direction. We ought to deprecate the existing mirror functions and use Qt::Orientations as arguments instead.
Motivation: That something has been a wrong way for a long time is not a reason not to fix it (when it is very wrong) and I had a codereview in some code using QImage::mirror and the result is unreadable code. Now, I didn't think exactly this, but I believe it will be prefectly acceptable to think the below:
void someFunction(QImage &img) { img.mirror(true); // Now the image is mirrored, right callSomeOtherFunction(image); img.mirror(true); // We ensure image is still mirrored (in case the above function changes something) callAthridFuncttion(image); img.mirror(false); // Ensure the image isn't mirrored anymore // do something more }
I suggest that the API for mirror (and mirrored) is changed to use Qt::Orientations and that the existing mirror versions are deprecated (lastest in Qt7 and later removed - preferable in Qt7 but latest in Qt8).
Attachments
For Gerrit Dashboard: QTBUG-129575 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
608586,2 | Replace deprecated QImage::mirror(ed) with flip(ped) | dev | qt/qtcanvas3d | Status: NEW | +2 | 0 |
595111,9 | Add Qt::Orientations based flip and flipped functions | dev | qt/qtbase | Status: MERGED | +2 | 0 |
608577,4 | Replace deprecated QImage::mirror(ed) with flip(ped) | dev | qt/qtdeclarative | Status: MERGED | +2 | 0 |
608579,5 | Replace deprecated QImage::mirror(ed) with flip(ped) | dev | qt/qtquick3d | Status: MERGED | +2 | 0 |
608580,2 | Replace deprecated QImage::mirror(ed) with flip(ped) | dev | qt/qtdatavis3d | Status: MERGED | +2 | 0 |
608581,2 | Replace deprecated QImage::mirror(ed) with flip(ped) | dev | qt/qtgraphs | Status: MERGED | +2 | 0 |
608587,3 | Replace deprecated QImage::mirror(ed) with flip(ped) | dev | qt/qt3d | Status: MERGED | +2 | 0 |