Qt 4.8
Functions
qcocoawindowsurface.mm File Reference
#include "qcocoawindowsurface.h"
#include <QtCore/qdebug.h>
#include <QtGui/QPainter>

Go to the source code of this file.

Functions

QRect flipedRect (const QRect &sourceRect, int height)
 

Function Documentation

◆ flipedRect()

QRect flipedRect ( const QRect sourceRect,
int  height 
)

Definition at line 50 of file qcocoawindowsurface.mm.

51 {
52  if (!sourceRect.isValid())
53  return QRect();
54  QRect flippedRect = sourceRect;
55  flippedRect.moveTop(height - sourceRect.y());
56  return flippedRect;
57 }
int y() const
Returns the y-coordinate of the rectangle&#39;s top edge.
Definition: qrect.h:255
The QRect class defines a rectangle in the plane using integer precision.
Definition: qrect.h:58
void moveTop(int pos)
Moves the rectangle vertically, leaving the rectangle&#39;s top edge at the given y coordinate.
Definition: qrect.h:353
bool isValid() const
Returns true if the rectangle is valid, otherwise returns false.
Definition: qrect.h:237