Don't use obsolete QRectF and QAbstractItemModel functions
ClosedPublic

Authored by dcaliste on Aug 21 2018, 1:12 PM.

Details

Summary

Change deprecated function calls to QRectF::intersect() for QRectF::intersected().

(Very minor patch, to get use to Phabricator, I've got some changes not to use obsolate functions from QAbstractItemModel that will come later, or do you prefer to make them goes to the same commit ?)

Diff Detail

Repository
R8 Calligra
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
dcaliste created this revision.Aug 21 2018, 1:12 PM
Restricted Application added a project: Calligra: 3.0. · View Herald TranscriptAug 21 2018, 1:12 PM
Restricted Application added a subscriber: Calligra-Devel-list. · View Herald Transcript
dcaliste requested review of this revision.Aug 21 2018, 1:12 PM

You can make them at once, if there is no functionality changes.

@anthonyfieroni Ok, will update the diff with other replacements of obsolete functions.

dcaliste updated this revision to Diff 40152.Aug 21 2018, 1:35 PM

I've added replacements for QAbstractItemModel::reset(). This allow to "lock" the model during the reset. So I've tried to put the beginResetModel() before the change of the private members, and the endResetModel() after.

dcaliste retitled this revision from Don't use obsolete QRectF functions to Don't use obsolete QRectF and QAbstractItemModel functions.Aug 22 2018, 7:17 AM

I'm not 100% sure of stackChanged() change.
Probably ok, but the original would call both begin and end before calling the selection model.
To get exactly the same behaviour you could do the same.
It depends on how the selction model handles reset and setCurrentIndex() I guess.

Hmm, I think I would call both begin and end before setCurrentIndex() as setCurrentIndex() usually emits signals that may prompt consumers to access the model.

@danders I agree with your remark, I was wondering exactly the same. It's safer to put the begin / end together. I'll update the diff and add a comment to suggest to move the end after the setCurrentIndex() after extensive testing.

dcaliste updated this revision to Diff 40193.Aug 22 2018, 8:24 AM

Update the patch in stackChanged() call to have the exact behaviour than before in this method.

danders accepted this revision.Aug 22 2018, 8:59 AM
This revision is now accepted and ready to land.Aug 22 2018, 8:59 AM
This revision was automatically updated to reflect the committed changes.