Main Page | Class List | File List | Class Members | File Members

AreaGrab Class Reference

#include <areagrab.h>

List of all members.

Signals

void areaReady (const QRect &)

Public Member Functions

 AreaGrab (QWidget *parent=0, const char *name=0, WFlags f=0)

Protected Member Functions

void mousePressEvent (QMouseEvent *)
void mouseReleaseEvent (QMouseEvent *)
void mouseMoveEvent (QMouseEvent *)

Private Member Functions

void drawRect ()

Private Attributes

QRect area
QRect bgRect
QPixmap bgPixmap
bool grabbing


Detailed Description

This is just a little trick to let you draw on everything currently shown on your display. No decent window manager would allow you to do this, so we just create a widget the size of the available display and use a pixmap of that area as a background image.
Note that no transformation of mouse coords is needed here.


Constructor & Destructor Documentation

AreaGrab::AreaGrab QWidget *  parent = 0,
const char *  name = 0,
WFlags  f = 0
 

Constructs the area widget with the currently shown display as a background pixmap in original size.


Member Function Documentation

void AreaGrab::areaReady const QRect &   )  [signal]
 

void AreaGrab::drawRect  )  [private]
 

This is where the drawing is done. Note that we set the RasterOp to XorROP here, because we want the rectangle to be erased if drawn twice with the same geometry.

void AreaGrab::mouseMoveEvent QMouseEvent *  e  )  [protected]
 

Updates the area rectangle. Draws the rectangle once before doing the update and once after the update. The first drawing will erase the currently shown rectangle, because of the XOR method used by the painter.

Here is the call graph for this function:

void AreaGrab::mousePressEvent QMouseEvent *  e  )  [protected]
 

Sets up the area rectangle at the current mouse position.

Here is the call graph for this function:

void AreaGrab::mouseReleaseEvent QMouseEvent *  e  )  [protected]
 

The final update of the area rectangle occurs here. Also the rectangle is drawn one last time, thus erasing it. The areaReady() signal is emitted here.

Here is the call graph for this function:


Member Data Documentation

QRect AreaGrab::area [private]
 

QPixmap AreaGrab::bgPixmap [private]
 

QRect AreaGrab::bgRect [private]
 

bool AreaGrab::grabbing [private]
 


The documentation for this class was generated from the following files:
Go back to rwm - the window manager's - Home page.
created 13 Jun 2005 for screenshot $Revision:1.1$ by Rolf C. Rönnau using doxygen 1.4.2