⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 qwtpicker.3

📁 软件无线电的平台
💻 3
字号:
.TH "QwtPicker" 3 "4 Nov 2003" "Qwt User's Guide" \" -*- nroff -*-.ad l.nh.SH NAMEQwtPicker \- .SH SYNOPSIS.br.PPInherits \fBQwtEventPattern\fP..PPInherited by \fBQwtPlotPicker\fP..PP.SH "Detailed Description".PP QwtPicker provides selections on a widget. QwtPicker filters all mouse and keyboard events of a widget and translates them into an array of selected points. Depending on the \fBQwtPicker::SelectionType\fP the selection might be a single point, a rectangle or a polygon. The selection process is supported by optional rubberbands (rubberband selection) and position labels..PPQwtPicker is useful for widgets where the event handlers can磘 be overloaded, like for components of composite widgets. It offers alternative handlers for mouse and key events..PP\fBExample \fP.RS 4.PP.nf #include <qwt_picker.h>QwtPicker *picker = new QwtPicker(widget);picker->setCursorLabelMode(QwtPicker::ActiveOnly);connect(picker, SIGNAL(selected(const QPointArray &)), ...);// emit the position of clicks on widgetpicker->setSelectionFlags(QwtPicker::PointSelection | QwtPicker::ClickSelection);    ...    // now select rectanglespicker->setSelectionFlags(QwtPicker::RectSelection | QwtPicker::DragSelection);picker->setRubberBand(QwtPicker::RectRubberBand); .PP.br.RE.PPThe selection process uses the commands \fBbegin()\fP, \fBappend()\fP, \fBmove()\fP and \fBend()\fP. \fBappend()\fP adds a new point to the selection, \fBmove()\fP changes the position of the latest point..PPThe commands are initiated from a small state machine (\fBQwtPickerMachine\fP) that translates mouse and key events. There are a couple of predefined state machines for point, rect and polygon selections. The \fBselectionFlags()\fP control which one should be used. It is possible to use other machines by overloading \fBstateMachine()\fP..PPThe picker is active (\fBisActive()\fP), between \fBbegin()\fP and \fBend()\fP. In active state the rubberband is displayed, and the cursor label is visible in case of cursorLabelMode is ActiveOnly or AlwaysOn..PPThe cursor can be moved using the arrow keys. All selections can be aborted using the abort key. (\fBQwtEventPattern::KeyPatternCode\fP).PP\fBWarning:\fP.RS 4In case of QWidget::NoFocus the focus policy of the observed widget is set to QWidget::WheelFocus and mouse tracking will be manipulated for ClickSelection while the picker is active, or if \fBcursorLabelMode()\fP is AlwayOn. .RE.PP.PP.SS "Public Types".in +1c.ti -1c.RI "enum \fBSelectionType\fP { \fBNoSelection\fP =  0, \fBPointSelection\fP =  1, \fBRectSelection\fP =  2, \fBPolygonSelection\fP =  4 }".br.ti -1c.RI "enum \fBRectSelectionType\fP { \fBCornerToCorner\fP =  64, \fBCenterToCorner\fP =  128, \fBCenterToRadius\fP =  256 }".br.ti -1c.RI "enum \fBSelectionMode\fP { \fBClickSelection\fP =  1024, \fBDragSelection\fP =  2048 }".br.ti -1c.RI "enum \fBRubberBand\fP { \fBNoRubberBand\fP =  0, \fBHLineRubberBand\fP, \fBVLineRubberBand\fP, \fBCrossRubberBand\fP, \fBRectRubberBand\fP, \fBEllipseRubberBand\fP, \fBPolygonRubberBand\fP, \fBUserRubberBand\fP =  100 }".br.ti -1c.RI "enum \fBDisplayMode\fP { \fBAlwaysOff\fP, \fBAlwaysOn\fP, \fBActiveOnly\fP }".br.ti -1c.RI "enum \fBResizeMode\fP { \fBStretch\fP, \fBKeepSize\fP }".br.in -1c.SS "Public Member Functions".in +1c.ti -1c.RI "\fBQwtPicker\fP (QWidget *, const  char *name=0)".br.ti -1c.RI "\fBQwtPicker\fP (int selectionFlags, \fBRubberBand\fP rubberBand, \fBDisplayMode\fP cursorLabelMode, QWidget *, const  char *name=0)".br.ti -1c.RI "virtual \fB~QwtPicker\fP ()".br.ti -1c.RI "virtual void \fBsetSelectionFlags\fP (int)".br.ti -1c.RI "int \fBselectionFlags\fP () const ".br.ti -1c.RI "virtual void \fBsetRubberBand\fP (\fBRubberBand\fP)".br.ti -1c.RI "\fBRubberBand\fP \fBrubberBand\fP () const ".br.ti -1c.RI "virtual void \fBsetCursorLabelMode\fP (\fBDisplayMode\fP)".br.ti -1c.RI "\fBDisplayMode\fP \fBcursorLabelMode\fP () const ".br.ti -1c.RI "virtual void \fBsetResizeMode\fP (\fBResizeMode\fP)".br.ti -1c.RI "\fBResizeMode\fP \fBresizeMode\fP () const ".br.ti -1c.RI "virtual void \fBsetRubberBandPen\fP (const  QPen &)".br.ti -1c.RI "QPen \fBrubberBandPen\fP () const ".br.ti -1c.RI "virtual void \fBsetCursorLabelPen\fP (const  QPen &)".br.ti -1c.RI "QPen \fBcursorLabelPen\fP () const ".br.ti -1c.RI "virtual void \fBsetCursorLabelFont\fP (const  QFont &)".br.ti -1c.RI "QFont \fBcursorLabelFont\fP () const ".br.ti -1c.RI "bool \fBisEnabled\fP () const ".br.ti -1c.RI "virtual void \fBsetEnabled\fP (bool)".br.ti -1c.RI "bool \fBisActive\fP () const ".br.ti -1c.RI "virtual bool \fBevent\fP (QEvent *)".br.ti -1c.RI "virtual bool \fBeventFilter\fP (QObject *, QEvent *)".br.ti -1c.RI "QWidget * \fBparentWidget\fP ()".br.ti -1c.RI "const  QWidget * \fBparentWidget\fP () const ".br.ti -1c.RI "virtual QRect \fBpickRect\fP () const ".br.ti -1c.RI "const  QPointArray & \fBselection\fP () const ".br.in -1c.SS "Protected Member Functions".in +1c.ti -1c.RI "void \fBselected\fP (const  QPointArray &pa)".br.ti -1c.RI "void \fBappended\fP (const  QPoint &pos)".br.ti -1c.RI "void \fBmoved\fP (const  QPoint &pos)".br.ti -1c.RI "void \fBchanged\fP (const  QPointArray &pa)".br.ti -1c.RI "virtual bool \fBaccept\fP (QPointArray &selection) const ".br.ti -1c.RI "virtual void \fBtransition\fP (const  QEvent *)".br.ti -1c.RI "virtual void \fBbegin\fP ()".br.ti -1c.RI "virtual void \fBappend\fP (const  QPoint &)".br.ti -1c.RI "virtual void \fBmove\fP (const  QPoint &)".br.ti -1c.RI "virtual bool \fBend\fP (bool ok=TRUE)".br.ti -1c.RI "virtual void \fBwidgetMousePressEvent\fP (QMouseEvent *)".br.ti -1c.RI "virtual void \fBwidgetMouseReleaseEvent\fP (QMouseEvent *)".br.ti -1c.RI "virtual void \fBwidgetMouseDoubleClickEvent\fP (QMouseEvent *)".br.ti -1c.RI "virtual void \fBwidgetMouseMoveEvent\fP (QMouseEvent *)".br.ti -1c.RI "virtual void \fBwidgetWheelEvent\fP (QWheelEvent *)".br.ti -1c.RI "virtual void \fBwidgetKeyPressEvent\fP (QKeyEvent *)".br.ti -1c.RI "virtual void \fBwidgetKeyReleaseEvent\fP (QKeyEvent *)".br.ti -1c.RI "virtual void \fBdrawRubberBand\fP (const  QRect &clipRect=QRect()) const ".br.ti -1c.RI "virtual void \fBdrawRubberBand\fP (QPainter *, const  QRect &rect, const  QPointArray &) const ".br.ti -1c.RI "virtual void \fBdrawCursorLabel\fP (const  QRect &clipRect=QRect()) const ".br.ti -1c.RI "virtual void \fBdrawCursorLabel\fP (QPainter *, const  QRect &rect, const  QPoint &, const  QPointArray &) const ".br.ti -1c.RI "virtual void \fBstretchSelection\fP (const  QSize &oldSize, const  QSize &newSize)".br.ti -1c.RI "virtual QString \fBcursorLabel\fP (const  QPoint &pos) const ".br.ti -1c.RI "virtual \fBQwtPickerMachine\fP * \fBstateMachine\fP (int) const ".br.in -1c.SH "Member Enumeration Documentation".PP .SS "enum \fBQwtPicker::DisplayMode\fP".PP.IP "\(bu" 2AlwaysOff.br Display never..IP "\(bu" 2AlwaysOn.br Display always..IP "\(bu" 2ActiveOnly.br Display only when the selection is active..PP.PP\fBSee also:\fP.RS 4QwtPicker::setDisplayMode(), QwtPicker::displayMode(), \fBQwtPicker::isActive()\fP .RE.PP.SS "enum \fBQwtPicker::RectSelectionType\fP".PPSelection subtype for RectSelection This enum type describes the type of rectangle selections. It can be or磀 with \fBQwtPicker::RectSelectionType\fP and \fBQwtPicker::SelectionMode\fP and passed to \fBQwtPicker::setSelectionFlags()\fP..IP "\(bu" 2CornerToCorner.br The first and the second selected point are the corners of the rectangle..IP "\(bu" 2CenterToCorner.br The first point is the center, the second a corner of the rectangle..IP "\(bu" 2CenterToRadius.br The first point is the center of a quadrat, calculated by the maximum of the x- and y-distance. .PPThe default value is CornerToCorner. .PP\fBSee also:\fP.RS 4\fBQwtPicker::setSelectionFlags()\fP, \fBQwtPicker::selectionFlags()\fP .RE.PP.SS "enum \fBQwtPicker::ResizeMode\fP".PPControls what to do with the selected points of an active selection when the observed widget is resized..IP "\(bu" 2Stretch.br All points are scaled according to the new size,.IP "\(bu" 2KeepSize.br All points remain unchanged..PP.PPThe default value is Stretch. .PP\fBSee also:\fP.RS 4\fBQwtPicker::setResizeMode()\fP, QwtPicker::resize() .RE.PP.SS "enum \fBQwtPicker::RubberBand\fP".PPRubberband style.IP "\(bu" 2NoRubberBand.br No rubberband..IP "\(bu" 2HLineRubberBand & PointSelection.br A horizontal line..IP "\(bu" 2VLineRubberBand & PointSelection.br A vertical line..IP "\(bu" 2CrossRubberBand & PointSelection.br A horizontal and a vertical line..IP "\(bu" 2RectRubberBand & RectSelection.br A rectangle..IP "\(bu" 2EllipseRubberBand & RectSelection.br An ellipse..IP "\(bu" 2PolygonRubberBand &PolygonSelection.br A polygon..IP "\(bu" 2UserRubberBand.br Values >= UserRubberBand can be used to define additional rubber bands..PP.PPThe default value is NoRubberBand. .PP\fBSee also:\fP.RS 4\fBQwtPicker::setRubberBand()\fP, \fBQwtPicker::rubberBand()\fP .RE.PP.SS "enum \fBQwtPicker::SelectionMode\fP".PPValues of this enum type or磀 together with a SelectionType value identifies which state machine should be used for the selection..PPThe default value is ClickSelection. .PP\fBSee also:\fP.RS 4\fBstateMachine()\fP .RE.PP.SS "enum \fBQwtPicker::SelectionType\fP".PPThis enum type describes the type of a selection. It can be or磀 with \fBQwtPicker::RectSelectionType\fP and \fBQwtPicker::SelectionMode\fP and passed to \fBQwtPicker::setSelectionFlags()\fP.IP "\(bu" 2NoSelection.br Selection is disabled. Note this is different to the disabled state, as you might have a cursor label..IP "\(bu" 2PointSelection.br Select a single point..IP "\(bu" 2RectSelection.br Select a rectangle..IP "\(bu" 2PolygonSelection.br Select a polygon..PP.PPThe default value is NoSelection. .PP\fBSee also:\fP.RS 4\fBQwtPicker::setSelectionFlags()\fP, \fBQwtPicker::selectionFlags()\fP .RE.PP.SH "Constructor & Destructor Documentation".PP .SS "QwtPicker::QwtPicker (QWidget * parent, const char * name = 0)".PPConstructor.PPCreates an picker that is enabled, but where selection flags s set to NoSelection, rubberband and cursor label are disabled..PP\fBParameters:\fP.RS 4\fIparent\fP Parent widget, that will be observed .br\fIname\fP Object name .RE.PP.SS "QwtPicker::QwtPicker (int selectionFlags, \fBRubberBand\fP rubberBand, \fBDisplayMode\fP cursorLabelMode, QWidget * parent, const char * name = 0)".PPConstructor.PP\fBParameters:\fP.RS 4\fIselectionFlags\fP Or磀 value of SelectionType, RectSelectionType and SelectionMode .br\fIrubberBand\fP Rubberband style .br\fIcursorLabelMode\fP Cursor label mode .br\fIparent\fP Parent widget, that will be observed .br\fIname\fP Object name .RE.PP.SS "QwtPicker::~\fBQwtPicker\fP ()\fC [virtual]\fP".PPDestructor. .SH "Member Function Documentation".PP .SS "bool QwtPicker::accept (QPointArray & selection) const\fC [protected, virtual]\fP".PPValidate and fixup the selection. Accepts all selections unmodified.PP\fBParameters:\fP.RS 4\fIselection\fP Selection to validate and fixup .RE.PP\fBReturns:\fP.RS 4TRUE, when accepted, FALSE otherwise .RE.PPReimplemented in \fBQwtPlotZoomer\fP..SS "void QwtPicker::append (const QPoint & pos)\fC [protected, virtual]\fP".PPAppend a point to the selection and update rubberband and cursor label. The \fBappended()\fP signal is emitted..PP\fBParameters:\fP.RS 4\fIpos\fP Additional point.RE.PP\fBSee also:\fP.RS 4\fBisActive\fP, \fBbegin()\fP, \fBend()\fP, \fBmove()\fP, \fBappended()\fP .RE.PPReimplemented in \fBQwtPlotPicker\fP..SS "void QwtPicker::appended (const QPoint & pos)\fC [protected]\fP".PPA signal emitted when a point has been appended to the selection.PP\fBParameters:\fP.RS 4\fIpos\fP Position of the appended point. .RE.PP\fBSee also:\fP.RS 4\fBappend()\fP. \fBmoved()\fP .RE.PP.SS "void QwtPicker::begin ()\fC [protected, virtual]\fP".PPOpen a selection setting the state to active.PP\fBSee also:\fP.RS 4\fBisActive\fP, \fBend()\fP, \fBappend()\fP, \fBmove()\fP .RE.PPReimplemented in \fBQwtPlotZoomer\fP..SS "void QwtPicker::changed (const QPointArray & pa)\fC [protected]\fP".PPA signal emitted when the active selection has been changed. This might happen when the observed widget is resized..PP\fBParameters:\fP.RS 4\fIpa\fP Changed selection .RE.PP\fBSee also:\fP.RS 4\fBstretchSelection()\fP .RE.PP.SS "QString QwtPicker::cursorLabel (const QPoint & pos) const\fC [protected, virtual]\fP".PPReturn the label for a position. In case of HLineRubberBand the label is the value of the y position, in case of VLineRubberBand the value of the x position. Otherwise the label contains x and y position separated by a 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -