logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

QwtPanner - QwtPanner provides panning of a widget.

Author

       Generated automatically by Doxygen for Qwt User's Guide from the source code.

Version 6.1.4                                    Wed Jan 2 2019                                     QwtPanner(3)

Constructor & Destructor Documentation

QwtPanner::QwtPanner(QWidget*parent)
       Creates an panner that is enabled for the left mouse button.

       Parameters:parent Parent widget to be panned

Detailed Description

QwtPanner provides panning of a widget.

       QwtPanner grabs the contents of a widget, that can be dragged in all directions. The offset between the
       start and the end position is emitted by the panned signal.

       QwtPanner grabs the content of the widget into a pixmap and moves the pixmap around, without initiating
       any repaint events for the widget. Areas, that are not part of content are not painted while panning.
       This makes panning fast enough for widgets, where repaints are too slow for mouse movements.

       For widgets, where repaints are very fast it might be better to implement panning manually by mapping
       mouse events into paint events.

Member Function Documentation

QBitmapQwtPanner::contentsMask()const[protected],[virtual]
       Calculate a mask for the contents of the panned widget. Sometimes only parts of the contents of a widget
       should be panned. F.e. for a widget with a styled background with rounded borders only the area inside of
       the border should be panned.

       Returns:
           An empty bitmap, indicating no mask

       Reimplemented in QwtPlotPanner.

   constQCursorQwtPanner::cursor()constReturns:
           Cursor that is active while panning

       Seealso:setCursor()boolQwtPanner::eventFilter(QObject*object,QEvent*event)[virtual]
       Event filter. When isEnabled() is true mouse events of the observed widget are filtered.

       Parameters:object Object to be filtered
           event Event

       Returns:
           Always false, beside for paint events for the parent widget.

       Seealso:widgetMousePressEvent(), widgetMouseReleaseEvent(), widgetMouseMoveEvent()QPixmapQwtPanner::grab()const[protected],[virtual]
       Grab the widget into a pixmap.

       Returns:
           Grabbed pixmap

       Reimplemented in QwtPlotPanner.

   boolQwtPanner::isEnabled()constReturns:
           true when enabled, false otherwise

       Seealso:setEnabled, eventFilter()boolQwtPanner::isOrientationEnabled(Qt::Orientationo)constReturns:
           True if an orientation is enabled

       Seealso:orientations(), setOrientations()voidQwtPanner::moved(intdx,intdy)[signal]
       Signal emitted, while the widget moved, but panning is not finished.

       Parameters:dx Offset in horizontal direction
           dy Offset in vertical direction

   voidQwtPanner::paintEvent(QPaintEvent*event)[protected],[virtual]
       Paint event. Repaint the grabbed pixmap on its current position and fill the empty spaces by the
       background of the parent widget.

       Parameters:event Paint event

   voidQwtPanner::panned(intdx,intdy)[signal]
       Signal emitted, when panning is done

       Parameters:dx Offset in horizontal direction
           dy Offset in vertical direction

   voidQwtPanner::setAbortKey(intkey,Qt::KeyboardModifiersmodifiers=Qt::NoModifier)
       Change the abort key The defaults are Qt::Key_Escape and Qt::NoModifiers

       Parameters:key Key ( See Qt::Keycode )
           modifiers Keyboard modifiers

   voidQwtPanner::setCursor(constQCursor&cursor)
       Change the cursor, that is active while panning The default is the cursor of the parent widget.

       Parameters:cursor New cursor

       Seealso:setCursor()voidQwtPanner::setEnabled(boolon)
       En/disable the panner. When enabled is true an event filter is installed for the observed widget,
       otherwise the event filter is removed.

       Parameters:on true or false

       Seealso:isEnabled(), eventFilter()voidQwtPanner::setMouseButton(Qt::MouseButtonbutton,Qt::KeyboardModifiersmodifiers=Qt::NoModifier)
       Change the mouse button and modifiers used for panning The defaults are Qt::LeftButton and Qt::NoModifier

   voidQwtPanner::setOrientations(Qt::Orientationso)
       Set the orientations, where panning is enabled The default value is in both directions: Qt::Horizontal |
       Qt::Vertical

       /param o Orientation

   voidQwtPanner::widgetKeyPressEvent(QKeyEvent*keyEvent)[protected],[virtual]
       Handle a key press event for the observed widget.

       Parameters:keyEvent Key event

       Seealso:eventFilter(), widgetKeyReleaseEvent()voidQwtPanner::widgetKeyReleaseEvent(QKeyEvent*keyEvent)[protected],[virtual]
       Handle a key release event for the observed widget.

       Parameters:keyEvent Key event

       Seealso:eventFilter(), widgetKeyReleaseEvent()voidQwtPanner::widgetMouseMoveEvent(QMouseEvent*mouseEvent)[protected],[virtual]
       Handle a mouse move event for the observed widget.

       Parameters:mouseEvent Mouse event

       Seealso:eventFilter(), widgetMousePressEvent(), widgetMouseReleaseEvent()voidQwtPanner::widgetMousePressEvent(QMouseEvent*mouseEvent)[protected],[virtual]
       Handle a mouse press event for the observed widget.

       Parameters:mouseEvent Mouse event

       Seealso:eventFilter(), widgetMouseReleaseEvent(), widgetMouseMoveEvent(),

   voidQwtPanner::widgetMouseReleaseEvent(QMouseEvent*mouseEvent)[protected],[virtual]
       Handle a mouse release event for the observed widget.

       Parameters:mouseEvent Mouse event

       Seealso:eventFilter(), widgetMousePressEvent(), widgetMouseMoveEvent(),

Name

       QwtPanner - QwtPanner provides panning of a widget.

Synopsis

       #include <qwt_panner.h>

       Inherits QWidget.

       Inherited by QwtPlotPanner.

   Signals
       void panned (int dx, int dy)
       void moved (int dx, int dy)

   PublicMemberFunctionsQwtPanner (QWidget *parent)
       virtual ~QwtPanner ()
           Destructor.
       void setEnabled (bool)
           En/disable the panner.
       bool isEnabled () const
       void setMouseButton (Qt::MouseButton, Qt::KeyboardModifiers=Qt::NoModifier)
       void getMouseButton (Qt::MouseButton &button, Qt::KeyboardModifiers &) const
           Get mouse button and modifiers used for panning.
       void setAbortKey (int key, Qt::KeyboardModifiers=Qt::NoModifier)
       void getAbortKey (int &key, Qt::KeyboardModifiers &) const
           Get the abort key and modifiers.
       void setCursor (const QCursor &)
       const QCursor cursor () const
       void setOrientations (Qt::Orientations)
       Qt::Orientations orientations () const
           Return the orientation, where paning is enabled.
       bool isOrientationEnabled (Qt::Orientation) const
       virtual bool eventFilter (QObject *, QEvent *)
           Event filter.

   ProtectedMemberFunctions
       virtual void widgetMousePressEvent (QMouseEvent *)
       virtual void widgetMouseReleaseEvent (QMouseEvent *)
       virtual void widgetMouseMoveEvent (QMouseEvent *)
       virtual void widgetKeyPressEvent (QKeyEvent *)
       virtual void widgetKeyReleaseEvent (QKeyEvent *)
       virtual void paintEvent (QPaintEvent *)
           Paint event.
       virtual QBitmap contentsMask () const
           Calculate a mask for the contents of the panned widget.
       virtual QPixmap grab () const

See Also