Commit ef0be61f authored by Guillaume Pasero's avatar Guillaume Pasero

BUG: Mantis-1334: bad qpoint initialization with MSVC15 in release

parent bf99beba
--- src/gui/itemviews/qtreeview.cpp 2015-05-07 16:14:43.000000000 +0200
+++ /media/otbnas/gpasero/OTB/qtreeview.cpp 2017-02-07 15:30:57.463689900 +0100
@@ -2261,10 +2261,23 @@
return;
d->executePostedLayout();
- QPoint tl(isRightToLeft() ? qMax(rect.left(), rect.right())
- : qMin(rect.left(), rect.right()), qMin(rect.top(), rect.bottom()));
- QPoint br(isRightToLeft() ? qMin(rect.left(), rect.right()) :
- qMax(rect.left(), rect.right()), qMax(rect.top(), rect.bottom()));
+ QPoint tl(rect.left(),rect.top());
+ QPoint br(rect.right(),rect.bottom());
+ if (isRightToLeft()) {
+ if (rect.left() < rect.right()) {
+ tl.setX(rect.right());
+ br.setX(rect.left());
+ }
+ } else {
+ if (rect.left() > rect.right()) {
+ tl.setX(rect.right());
+ br.setX(rect.left());
+ }
+ }
+ if (rect.bottom() < rect.top()) {
+ tl.setY(rect.bottom());
+ br.setY(rect.top());
+ }
QModelIndex topLeft = indexAt(tl);
QModelIndex bottomRight = indexAt(br);
if (!topLeft.isValid() && !bottomRight.isValid()) {
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment