24 QObjectList children = w->children();
25 for (
int i = 0; i < children.size(); i++ )
92 setAttribute( Qt::WA_TransparentForMouseEvents );
93 setAttribute( Qt::WA_NoSystemBackground );
94 setFocusPolicy( Qt::NoFocus );
111 Qt::KeyboardModifiers modifiers )
119 Qt::KeyboardModifiers &modifiers )
const 133 Qt::KeyboardModifiers modifiers )
141 Qt::KeyboardModifiers &modifiers )
const 172 if ( parentWidget() )
173 return parentWidget()->cursor();
194 QWidget *w = parentWidget();
199 w->installEventFilter(
this );
203 w->removeEventFilter(
this );
260 r.moveCenter( QPointF( r.center().x() + dx, r.center().y() + dy ) );
265 QPainter painter( &pm );
271 painter.drawPixmap( r.toRect(), masked );
283 painter.begin(
this );
284 painter.setClipRegion( event->region() );
285 painter.drawPixmap( 0, 0, pm );
308 #if QT_VERSION >= 0x050000 309 return parentWidget()->grab( parentWidget()->rect() );
311 return QPixmap::grabWidget( parentWidget() );
332 if (
object == NULL ||
object != parentWidget() )
335 switch ( event->type() )
337 case QEvent::MouseButtonPress:
342 case QEvent::MouseMove:
347 case QEvent::MouseButtonRelease:
352 case QEvent::KeyPress:
357 case QEvent::KeyRelease:
389 QWidget *w = parentWidget();
399 setGeometry( parentWidget()->rect() );
403 for (
int i = 0; i < pickers.size(); i++ )
409 for (
int i = 0; i < pickers.size(); i++ )
426 QPoint pos = mouseEvent->pos();
432 if ( pos !=
d_data->
pos && rect().contains( pos ) )
458 QPoint pos = mouseEvent->pos();
504 Q_UNUSED( keyEvent );
513 QWidget *w = parentWidget();
521 if ( w->testAttribute( Qt::WA_SetCursor ) )
543 #include "moc_qwt_panner.cpp" const QCursor cursor() const
virtual void widgetKeyReleaseEvent(QKeyEvent *)
QwtPanner(QWidget *parent)
static void fillPixmap(const QWidget *, QPixmap &, const QPoint &offset=QPoint())
void setCursor(const QCursor &)
void setOrientations(Qt::Orientations)
void setAbortKey(int key, Qt::KeyboardModifiers=Qt::NoModifier)
virtual QBitmap contentsMask() const
Calculate a mask for the contents of the panned widget.
void moved(int dx, int dy)
virtual void widgetMouseMoveEvent(QMouseEvent *)
virtual void widgetMouseReleaseEvent(QMouseEvent *)
Qt::KeyboardModifiers abortKeyModifiers
bool isOrientationEnabled(Qt::Orientation) const
virtual void widgetKeyPressEvent(QKeyEvent *)
Qt::Orientations orientations
static qreal devicePixelRatio(const QPaintDevice *)
virtual void widgetMousePressEvent(QMouseEvent *)
virtual bool eventFilter(QObject *, QEvent *) QWT_OVERRIDE
Event filter.
virtual void paintEvent(QPaintEvent *) QWT_OVERRIDE
Paint event.
void panned(int dx, int dy)
Qt::Orientations orientations() const
Return the orientation, where paning is enabled.
void getAbortKey(int &key, Qt::KeyboardModifiers &) const
Get the abort key and modifiers.
virtual QPixmap grab() const
virtual ~QwtPanner()
Destructor.
Qt::KeyboardModifiers buttonModifiers
static QVector< QwtPicker * > qwtActivePickers(QWidget *w)
void setMouseButton(Qt::MouseButton, Qt::KeyboardModifiers=Qt::NoModifier)
void setEnabled(bool)
En/disable the panner.
QwtPicker provides selections on a widget.
static QPixmap backingStore(QWidget *, const QSize &)
void getMouseButton(Qt::MouseButton &button, Qt::KeyboardModifiers &) const
Get mouse button and modifiers used for panning.