[Qt] Inverted cursor position on Mac

Den Jean Den.Jean at telenet.be
Tue Jul 3 22:40:54 CEST 2007


On Tuesday 03 July 2007 10:05:10 pm Felipe Monteiro de Carvalho wrote:
> Here you can fix this by declaring a correct type for pr. Create a

too late, copy/paste did it 

typedef void *PRect;

inline void copyQRectToPRect(const QRect &qr, PRect pr)
{
#if defined DARWIN
  ((QRect *)pr)->setLeft(qr.top());
  ((QRect *)pr)->setTop(qr.left());
  ((QRect *)pr)->setRight(qr.bottom()+1);
  ((QRect *)pr)->setBottom(qr.right()+1);
#else
  ((QRect *)pr)->setLeft(qr.left());
  ((QRect *)pr)->setTop(qr.top());
  ((QRect *)pr)->setRight(qr.right()+1);
  ((QRect *)pr)->setBottom(qr.bottom()+1);
#endif  
}

inline void copyPRectToQRect(PRect pr, QRect &qr)
{
#if defined DARWIN
  qr.setLeft(((QRect *)pr)->top());
  qr.setTop(((QRect *)pr)->left());
  qr.setRight(((QRect *)pr)->bottom()-1);
  qr.setBottom(((QRect *)pr)->right()-1);
#else
  qr.setLeft(((QRect *)pr)->left());
  qr.setTop(((QRect *)pr)->top());
  qr.setRight(((QRect *)pr)->right()-1);
  qr.setBottom(((QRect *)pr)->bottom()-1);
#endif  
}




More information about the Qt mailing list