QwtPicker.3
28.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
.TH "QwtPicker" 3 "Sat Jan 26 2013" "Version 6.1-rc3" "Qwt User's Guide" \" -*- nroff -*-
.ad l
.nh
.SH NAME
QwtPicker \-
.PP
\fBQwtPicker\fP provides selections on a widget\&.
.SH SYNOPSIS
.br
.PP
.PP
\fC#include <qwt_picker\&.h>\fP
.PP
Inherits QObject, and \fBQwtEventPattern\fP\&.
.PP
Inherited by \fBQwtPlotPicker\fP\&.
.SS "Public Types"
.in +1c
.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
.RI "\fIDisplay mode\&. \fP"
.ti -1c
.RI "enum \fBResizeMode\fP { \fBStretch\fP, \fBKeepSize\fP }"
.br
.in -1c
.SS "Public Slots"
.in +1c
.ti -1c
.RI "void \fBsetEnabled\fP (bool)"
.br
.RI "\fIEn/disable the picker\&. \fP"
.in -1c
.SS "Signals"
.in +1c
.ti -1c
.RI "void \fBactivated\fP (bool on)"
.br
.ti -1c
.RI "void \fBselected\fP (const QPolygon &polygon)"
.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 \fBremoved\fP (const QPoint &pos)"
.br
.ti -1c
.RI "void \fBchanged\fP (const QPolygon &\fBselection\fP)"
.br
.in -1c
.SS "Public Member Functions"
.in +1c
.ti -1c
.RI "\fBQwtPicker\fP (QWidget *parent)"
.br
.ti -1c
.RI "\fBQwtPicker\fP (\fBRubberBand\fP \fBrubberBand\fP, \fBDisplayMode\fP \fBtrackerMode\fP, QWidget *)"
.br
.ti -1c
.RI "virtual \fB~QwtPicker\fP ()"
.br
.RI "\fIDestructor\&. \fP"
.ti -1c
.RI "void \fBsetStateMachine\fP (\fBQwtPickerMachine\fP *)"
.br
.ti -1c
.RI "const \fBQwtPickerMachine\fP * \fBstateMachine\fP () const "
.br
.ti -1c
.RI "\fBQwtPickerMachine\fP * \fBstateMachine\fP ()"
.br
.ti -1c
.RI "void \fBsetRubberBand\fP (\fBRubberBand\fP)"
.br
.ti -1c
.RI "\fBRubberBand\fP \fBrubberBand\fP () const "
.br
.ti -1c
.RI "void \fBsetTrackerMode\fP (\fBDisplayMode\fP)"
.br
.RI "\fISet the display mode of the tracker\&. \fP"
.ti -1c
.RI "\fBDisplayMode\fP \fBtrackerMode\fP () const "
.br
.ti -1c
.RI "void \fBsetResizeMode\fP (\fBResizeMode\fP)"
.br
.RI "\fISet the resize mode\&. \fP"
.ti -1c
.RI "\fBResizeMode\fP \fBresizeMode\fP () const "
.br
.ti -1c
.RI "void \fBsetRubberBandPen\fP (const QPen &)"
.br
.ti -1c
.RI "QPen \fBrubberBandPen\fP () const "
.br
.ti -1c
.RI "void \fBsetTrackerPen\fP (const QPen &)"
.br
.ti -1c
.RI "QPen \fBtrackerPen\fP () const "
.br
.ti -1c
.RI "void \fBsetTrackerFont\fP (const QFont &)"
.br
.ti -1c
.RI "QFont \fBtrackerFont\fP () const "
.br
.ti -1c
.RI "bool \fBisEnabled\fP () const "
.br
.ti -1c
.RI "bool \fBisActive\fP () const "
.br
.ti -1c
.RI "virtual bool \fBeventFilter\fP (QObject *, QEvent *)"
.br
.RI "\fIEvent filter\&. \fP"
.ti -1c
.RI "QWidget * \fBparentWidget\fP ()"
.br
.RI "\fIReturn the parent widget, where the selection happens\&. \fP"
.ti -1c
.RI "const QWidget * \fBparentWidget\fP () const "
.br
.RI "\fIReturn the parent widget, where the selection happens\&. \fP"
.ti -1c
.RI "virtual QPainterPath \fBpickArea\fP () const "
.br
.ti -1c
.RI "virtual void \fBdrawRubberBand\fP (QPainter *) const "
.br
.ti -1c
.RI "virtual void \fBdrawTracker\fP (QPainter *) const "
.br
.ti -1c
.RI "virtual QRegion \fBrubberBandMask\fP () const "
.br
.ti -1c
.RI "virtual \fBQwtText\fP \fBtrackerText\fP (const QPoint &pos) const "
.br
.RI "\fIReturn the label for a position\&. \fP"
.ti -1c
.RI "QPoint \fBtrackerPosition\fP () const "
.br
.ti -1c
.RI "virtual QRect \fBtrackerRect\fP (const QFont &) const "
.br
.ti -1c
.RI "QPolygon \fBselection\fP () const "
.br
.in -1c
.SS "Protected Member Functions"
.in +1c
.ti -1c
.RI "virtual QPolygon \fBadjustedPoints\fP (const QPolygon &) const "
.br
.RI "\fIMap the \fBpickedPoints()\fP into a \fBselection()\fP \fP"
.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 void \fBremove\fP ()"
.br
.ti -1c
.RI "virtual bool \fBend\fP (bool ok=true)"
.br
.RI "\fIClose a selection setting the state to inactive\&. \fP"
.ti -1c
.RI "virtual bool \fBaccept\fP (QPolygon &) const "
.br
.RI "\fIValidate and fix up the selection\&. \fP"
.ti -1c
.RI "virtual void \fBreset\fP ()"
.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 \fBwidgetEnterEvent\fP (QEvent *)"
.br
.ti -1c
.RI "virtual void \fBwidgetLeaveEvent\fP (QEvent *)"
.br
.ti -1c
.RI "virtual void \fBstretchSelection\fP (const QSize &oldSize, const QSize &newSize)"
.br
.ti -1c
.RI "virtual void \fBupdateDisplay\fP ()"
.br
.RI "\fIUpdate the state of rubber band and tracker label\&. \fP"
.ti -1c
.RI "const \fBQwtWidgetOverlay\fP * \fBrubberBandOverlay\fP () const "
.br
.ti -1c
.RI "const \fBQwtWidgetOverlay\fP * \fBtrackerOverlay\fP () const "
.br
.ti -1c
.RI "const QPolygon & \fBpickedPoints\fP () const "
.br
.in -1c
.SH "Detailed Description"
.PP
\fBQwtPicker\fP provides selections on a widget\&.
\fBQwtPicker\fP filters all enter, leave, mouse and keyboard events of a widget and translates them into an array of selected points\&.
.PP
The way how the points are collected depends on type of state machine that is connected to the picker\&. Qwt offers a couple of predefined state machines for selecting:
.PP
.IP "\(bu" 2
Nothing
.br
\fBQwtPickerTrackerMachine\fP
.IP "\(bu" 2
Single points
.br
\fBQwtPickerClickPointMachine\fP, \fBQwtPickerDragPointMachine\fP
.IP "\(bu" 2
Rectangles
.br
\fBQwtPickerClickRectMachine\fP, \fBQwtPickerDragRectMachine\fP
.IP "\(bu" 2
Polygons
.br
\fBQwtPickerPolygonMachine\fP
.PP
.PP
While these state machines cover the most common ways to collect points it is also possible to implement individual machines as well\&.
.PP
\fBQwtPicker\fP translates the picked points into a selection using the \fBadjustedPoints()\fP method\&. \fBadjustedPoints()\fP is intended to be reimplemented to fix up the selection according to application specific requirements\&. (F\&.e\&. when an application accepts rectangles of a fixed aspect ratio only\&.)
.PP
Optionally \fBQwtPicker\fP support the process of collecting points by a rubber band and tracker displaying a text for the current mouse position\&.
.PP
\fBExample\fP
.RS 4
.PP
.nf
#include <qwt_picker.h>
#include <qwt_picker_machine.h>
QwtPicker *picker = new QwtPicker(widget);
picker->setStateMachine(new QwtPickerDragRectMachine);
picker->setTrackerMode(QwtPicker::ActiveOnly);
picker->setRubberBand(QwtPicker::RectRubberBand);
.fi
.PP
.br
.RE
.PP
The state machine triggers the following commands:
.PP
.IP "\(bu" 2
\fBbegin()\fP
.br
Activate/Initialize the selection\&.
.IP "\(bu" 2
\fBappend()\fP
.br
Add a new point
.IP "\(bu" 2
\fBmove()\fP
.br
Change the position of the last point\&.
.IP "\(bu" 2
\fBremove()\fP
.br
Remove the last point\&.
.IP "\(bu" 2
\fBend()\fP
.br
Terminate the selection and call accept to validate the picked points\&.
.PP
.PP
The picker is active (\fBisActive()\fP), between \fBbegin()\fP and \fBend()\fP\&. In active state the rubber band is displayed, and the tracker is visible in case of trackerMode is ActiveOnly or AlwaysOn\&.
.PP
The cursor can be moved using the arrow keys\&. All selections can be aborted using the abort key\&. (\fBQwtEventPattern::KeyPatternCode\fP)
.PP
\fBWarning:\fP
.RS 4
In case of QWidget::NoFocus the focus policy of the observed widget is set to QWidget::WheelFocus and mouse tracking will be manipulated while the picker is active, or if \fBtrackerMode()\fP is AlwayOn\&.
.RE
.PP
.SH "Member Enumeration Documentation"
.PP
.SS "enum \fBQwtPicker::DisplayMode\fP"
.PP
Display mode\&. \fBSee Also:\fP
.RS 4
\fBsetTrackerMode()\fP, \fBtrackerMode()\fP, \fBisActive()\fP
.RE
.PP
.PP
\fBEnumerator\fP
.in +1c
.TP
\fB\fIAlwaysOff \fP\fP
Display never\&.
.TP
\fB\fIAlwaysOn \fP\fP
Display always\&.
.TP
\fB\fIActiveOnly \fP\fP
Display only when the selection is active\&.
.SS "enum \fBQwtPicker::ResizeMode\fP"
Controls what to do with the selected points of an active selection when the observed widget is resized\&.
.PP
The default value is \fBQwtPicker::Stretch\fP\&.
.PP
\fBSee Also:\fP
.RS 4
\fBsetResizeMode()\fP
.RE
.PP
.PP
\fBEnumerator\fP
.in +1c
.TP
\fB\fIStretch \fP\fP
All points are scaled according to the new size,\&.
.TP
\fB\fIKeepSize \fP\fP
All points remain unchanged\&.
.SS "enum \fBQwtPicker::RubberBand\fP"
Rubber band style
.PP
The default value is \fBQwtPicker::NoRubberBand\fP\&.
.PP
\fBSee Also:\fP
.RS 4
\fBsetRubberBand()\fP, \fBrubberBand()\fP
.RE
.PP
.PP
\fBEnumerator\fP
.in +1c
.TP
\fB\fINoRubberBand \fP\fP
No rubberband\&.
.TP
\fB\fIHLineRubberBand \fP\fP
A horizontal line ( only for \fBQwtPickerMachine::PointSelection\fP )
.TP
\fB\fIVLineRubberBand \fP\fP
A vertical line ( only for \fBQwtPickerMachine::PointSelection\fP )
.TP
\fB\fICrossRubberBand \fP\fP
A crosshair ( only for \fBQwtPickerMachine::PointSelection\fP )
.TP
\fB\fIRectRubberBand \fP\fP
A rectangle ( only for \fBQwtPickerMachine::RectSelection\fP )
.TP
\fB\fIEllipseRubberBand \fP\fP
An ellipse ( only for \fBQwtPickerMachine::RectSelection\fP )
.TP
\fB\fIPolygonRubberBand \fP\fP
A polygon ( only for \fBQwtPickerMachine::PolygonSelection\fP )
.TP
\fB\fIUserRubberBand \fP\fP
Values >= UserRubberBand can be used to define additional rubber bands\&.
.SH "Constructor & Destructor Documentation"
.PP
.SS "QwtPicker::QwtPicker (QWidget *parent)\fC [explicit]\fP"
Constructor
.PP
Creates an picker that is enabled, but without a state machine\&. rubber band and tracker are disabled\&.
.PP
\fBParameters:\fP
.RS 4
\fIparent\fP Parent widget, that will be observed
.RE
.PP
.SS "QwtPicker::QwtPicker (\fBRubberBand\fPrubberBand, \fBDisplayMode\fPtrackerMode, QWidget *parent)\fC [explicit]\fP"
Constructor
.PP
\fBParameters:\fP
.RS 4
\fIrubberBand\fP Rubber band style
.br
\fItrackerMode\fP Tracker mode
.br
\fIparent\fP Parent widget, that will be observed
.RE
.PP
.SH "Member Function Documentation"
.PP
.SS "bool QwtPicker::accept (QPolygon &selection) const\fC [protected]\fP, \fC [virtual]\fP"
.PP
Validate and fix up the selection\&. Accepts all selections unmodified
.PP
\fBParameters:\fP
.RS 4
\fIselection\fP Selection to validate and fix up
.RE
.PP
\fBReturns:\fP
.RS 4
true, when accepted, false otherwise
.RE
.PP
.PP
Reimplemented in \fBQwtPlotZoomer\fP\&.
.SS "void QwtPicker::activated (boolon)\fC [signal]\fP"
A signal indicating, when the picker has been activated\&. Together with \fBsetEnabled()\fP it can be used to implement selections with more than one picker\&.
.PP
\fBParameters:\fP
.RS 4
\fIon\fP True, when the picker has been activated
.RE
.PP
.SS "QPolygon QwtPicker::adjustedPoints (const QPolygon &points) const\fC [protected]\fP, \fC [virtual]\fP"
.PP
Map the \fBpickedPoints()\fP into a \fBselection()\fP \fBadjustedPoints()\fP maps the points, that have been collected on the \fBparentWidget()\fP into a \fBselection()\fP\&. The default implementation simply returns the points unmodified\&.
.PP
The reason, why a \fBselection()\fP differs from the picked points depends on the application requirements\&. F\&.e\&. :
.PP
.IP "\(bu" 2
A rectangular selection might need to have a specific aspect ratio only\&.
.br
.IP "\(bu" 2
A selection could accept non intersecting polygons only\&.
.br
.IP "\(bu" 2
\&.\&.\&.
.br
.PP
.PP
The example below is for a rectangular selection, where the first point is the center of the selected rectangle\&.
.PP
\fBExample\fP
.RS 4
.PP
.nf
QPolygon MyPicker::adjustedPoints(const QPolygon &points) const
{
QPolygon adjusted;
if ( points.size() == 2 )
{
const int width = qAbs(points[1].x() - points[0].x());
const int height = qAbs(points[1].y() - points[0].y());
QRect rect(0, 0, 2 * width, 2 * height);
rect.moveCenter(points[0]);
adjusted += rect.topLeft();
adjusted += rect.bottomRight();
}
return adjusted;
}
.fi
.PP
.br
.RE
.PP
.SS "void QwtPicker::append (const QPoint &pos)\fC [protected]\fP, \fC [virtual]\fP"
Append a point to the selection and update rubber band and tracker\&. 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
.PP
.PP
Reimplemented in \fBQwtPlotPicker\fP\&.
.SS "void QwtPicker::appended (const QPoint &pos)\fC [signal]\fP"
A 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]\fP, \fC [virtual]\fP"
Open a selection setting the state to active
.PP
\fBSee Also:\fP
.RS 4
\fBisActive()\fP, \fBend()\fP, \fBappend()\fP, \fBmove()\fP
.RE
.PP
.PP
Reimplemented in \fBQwtPlotZoomer\fP\&.
.SS "void QwtPicker::changed (const QPolygon &selection)\fC [signal]\fP"
A signal emitted when the active selection has been changed\&. This might happen when the observed widget is resized\&.
.PP
\fBParameters:\fP
.RS 4
\fIselection\fP Changed selection
.RE
.PP
\fBSee Also:\fP
.RS 4
\fBstretchSelection()\fP
.RE
.PP
.SS "void QwtPicker::drawRubberBand (QPainter *painter) const\fC [virtual]\fP"
Draw a rubber band, depending on \fBrubberBand()\fP
.PP
\fBParameters:\fP
.RS 4
\fIpainter\fP Painter, initialized with a clip region
.RE
.PP
\fBSee Also:\fP
.RS 4
\fBrubberBand()\fP, \fBRubberBand\fP
.RE
.PP
.SS "void QwtPicker::drawTracker (QPainter *painter) const\fC [virtual]\fP"
Draw the tracker
.PP
\fBParameters:\fP
.RS 4
\fIpainter\fP Painter
.RE
.PP
\fBSee Also:\fP
.RS 4
\fBtrackerRect()\fP, \fBtrackerText()\fP
.RE
.PP
.SS "bool QwtPicker::end (boolok = \fCtrue\fP)\fC [protected]\fP, \fC [virtual]\fP"
.PP
Close a selection setting the state to inactive\&. The selection is validated and maybe fixed by \fBaccept()\fP\&.
.PP
\fBParameters:\fP
.RS 4
\fIok\fP If true, complete the selection and emit a selected signal otherwise discard the selection\&.
.RE
.PP
\fBReturns:\fP
.RS 4
true if the selection is accepted, false otherwise
.RE
.PP
\fBSee Also:\fP
.RS 4
\fBisActive()\fP, \fBbegin()\fP, \fBappend()\fP, \fBmove()\fP, \fBselected()\fP, \fBaccept()\fP
.RE
.PP
.PP
Reimplemented in \fBQwtPlotZoomer\fP, and \fBQwtPlotPicker\fP\&.
.SS "bool QwtPicker::eventFilter (QObject *object, QEvent *event)\fC [virtual]\fP"
.PP
Event filter\&. When \fBisEnabled()\fP is true all events of the observed widget are filtered\&. Mouse and keyboard events are translated into widgetMouse- and widgetKey- and widgetWheel-events\&. Paint and Resize events are handled to keep rubber band and tracker up to date\&.
.PP
\fBParameters:\fP
.RS 4
\fIobject\fP Object to be filtered
.br
\fIevent\fP Event
.RE
.PP
\fBSee Also:\fP
.RS 4
\fBwidgetEnterEvent()\fP, \fBwidgetLeaveEvent()\fP, \fBwidgetMousePressEvent()\fP, \fBwidgetMouseReleaseEvent()\fP, \fBwidgetMouseDoubleClickEvent()\fP, \fBwidgetMouseMoveEvent()\fP, \fBwidgetWheelEvent()\fP, \fBwidgetKeyPressEvent()\fP, \fBwidgetKeyReleaseEvent()\fP, QObject::installEventFilter(), QObject::event()
.RE
.PP
.SS "bool QwtPicker::isActive () const"
A picker is active between \fBbegin()\fP and \fBend()\fP\&.
.PP
\fBReturns:\fP
.RS 4
true if the selection is active\&.
.RE
.PP
.SS "bool QwtPicker::isEnabled () const"
\fBReturns:\fP
.RS 4
true when enabled, false otherwise
.RE
.PP
\fBSee Also:\fP
.RS 4
\fBsetEnabled()\fP, \fBeventFilter()\fP
.RE
.PP
.SS "void QwtPicker::move (const QPoint &pos)\fC [protected]\fP, \fC [virtual]\fP"
Move the last point of the selection The \fBmoved()\fP signal is emitted\&.
.PP
\fBParameters:\fP
.RS 4
\fIpos\fP New position
.RE
.PP
\fBSee Also:\fP
.RS 4
\fBisActive()\fP, \fBbegin()\fP, \fBend()\fP, \fBappend()\fP
.RE
.PP
.PP
Reimplemented in \fBQwtPlotPicker\fP\&.
.SS "void QwtPicker::moved (const QPoint &pos)\fC [signal]\fP"
A signal emitted whenever the last appended point of the selection has been moved\&.
.PP
\fBParameters:\fP
.RS 4
\fIpos\fP Position of the moved last point of the selection\&.
.RE
.PP
\fBSee Also:\fP
.RS 4
\fBmove()\fP, \fBappended()\fP
.RE
.PP
.SS "QPainterPath QwtPicker::pickArea () const\fC [virtual]\fP"
Find the area of the observed widget, where selection might happen\&.
.PP
\fBReturns:\fP
.RS 4
\fBparentWidget()\fP->contentsRect()
.RE
.PP
.SS "const QPolygon & QwtPicker::pickedPoints () const\fC [protected]\fP"
Return the points, that have been collected so far\&. The \fBselection()\fP is calculated from the \fBpickedPoints()\fP in \fBadjustedPoints()\fP\&.
.PP
\fBReturns:\fP
.RS 4
Picked points
.RE
.PP
.SS "void QwtPicker::remove ()\fC [protected]\fP, \fC [virtual]\fP"
Remove the last point of the selection The \fBremoved()\fP signal is emitted\&.
.PP
\fBSee Also:\fP
.RS 4
\fBisActive()\fP, \fBbegin()\fP, \fBend()\fP, \fBappend()\fP, \fBmove()\fP
.RE
.PP
.SS "void QwtPicker::removed (const QPoint &pos)\fC [signal]\fP"
A signal emitted whenever the last appended point of the selection has been removed\&.
.PP
\fBSee Also:\fP
.RS 4
\fBremove()\fP, \fBappended()\fP
.RE
.PP
.SS "void QwtPicker::reset ()\fC [protected]\fP, \fC [virtual]\fP"
Reset the state machine and terminate ( end(false) ) the selection
.SS "\fBQwtPicker::ResizeMode\fP QwtPicker::resizeMode () const"
\fBReturns:\fP
.RS 4
Resize mode
.RE
.PP
\fBSee Also:\fP
.RS 4
\fBsetResizeMode()\fP, \fBResizeMode\fP
.RE
.PP
.SS "\fBQwtPicker::RubberBand\fP QwtPicker::rubberBand () const"
\fBReturns:\fP
.RS 4
Rubber band style
.RE
.PP
\fBSee Also:\fP
.RS 4
\fBsetRubberBand()\fP, \fBRubberBand\fP, \fBrubberBandPen()\fP
.RE
.PP
.SS "QRegion QwtPicker::rubberBandMask () const\fC [virtual]\fP"
Calculate the mask for the rubber band overlay
.PP
\fBReturns:\fP
.RS 4
Region for the mask
.RE
.PP
\fBSee Also:\fP
.RS 4
QWidget::setMask()
.RE
.PP
.SS "const \fBQwtWidgetOverlay\fP * QwtPicker::rubberBandOverlay () const\fC [protected]\fP"
\fBReturns:\fP
.RS 4
Overlay displaying the rubber band
.RE
.PP
.SS "QPen QwtPicker::rubberBandPen () const"
\fBReturns:\fP
.RS 4
Rubber band pen
.RE
.PP
\fBSee Also:\fP
.RS 4
\fBsetRubberBandPen()\fP, \fBrubberBand()\fP
.RE
.PP
.SS "void QwtPicker::selected (const QPolygon &polygon)\fC [signal]\fP"
A signal emitting the selected points, at the end of a selection\&.
.PP
\fBParameters:\fP
.RS 4
\fIpolygon\fP Selected points
.RE
.PP
.SS "QPolygon QwtPicker::selection () const"
\fBReturns:\fP
.RS 4
Selected points
.RE
.PP
\fBSee Also:\fP
.RS 4
\fBpickedPoints()\fP, \fBadjustedPoints()\fP
.RE
.PP
.SS "void QwtPicker::setEnabled (boolenabled)\fC [slot]\fP"
.PP
En/disable the picker\&. When enabled is true an event filter is installed for the observed widget, otherwise the event filter is removed\&.
.PP
\fBParameters:\fP
.RS 4
\fIenabled\fP true or false
.RE
.PP
\fBSee Also:\fP
.RS 4
\fBisEnabled()\fP, \fBeventFilter()\fP
.RE
.PP
.SS "void QwtPicker::setResizeMode (\fBResizeMode\fPmode)"
.PP
Set the resize mode\&. The resize mode controls what to do with the selected points of an active selection when the observed widget is resized\&.
.PP
Stretch means the points are scaled according to the new size, KeepSize means the points remain unchanged\&.
.PP
The default mode is Stretch\&.
.PP
\fBParameters:\fP
.RS 4
\fImode\fP Resize mode
.RE
.PP
\fBSee Also:\fP
.RS 4
\fBresizeMode()\fP, \fBResizeMode\fP
.RE
.PP
.SS "void QwtPicker::setRubberBand (\fBRubberBand\fPrubberBand)"
Set the rubber band style
.PP
\fBParameters:\fP
.RS 4
\fIrubberBand\fP Rubber band style The default value is NoRubberBand\&.
.RE
.PP
\fBSee Also:\fP
.RS 4
\fBrubberBand()\fP, \fBRubberBand\fP, \fBsetRubberBandPen()\fP
.RE
.PP
.SS "void QwtPicker::setRubberBandPen (const QPen &pen)"
Set the pen for the rubberband
.PP
\fBParameters:\fP
.RS 4
\fIpen\fP Rubber band pen
.RE
.PP
\fBSee Also:\fP
.RS 4
\fBrubberBandPen()\fP, \fBsetRubberBand()\fP
.RE
.PP
.SS "void QwtPicker::setStateMachine (\fBQwtPickerMachine\fP *stateMachine)"
Set a state machine and delete the previous one
.PP
\fBParameters:\fP
.RS 4
\fIstateMachine\fP State machine
.RE
.PP
\fBSee Also:\fP
.RS 4
\fBstateMachine()\fP
.RE
.PP
.SS "void QwtPicker::setTrackerFont (const QFont &font)"
Set the font for the tracker
.PP
\fBParameters:\fP
.RS 4
\fIfont\fP Tracker font
.RE
.PP
\fBSee Also:\fP
.RS 4
\fBtrackerFont()\fP, \fBsetTrackerMode()\fP, \fBsetTrackerPen()\fP
.RE
.PP
.SS "void QwtPicker::setTrackerMode (\fBDisplayMode\fPmode)"
.PP
Set the display mode of the tracker\&. A tracker displays information about current position of the cursor as a string\&. The display mode controls if the tracker has to be displayed whenever the observed widget has focus and cursor (AlwaysOn), never (AlwaysOff), or only when the selection is active (ActiveOnly)\&.
.PP
\fBParameters:\fP
.RS 4
\fImode\fP Tracker display mode
.RE
.PP
\fBWarning:\fP
.RS 4
In case of AlwaysOn, mouseTracking will be enabled for the observed widget\&.
.RE
.PP
\fBSee Also:\fP
.RS 4
\fBtrackerMode()\fP, \fBDisplayMode\fP
.RE
.PP
.SS "void QwtPicker::setTrackerPen (const QPen &pen)"
Set the pen for the tracker
.PP
\fBParameters:\fP
.RS 4
\fIpen\fP Tracker pen
.RE
.PP
\fBSee Also:\fP
.RS 4
\fBtrackerPen()\fP, \fBsetTrackerMode()\fP, \fBsetTrackerFont()\fP
.RE
.PP
.SS "const \fBQwtPickerMachine\fP * QwtPicker::stateMachine () const"
\fBReturns:\fP
.RS 4
Assigned state machine
.RE
.PP
\fBSee Also:\fP
.RS 4
\fBsetStateMachine()\fP
.RE
.PP
.SS "\fBQwtPickerMachine\fP * QwtPicker::stateMachine ()"
\fBReturns:\fP
.RS 4
Assigned state machine
.RE
.PP
\fBSee Also:\fP
.RS 4
\fBsetStateMachine()\fP
.RE
.PP
.SS "void QwtPicker::stretchSelection (const QSize &oldSize, const QSize &newSize)\fC [protected]\fP, \fC [virtual]\fP"
Scale the selection by the ratios of oldSize and newSize The \fBchanged()\fP signal is emitted\&.
.PP
\fBParameters:\fP
.RS 4
\fIoldSize\fP Previous size
.br
\fInewSize\fP Current size
.RE
.PP
\fBSee Also:\fP
.RS 4
\fBResizeMode\fP, \fBsetResizeMode()\fP, \fBresizeMode()\fP
.RE
.PP
.SS "QFont QwtPicker::trackerFont () const"
\fBReturns:\fP
.RS 4
Tracker font
.RE
.PP
\fBSee Also:\fP
.RS 4
\fBsetTrackerFont()\fP, \fBtrackerMode()\fP, \fBtrackerPen()\fP
.RE
.PP
.SS "\fBQwtPicker::DisplayMode\fP QwtPicker::trackerMode () const"
\fBReturns:\fP
.RS 4
Tracker display mode
.RE
.PP
\fBSee Also:\fP
.RS 4
\fBsetTrackerMode()\fP, \fBDisplayMode\fP
.RE
.PP
.SS "const \fBQwtWidgetOverlay\fP * QwtPicker::trackerOverlay () const\fC [protected]\fP"
\fBReturns:\fP
.RS 4
Overlay displaying the tracker text
.RE
.PP
.SS "QPen QwtPicker::trackerPen () const"
\fBReturns:\fP
.RS 4
Tracker pen
.RE
.PP
\fBSee Also:\fP
.RS 4
\fBsetTrackerPen()\fP, \fBtrackerMode()\fP, \fBtrackerFont()\fP
.RE
.PP
.SS "QPoint QwtPicker::trackerPosition () const"
\fBReturns:\fP
.RS 4
Current position of the tracker
.RE
.PP
.SS "QRect QwtPicker::trackerRect (const QFont &font) const\fC [virtual]\fP"
Calculate the bounding rectangle for the tracker text from the current position of the tracker
.PP
\fBParameters:\fP
.RS 4
\fIfont\fP Font of the tracker text
.RE
.PP
\fBReturns:\fP
.RS 4
Bounding rectangle of the tracker text
.RE
.PP
\fBSee Also:\fP
.RS 4
\fBtrackerPosition()\fP
.RE
.PP
.SS "\fBQwtText\fP QwtPicker::trackerText (const QPoint &pos) const\fC [virtual]\fP"
.PP
Return 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 ',' \&.
.PP
The format for the string conversion is '%d'\&.
.PP
\fBParameters:\fP
.RS 4
\fIpos\fP Position
.RE
.PP
\fBReturns:\fP
.RS 4
Converted position as string
.RE
.PP
.PP
Reimplemented in \fBQwtPlotPicker\fP\&.
.SS "void QwtPicker::transition (const QEvent *event)\fC [protected]\fP, \fC [virtual]\fP"
Passes an event to the state machine and executes the resulting commands\&. Append and Move commands use the current position of the cursor ( QCursor::pos() )\&.
.PP
\fBParameters:\fP
.RS 4
\fIevent\fP Event
.RE
.PP
.SS "void QwtPicker::widgetEnterEvent (QEvent *event)\fC [protected]\fP, \fC [virtual]\fP"
Handle a enter event for the observed widget\&.
.PP
\fBParameters:\fP
.RS 4
\fIevent\fP Qt event
.RE
.PP
\fBSee Also:\fP
.RS 4
\fBeventFilter()\fP, \fBwidgetMousePressEvent()\fP, \fBwidgetMouseReleaseEvent()\fP, \fBwidgetMouseDoubleClickEvent()\fP, \fBwidgetWheelEvent()\fP, \fBwidgetKeyPressEvent()\fP, \fBwidgetKeyReleaseEvent()\fP
.RE
.PP
.SS "void QwtPicker::widgetKeyPressEvent (QKeyEvent *keyEvent)\fC [protected]\fP, \fC [virtual]\fP"
Handle a key press event for the observed widget\&.
.PP
Selections can be completely done by the keyboard\&. The arrow keys move the cursor, the abort key aborts a selection\&. All other keys are handled by the current state machine\&.
.PP
\fBParameters:\fP
.RS 4
\fIkeyEvent\fP Key event
.RE
.PP
\fBSee Also:\fP
.RS 4
\fBeventFilter()\fP, \fBwidgetMousePressEvent()\fP, \fBwidgetMouseReleaseEvent()\fP, \fBwidgetMouseDoubleClickEvent()\fP, \fBwidgetMouseMoveEvent()\fP, \fBwidgetWheelEvent()\fP, \fBwidgetKeyReleaseEvent()\fP, \fBstateMachine()\fP, \fBQwtEventPattern::KeyPatternCode\fP
.RE
.PP
.PP
Reimplemented in \fBQwtPlotZoomer\fP\&.
.SS "void QwtPicker::widgetKeyReleaseEvent (QKeyEvent *keyEvent)\fC [protected]\fP, \fC [virtual]\fP"
Handle a key release event for the observed widget\&.
.PP
Passes the event to the state machine\&.
.PP
\fBParameters:\fP
.RS 4
\fIkeyEvent\fP Key event
.RE
.PP
\fBSee Also:\fP
.RS 4
\fBeventFilter()\fP, \fBwidgetMousePressEvent()\fP, \fBwidgetMouseReleaseEvent()\fP, \fBwidgetMouseDoubleClickEvent()\fP, \fBwidgetMouseMoveEvent()\fP, \fBwidgetWheelEvent()\fP, \fBwidgetKeyPressEvent()\fP, \fBstateMachine()\fP
.RE
.PP
.SS "void QwtPicker::widgetLeaveEvent (QEvent *event)\fC [protected]\fP, \fC [virtual]\fP"
Handle a leave event for the observed widget\&.
.PP
\fBParameters:\fP
.RS 4
\fIevent\fP Qt event
.RE
.PP
\fBSee Also:\fP
.RS 4
\fBeventFilter()\fP, \fBwidgetMousePressEvent()\fP, \fBwidgetMouseReleaseEvent()\fP, \fBwidgetMouseDoubleClickEvent()\fP, \fBwidgetWheelEvent()\fP, \fBwidgetKeyPressEvent()\fP, \fBwidgetKeyReleaseEvent()\fP
.RE
.PP
.SS "void QwtPicker::widgetMouseDoubleClickEvent (QMouseEvent *mouseEvent)\fC [protected]\fP, \fC [virtual]\fP"
Handle mouse double click event for the observed widget\&.
.PP
\fBParameters:\fP
.RS 4
\fImouseEvent\fP Mouse event
.RE
.PP
\fBSee Also:\fP
.RS 4
\fBeventFilter()\fP, \fBwidgetMousePressEvent()\fP, \fBwidgetMouseReleaseEvent()\fP, \fBwidgetMouseMoveEvent()\fP, \fBwidgetWheelEvent()\fP, \fBwidgetKeyPressEvent()\fP, \fBwidgetKeyReleaseEvent()\fP
.RE
.PP
.SS "void QwtPicker::widgetMouseMoveEvent (QMouseEvent *mouseEvent)\fC [protected]\fP, \fC [virtual]\fP"
Handle a mouse move event for the observed widget\&.
.PP
\fBParameters:\fP
.RS 4
\fImouseEvent\fP Mouse event
.RE
.PP
\fBSee Also:\fP
.RS 4
\fBeventFilter()\fP, \fBwidgetMousePressEvent()\fP, \fBwidgetMouseReleaseEvent()\fP, \fBwidgetMouseDoubleClickEvent()\fP, \fBwidgetWheelEvent()\fP, \fBwidgetKeyPressEvent()\fP, \fBwidgetKeyReleaseEvent()\fP
.RE
.PP
.SS "void QwtPicker::widgetMousePressEvent (QMouseEvent *mouseEvent)\fC [protected]\fP, \fC [virtual]\fP"
Handle a mouse press event for the observed widget\&.
.PP
\fBParameters:\fP
.RS 4
\fImouseEvent\fP Mouse event
.RE
.PP
\fBSee Also:\fP
.RS 4
\fBeventFilter()\fP, \fBwidgetMouseReleaseEvent()\fP, \fBwidgetMouseDoubleClickEvent()\fP, \fBwidgetMouseMoveEvent()\fP, \fBwidgetWheelEvent()\fP, \fBwidgetKeyPressEvent()\fP, \fBwidgetKeyReleaseEvent()\fP
.RE
.PP
.SS "void QwtPicker::widgetMouseReleaseEvent (QMouseEvent *mouseEvent)\fC [protected]\fP, \fC [virtual]\fP"
Handle a mouse release event for the observed widget\&.
.PP
\fBParameters:\fP
.RS 4
\fImouseEvent\fP Mouse event
.RE
.PP
\fBSee Also:\fP
.RS 4
\fBeventFilter()\fP, \fBwidgetMousePressEvent()\fP, \fBwidgetMouseDoubleClickEvent()\fP, \fBwidgetMouseMoveEvent()\fP, \fBwidgetWheelEvent()\fP, \fBwidgetKeyPressEvent()\fP, \fBwidgetKeyReleaseEvent()\fP
.RE
.PP
.PP
Reimplemented in \fBQwtPlotZoomer\fP\&.
.SS "void QwtPicker::widgetWheelEvent (QWheelEvent *wheelEvent)\fC [protected]\fP, \fC [virtual]\fP"
Handle a wheel event for the observed widget\&.
.PP
Move the last point of the selection in case of \fBisActive()\fP == true
.PP
\fBParameters:\fP
.RS 4
\fIwheelEvent\fP Wheel event
.RE
.PP
\fBSee Also:\fP
.RS 4
\fBeventFilter()\fP, \fBwidgetMousePressEvent()\fP, \fBwidgetMouseReleaseEvent()\fP, \fBwidgetMouseDoubleClickEvent()\fP, \fBwidgetMouseMoveEvent()\fP, \fBwidgetKeyPressEvent()\fP, \fBwidgetKeyReleaseEvent()\fP
.RE
.PP
.SH "Author"
.PP
Generated automatically by Doxygen for Qwt User's Guide from the source code\&.