QWT API (中文) 7.3.0
Qt绘图库 - 中文API文档
载入中...
搜索中...
未找到
| Public 成员函数 | Protected 成员函数 | 所有成员列表
QwtMagnifier类 参考abstract

QwtMagnifier provides zooming by magnifying in steps 更多...

#include <qwt_magnifier.h>

类 QwtMagnifier 继承关系图:
QwtPlotMagnifier QwtPolarMagnifier

class  PrivateData
 

Public 成员函数

 QwtMagnifier (QWidget *)
 Constructor
 
QWidget * parentWidget ()
 Return the parent widget where the rescaling happens
 
const QWidget * parentWidget () const
 Return the parent widget where the rescaling happens
 
void setEnabled (bool)
 En/disable the magnifier
 
bool isEnabled () const
 Return whether the magnifier is enabled
 
void setMouseFactor (double)
 Change the mouse factor
 
double mouseFactor () const
 Return the mouse factor
 
void setMouseButton (Qt::MouseButton, Qt::KeyboardModifiers=Qt::NoModifier)
 Assign the mouse button that is used for zooming in/out
 
void getMouseButton (Qt::MouseButton &, Qt::KeyboardModifiers &) const
 Get the mouse button and modifiers used for zooming
 
void setWheelFactor (double)
 Change the wheel factor
 
double wheelFactor () const
 Return the wheel factor
 
void setWheelModifiers (Qt::KeyboardModifiers)
 Assign keyboard modifiers for zooming in/out using the wheel
 
Qt::KeyboardModifiers wheelModifiers () const
 Return the wheel modifiers
 
void setKeyFactor (double)
 Change the key factor
 
double keyFactor () const
 Return the key factor
 
void setZoomInKey (int key, Qt::KeyboardModifiers=Qt::NoModifier)
 Assign the key that is used for zooming in
 
void getZoomInKey (int &key, Qt::KeyboardModifiers &) const
 Retrieve the settings of the zoom in key
 
void setZoomOutKey (int key, Qt::KeyboardModifiers=Qt::NoModifier)
 Assign the key that is used for zooming out
 
void getZoomOutKey (int &key, Qt::KeyboardModifiers &) const
 Retrieve the settings of the zoom out key
 
virtual bool eventFilter (QObject *, QEvent *) override
 Event filter
 

Protected 成员函数

virtual void rescale (double factor)=0
 
virtual void widgetMousePressEvent (QMouseEvent *)
 Handle a mouse press event for the observed widget.
 
virtual void widgetMouseReleaseEvent (QMouseEvent *)
 Handle a mouse release event for the observed widget.
 
virtual void widgetMouseMoveEvent (QMouseEvent *)
 Handle a mouse move event for the observed widget.
 
virtual void widgetWheelEvent (QWheelEvent *)
 Handle a wheel event for the observed widget.
 
virtual void widgetKeyPressEvent (QKeyEvent *)
 Handle a key press event for the observed widget.
 
virtual void widgetKeyReleaseEvent (QKeyEvent *)
 Handle a key release event for the observed widget.
 

详细描述

QwtMagnifier provides zooming by magnifying in steps

Using QwtMagnifier a plot can be zoomed in/out in steps using keys, the mouse wheel or moving a mouse button in vertical direction.

构造及析构函数说明

◆ QwtMagnifier()

QwtMagnifier::QwtMagnifier ( QWidget *  parent)
explicit

Constructor

参数
[in]parentWidget to be magnified

Destructor

成员函数说明

◆ eventFilter()

bool QwtMagnifier::eventFilter ( QObject *  object,
QEvent *  event 
)
overridevirtual

Event filter

When isEnabled() is true, the mouse events of the observed widget are filtered.

参数
[in]objectObject to be filtered
[in]eventEvent
返回
Forwarded to QObject::eventFilter()
参见
widgetMousePressEvent(), widgetMouseReleaseEvent(), widgetMouseMoveEvent(), widgetWheelEvent(), widgetKeyPressEvent(), widgetKeyReleaseEvent()

◆ getMouseButton()

void QwtMagnifier::getMouseButton ( Qt::MouseButton &  button,
Qt::KeyboardModifiers &  modifiers 
) const

Get the mouse button and modifiers used for zooming

参数
[out]buttonMouse button used for zooming
[out]modifiersKeyboard modifiers used for zooming
参见
setMouseButton()

◆ getZoomInKey()

void QwtMagnifier::getZoomInKey ( int &  key,
Qt::KeyboardModifiers &  modifiers 
) const

Retrieve the settings of the zoom in key

参数
[out]keyKey code, see Qt::Key
[out]modifiersKeyboard modifiers
参见
setZoomInKey()

◆ getZoomOutKey()

void QwtMagnifier::getZoomOutKey ( int &  key,
Qt::KeyboardModifiers &  modifiers 
) const

Retrieve the settings of the zoom out key

参数
[out]keyKey code, see Qt::Key
[out]modifiersKeyboard modifiers
参见
setZoomOutKey()

◆ isEnabled()

bool QwtMagnifier::isEnabled ( ) const

Return whether the magnifier is enabled

返回
true when enabled, false otherwise
参见
setEnabled(), eventFilter()

◆ keyFactor()

double QwtMagnifier::keyFactor ( ) const

Return the key factor

返回
Key factor
参见
setKeyFactor()

◆ mouseFactor()

double QwtMagnifier::mouseFactor ( ) const

Return the mouse factor

返回
Mouse factor
参见
setMouseFactor()

◆ parentWidget() [1/2]

QWidget * QwtMagnifier::parentWidget ( )

Return the parent widget where the rescaling happens

返回
Parent widget

◆ parentWidget() [2/2]

const QWidget * QwtMagnifier::parentWidget ( ) const

Return the parent widget where the rescaling happens

返回
Parent widget (const)

◆ setEnabled()

void QwtMagnifier::setEnabled ( bool  on)

En/disable the magnifier

When enabled is true an event filter is installed for the observed widget, otherwise the event filter is removed.

参数
[in]ontrue or false
参见
isEnabled(), eventFilter()

◆ setKeyFactor()

void QwtMagnifier::setKeyFactor ( double  factor)

Change the key factor

The key factor defines the ratio between the current range on the parent widget and the zoomed range for each key press of the zoom in/out keys. The default value is 0.9.

参数
[in]factorKey factor
参见
keyFactor(), setZoomInKey(), setZoomOutKey(), setWheelFactor(), setMouseFactor()

◆ setMouseButton()

void QwtMagnifier::setMouseButton ( Qt::MouseButton  button,
Qt::KeyboardModifiers  modifiers = Qt::NoModifier 
)

Assign the mouse button that is used for zooming in/out

The default value is Qt::RightButton.

参数
[in]buttonButton
[in]modifiersKeyboard modifiers
参见
getMouseButton()

◆ setMouseFactor()

void QwtMagnifier::setMouseFactor ( double  factor)

Change the mouse factor

The mouse factor defines the ratio between the current range on the parent widget and the zoomed range for each vertical mouse movement. The default value is 0.95.

参数
[in]factorMouse factor
参见
mouseFactor(), setMouseButton(), setWheelFactor(), setKeyFactor()

◆ setWheelFactor()

void QwtMagnifier::setWheelFactor ( double  factor)

Change the wheel factor

The wheel factor defines the ratio between the current range on the parent widget and the zoomed range for each step of the wheel. Use values > 1 for magnification (i.e. 2.0) and values < 1 for scaling down (i.e. 1/2.0 = 0.5). You can use this feature for inverting the direction of the wheel. The default value is 0.9.

参数
[in]factorWheel factor
参见
wheelFactor(), setWheelButtonState(), setMouseFactor(), setKeyFactor()

◆ setWheelModifiers()

void QwtMagnifier::setWheelModifiers ( Qt::KeyboardModifiers  modifiers)

Assign keyboard modifiers for zooming in/out using the wheel

The default modifiers are Qt::NoModifiers.

参数
[in]modifiersKeyboard modifiers
参见
wheelModifiers()

◆ setZoomInKey()

void QwtMagnifier::setZoomInKey ( int  key,
Qt::KeyboardModifiers  modifiers = Qt::NoModifier 
)

Assign the key that is used for zooming in

The default combination is Qt::Key_Plus + Qt::NoModifier.

参数
[in]keyKey code
[in]modifiersKeyboard modifiers
参见
getZoomInKey(), setZoomOutKey()

◆ setZoomOutKey()

void QwtMagnifier::setZoomOutKey ( int  key,
Qt::KeyboardModifiers  modifiers = Qt::NoModifier 
)

Assign the key that is used for zooming out

The default combination is Qt::Key_Minus + Qt::NoModifier.

参数
[in]keyKey code
[in]modifiersKeyboard modifiers
参见
getZoomOutKey(), setZoomInKey()

◆ wheelFactor()

double QwtMagnifier::wheelFactor ( ) const

Return the wheel factor

返回
Wheel factor
参见
setWheelFactor()

◆ wheelModifiers()

Qt::KeyboardModifiers QwtMagnifier::wheelModifiers ( ) const

Return the wheel modifiers

返回
Wheel modifiers
参见
setWheelModifiers()

◆ widgetKeyPressEvent()

void QwtMagnifier::widgetKeyPressEvent ( QKeyEvent *  keyEvent)
protectedvirtual

Handle a key press event for the observed widget.

参数
keyEventKey event
参见
eventFilter(), widgetKeyReleaseEvent()

QwtPolarMagnifier 重载.

◆ widgetKeyReleaseEvent()

void QwtMagnifier::widgetKeyReleaseEvent ( QKeyEvent *  keyEvent)
protectedvirtual

Handle a key release event for the observed widget.

参数
keyEventKey event
参见
eventFilter(), widgetKeyReleaseEvent()

◆ widgetMouseMoveEvent()

void QwtMagnifier::widgetMouseMoveEvent ( QMouseEvent *  mouseEvent)
protectedvirtual

Handle a mouse move event for the observed widget.

参数
mouseEventMouse event
参见
eventFilter(), widgetMousePressEvent(), widgetMouseReleaseEvent(),

◆ widgetMousePressEvent()

void QwtMagnifier::widgetMousePressEvent ( QMouseEvent *  mouseEvent)
protectedvirtual

Handle a mouse press event for the observed widget.

参数
mouseEventMouse event
参见
eventFilter(), widgetMouseReleaseEvent(), widgetMouseMoveEvent()

◆ widgetMouseReleaseEvent()

void QwtMagnifier::widgetMouseReleaseEvent ( QMouseEvent *  mouseEvent)
protectedvirtual

Handle a mouse release event for the observed widget.

参数
mouseEventMouse event
参见
eventFilter(), widgetMousePressEvent(), widgetMouseMoveEvent(),

◆ widgetWheelEvent()

void QwtMagnifier::widgetWheelEvent ( QWheelEvent *  wheelEvent)
protectedvirtual

Handle a wheel event for the observed widget.

参数
wheelEventWheel event
参见
eventFilter()

该类的文档由以下文件生成: