<class name="QRubberBand" doc="/**
&lt;p&gt;The &lt;a href=&quot;QRubberBand.html#QRubberBand(com.trolltech.qt.gui.QRubberBand.Shape, com.trolltech.qt.gui.QWidget)&quot;&gt;&lt;tt&gt;QRubberBand&lt;/tt&gt;&lt;/a&gt; class provides a rectangle or line that can indicate a selection or a boundary.&lt;/p&gt;
&lt;p&gt;A rubber band is often used to show a new bounding area (as in a &lt;a href=&quot;QSplitter.html&quot;&gt;&lt;tt&gt;QSplitter&lt;/tt&gt;&lt;/a&gt; or a &lt;a href=&quot;QDockWidget.html&quot;&gt;&lt;tt&gt;QDockWidget&lt;/tt&gt;&lt;/a&gt; that is undocking). Historically this has been implemented using a &lt;a href=&quot;QPainter.html&quot;&gt;&lt;tt&gt;QPainter&lt;/tt&gt;&lt;/a&gt; and XOR, but this approach doesn't always work properly since rendering can happen in the window below the rubber band, but before the rubber band has been &amp;quot;erased&amp;quot;.&lt;/p&gt;
&lt;p&gt;You can create a &lt;a href=&quot;QRubberBand.html#QRubberBand(com.trolltech.qt.gui.QRubberBand.Shape, com.trolltech.qt.gui.QWidget)&quot;&gt;&lt;tt&gt;QRubberBand&lt;/tt&gt;&lt;/a&gt; whenever you need to render a rubber band around a given area (or to represent a single line), then call &lt;a href=&quot;QWidget.html#setGeometry(com.trolltech.qt.core.QRect)&quot;&gt;&lt;tt&gt;setGeometry&lt;/tt&gt;&lt;/a&gt;, &lt;a href=&quot;QWidget.html#move(com.trolltech.qt.core.QPoint)&quot;&gt;&lt;tt&gt;move&lt;/tt&gt;&lt;/a&gt; or &lt;a href=&quot;QWidget.html#resize(int, int)&quot;&gt;&lt;tt&gt;resize&lt;/tt&gt;&lt;/a&gt; to position and size it. A common pattern is to do this in conjunction with mouse events. For example:&lt;/p&gt;
&lt;pre&gt;    void Widget::mousePressEvent(QMouseEvent *event)
    {
        origin = event-&amp;gt;pos();
        if (!rubberBand)
            rubberBand = new QRubberBand(QRubberBand::Rectangle, this);
        rubberBand-&amp;gt;setGeometry(QRect(origin, QSize()));
        rubberBand-&amp;gt;show();
    }

    void Widget::mouseMoveEvent(QMouseEvent *event)
    {
        rubberBand-&amp;gt;setGeometry(QRect(origin, event-&amp;gt;pos()).normalized());
    }

    void Widget::mouseReleaseEvent(QMouseEvent *event)
    {
        rubberBand-&amp;gt;hide();
        &lt;span class=&quot;comment&quot;&gt;//&lt;/span&gt; determine selection, for example using QRect::intersects()
        &lt;span class=&quot;comment&quot;&gt;//&lt;/span&gt; and QRect::contains().
    }&lt;/pre&gt;
&lt;p&gt;If you pass a parent to &lt;a href=&quot;QRubberBand.html#QRubberBand(com.trolltech.qt.gui.QRubberBand.Shape, com.trolltech.qt.gui.QWidget)&quot;&gt;&lt;tt&gt;QRubberBand&lt;/tt&gt;&lt;/a&gt;'s constructor, the rubber band will display only inside its parent, but stays on top of other child widgets. If no parent is passed, &lt;a href=&quot;QRubberBand.html#QRubberBand(com.trolltech.qt.gui.QRubberBand.Shape, com.trolltech.qt.gui.QWidget)&quot;&gt;&lt;tt&gt;QRubberBand&lt;/tt&gt;&lt;/a&gt; will act as a top-level widget.&lt;/p&gt;
&lt;p&gt;Call &lt;a href=&quot;QWidget.html#show()&quot;&gt;&lt;tt&gt;show&lt;/tt&gt;&lt;/a&gt; to make the rubber band visible; also when the rubber band is not a top-level. Hiding or destroying the widget will make the rubber band disappear. The rubber band can be a &lt;a href=&quot;QRubberBand.html#Shape-enum&quot;&gt;Rectangle&lt;/tt&gt;&lt;/a&gt; or a &lt;a href=&quot;QRubberBand.html#Shape-enum&quot;&gt;Line&lt;/tt&gt;&lt;/a&gt; (vertical or horizontal), depending on the &lt;a href=&quot;QRubberBand.html#shape()&quot;&gt;&lt;tt&gt;shape&lt;/tt&gt;&lt;/a&gt; it was given when constructed.&lt;/p&gt;
 */">
    <signal name="protected final void customContextMenuRequested(com.trolltech.qt.core.QPoint pos)" doc="/**
&lt;p&gt;This signal is emitted when the widget's &lt;a href=&quot;QWidget.html#contextMenuPolicy()&quot;&gt;&lt;tt&gt;contextMenuPolicy&lt;/tt&gt;&lt;/a&gt; is Qt::CustomContextMenu, and the user has requested a context menu on the widget. The position &lt;tt&gt;pos&lt;/tt&gt; is the position of the context menu event that the widget receives. Normally this is in widget coordinates. The exception to this rule is &lt;a href=&quot;QAbstractScrollArea.html&quot;&gt;&lt;tt&gt;QAbstractScrollArea&lt;/tt&gt;&lt;/a&gt; and its subclasses that map the context menu event to coordinates of the viewport()&lt;/tt&gt; .&lt;/p&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;b&gt;Compatible Slot Signatures:&lt;/b&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;tt&gt;void mySlot(com.trolltech.qt.core.QPoint pos)&lt;/tt&gt;&lt;/dd&gt;
&lt;dd&gt;&lt;tt&gt;void mySlot()&lt;/tt&gt;&lt;/dd&gt;
&lt;/dl&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;b&gt;See Also:&lt;/b&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;a href=&quot;QWidget.html#mapToGlobal(com.trolltech.qt.core.QPoint)&quot;&gt;&lt;tt&gt;mapToGlobal&lt;/tt&gt;&lt;/a&gt;, &lt;a href=&quot;QMenu.html&quot;&gt;&lt;tt&gt;QMenu&lt;/tt&gt;&lt;/a&gt;, &lt;a href=&quot;QWidget.html#contextMenuPolicy()&quot;&gt;&lt;tt&gt;contextMenuPolicy&lt;/tt&gt;&lt;/a&gt;&lt;/dd&gt;
&lt;/dl&gt;
 */"/>
    <method name="public QRubberBand(com.trolltech.qt.gui.QRubberBand.Shape arg__1, com.trolltech.qt.gui.QWidget arg__2)" doc="/**
&lt;p&gt;Constructs a rubber band of shape &lt;tt&gt;arg__1&lt;/tt&gt;, with parent &lt;tt&gt;arg__2&lt;/tt&gt;.&lt;/p&gt;
&lt;p&gt;By default a rectangular rubber band (&lt;tt&gt;arg__1&lt;/tt&gt; is &lt;tt&gt;Rectangle&lt;/tt&gt;) will use a mask, so that a small border of the rectangle is all that is visible. Some styles (e.g&amp;#x2e;, native Mac OS X) will change this and call QWidget::setWindowOpacity() to make a semi-transparent filled selection rectangle.&lt;/p&gt;
 */"/>
    <method name="public QRubberBand(com.trolltech.qt.gui.QRubberBand.Shape arg__1)" doc="/**
&lt;p&gt;Equivalent to &lt;a href=&quot;QRubberBand.html#QRubberBand(com.trolltech.qt.gui.QRubberBand.Shape, com.trolltech.qt.gui.QWidget)&quot;&gt;&lt;tt&gt;QRubberBand&lt;/tt&gt;&lt;/a&gt;(&lt;tt&gt;arg__1&lt;/tt&gt;, 0). */"/>
    <method name="public final void moveRubberBand(com.trolltech.qt.core.QPoint p)" doc="/**
&lt;p&gt;Moves the rubberband to point &lt;tt&gt;p&lt;/tt&gt;.&lt;/p&gt;

@see &lt;a href=&quot;QWidget.html#resize(int, int)&quot;&gt;&lt;tt&gt;resize&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="public final void moveRubberBand(int x, int y)" doc="/**
&lt;p&gt;Moves the rubberband to point (&lt;tt&gt;x&lt;/tt&gt;, &lt;tt&gt;y&lt;/tt&gt;).&lt;/p&gt;

@see &lt;a href=&quot;QWidget.html#resize(int, int)&quot;&gt;&lt;tt&gt;resize&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="public final void resizeRubberBand(com.trolltech.qt.core.QSize s)" doc="/**
&lt;p&gt;Resizes the rubberband so that its new size is &lt;tt&gt;s&lt;/tt&gt;.&lt;/p&gt;

@see &lt;a href=&quot;QWidget.html#move(com.trolltech.qt.core.QPoint)&quot;&gt;&lt;tt&gt;move&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="public final void resizeRubberBand(int w, int h)" doc="/**
&lt;p&gt;Resizes the rubberband so that its width is &lt;tt&gt;w&lt;/tt&gt;, and its height is &lt;tt&gt;h&lt;/tt&gt;.&lt;/p&gt;

@see &lt;a href=&quot;QWidget.html#move(com.trolltech.qt.core.QPoint)&quot;&gt;&lt;tt&gt;move&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="public final void setRubberBandGeometry(com.trolltech.qt.core.QRect r)" doc="/**
&lt;p&gt;Sets the geometry of the rubber band to &lt;tt&gt;r&lt;/tt&gt;, specified in the coordinate system of its parent widget.&lt;/p&gt;

@see &lt;tt&gt;QWidget::geometry&lt;/tt&gt; */"/>
    <method name="public final void setRubberBandGeometry(int x, int y, int w, int h)" doc="/**
&lt;p&gt;Sets the geometry of the rubberband to the rectangle whose top-left corner lies at the point (&lt;tt&gt;x&lt;/tt&gt;, &lt;tt&gt;y&lt;/tt&gt;), and with dimensions specified by &lt;tt&gt;w&lt;/tt&gt; and &lt;tt&gt;h&lt;/tt&gt;. The geometry is specified in the parent widget's coordinate system.&lt;/p&gt;
 */"/>
    <method name="public final com.trolltech.qt.gui.QRubberBand.Shape shape()" doc="/**
&lt;p&gt;Returns the shape of this rubber band. The shape can only be set upon construction.&lt;/p&gt;
 */"/>
    <method name="protected void changeEvent(com.trolltech.qt.core.QEvent arg__1)" doc="/**
&lt;p&gt;This function is reimplemented for internal reasons.&lt;/p&gt;
 */"/>
    <method name="public boolean event(com.trolltech.qt.core.QEvent e)" doc="/**
&lt;p&gt;This function is reimplemented for internal reasons.&lt;/p&gt;
 */"/>
    <method name="protected void moveEvent(com.trolltech.qt.gui.QMoveEvent arg__1)" doc="/**
&lt;p&gt;This function is reimplemented for internal reasons.&lt;/p&gt;
 */"/>
    <method name="protected void paintEvent(com.trolltech.qt.gui.QPaintEvent arg__1)" doc="/**
&lt;p&gt;This function is reimplemented for internal reasons.&lt;/p&gt;
 */"/>
    <method name="protected void resizeEvent(com.trolltech.qt.gui.QResizeEvent arg__1)" doc="/**
&lt;p&gt;This function is reimplemented for internal reasons.&lt;/p&gt;
 */"/>
    <method name="protected void showEvent(com.trolltech.qt.gui.QShowEvent arg__1)" doc="/**
&lt;p&gt;This function is reimplemented for internal reasons.&lt;/p&gt;
 */"/>
    <enum name="Shape" doc="/**
&lt;p&gt;This enum specifies what shape a &lt;a href=&quot;QRubberBand.html#QRubberBand(com.trolltech.qt.gui.QRubberBand.Shape, com.trolltech.qt.gui.QWidget)&quot;&gt;&lt;tt&gt;QRubberBand&lt;/tt&gt;&lt;/a&gt; should have. This is a drawing hint that is passed down to the style system, and can be interpreted by each &lt;a href=&quot;QStyle.html&quot;&gt;&lt;tt&gt;QStyle&lt;/tt&gt;&lt;/a&gt;.&lt;/p&gt;
 */">
        <enum-value name="Line" doc="/**
&lt;p&gt;A &lt;a href=&quot;QRubberBand.html#QRubberBand(com.trolltech.qt.gui.QRubberBand.Shape, com.trolltech.qt.gui.QWidget)&quot;&gt;&lt;tt&gt;QRubberBand&lt;/tt&gt;&lt;/a&gt; can represent a vertical or horizontal line. Geometry is still given in &lt;a href=&quot;QWidget.html#rect()&quot;&gt;&lt;tt&gt;rect&lt;/tt&gt;&lt;/a&gt; and the line will fill the given geometry on most styles.&lt;/p&gt;
 */"/>
        <enum-value name="Rectangle" doc="/**
&lt;p&gt;A &lt;a href=&quot;QRubberBand.html#QRubberBand(com.trolltech.qt.gui.QRubberBand.Shape, com.trolltech.qt.gui.QWidget)&quot;&gt;&lt;tt&gt;QRubberBand&lt;/tt&gt;&lt;/a&gt; can represent a rectangle. Some styles will interpret this as a filled (often semi-transparent) rectangle, or a rectangular outline.&lt;/p&gt;
 */"/>
</enum>
</class>
