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
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- /home/espenr/tmp/qt-3.3.8-espenr-2499/qt-x11-free-3.3.8/src/widgets/tqlistview.cpp:2407 -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>TQListView Class</title>
<style type="text/css"><!--
fn { margin-left: 1cm; text-indent: -1cm; }
a:link { color: #004faf; text-decoration: none }
a:visited { color: #672967; text-decoration: none }
body { background: #ffffff; color: black; }
--></style>
</head>
<body>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr bgcolor="#E5E5E5">
<td valign=center>
<a href="index.html">
<font color="#004faf">Home</font></a>
| <a href="classes.html">
<font color="#004faf">All Classes</font></a>
| <a href="mainclasses.html">
<font color="#004faf">Main Classes</font></a>
| <a href="annotated.html">
<font color="#004faf">Annotated</font></a>
| <a href="groups.html">
<font color="#004faf">Grouped Classes</font></a>
| <a href="functions.html">
<font color="#004faf">Functions</font></a>
</td>
<td align="right" valign="center"><img src="logo32.png" align="right" width="64" height="32" border="0"></td></tr></table><h1 align=center>TQListView Class Reference</h1>
<p>The TQListView class implements a list/tree view.
<a href="#details">More...</a>
<p><tt>#include <<a href="tqlistview-h.html">tqlistview.h</a>></tt>
<p>Inherits <a href="tqscrollview.html">TQScrollView</a>.
<p><a href="tqlistview-members.html">List of all member functions.</a>
<h2>Public Members</h2>
<ul>
<li class=fn><a href="#TQListView"><b>TQListView</b></a> ( TQWidget * parent = 0, const char * name = 0, WFlags f = 0 )</li>
<li class=fn><a href="#~TQListView"><b>~TQListView</b></a> ()</li>
<li class=fn>int <a href="#treeStepSize"><b>treeStepSize</b></a> () const</li>
<li class=fn>virtual void <a href="#setTreeStepSize"><b>setTreeStepSize</b></a> ( int )</li>
<li class=fn>virtual void <a href="#insertItem"><b>insertItem</b></a> ( TQListViewItem * i )</li>
<li class=fn>virtual void <a href="#takeItem"><b>takeItem</b></a> ( TQListViewItem * i )</li>
<li class=fn>virtual void removeItem ( TQListViewItem * item ) <em>(obsolete)</em></li>
<li class=fn>TQHeader * <a href="#header"><b>header</b></a> () const</li>
<li class=fn>virtual int <a href="#addColumn"><b>addColumn</b></a> ( const TQString & label, int width = -1 )</li>
<li class=fn>virtual int <a href="#addColumn-2"><b>addColumn</b></a> ( const TQIconSet & iconset, const TQString & label, int width = -1 )</li>
<li class=fn>virtual void <a href="#removeColumn"><b>removeColumn</b></a> ( int index )</li>
<li class=fn>virtual void <a href="#setColumnText"><b>setColumnText</b></a> ( int column, const TQString & label )</li>
<li class=fn>virtual void <a href="#setColumnText-2"><b>setColumnText</b></a> ( int column, const TQIconSet & iconset, const TQString & label )</li>
<li class=fn>TQString <a href="#columnText"><b>columnText</b></a> ( int c ) const</li>
<li class=fn>virtual void <a href="#setColumnWidth"><b>setColumnWidth</b></a> ( int column, int w )</li>
<li class=fn>int <a href="#columnWidth"><b>columnWidth</b></a> ( int c ) const</li>
<li class=fn>enum <a href="#WidthMode-enum"><b>WidthMode</b></a> { Manual, Maximum }</li>
<li class=fn>virtual void <a href="#setColumnWidthMode"><b>setColumnWidthMode</b></a> ( int c, WidthMode mode )</li>
<li class=fn>WidthMode <a href="#columnWidthMode"><b>columnWidthMode</b></a> ( int c ) const</li>
<li class=fn>int <a href="#columns"><b>columns</b></a> () const</li>
<li class=fn>virtual void <a href="#setColumnAlignment"><b>setColumnAlignment</b></a> ( int column, int align )</li>
<li class=fn>int <a href="#columnAlignment"><b>columnAlignment</b></a> ( int column ) const</li>
<li class=fn>TQListViewItem * <a href="#itemAt"><b>itemAt</b></a> ( const TQPoint & viewPos ) const</li>
<li class=fn>TQRect <a href="#itemRect"><b>itemRect</b></a> ( const TQListViewItem * i ) const</li>
<li class=fn>int <a href="#itemPos"><b>itemPos</b></a> ( const TQListViewItem * item )</li>
<li class=fn>void <a href="#ensureItemVisible"><b>ensureItemVisible</b></a> ( const TQListViewItem * i )</li>
<li class=fn>void <a href="#repaintItem"><b>repaintItem</b></a> ( const TQListViewItem * item ) const</li>
<li class=fn>virtual void setMultiSelection ( bool enable ) <em>(obsolete)</em></li>
<li class=fn>bool isMultiSelection () const <em>(obsolete)</em></li>
<li class=fn>enum <a href="#SelectionMode-enum"><b>SelectionMode</b></a> { Single, Multi, Extended, NoSelection }</li>
<li class=fn>void <a href="#setSelectionMode"><b>setSelectionMode</b></a> ( SelectionMode mode )</li>
<li class=fn>SelectionMode <a href="#selectionMode"><b>selectionMode</b></a> () const</li>
<li class=fn>virtual void <a href="#clearSelection"><b>clearSelection</b></a> ()</li>
<li class=fn>virtual void <a href="#setSelected"><b>setSelected</b></a> ( TQListViewItem * item, bool selected )</li>
<li class=fn>void <a href="#setSelectionAnchor"><b>setSelectionAnchor</b></a> ( TQListViewItem * item )</li>
<li class=fn>bool <a href="#isSelected"><b>isSelected</b></a> ( const TQListViewItem * i ) const</li>
<li class=fn>TQListViewItem * <a href="#selectedItem"><b>selectedItem</b></a> () const</li>
<li class=fn>virtual void <a href="#setOpen"><b>setOpen</b></a> ( TQListViewItem * item, bool open )</li>
<li class=fn>bool <a href="#isOpen"><b>isOpen</b></a> ( const TQListViewItem * item ) const</li>
<li class=fn>virtual void <a href="#setCurrentItem"><b>setCurrentItem</b></a> ( TQListViewItem * i )</li>
<li class=fn>TQListViewItem * <a href="#currentItem"><b>currentItem</b></a> () const</li>
<li class=fn>TQListViewItem * <a href="#firstChild"><b>firstChild</b></a> () const</li>
<li class=fn>TQListViewItem * <a href="#lastItem"><b>lastItem</b></a> () const</li>
<li class=fn>int <a href="#childCount"><b>childCount</b></a> () const</li>
<li class=fn>virtual void <a href="#setAllColumnsShowFocus"><b>setAllColumnsShowFocus</b></a> ( bool )</li>
<li class=fn>bool <a href="#allColumnsShowFocus"><b>allColumnsShowFocus</b></a> () const</li>
<li class=fn>virtual void <a href="#setItemMargin"><b>setItemMargin</b></a> ( int )</li>
<li class=fn>int <a href="#itemMargin"><b>itemMargin</b></a> () const</li>
<li class=fn>virtual void <a href="#setRootIsDecorated"><b>setRootIsDecorated</b></a> ( bool )</li>
<li class=fn>bool <a href="#rootIsDecorated"><b>rootIsDecorated</b></a> () const</li>
<li class=fn>virtual void <a href="#setSorting"><b>setSorting</b></a> ( int column, bool ascending = TRUE )</li>
<li class=fn>int <a href="#sortColumn"><b>sortColumn</b></a> () const</li>
<li class=fn>void <a href="#setSortColumn"><b>setSortColumn</b></a> ( int column )</li>
<li class=fn>SortOrder <a href="#sortOrder"><b>sortOrder</b></a> () const</li>
<li class=fn>void <a href="#setSortOrder"><b>setSortOrder</b></a> ( SortOrder order )</li>
<li class=fn>virtual void <a href="#sort"><b>sort</b></a> ()</li>
<li class=fn>virtual bool <a href="#eventFilter"><b>eventFilter</b></a> ( TQObject * o, TQEvent * e )</li>
<li class=fn>virtual void <a href="#setShowSortIndicator"><b>setShowSortIndicator</b></a> ( bool show )</li>
<li class=fn>bool <a href="#showSortIndicator"><b>showSortIndicator</b></a> () const</li>
<li class=fn>virtual void <a href="#setShowToolTips"><b>setShowToolTips</b></a> ( bool b )</li>
<li class=fn>bool <a href="#showToolTips"><b>showToolTips</b></a> () const</li>
<li class=fn>enum <a href="#ResizeMode-enum"><b>ResizeMode</b></a> { NoColumn, AllColumns, LastColumn }</li>
<li class=fn>virtual void <a href="#setResizeMode"><b>setResizeMode</b></a> ( ResizeMode m )</li>
<li class=fn>ResizeMode <a href="#resizeMode"><b>resizeMode</b></a> () const</li>
<li class=fn>TQListViewItem * <a href="#findItem"><b>findItem</b></a> ( const TQString & text, int column, ComparisonFlags compare = ExactMatch | CaseSensitive ) const</li>
<li class=fn>enum <a href="#RenameAction-enum"><b>RenameAction</b></a> { Accept, Reject }</li>
<li class=fn>virtual void <a href="#setDefaultRenameAction"><b>setDefaultRenameAction</b></a> ( RenameAction a )</li>
<li class=fn>RenameAction <a href="#defaultRenameAction"><b>defaultRenameAction</b></a> () const</li>
<li class=fn>bool <a href="#isRenaming"><b>isRenaming</b></a> () const</li>
<li class=fn>void <a href="#hideColumn"><b>hideColumn</b></a> ( int column )</li>
</ul>
<h2>Public Slots</h2>
<ul>
<li class=fn>virtual void <a href="#clear"><b>clear</b></a> ()</li>
<li class=fn>virtual void <a href="#invertSelection"><b>invertSelection</b></a> ()</li>
<li class=fn>virtual void <a href="#selectAll"><b>selectAll</b></a> ( bool select )</li>
<li class=fn>void <a href="#triggerUpdate"><b>triggerUpdate</b></a> ()</li>
<li class=fn>void <a href="#adjustColumn"><b>adjustColumn</b></a> ( int col )</li>
</ul>
<h2>Signals</h2>
<ul>
<li class=fn>void <a href="#selectionChanged"><b>selectionChanged</b></a> ()</li>
<li class=fn>void <a href="#selectionChanged-2"><b>selectionChanged</b></a> ( TQListViewItem * )</li>
<li class=fn>void <a href="#currentChanged"><b>currentChanged</b></a> ( TQListViewItem * )</li>
<li class=fn>void <a href="#clicked"><b>clicked</b></a> ( TQListViewItem * item )</li>
<li class=fn>void <a href="#clicked-2"><b>clicked</b></a> ( TQListViewItem * item, const TQPoint & pnt, int c )</li>
<li class=fn>void <a href="#pressed"><b>pressed</b></a> ( TQListViewItem * item )</li>
<li class=fn>void <a href="#pressed-2"><b>pressed</b></a> ( TQListViewItem * item, const TQPoint & pnt, int c )</li>
<li class=fn>void doubleClicked ( TQListViewItem * item ) <em>(obsolete)</em></li>
<li class=fn>void <a href="#doubleClicked"><b>doubleClicked</b></a> ( TQListViewItem *, const TQPoint &, int )</li>
<li class=fn>void <a href="#returnPressed"><b>returnPressed</b></a> ( TQListViewItem * )</li>
<li class=fn>void <a href="#spacePressed"><b>spacePressed</b></a> ( TQListViewItem * )</li>
<li class=fn>void <a href="#rightButtonClicked"><b>rightButtonClicked</b></a> ( TQListViewItem *, const TQPoint &, int )</li>
<li class=fn>void <a href="#rightButtonPressed"><b>rightButtonPressed</b></a> ( TQListViewItem *, const TQPoint &, int )</li>
<li class=fn>void <a href="#mouseButtonPressed"><b>mouseButtonPressed</b></a> ( int button, TQListViewItem * item, const TQPoint & pos, int c )</li>
<li class=fn>void <a href="#mouseButtonClicked"><b>mouseButtonClicked</b></a> ( int button, TQListViewItem * item, const TQPoint & pos, int c )</li>
<li class=fn>void <a href="#contextMenuRequested"><b>contextMenuRequested</b></a> ( TQListViewItem * item, const TQPoint & pos, int col )</li>
<li class=fn>void <a href="#onItem"><b>onItem</b></a> ( TQListViewItem * i )</li>
<li class=fn>void <a href="#onViewport"><b>onViewport</b></a> ()</li>
<li class=fn>void <a href="#expanded"><b>expanded</b></a> ( TQListViewItem * item )</li>
<li class=fn>void <a href="#collapsed"><b>collapsed</b></a> ( TQListViewItem * item )</li>
<li class=fn>void <a href="#dropped"><b>dropped</b></a> ( TQDropEvent * e )</li>
<li class=fn>void <a href="#itemRenamed"><b>itemRenamed</b></a> ( TQListViewItem * item, int col, const TQString & text )</li>
<li class=fn>void <a href="#itemRenamed-2"><b>itemRenamed</b></a> ( TQListViewItem * item, int col )</li>
</ul>
<h2>Properties</h2>
<ul>
<li class=fn>bool <a href="#allColumnsShowFocus-prop"><b>allColumnsShowFocus</b></a> - whether items should show keyboard focus using all columns</li>
<li class=fn>int <a href="#childCount-prop"><b>childCount</b></a> - the number of parentless (top-level) TQListViewItem objects in this TQListView <em>(read only)</em></li>
<li class=fn>int <a href="#columns-prop"><b>columns</b></a> - the number of columns in this list view <em>(read only)</em></li>
<li class=fn>RenameAction <a href="#defaultRenameAction-prop"><b>defaultRenameAction</b></a> - what action to perform when the editor loses focus during renaming</li>
<li class=fn>int <a href="#itemMargin-prop"><b>itemMargin</b></a> - the advisory item margin that list items may use</li>
<li class=fn>bool multiSelection - whether the list view is in multi-selection or extended-selection mode <em>(obsolete)</em></li>
<li class=fn>ResizeMode <a href="#resizeMode-prop"><b>resizeMode</b></a> - whether all, none or the only the last column should be resized</li>
<li class=fn>bool <a href="#rootIsDecorated-prop"><b>rootIsDecorated</b></a> - whether the list view shows open/close signs on root items</li>
<li class=fn>SelectionMode <a href="#selectionMode-prop"><b>selectionMode</b></a> - the list view's selection mode</li>
<li class=fn>bool <a href="#showSortIndicator-prop"><b>showSortIndicator</b></a> - whether the list view header should display a sort indicator</li>
<li class=fn>bool <a href="#showToolTips-prop"><b>showToolTips</b></a> - whether this list view should show tooltips for truncated column texts</li>
<li class=fn>int <a href="#treeStepSize-prop"><b>treeStepSize</b></a> - the number of pixels a child is offset from its parent</li>
</ul>
<h2>Protected Members</h2>
<ul>
<li class=fn>virtual void <a href="#contentsMousePressEvent"><b>contentsMousePressEvent</b></a> ( TQMouseEvent * e )</li>
<li class=fn>virtual void <a href="#contentsMouseReleaseEvent"><b>contentsMouseReleaseEvent</b></a> ( TQMouseEvent * e )</li>
<li class=fn>virtual void <a href="#contentsMouseMoveEvent"><b>contentsMouseMoveEvent</b></a> ( TQMouseEvent * e )</li>
<li class=fn>virtual void <a href="#contentsMouseDoubleClickEvent"><b>contentsMouseDoubleClickEvent</b></a> ( TQMouseEvent * e )</li>
<li class=fn>virtual TQDragObject * <a href="#dragObject"><b>dragObject</b></a> ()</li>
<li class=fn>virtual void <a href="#startDrag"><b>startDrag</b></a> ()</li>
<li class=fn>virtual void <a href="#resizeEvent"><b>resizeEvent</b></a> ( TQResizeEvent * e )</li>
<li class=fn>virtual void <a href="#drawContentsOffset"><b>drawContentsOffset</b></a> ( TQPainter * p, int ox, int oy, int cx, int cy, int cw, int ch )</li>
<li class=fn>virtual void <a href="#paintEmptyArea"><b>paintEmptyArea</b></a> ( TQPainter * p, const TQRect & rect )</li>
</ul>
<h2>Protected Slots</h2>
<ul>
<li class=fn>void <a href="#updateContents"><b>updateContents</b></a> ()</li>
<li class=fn>void <a href="#doAutoScroll"><b>doAutoScroll</b></a> ()</li>
</ul>
<hr><a name="details"></a><h2>Detailed Description</h2>
The TQListView class implements a list/tree view.
<p>
<p> It can display and control a hierarchy of multi-column items, and
provides the ability to add new items at any time. The user may
select one or many items (depending on the <a href="#SelectionMode-enum">SelectionMode</a>) and
sort the list in increasing or decreasing order by any column.
<p> The simplest pattern of use is to create a TQListView, add some
column headers using <a href="#addColumn">addColumn</a>() and create one or more
<a href="tqlistviewitem.html">TQListViewItem</a> or <a href="tqchecklistitem.html">TQCheckListItem</a> objects with the TQListView as
parent:
<p>
<pre> TQListView * table;
</pre>
<pre> table->addColumn( "Qualified name" );
table->addColumn( "Namespace" );
</pre><pre> element = new <a href="tqlistviewitem.html">TQListViewItem</a>( table, qName, namespaceURI );
</pre>
<p> Further nodes can be added to the list view object (the root of the
tree) or as child nodes to TQListViewItems:
<p> <pre> <a name="x2105"></a> for ( int i = 0 ; i < attributes.<a href="tqxmlattributes.html#length">length</a>(); i++ ) {
<a name="x2107"></a><a name="x2106"></a> new <a href="tqlistviewitem.html">TQListViewItem</a>( element, attributes.<a href="tqxmlattributes.html#qName">qName</a>(i), attributes.<a href="tqxmlattributes.html#uri">uri</a>(i) );
}
</pre>
<p> (From <a href="tagreader-with-features-example.html">xml/tagreader-with-features/structureparser.cpp</a>)
<p> The main setup functions are:
<center><table cellpadding="4" cellspacing="2" border="0">
<tr bgcolor="#a2c511"> <th valign="top">Function <th valign="top">Action
<tr bgcolor="#f0f0f0"> <td valign="top"><a href="#addColumn">addColumn</a>()
<td valign="top">Adds a column with a text label and perhaps width. Columns
are counted from the left starting with column 0.
<tr bgcolor="#d0d0d0"> <td valign="top"><a href="#setColumnWidthMode">setColumnWidthMode</a>()
<td valign="top">Sets the column to be resized automatically or not.
<tr bgcolor="#f0f0f0"> <td valign="top"><a href="#setAllColumnsShowFocus">setAllColumnsShowFocus</a>()
<td valign="top">Sets whether items should show <a href="focus.html#keyboard-focus">keyboard focus</a> using all
columns or just column 0. The default is to show focus
just using column 0.
<tr bgcolor="#d0d0d0"> <td valign="top"><a href="#setRootIsDecorated">setRootIsDecorated</a>()
<td valign="top">Sets whether root items should show open/close decoration to their left.
The default is FALSE.
<tr bgcolor="#f0f0f0"> <td valign="top"><a href="#setTreeStepSize">setTreeStepSize</a>()
<td valign="top">Sets how many pixels an item's children are indented
relative to their parent. The default is 20. This is
mostly a matter of taste.
<tr bgcolor="#d0d0d0"> <td valign="top"><a href="#setSorting">setSorting</a>()
<td valign="top">Sets whether the items should be sorted, whether it should
be in ascending or descending order, and by what column
they should be sorted. By default the list view is sorted
by the first column; to switch this off call <a href="#setSorting">setSorting</a>(-1).
</table></center>
<p> To handle events such as mouse presses on the list view, derived
classes can reimplement the <a href="tqscrollview.html">TQScrollView</a> functions:
<a href="tqscrollview.html#contentsMousePressEvent">contentsMousePressEvent</a>,
<a href="tqscrollview.html#contentsMouseReleaseEvent">contentsMouseReleaseEvent</a>,
<a href="tqscrollview.html#contentsMouseDoubleClickEvent">contentsMouseDoubleClickEvent</a>,
<a href="tqscrollview.html#contentsMouseMoveEvent">contentsMouseMoveEvent</a>,
<a href="tqscrollview.html#contentsDragEnterEvent">contentsDragEnterEvent</a>,
<a href="tqscrollview.html#contentsDragMoveEvent">contentsDragMoveEvent</a>,
<a href="tqscrollview.html#contentsDragLeaveEvent">contentsDragLeaveEvent</a>,
<a href="tqscrollview.html#contentsDropEvent">contentsDropEvent</a>, and
<a href="tqscrollview.html#contentsWheelEvent">contentsWheelEvent</a>.
<p> There are also several functions for mapping between items and
coordinates. <a href="#itemAt">itemAt</a>() returns the item at a position on-screen,
<a href="#itemRect">itemRect</a>() returns the rectangle an item occupies on the screen,
and <a href="#itemPos">itemPos</a>() returns the position of any item (whether it is
on-screen or not). <a href="#firstChild">firstChild</a>() returns the list view's first item
(not necessarily visible on-screen).
<p> You can iterate over visible items using
<a href="tqlistviewitem.html#itemBelow">TQListViewItem::itemBelow</a>(); over a list view's top-level items
using <a href="tqlistviewitem.html#firstChild">TQListViewItem::firstChild</a>() and
<a href="tqlistviewitem.html#nextSibling">TQListViewItem::nextSibling</a>(); or every item using a
<a href="tqlistviewitemiterator.html">TQListViewItemIterator</a>. See
the <a href="tqlistviewitem.html">TQListViewItem</a> documentation for examples of traversal.
<p> An item can be moved amongst its siblings using
<a href="tqlistviewitem.html#moveItem">TQListViewItem::moveItem</a>(). To move an item in the hierarchy use
<a href="#takeItem">takeItem</a>() and <a href="#insertItem">insertItem</a>(). Item's (and all their child items)
are deleted with <tt>delete</tt>; to delete all the list view's items
use <a href="#clear">clear</a>().
<p> There are a variety of selection modes described in the
TQListView::SelectionMode documentation. The default is <a href="#SelectionMode-enum">Single</a>
selection, which you can change using <a href="#setSelectionMode">setSelectionMode</a>().
<p> Because TQListView offers multiple selection it must display
keyboard focus and selection state separately. Therefore there are
functions both to set the selection state of an item
(<a href="#setSelected">setSelected</a>()) and to set which item displays keyboard focus
(<a href="#setCurrentItem">setCurrentItem</a>()).
<p> TQListView emits two groups of signals; one group signals changes
in selection/focus state and one indicates selection. The first
group consists of <a href="#selectionChanged">selectionChanged</a>() (applicable to all list
views), selectionChanged(<a href="tqlistviewitem.html">TQListViewItem</a>*) (applicable only to a
<a href="#SelectionMode-enum">Single</a> selection list view), and <a href="#currentChanged">currentChanged</a>(TQListViewItem*).
The second group consists of <a href="#doubleClicked">doubleClicked</a>(TQListViewItem*),
<a href="#returnPressed">returnPressed</a>(TQListViewItem*),
<a href="#rightButtonClicked">rightButtonClicked</a>(TQListViewItem*, const <a href="tqpoint.html">TQPoint</a>&, int), etc.
<p> Note that changing the state of the list view in a slot connected
to a list view signal may cause unexpected side effects. If you
need to change the list view's state in response to a signal, use
a <a href="tqtimer.html#singleShot">single shot timer</a> with a
time out of 0, and connect this timer to a slot that modifies the
list view's state.
<p> In <a href="motif-extension.html#Motif">Motif</a> style, TQListView deviates fairly strongly from the look
and feel of the Motif hierarchical tree view. This is done mostly
to provide a usable keyboard interface and to make the list view
look better with a white background.
<p> If <a href="#selectionMode">selectionMode</a>() is <a href="#SelectionMode-enum">Single</a> (the default) the user can select
one item at a time, e.g. by clicking an item with the mouse, see
<a href="#SelectionMode-enum">TQListView::SelectionMode</a> for details.
<p> The list view can be navigated either using the mouse or the
keyboard. Clicking a <b>-</b> icon closes an item (hides its
children) and clicking a <b>+</b> icon opens an item (shows its
children). The keyboard controls are these:
<center><table cellpadding="4" cellspacing="2" border="0">
<tr bgcolor="#a2c511"> <th valign="top">Keypress <th valign="top">Action
<tr bgcolor="#f0f0f0"> <td valign="top">Home
<td valign="top">Make the first item current and visible.
<tr bgcolor="#d0d0d0"> <td valign="top">End
<td valign="top">Make the last item current and visible.
<tr bgcolor="#f0f0f0"> <td valign="top">Page Up
<td valign="top">Make the item above the top visible item current and visible.
<tr bgcolor="#d0d0d0"> <td valign="top">Page Down
<td valign="top">Make the item below the bottom visible item current and visible.
<tr bgcolor="#f0f0f0"> <td valign="top">Up Arrow
<td valign="top">Make the item above the current item current and visible.
<tr bgcolor="#d0d0d0"> <td valign="top">Down Arrow
<td valign="top">Make the item below the current item current and visible.
<tr bgcolor="#f0f0f0"> <td valign="top">Left Arrow
<td valign="top">If the current item is closed (<b>+</b> icon) or has no
children, make its parent item current and visible. If the
current item is open (<b>-</b> icon) close it, i.e. hide its
children. Exception: if the current item is the first item
and is closed and the horizontal scrollbar is offset to
the right the list view will be scrolled left.
<tr bgcolor="#d0d0d0"> <td valign="top">Right Arrow
<td valign="top">If the current item is closed (<b>+</b> icon) and has
children, the item is opened. If the current item is
opened (<b>-</b> icon) and has children the item's first
child is made current and visible. If the current item has
no children the list view is scrolled right.
</table></center>
<p> If the user starts typing letters with the focus in the list view
an incremental search will occur. For example if the user types
'd' the current item will change to the first item that begins
with the letter 'd'; if they then type 'a', the current item will
change to the first item that begins with 'da', and so on. If no
item begins with the letters they type the current item doesn't
change.
<p> <b>Warning:</b> The list view assumes ownership of all list view items
and will delete them when it does not need them any more.
<p> <img src=tqlistview-m.png> <img src=tqlistview-w.png>
<p> <p>See also <a href="tqlistviewitem.html">TQListViewItem</a>, <a href="tqchecklistitem.html">TQCheckListItem</a>, and <a href="advanced.html">Advanced Widgets</a>.
<hr><h2>Member Type Documentation</h2>
<h3 class=fn><a name="RenameAction-enum"></a>TQListView::RenameAction</h3>
<p> This enum describes whether a rename operation is accepted if the
rename editor loses focus without the user pressing Enter.
<ul>
<li><tt>TQListView::Accept</tt> - Rename if Enter is pressed or focus is lost.
<li><tt>TQListView::Reject</tt> - Discard the rename operation if focus is lost (and
Enter has not been pressed).
</ul>
<h3 class=fn><a name="ResizeMode-enum"></a>TQListView::ResizeMode</h3>
<p> This enum describes how the list view's header adjusts to resize
events which affect the width of the list view.
<ul>
<li><tt>TQListView::NoColumn</tt> - The columns do not get resized in resize events.
<li><tt>TQListView::AllColumns</tt> - All columns are resized equally to fit the width
of the list view.
<li><tt>TQListView::LastColumn</tt> - The last column is resized to fit the width of
the list view.
</ul>
<h3 class=fn><a name="SelectionMode-enum"></a>TQListView::SelectionMode</h3>
<p> This enumerated type is used by TQListView to indicate how it
reacts to selection by the user.
<ul>
<li><tt>TQListView::Single</tt> - When the user selects an item, any already-selected
item becomes unselected. The user can unselect the selected
item by clicking on some empty space within the view.
<li><tt>TQListView::Multi</tt> - When the user selects an item in the usual way, the
selection status of that item is toggled and the other items are
left alone. Also, multiple items can be selected by dragging the
mouse while the left mouse button stays pressed.
<li><tt>TQListView::Extended</tt> - When the user selects an item in the usual way,
the selection is cleared and the new item selected. However, if
the user presses the Ctrl key when clicking on an item, the
clicked item gets toggled and all other items are left untouched.
And if the user presses the Shift key while clicking on an item,
all items between the current item and the clicked item get
selected or unselected, depending on the state of the clicked
item. Also, multiple items can be selected by dragging the mouse
over them.
<li><tt>TQListView::NoSelection</tt> - Items cannot be selected.
</ul><p> In other words, <a href="#SelectionMode-enum">Single</a> is a real single-selection list view, <a href="#SelectionMode-enum">Multi</a> a real multi-selection list view, <a href="#SelectionMode-enum">Extended</a> is a list view
where users can select multiple items but usually want to select
either just one or a range of contiguous items, and <a href="#SelectionMode-enum">NoSelection</a>
is a list view where the user can look but not touch.
<h3 class=fn><a name="WidthMode-enum"></a>TQListView::WidthMode</h3>
<p> This enum type describes how the width of a column in the view
changes.
<ul>
<li><tt>TQListView::Manual</tt> - the column width does not change automatically.
<li><tt>TQListView::Maximum</tt> - the column is automatically sized according to the
widths of all items in the column. (Note: The column never shrinks
in this case.) This means that the column is always resized to the
width of the item with the largest width in the column.
</ul><p> <p>See also <a href="#setColumnWidth">setColumnWidth</a>(), <a href="#setColumnWidthMode">setColumnWidthMode</a>(), and <a href="#columnWidth">columnWidth</a>().
<hr><h2>Member Function Documentation</h2>
<h3 class=fn><a name="TQListView"></a>TQListView::TQListView ( <a href="tqwidget.html">TQWidget</a> * parent = 0, const char * name = 0, WFlags f = 0 )
</h3>
Constructs a new empty list view called <em>name</em> with parent <em>parent</em>.
<p> Performance is boosted by modifying the widget flags <em>f</em> so that
only part of the <a href="tqlistviewitem.html">TQListViewItem</a> children is redrawn. This may be
unsuitable for custom TQListViewItem classes, in which case <a href="ntqt.html#WidgetFlags-enum">WStaticContents</a> and <a href="ntqt.html#WidgetFlags-enum">WNoAutoErase</a> should be cleared.
<p> <p>See also <a href="tqwidget.html#clearWFlags">TQWidget::clearWFlags</a>() and <a href="ntqt.html#WidgetFlags-enum">TQt::WidgetFlags</a>.
<h3 class=fn><a name="~TQListView"></a>TQListView::~TQListView ()
</h3>
Destroys the list view, deleting all its items, and frees up all
allocated resources.
<h3 class=fn>int <a name="addColumn"></a>TQListView::addColumn ( const <a href="tqstring.html">TQString</a> & label, int width = -1 )<tt> [virtual]</tt>
</h3>
Adds a <em>width</em> pixels wide column with the column header <em>label</em>
to the list view, and returns the index of the new column.
<p> All columns apart from the first one are inserted to the right of
the existing ones.
<p> If <em>width</em> is negative, the new column's <a href="#WidthMode-enum">WidthMode</a> is set to
<a href="#WidthMode-enum">Maximum</a> instead of <a href="#WidthMode-enum">Manual</a>.
<p> <p>See also <a href="#setColumnText">setColumnText</a>(), <a href="#setColumnWidth">setColumnWidth</a>(), and <a href="#setColumnWidthMode">setColumnWidthMode</a>().
<p>Examples: <a href="addressbook-example.html#x585">addressbook/centralwidget.cpp</a>, <a href="checklists-example.html#x427">checklists/checklists.cpp</a>, <a href="dirview-example.html#x1714">dirview/main.cpp</a>, <a href="fileiconview-example.html#x886">fileiconview/mainwindow.cpp</a>, <a href="listviews-example.html#x141">listviews/listviews.cpp</a>, and <a href="tqdir-example.html#x1827">tqdir/tqdir.cpp</a>.
<h3 class=fn>int <a name="addColumn-2"></a>TQListView::addColumn ( const <a href="tqiconset.html">TQIconSet</a> & iconset, const <a href="tqstring.html">TQString</a> & label, int width = -1 )<tt> [virtual]</tt>
</h3>
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
<p> Adds a <em>width</em> pixels wide new column with the header <em>label</em>
and the <em>iconset</em> to the list view, and returns the index of the
column.
<p> If <em>width</em> is negative, the new column's <a href="#WidthMode-enum">WidthMode</a> is set to
<a href="#WidthMode-enum">Maximum</a>, and to <a href="#WidthMode-enum">Manual</a> otherwise.
<p> <p>See also <a href="#setColumnText">setColumnText</a>(), <a href="#setColumnWidth">setColumnWidth</a>(), and <a href="#setColumnWidthMode">setColumnWidthMode</a>().
<h3 class=fn>void <a name="adjustColumn"></a>TQListView::adjustColumn ( int col )<tt> [slot]</tt>
</h3> Adjusts the column <em>col</em> to its preferred width
<h3 class=fn>bool <a name="allColumnsShowFocus"></a>TQListView::allColumnsShowFocus () const
</h3><p>Returns TRUE if items should show keyboard focus using all columns; otherwise returns FALSE.
See the <a href="tqlistview.html#allColumnsShowFocus-prop">"allColumnsShowFocus"</a> property for details.
<h3 class=fn>int <a name="childCount"></a>TQListView::childCount () const
</h3><p>Returns the number of parentless (top-level) <a href="tqlistviewitem.html">TQListViewItem</a> objects in this TQListView.
See the <a href="tqlistview.html#childCount-prop">"childCount"</a> property for details.
<h3 class=fn>void <a name="clear"></a>TQListView::clear ()<tt> [virtual slot]</tt>
</h3>
Removes and deletes all the items in this list view and triggers
an update.
<p> Note that the <a href="#currentChanged">currentChanged</a>() signal is not emitted when this slot is invoked.
<p>See also <a href="#triggerUpdate">triggerUpdate</a>().
<p>Examples: <a href="addressbook-example.html#x586">addressbook/centralwidget.cpp</a>, <a href="checklists-example.html#x428">checklists/checklists.cpp</a> and <a href="listviews-example.html#x142">listviews/listviews.cpp</a>.
<h3 class=fn>void <a name="clearSelection"></a>TQListView::clearSelection ()<tt> [virtual]</tt>
</h3>
Sets all the items to be not selected, updates the list view as
necessary, and emits the <a href="#selectionChanged">selectionChanged</a>() signals. Note that for
<a href="#SelectionMode-enum">Multi</a> selection list views this function needs to iterate over
<em>all</em> items.
<p> <p>See also <a href="#setSelected">setSelected</a>() and <a href="#multiSelection-prop">multiSelection</a>.
<p>Example: <a href="addressbook-example.html#x587">addressbook/centralwidget.cpp</a>.
<h3 class=fn>void <a name="clicked"></a>TQListView::clicked ( <a href="tqlistviewitem.html">TQListViewItem</a> * item )<tt> [signal]</tt>
</h3>
<p> This signal is emitted whenever the user clicks (mouse pressed <em>and</em> mouse released) in the list view. <em>item</em> is the clicked list
view item, or 0 if the user didn't click on an item.
<p> <b>Warning:</b> Do not delete any <a href="tqlistviewitem.html">TQListViewItem</a> objects in slots
connected to this signal.
<p>Example: <a href="addressbook-example.html#x588">addressbook/centralwidget.cpp</a>.
<h3 class=fn>void <a name="clicked-2"></a>TQListView::clicked ( <a href="tqlistviewitem.html">TQListViewItem</a> * item, const <a href="tqpoint.html">TQPoint</a> & pnt, int c )<tt> [signal]</tt>
</h3>
<p> This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
<p> This signal is emitted whenever the user clicks (mouse pressed <em>and</em> mouse released) in the list view. <em>item</em> is the clicked list
view item, or 0 if the user didn't click on an item. <em>pnt</em> is the
position where the user has clicked in global coordinates. If <em>item</em> is not 0, <em>c</em> is the list view column into which the user
pressed; if <em>item</em> is 0 <em>c</em>'s value is undefined.
<p> <b>Warning:</b> Do not delete any <a href="tqlistviewitem.html">TQListViewItem</a> objects in slots
connected to this signal.
<h3 class=fn>void <a name="collapsed"></a>TQListView::collapsed ( <a href="tqlistviewitem.html">TQListViewItem</a> * item )<tt> [signal]</tt>
</h3>
<p> This signal is emitted when the <em>item</em> has been collapsed, i.e.
when the children of <em>item</em> are hidden.
<p> <p>See also <a href="#setOpen">setOpen</a>() and <a href="#expanded">expanded</a>().
<h3 class=fn>int <a name="columnAlignment"></a>TQListView::columnAlignment ( int column ) const
</h3>
Returns the alignment of column <em>column</em>. The default is <a href="ntqt.html#AlignmentFlags-enum">AlignAuto</a>.
<p> <p>See also <a href="ntqt.html#AlignmentFlags-enum">TQt::AlignmentFlags</a>.
<h3 class=fn><a href="tqstring.html">TQString</a> <a name="columnText"></a>TQListView::columnText ( int c ) const
</h3>
Returns the text of column <em>c</em>.
<p> <p>See also <a href="#setColumnText">setColumnText</a>().
<h3 class=fn>int <a name="columnWidth"></a>TQListView::columnWidth ( int c ) const
</h3>
Returns the width of column <em>c</em>.
<p> <p>See also <a href="#setColumnWidth">setColumnWidth</a>().
<h3 class=fn><a href="tqlistview.html#WidthMode-enum">WidthMode</a> <a name="columnWidthMode"></a>TQListView::columnWidthMode ( int c ) const
</h3>
Returns the <a href="#WidthMode-enum">WidthMode</a> for column <em>c</em>.
<p> <p>See also <a href="#setColumnWidthMode">setColumnWidthMode</a>().
<h3 class=fn>int <a name="columns"></a>TQListView::columns () const
</h3><p>Returns the number of columns in this list view.
See the <a href="tqlistview.html#columns-prop">"columns"</a> property for details.
<h3 class=fn>void <a name="contentsMouseDoubleClickEvent"></a>TQListView::contentsMouseDoubleClickEvent ( <a href="qmouseevent.html">TQMouseEvent</a> * e )<tt> [virtual protected]</tt>
</h3>
Processes the mouse double-click event <em>e</em> on behalf of the viewed widget.
<p>Reimplemented from <a href="tqscrollview.html#contentsMouseDoubleClickEvent">TQScrollView</a>.
<h3 class=fn>void <a name="contentsMouseMoveEvent"></a>TQListView::contentsMouseMoveEvent ( <a href="qmouseevent.html">TQMouseEvent</a> * e )<tt> [virtual protected]</tt>
</h3>
Processes the mouse move event <em>e</em> on behalf of the viewed widget.
<p>Example: <a href="dirview-example.html#x1683">dirview/dirview.cpp</a>.
<p>Reimplemented from <a href="tqscrollview.html#contentsMouseMoveEvent">TQScrollView</a>.
<h3 class=fn>void <a name="contentsMousePressEvent"></a>TQListView::contentsMousePressEvent ( <a href="qmouseevent.html">TQMouseEvent</a> * e )<tt> [virtual protected]</tt>
</h3>
Processes the mouse press event <em>e</em> on behalf of the viewed widget.
<p>Example: <a href="dirview-example.html#x1684">dirview/dirview.cpp</a>.
<p>Reimplemented from <a href="tqscrollview.html#contentsMousePressEvent">TQScrollView</a>.
<h3 class=fn>void <a name="contentsMouseReleaseEvent"></a>TQListView::contentsMouseReleaseEvent ( <a href="qmouseevent.html">TQMouseEvent</a> * e )<tt> [virtual protected]</tt>
</h3>
Processes the mouse release event <em>e</em> on behalf of the viewed widget.
<p>Example: <a href="dirview-example.html#x1685">dirview/dirview.cpp</a>.
<p>Reimplemented from <a href="tqscrollview.html#contentsMouseReleaseEvent">TQScrollView</a>.
<h3 class=fn>void <a name="contextMenuRequested"></a>TQListView::contextMenuRequested ( <a href="tqlistviewitem.html">TQListViewItem</a> * item, const <a href="tqpoint.html">TQPoint</a> & pos, int col )<tt> [signal]</tt>
</h3>
<p> This signal is emitted when the user invokes a context menu with
the right mouse button or with special system keys. If the
keyboard was used <em>item</em> is the current item; if the mouse was
used, <em>item</em> is the item under the mouse pointer or 0 if there is
no item under the mouse pointer. If no item is clicked, the column
index emitted is -1.
<p> <em>pos</em> is the position for the context menu in the global
coordinate system.
<p> <em>col</em> is the column on which the user pressed, or -1 if the
signal was triggered by a key event.
<p>Example: <a href="listviews-example.html#x143">listviews/listviews.cpp</a>.
<h3 class=fn>void <a name="currentChanged"></a>TQListView::currentChanged ( <a href="tqlistviewitem.html">TQListViewItem</a> * )<tt> [signal]</tt>
</h3>
<p> This signal is emitted whenever the current item has changed
(normally after the screen update). The current item is the item
responsible for indicating <a href="focus.html#keyboard-focus">keyboard focus</a>.
<p> The argument is the newly current item, or 0 if the change made no
item current. This can happen, for example, if all items in the
list view are deleted.
<p> <b>Warning:</b> Do not delete any <a href="tqlistviewitem.html">TQListViewItem</a> objects in slots
connected to this signal.
<p> <p>See also <a href="#setCurrentItem">setCurrentItem</a>() and <a href="#currentItem">currentItem</a>().
<p>Example: <a href="listviews-example.html#x144">listviews/listviews.cpp</a>.
<h3 class=fn><a href="tqlistviewitem.html">TQListViewItem</a> * <a name="currentItem"></a>TQListView::currentItem () const
</h3>
Returns the current item, or 0 if there isn't one.
<p> <p>See also <a href="#setCurrentItem">setCurrentItem</a>().
<p>Examples: <a href="addressbook-example.html#x589">addressbook/centralwidget.cpp</a> and <a href="listviews-example.html#x145">listviews/listviews.cpp</a>.
<h3 class=fn><a href="tqlistview.html#RenameAction-enum">RenameAction</a> <a name="defaultRenameAction"></a>TQListView::defaultRenameAction () const
</h3><p>Returns what action to perform when the editor loses focus during renaming.
See the <a href="tqlistview.html#defaultRenameAction-prop">"defaultRenameAction"</a> property for details.
<h3 class=fn>void <a name="doAutoScroll"></a>TQListView::doAutoScroll ()<tt> [protected slot]</tt>
</h3>
This slot handles auto-scrolling when the mouse button is pressed
and the mouse is outside the widget.
<h3 class=fn>void <a name="doubleClicked"></a>TQListView::doubleClicked ( <a href="tqlistviewitem.html">TQListViewItem</a> *, const <a href="tqpoint.html">TQPoint</a> &, int )<tt> [signal]</tt>
</h3>
<p> This signal is emitted whenever an item is double-clicked. It's
emitted on the second button press, not the second button release.
The arguments are the relevant <a href="tqlistviewitem.html">TQListViewItem</a> (may be 0), the point
in global coordinates and the relevant column (or -1 if the click
was outside the list).
<p> <b>Warning:</b> Do not delete any TQListViewItem objects in slots
connected to this signal.
<h3 class=fn>void <a name="doubleClicked-2"></a>TQListView::doubleClicked ( <a href="tqlistviewitem.html">TQListViewItem</a> * item )<tt> [signal]</tt>
</h3>
<p> <b>This function is obsolete.</b> It is provided to keep old source working. We strongly advise against using it in new code.
(use <a href="#doubleClicked">doubleClicked</a>( <a href="tqlistviewitem.html">TQListViewItem</a> *, const <a href="tqpoint.html">TQPoint</a>&, int ))
<p> This signal is emitted whenever an item is double-clicked. It's
emitted on the second button press, not the second button release.
<em>item</em> is the list view item on which the user did the
double-click.
<h3 class=fn><a href="tqdragobject.html">TQDragObject</a> * <a name="dragObject"></a>TQListView::dragObject ()<tt> [virtual protected]</tt>
</h3>
If the user presses the mouse on an item and starts moving the
mouse, and the item allow dragging (see
<a href="tqlistviewitem.html#setDragEnabled">TQListViewItem::setDragEnabled</a>()), this function is called to get a
drag object and a drag is started unless <a href="#dragObject">dragObject</a>() returns 0.
<p> By default this function returns 0. You should reimplement it and
create a <a href="tqdragobject.html">TQDragObject</a> depending on the selected items.
<h3 class=fn>void <a name="drawContentsOffset"></a>TQListView::drawContentsOffset ( <a href="tqpainter.html">TQPainter</a> * p, int ox, int oy, int cx, int cy, int cw, int ch )<tt> [virtual protected]</tt>
</h3>
Calls <a href="tqlistviewitem.html#paintCell">TQListViewItem::paintCell</a>() and
<a href="tqlistviewitem.html#paintBranches">TQListViewItem::paintBranches</a>() as necessary for all list view
items that require repainting in the <em>cw</em> pixels wide and <em>ch</em>
pixels high bounding rectangle starting at position <em>cx</em>, <em>cy</em>
with offset <em>ox</em>, <em>oy</em>. Uses the painter <em>p</em>.
<p>Reimplemented from <a href="tqscrollview.html#drawContentsOffset">TQScrollView</a>.
<h3 class=fn>void <a name="dropped"></a>TQListView::dropped ( <a href="tqdropevent.html">TQDropEvent</a> * e )<tt> [signal]</tt>
</h3>
<p> This signal is emitted, when a drop event occurred on the
viewport (not onto an item).
<p> <em>e</em> provides all the information about the drop.
<h3 class=fn>void <a name="ensureItemVisible"></a>TQListView::ensureItemVisible ( const <a href="tqlistviewitem.html">TQListViewItem</a> * i )
</h3>
Ensures that item <em>i</em> is visible, scrolling the list view
vertically if necessary and opening (expanding) any parent items
if this is required to show the item.
<p> <p>See also <a href="#itemRect">itemRect</a>() and <a href="tqscrollview.html#ensureVisible">TQScrollView::ensureVisible</a>().
<h3 class=fn>bool <a name="eventFilter"></a>TQListView::eventFilter ( <a href="tqobject.html">TQObject</a> * o, <a href="tqevent.html">TQEvent</a> * e )<tt> [virtual]</tt>
</h3>
Redirects the event <em>e</em> relating to object <em>o</em>, for the viewport
to <a href="tqwidget.html#mousePressEvent">mousePressEvent</a>(), <a href="tqwidget.html#keyPressEvent">keyPressEvent</a>() and friends.
<p>Reimplemented from <a href="tqscrollview.html#eventFilter">TQScrollView</a>.
<h3 class=fn>void <a name="expanded"></a>TQListView::expanded ( <a href="tqlistviewitem.html">TQListViewItem</a> * item )<tt> [signal]</tt>
</h3>
<p> This signal is emitted when <em>item</em> has been expanded, i.e. when
the children of <em>item</em> are shown.
<p> <p>See also <a href="#setOpen">setOpen</a>() and <a href="#collapsed">collapsed</a>().
<h3 class=fn><a href="tqlistviewitem.html">TQListViewItem</a> * <a name="findItem"></a>TQListView::findItem ( const <a href="tqstring.html">TQString</a> & text, int column, ComparisonFlags compare = ExactMatch | CaseSensitive ) const
</h3>
Finds the first list view item in column <em>column</em>, that matches
<em>text</em> and returns the item, or returns 0 of no such item could
be found.
The search starts from the current item if the current item exists,
otherwise it starts from the first list view item. After reaching
the last item the search continues from the first item.
Pass OR-ed together <a href="ntqt.html#StringComparisonMode-enum">TQt::StringComparisonMode</a> values
in the <em>compare</em> flag, to control how the matching is performed.
The default comparison mode is case-sensitive, exact match.
<h3 class=fn><a href="tqlistviewitem.html">TQListViewItem</a> * <a name="firstChild"></a>TQListView::firstChild () const
</h3>
Returns the first item in this TQListView. Returns 0 if there is no
first item.
<p> A list view's items can be traversed using <a href="#firstChild">firstChild</a>()
and nextSibling() or using a <a href="tqlistviewitemiterator.html">TQListViewItemIterator</a>.
<p> <p>See also <a href="#itemAt">itemAt</a>(), <a href="tqlistviewitem.html#itemBelow">TQListViewItem::itemBelow</a>(), and <a href="tqlistviewitem.html#itemAbove">TQListViewItem::itemAbove</a>().
<p>Examples: <a href="addressbook-example.html#x590">addressbook/centralwidget.cpp</a> and <a href="listviews-example.html#x146">listviews/listviews.cpp</a>.
<h3 class=fn><a href="tqheader.html">TQHeader</a> * <a name="header"></a>TQListView::header () const
</h3>
Returns the <a href="tqheader.html">TQHeader</a> object that manages this list view's columns.
Please don't modify the header behind the list view's back.
<p> You may safely call <a href="tqheader.html#setClickEnabled">TQHeader::setClickEnabled</a>(),
<a href="tqheader.html#setResizeEnabled">TQHeader::setResizeEnabled</a>(), <a href="tqheader.html#setMovingEnabled">TQHeader::setMovingEnabled</a>(),
<a href="tqwidget.html#hide">TQHeader::hide</a>() and all the const TQHeader functions.
<p>Examples: <a href="listviews-example.html#x147">listviews/listviews.cpp</a> and <a href="tqdir-example.html#x1828">tqdir/tqdir.cpp</a>.
<h3 class=fn>void <a name="hideColumn"></a>TQListView::hideColumn ( int column )
</h3>
Hides the column specified at <em>column</em>. This is a convenience
function that calls <a href="#setColumnWidth">setColumnWidth</a>( <em>column</em>, 0 ).
<p> Note: The user may still be able to resize the hidden column using
the header handles. To prevent this, call setResizeEnabled(FALSE,
<em>column</em>) on the list views header.
<p> <p>See also <a href="#setColumnWidth">setColumnWidth</a>().
<h3 class=fn>void <a name="insertItem"></a>TQListView::insertItem ( <a href="tqlistviewitem.html">TQListViewItem</a> * i )<tt> [virtual]</tt>
</h3>
Inserts item <em>i</em> into the list view as a top-level item. You do
not need to call this unless you've called <a href="#takeItem">takeItem</a>(<em>i</em>) or
<a href="tqlistviewitem.html#takeItem">TQListViewItem::takeItem</a>(<em>i</em>) and need to reinsert <em>i</em> elsewhere.
<p> <p>See also <a href="tqlistviewitem.html#takeItem">TQListViewItem::takeItem</a>() and <a href="#takeItem">takeItem</a>().
<h3 class=fn>void <a name="invertSelection"></a>TQListView::invertSelection ()<tt> [virtual slot]</tt>
</h3>
Inverts the selection. Only works in <a href="#SelectionMode-enum">Multi</a> and <a href="#SelectionMode-enum">Extended</a>
selection modes.
<h3 class=fn>bool <a name="isMultiSelection"></a>TQListView::isMultiSelection () const
</h3><p>Returns TRUE if the list view is in multi-selection or extended-selection mode; otherwise returns FALSE.
See the <a href="tqlistview.html#multiSelection-prop">"multiSelection"</a> property for details.
<h3 class=fn>bool <a name="isOpen"></a>TQListView::isOpen ( const <a href="tqlistviewitem.html">TQListViewItem</a> * item ) const
</h3>
Identical to <em>item</em>->isOpen(). Provided for completeness.
<p> <p>See also <a href="#setOpen">setOpen</a>().
<h3 class=fn>bool <a name="isRenaming"></a>TQListView::isRenaming () const
</h3>
Returns TRUE if an item is being renamed; otherwise returns FALSE.
<h3 class=fn>bool <a name="isSelected"></a>TQListView::isSelected ( const <a href="tqlistviewitem.html">TQListViewItem</a> * i ) const
</h3>
Returns TRUE if the list view item <em>i</em> is selected; otherwise
returns FALSE.
<p> <p>See also <a href="tqlistviewitem.html#isSelected">TQListViewItem::isSelected</a>().
<h3 class=fn><a href="tqlistviewitem.html">TQListViewItem</a> * <a name="itemAt"></a>TQListView::itemAt ( const <a href="tqpoint.html">TQPoint</a> & viewPos ) const
</h3>
Returns the list view item at <em>viewPos</em>. Note that <em>viewPos</em> is
in the <a href="tqscrollview.html#viewport">viewport</a>()'s coordinate system, not in the list view's own,
much larger, coordinate system.
<p> <a href="#itemAt">itemAt</a>() returns 0 if there is no such item.
<p> Note that you also get the pointer to the item if <em>viewPos</em>
points to the root decoration (see <a href="#setRootIsDecorated">setRootIsDecorated</a>()) of the
item. To check whether or not <em>viewPos</em> is on the root decoration
of the item, you can do something like this:
<p> <pre>
<a href="tqlistviewitem.html">TQListViewItem</a> *i = <a href="#itemAt">itemAt</a>( p );
if ( i ) {
if ( p.x() > header()->sectionPos( <a href="#header">header</a>()->mapToIndex( 0 ) ) +
<a href="#treeStepSize">treeStepSize</a>() * ( i-><a href="tqlistviewitem.html#depth">depth</a>() + ( <a href="#rootIsDecorated">rootIsDecorated</a>() ? 1 : 0) ) + itemMargin() ||
p.x() < header()->sectionPos( <a href="#header">header</a>()->mapToIndex( 0 ) ) ) {
; // p is not on root decoration
else
; // p is on the root decoration
}
</pre>
<p> This might be interesting if you use this function to find out
where the user clicked and if you want to start a drag (which you
do not want to do if the user clicked onto the root decoration of
an item).
<p> <p>See also <a href="#itemPos">itemPos</a>(), <a href="#itemRect">itemRect</a>(), and <a href="tqscrollview.html#viewportToContents">viewportToContents</a>().
<h3 class=fn>int <a name="itemMargin"></a>TQListView::itemMargin () const
</h3><p>Returns the advisory item margin that list items may use.
See the <a href="tqlistview.html#itemMargin-prop">"itemMargin"</a> property for details.
<h3 class=fn>int <a name="itemPos"></a>TQListView::itemPos ( const <a href="tqlistviewitem.html">TQListViewItem</a> * item )
</h3>
Returns the y-coordinate of <em>item</em> in the list view's coordinate
system. This function is normally much slower than <a href="#itemAt">itemAt</a>() but it
works for all items, whereas itemAt() normally works only for
items on the screen.
<p> This is a thin wrapper around <a href="tqlistviewitem.html#itemPos">TQListViewItem::itemPos</a>().
<p> <p>See also <a href="#itemAt">itemAt</a>() and <a href="#itemRect">itemRect</a>().
<h3 class=fn><a href="tqrect.html">TQRect</a> <a name="itemRect"></a>TQListView::itemRect ( const <a href="tqlistviewitem.html">TQListViewItem</a> * i ) const
</h3>
Returns the rectangle on the screen that item <em>i</em> occupies in
<a href="tqscrollview.html#viewport">viewport</a>()'s coordinates, or an invalid rectangle if <em>i</em> is 0 or
is not currently visible.
<p> The rectangle returned does not include any children of the
rectangle (i.e. it uses <a href="tqlistviewitem.html#height">TQListViewItem::height</a>(), rather than
<a href="tqlistviewitem.html#totalHeight">TQListViewItem::totalHeight</a>()). If you want the rectangle to
include children you can use something like this:
<p> <pre>
<a href="tqrect.html">TQRect</a> r( listView->itemRect( item ) );
r.<a href="tqrect.html#setHeight">setHeight</a>( (TQCOORD)(TQMIN( item->totalHeight(),
listView->viewport->height() - r.<a href="tqrect.html#y">y</a>() ) ) )
</pre>
<p> Note the way it avoids too-high rectangles. totalHeight() can be
much larger than the window system's coordinate system allows.
<p> <a href="#itemRect">itemRect</a>() is comparatively slow. It's best to call it only for
items that are probably on-screen.
<h3 class=fn>void <a name="itemRenamed"></a>TQListView::itemRenamed ( <a href="tqlistviewitem.html">TQListViewItem</a> * item, int col, const <a href="tqstring.html">TQString</a> & text )<tt> [signal]</tt>
</h3>
<p> This signal is emitted when <em>item</em> has been renamed to <em>text</em>,
e.g. by in in-place renaming, in column <em>col</em>.
<p> <p>See also <a href="tqlistviewitem.html#setRenameEnabled">TQListViewItem::setRenameEnabled</a>().
<h3 class=fn>void <a name="itemRenamed-2"></a>TQListView::itemRenamed ( <a href="tqlistviewitem.html">TQListViewItem</a> * item, int col )<tt> [signal]</tt>
</h3>
<p> This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
<p> This signal is emitted when <em>item</em> has been renamed, e.g. by
in-place renaming, in column <em>col</em>.
<p> <p>See also <a href="tqlistviewitem.html#setRenameEnabled">TQListViewItem::setRenameEnabled</a>().
<h3 class=fn><a href="tqlistviewitem.html">TQListViewItem</a> * <a name="lastItem"></a>TQListView::lastItem () const
</h3>
Returns the last item in the list view tree. Returns 0 if there
are no items in the TQListView.
<p> This function is slow because it traverses the entire tree to find
the last item.
<h3 class=fn>void <a name="mouseButtonClicked"></a>TQListView::mouseButtonClicked ( int button, <a href="tqlistviewitem.html">TQListViewItem</a> * item, const <a href="tqpoint.html">TQPoint</a> & pos, int c )<tt> [signal]</tt>
</h3>
<p> This signal is emitted whenever the user clicks (mouse pressed <em>and</em> mouse released) in the list view at position <em>pos</em>. <em>button</em>
is the mouse button that the user pressed, <em>item</em> is the clicked
list view item or 0 if the user didn't click on an item. If <em>item</em> is not 0, <em>c</em> is the list view column into which the user
pressed; if <em>item</em> is 0 <em>c</em>'s value is undefined.
<p> <b>Warning:</b> Do not delete any <a href="tqlistviewitem.html">TQListViewItem</a> objects in slots
connected to this signal.
<h3 class=fn>void <a name="mouseButtonPressed"></a>TQListView::mouseButtonPressed ( int button, <a href="tqlistviewitem.html">TQListViewItem</a> * item, const <a href="tqpoint.html">TQPoint</a> & pos, int c )<tt> [signal]</tt>
</h3>
<p> This signal is emitted whenever the user pressed the mouse button
in the list view at position <em>pos</em>. <em>button</em> is the mouse button
which the user pressed, <em>item</em> is the pressed list view item or 0
if the user didn't press on an item. If <em>item</em> is not 0, <em>c</em> is
the list view column into which the user pressed; if <em>item</em> is 0
<em>c</em>'s value is undefined.
<p> <b>Warning:</b> Do not delete any <a href="tqlistviewitem.html">TQListViewItem</a> objects in slots
connected to this signal.
<h3 class=fn>void <a name="onItem"></a>TQListView::onItem ( <a href="tqlistviewitem.html">TQListViewItem</a> * i )<tt> [signal]</tt>
</h3>
<p> This signal is emitted when the user moves the mouse cursor onto
item <em>i</em>, similar to the <a href="tqwidget.html#enterEvent">TQWidget::enterEvent</a>() function.
<h3 class=fn>void <a name="onViewport"></a>TQListView::onViewport ()<tt> [signal]</tt>
</h3>
<p> This signal is emitted when the user moves the mouse cursor from
an item to an empty part of the list view.
<h3 class=fn>void <a name="paintEmptyArea"></a>TQListView::paintEmptyArea ( <a href="tqpainter.html">TQPainter</a> * p, const <a href="tqrect.html">TQRect</a> & rect )<tt> [virtual protected]</tt>
</h3>
Paints <em>rect</em> so that it looks like empty background using
painter <em>p</em>. <em>rect</em> is in widget coordinates, ready to be fed to
<em>p</em>.
<p> The default function fills <em>rect</em> with the
<a href="tqscrollview.html#viewport">viewport</a>()->backgroundBrush().
<h3 class=fn>void <a name="pressed"></a>TQListView::pressed ( <a href="tqlistviewitem.html">TQListViewItem</a> * item )<tt> [signal]</tt>
</h3>
<p> This signal is emitted whenever the user presses the mouse button
in a list view. <em>item</em> is the list view item on which the user
pressed the mouse button, or 0 if the user didn't press the mouse
on an item.
<p> <b>Warning:</b> Do not delete any <a href="tqlistviewitem.html">TQListViewItem</a> objects in slots
connected to this signal.
<h3 class=fn>void <a name="pressed-2"></a>TQListView::pressed ( <a href="tqlistviewitem.html">TQListViewItem</a> * item, const <a href="tqpoint.html">TQPoint</a> & pnt, int c )<tt> [signal]</tt>
</h3>
<p> This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
<p> This signal is emitted whenever the user presses the mouse button
in a list view. <em>item</em> is the list view item on which the user
pressed the mouse button, or 0 if the user didn't press the mouse
on an item. <em>pnt</em> is the position of the mouse cursor in global
coordinates, and <em>c</em> is the column where the mouse cursor was
when the user pressed the mouse button.
<p> <b>Warning:</b> Do not delete any <a href="tqlistviewitem.html">TQListViewItem</a> objects in slots
connected to this signal.
<h3 class=fn>void <a name="removeColumn"></a>TQListView::removeColumn ( int index )<tt> [virtual]</tt>
</h3>
Removes the column at position <em>index</em>.
<p> If no columns remain after the column is removed, the
list view will be cleared.
<p> <p>See also <a href="#clear">clear</a>().
<h3 class=fn>void <a name="removeItem"></a>TQListView::removeItem ( <a href="tqlistviewitem.html">TQListViewItem</a> * item )<tt> [virtual]</tt>
</h3>
<b>This function is obsolete.</b> It is provided to keep old source working. We strongly advise against using it in new code.
<p> This function has been renamed <a href="#takeItem">takeItem</a>().
<h3 class=fn>void <a name="repaintItem"></a>TQListView::repaintItem ( const <a href="tqlistviewitem.html">TQListViewItem</a> * item ) const
</h3>
Repaints <em>item</em> on the screen if <em>item</em> is currently visible.
Takes care to avoid multiple repaints.
<h3 class=fn>void <a name="resizeEvent"></a>TQListView::resizeEvent ( <a href="qresizeevent.html">TQResizeEvent</a> * e )<tt> [virtual protected]</tt>
</h3>
Ensures that the header is correctly sized and positioned when the
resize event <em>e</em> occurs.
<h3 class=fn><a href="tqlistview.html#ResizeMode-enum">ResizeMode</a> <a name="resizeMode"></a>TQListView::resizeMode () const
</h3><p>Returns TRUE if all, none or the only the last column should be resized; otherwise returns FALSE.
See the <a href="tqlistview.html#resizeMode-prop">"resizeMode"</a> property for details.
<h3 class=fn>void <a name="returnPressed"></a>TQListView::returnPressed ( <a href="tqlistviewitem.html">TQListViewItem</a> * )<tt> [signal]</tt>
</h3>
<p> This signal is emitted when Enter or Return is pressed. The
argument is the <a href="#currentItem">currentItem</a>().
<h3 class=fn>void <a name="rightButtonClicked"></a>TQListView::rightButtonClicked ( <a href="tqlistviewitem.html">TQListViewItem</a> *, const <a href="tqpoint.html">TQPoint</a> &, int )<tt> [signal]</tt>
</h3>
<p> This signal is emitted when the right button is clicked (i.e. when
it's released). The arguments are the relevant <a href="tqlistviewitem.html">TQListViewItem</a> (may
be 0), the point in global coordinates and the relevant column (or
-1 if the click was outside the list).
<h3 class=fn>void <a name="rightButtonPressed"></a>TQListView::rightButtonPressed ( <a href="tqlistviewitem.html">TQListViewItem</a> *, const <a href="tqpoint.html">TQPoint</a> &, int )<tt> [signal]</tt>
</h3>
<p> This signal is emitted when the right button is pressed. The
arguments are the relevant <a href="tqlistviewitem.html">TQListViewItem</a> (may be 0), the point in
global coordinates and the relevant column (or -1 if the click was
outside the list).
<h3 class=fn>bool <a name="rootIsDecorated"></a>TQListView::rootIsDecorated () const
</h3><p>Returns TRUE if the list view shows open/close signs on root items; otherwise returns FALSE.
See the <a href="tqlistview.html#rootIsDecorated-prop">"rootIsDecorated"</a> property for details.
<h3 class=fn>void <a name="selectAll"></a>TQListView::selectAll ( bool select )<tt> [virtual slot]</tt>
</h3>
If <em>select</em> is TRUE, all the items get selected; otherwise all
the items get unselected. This only works in the selection modes <a href="#SelectionMode-enum">Multi</a> and <a href="#SelectionMode-enum">Extended</a>. In <a href="#SelectionMode-enum">Single</a> and <a href="#SelectionMode-enum">NoSelection</a> mode the
selection of the current item is just set to <em>select</em>.
<h3 class=fn><a href="tqlistviewitem.html">TQListViewItem</a> * <a name="selectedItem"></a>TQListView::selectedItem () const
</h3>
Returns the selected item if the list view is in <a href="#SelectionMode-enum">Single</a>
selection mode and an item is selected.
<p> If no items are selected or the list view is not in <a href="#SelectionMode-enum">Single</a>
selection mode this function returns 0.
<p> <p>See also <a href="#setSelected">setSelected</a>() and <a href="#multiSelection-prop">multiSelection</a>.
<h3 class=fn>void <a name="selectionChanged"></a>TQListView::selectionChanged ()<tt> [signal]</tt>
</h3>
<p> This signal is emitted whenever the set of selected items has
changed (normally before the screen update). It is available in
<a href="#SelectionMode-enum">Single</a>, <a href="#SelectionMode-enum">Multi</a>, and <a href="#SelectionMode-enum">Extended</a> selection modes, but is most
useful in <a href="#SelectionMode-enum">Multi</a> selection mode.
<p> <b>Warning:</b> Do not delete any <a href="tqlistviewitem.html">TQListViewItem</a> objects in slots
connected to this signal.
<p> <p>See also <a href="#setSelected">setSelected</a>() and <a href="tqlistviewitem.html#setSelected">TQListViewItem::setSelected</a>().
<p>Example: <a href="listviews-example.html#x148">listviews/listviews.cpp</a>.
<h3 class=fn>void <a name="selectionChanged-2"></a>TQListView::selectionChanged ( <a href="tqlistviewitem.html">TQListViewItem</a> * )<tt> [signal]</tt>
</h3>
<p> This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
<p> This signal is emitted whenever the selected item has changed in
<a href="#SelectionMode-enum">Single</a> selection mode (normally after the screen update). The
argument is the newly selected item. If the selection is cleared
(when, for example, the user clicks in the unused area of the list
view) then this signal will not be emitted.
<p> In <a href="#SelectionMode-enum">Multi</a> selection mode, use the no argument overload of this
signal.
<p> <b>Warning:</b> Do not delete any <a href="tqlistviewitem.html">TQListViewItem</a> objects in slots
connected to this signal.
<p> <p>See also <a href="#setSelected">setSelected</a>(), <a href="tqlistviewitem.html#setSelected">TQListViewItem::setSelected</a>(), and <a href="#currentChanged">currentChanged</a>().
<h3 class=fn><a href="tqlistview.html#SelectionMode-enum">SelectionMode</a> <a name="selectionMode"></a>TQListView::selectionMode () const
</h3><p>Returns the list view's selection mode.
See the <a href="tqlistview.html#selectionMode-prop">"selectionMode"</a> property for details.
<h3 class=fn>void <a name="setAllColumnsShowFocus"></a>TQListView::setAllColumnsShowFocus ( bool )<tt> [virtual]</tt>
</h3><p>Sets whether items should show keyboard focus using all columns.
See the <a href="tqlistview.html#allColumnsShowFocus-prop">"allColumnsShowFocus"</a> property for details.
<h3 class=fn>void <a name="setColumnAlignment"></a>TQListView::setColumnAlignment ( int column, int align )<tt> [virtual]</tt>
</h3>
Sets column <em>column</em>'s alignment to <em>align</em>. The alignment is
ultimately passed to <a href="tqlistviewitem.html#paintCell">TQListViewItem::paintCell</a>() for each item in
the list view. For horizontally aligned text with TQt::AlignLeft or
TQt::AlignHCenter the ellipsis (...) will be to the right, for
TQt::AlignRight the ellipsis will be to the left.
<p> <p>See also <a href="ntqt.html#AlignmentFlags-enum">TQt::AlignmentFlags</a>.
<p>Example: <a href="listviews-example.html#x150">listviews/listviews.cpp</a>.
<h3 class=fn>void <a name="setColumnText"></a>TQListView::setColumnText ( int column, const <a href="tqstring.html">TQString</a> & label )<tt> [virtual]</tt>
</h3>
Sets the heading of column <em>column</em> to <em>label</em>.
<p> <p>See also <a href="#columnText">columnText</a>().
<h3 class=fn>void <a name="setColumnText-2"></a>TQListView::setColumnText ( int column, const <a href="tqiconset.html">TQIconSet</a> & iconset, const <a href="tqstring.html">TQString</a> & label )<tt> [virtual]</tt>
</h3>
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
<p> Sets the heading of column <em>column</em> to <em>iconset</em> and <em>label</em>.
<p> <p>See also <a href="#columnText">columnText</a>().
<h3 class=fn>void <a name="setColumnWidth"></a>TQListView::setColumnWidth ( int column, int w )<tt> [virtual]</tt>
</h3>
Sets the width of column <em>column</em> to <em>w</em> pixels. Note that if
the column has a <a href="#WidthMode-enum">WidthMode</a> other than <a href="#WidthMode-enum">Manual</a>, this width
setting may be subsequently overridden.
<p> <p>See also <a href="#columnWidth">columnWidth</a>().
<h3 class=fn>void <a name="setColumnWidthMode"></a>TQListView::setColumnWidthMode ( int c, <a href="tqlistview.html#WidthMode-enum">WidthMode</a> mode )<tt> [virtual]</tt>
</h3>
Sets column <em>c</em>'s width mode to <em>mode</em>. The default depends on
the original width argument to <a href="#addColumn">addColumn</a>().
<p> <p>See also <a href="tqlistviewitem.html#width">TQListViewItem::width</a>().
<h3 class=fn>void <a name="setCurrentItem"></a>TQListView::setCurrentItem ( <a href="tqlistviewitem.html">TQListViewItem</a> * i )<tt> [virtual]</tt>
</h3>
Sets item <em>i</em> to be the current item and repaints appropriately
(i.e. highlights the item). The current item is used for keyboard
navigation and focus indication; it is independent of any selected
items, although a selected item can also be the current item.
<p> This function does not set the selection anchor. Use
<a href="#setSelectionAnchor">setSelectionAnchor</a>() instead.
<p> <p>See also <a href="#currentItem">currentItem</a>() and <a href="#setSelected">setSelected</a>().
<p>Example: <a href="listviews-example.html#x151">listviews/listviews.cpp</a>.
<h3 class=fn>void <a name="setDefaultRenameAction"></a>TQListView::setDefaultRenameAction ( <a href="tqlistview.html#RenameAction-enum">RenameAction</a> a )<tt> [virtual]</tt>
</h3><p>Sets what action to perform when the editor loses focus during renaming to <em>a</em>.
See the <a href="tqlistview.html#defaultRenameAction-prop">"defaultRenameAction"</a> property for details.
<h3 class=fn>void <a name="setItemMargin"></a>TQListView::setItemMargin ( int )<tt> [virtual]</tt>
</h3><p>Sets the advisory item margin that list items may use.
See the <a href="tqlistview.html#itemMargin-prop">"itemMargin"</a> property for details.
<h3 class=fn>void <a name="setMultiSelection"></a>TQListView::setMultiSelection ( bool enable )<tt> [virtual]</tt>
</h3><p>Sets whether the list view is in multi-selection or extended-selection mode to <em>enable</em>.
See the <a href="tqlistview.html#multiSelection-prop">"multiSelection"</a> property for details.
<h3 class=fn>void <a name="setOpen"></a>TQListView::setOpen ( <a href="tqlistviewitem.html">TQListViewItem</a> * item, bool open )<tt> [virtual]</tt>
</h3>
Sets <em>item</em> to be open if <em>open</em> is TRUE and <em>item</em> is
expandable, and to be closed if <em>open</em> is FALSE. Repaints
accordingly.
<p> <p>See also <a href="tqlistviewitem.html#setOpen">TQListViewItem::setOpen</a>() and <a href="tqlistviewitem.html#setExpandable">TQListViewItem::setExpandable</a>().
<h3 class=fn>void <a name="setResizeMode"></a>TQListView::setResizeMode ( <a href="tqlistview.html#ResizeMode-enum">ResizeMode</a> m )<tt> [virtual]</tt>
</h3><p>Sets whether all, none or the only the last column should be resized to <em>m</em>.
See the <a href="tqlistview.html#resizeMode-prop">"resizeMode"</a> property for details.
<h3 class=fn>void <a name="setRootIsDecorated"></a>TQListView::setRootIsDecorated ( bool )<tt> [virtual]</tt>
</h3><p>Sets whether the list view shows open/close signs on root items.
See the <a href="tqlistview.html#rootIsDecorated-prop">"rootIsDecorated"</a> property for details.
<h3 class=fn>void <a name="setSelected"></a>TQListView::setSelected ( <a href="tqlistviewitem.html">TQListViewItem</a> * item, bool selected )<tt> [virtual]</tt>
</h3>
If <em>selected</em> is TRUE the <em>item</em> is selected; otherwise it is
unselected.
<p> If the list view is in <a href="#SelectionMode-enum">Single</a> selection mode and <em>selected</em> is
TRUE, the currently selected item is unselected and <em>item</em> is
made current. Unlike <a href="tqlistviewitem.html#setSelected">TQListViewItem::setSelected</a>(), this function
updates the list view as necessary and emits the
<a href="#selectionChanged">selectionChanged</a>() signals.
<p> <p>See also <a href="#isSelected">isSelected</a>(), <a href="#multiSelection-prop">multiSelection</a>, <a href="#multiSelection-prop">multiSelection</a>, <a href="#setCurrentItem">setCurrentItem</a>(), and <a href="#setSelectionAnchor">setSelectionAnchor</a>().
<p>Example: <a href="listviews-example.html#x153">listviews/listviews.cpp</a>.
<h3 class=fn>void <a name="setSelectionAnchor"></a>TQListView::setSelectionAnchor ( <a href="tqlistviewitem.html">TQListViewItem</a> * item )
</h3>
Sets the selection anchor to <em>item</em>, if <em>item</em> is selectable.
<p> The selection anchor is the item that remains selected when
Shift-selecting with either mouse or keyboard in <a href="#SelectionMode-enum">Extended</a>
selection mode.
<p> <p>See also <a href="#setSelected">setSelected</a>().
<h3 class=fn>void <a name="setSelectionMode"></a>TQListView::setSelectionMode ( <a href="tqlistview.html#SelectionMode-enum">SelectionMode</a> mode )
</h3><p>Sets the list view's selection mode to <em>mode</em>.
See the <a href="tqlistview.html#selectionMode-prop">"selectionMode"</a> property for details.
<h3 class=fn>void <a name="setShowSortIndicator"></a>TQListView::setShowSortIndicator ( bool show )<tt> [virtual]</tt>
</h3><p>Sets whether the list view header should display a sort indicator to <em>show</em>.
See the <a href="tqlistview.html#showSortIndicator-prop">"showSortIndicator"</a> property for details.
<h3 class=fn>void <a name="setShowToolTips"></a>TQListView::setShowToolTips ( bool b )<tt> [virtual]</tt>
</h3><p>Sets whether this list view should show tooltips for truncated column texts to <em>b</em>.
See the <a href="tqlistview.html#showToolTips-prop">"showToolTips"</a> property for details.
<h3 class=fn>void <a name="setSortColumn"></a>TQListView::setSortColumn ( int column )
</h3>
Sets the sorting column for the list view.
<p> If <em>column</em> is -1, sorting is disabled and the user cannot sort
columns by clicking on the column headers. If <em>column</em> is larger
than the number of columns the user must click on a column header
to sort the list view.
<p> <p>See also <a href="#setSorting">setSorting</a>().
<h3 class=fn>void <a name="setSortOrder"></a>TQListView::setSortOrder ( <a href="ntqt.html#SortOrder-enum">SortOrder</a> order )
</h3>
Sets the sort order for the items in the list view to <em>order</em>.
<p> <p>See also <a href="#setSorting">setSorting</a>().
<h3 class=fn>void <a name="setSorting"></a>TQListView::setSorting ( int column, bool ascending = TRUE )<tt> [virtual]</tt>
</h3>
Sets the list view to be sorted by column <em>column</em> in ascending
order if <em>ascending</em> is TRUE or descending order if it is FALSE.
<p> If <em>column</em> is -1, sorting is disabled and the user cannot sort
columns by clicking on the column headers. If <em>column</em> is larger
than the number of columns the user must click on a column
header to sort the list view.
<h3 class=fn>void <a name="setTreeStepSize"></a>TQListView::setTreeStepSize ( int )<tt> [virtual]</tt>
</h3><p>Sets the number of pixels a child is offset from its parent.
See the <a href="tqlistview.html#treeStepSize-prop">"treeStepSize"</a> property for details.
<h3 class=fn>bool <a name="showSortIndicator"></a>TQListView::showSortIndicator () const
</h3><p>Returns TRUE if the list view header should display a sort indicator; otherwise returns FALSE.
See the <a href="tqlistview.html#showSortIndicator-prop">"showSortIndicator"</a> property for details.
<h3 class=fn>bool <a name="showToolTips"></a>TQListView::showToolTips () const
</h3><p>Returns TRUE if this list view should show tooltips for truncated column texts; otherwise returns FALSE.
See the <a href="tqlistview.html#showToolTips-prop">"showToolTips"</a> property for details.
<h3 class=fn>void <a name="sort"></a>TQListView::sort ()<tt> [virtual]</tt>
</h3>
Sorts the list view using the last sorting configuration (sort
column and ascending/descending).
<h3 class=fn>int <a name="sortColumn"></a>TQListView::sortColumn () const
</h3>
Returns the column by which the list view is sorted, or -1 if
sorting is disabled.
<p> <p>See also <a href="#sortOrder">sortOrder</a>().
<h3 class=fn><a href="ntqt.html#SortOrder-enum">SortOrder</a> <a name="sortOrder"></a>TQListView::sortOrder () const
</h3>
Returns the sorting order of the list view items.
<p> <p>See also <a href="#sortColumn">sortColumn</a>().
<h3 class=fn>void <a name="spacePressed"></a>TQListView::spacePressed ( <a href="tqlistviewitem.html">TQListViewItem</a> * )<tt> [signal]</tt>
</h3>
<p> This signal is emitted when Space is pressed. The argument is
the <a href="#currentItem">currentItem</a>().
<h3 class=fn>void <a name="startDrag"></a>TQListView::startDrag ()<tt> [virtual protected]</tt>
</h3>
Starts a drag.
<h3 class=fn>void <a name="takeItem"></a>TQListView::takeItem ( <a href="tqlistviewitem.html">TQListViewItem</a> * i )<tt> [virtual]</tt>
</h3>
Removes item <em>i</em> from the list view; <em>i</em> must be a top-level
item. The warnings regarding <a href="tqlistviewitem.html#takeItem">TQListViewItem::takeItem</a>() apply to
this function, too.
<p> <p>See also <a href="#insertItem">insertItem</a>().
<h3 class=fn>int <a name="treeStepSize"></a>TQListView::treeStepSize () const
</h3><p>Returns the number of pixels a child is offset from its parent.
See the <a href="tqlistview.html#treeStepSize-prop">"treeStepSize"</a> property for details.
<h3 class=fn>void <a name="triggerUpdate"></a>TQListView::triggerUpdate ()<tt> [slot]</tt>
</h3>
Triggers a size, geometry and content update during the next
iteration of the event loop. Ensures that there'll be just one
update to avoid flicker.
<h3 class=fn>void <a name="updateContents"></a>TQListView::updateContents ()<tt> [protected slot]</tt>
</h3>
Updates the sizes of the viewport, header, scroll bars and so on.
<p> <b>Warning:</b> Don't call this directly; call <a href="#triggerUpdate">triggerUpdate</a>() instead.
<hr><h2>Property Documentation</h2>
<h3 class=fn>bool <a name="allColumnsShowFocus-prop"></a>allColumnsShowFocus</h3>
<p>This property holds whether items should show <a href="focus.html#keyboard-focus">keyboard focus</a> using all columns.
<p>If this property is TRUE all columns will show focus and selection
states, otherwise only column 0 will show focus.
<p> The default is FALSE.
<p> Setting this to TRUE if it's not necessary may cause noticeable
flicker.
<p>Set this property's value with <a href="#setAllColumnsShowFocus">setAllColumnsShowFocus</a>() and get this property's value with <a href="#allColumnsShowFocus">allColumnsShowFocus</a>().
<h3 class=fn>int <a name="childCount-prop"></a>childCount</h3>
<p>This property holds the number of parentless (top-level) <a href="tqlistviewitem.html">TQListViewItem</a> objects in this TQListView.
<p>Holds the current number of parentless (top-level) TQListViewItem
objects in this TQListView.
<p> <p>See also <a href="tqlistviewitem.html#childCount">TQListViewItem::childCount</a>().
<p>Get this property's value with <a href="#childCount">childCount</a>().
<h3 class=fn>int <a name="columns-prop"></a>columns</h3>
<p>This property holds the number of columns in this list view.
<p>Get this property's value with <a href="#columns">columns</a>().
<p><p>See also <a href="#addColumn">addColumn</a>() and <a href="#removeColumn">removeColumn</a>().
<h3 class=fn><a href="tqlistview.html#RenameAction-enum">RenameAction</a> <a name="defaultRenameAction-prop"></a>defaultRenameAction</h3>
<p>This property holds what action to perform when the editor loses focus during renaming.
<p>If this property is <a href="#RenameAction-enum">Accept</a>, and the user renames an item and
the editor loses focus (without the user pressing Enter), the
item will still be renamed. If the property's value is <a href="#RenameAction-enum">Reject</a>,
the item will not be renamed unless the user presses Enter. The
default is <a href="#RenameAction-enum">Reject</a>.
<p>Set this property's value with <a href="#setDefaultRenameAction">setDefaultRenameAction</a>() and get this property's value with <a href="#defaultRenameAction">defaultRenameAction</a>().
<h3 class=fn>int <a name="itemMargin-prop"></a>itemMargin</h3>
<p>This property holds the advisory item margin that list items may use.
<p>The item margin defaults to one pixel and is the margin between
the item's edges and the area where it draws its contents.
<a href="tqlistviewitem.html#paintFocus">TQListViewItem::paintFocus</a>() draws in the margin.
<p> <p>See also <a href="tqlistviewitem.html#paintCell">TQListViewItem::paintCell</a>().
<p>Set this property's value with <a href="#setItemMargin">setItemMargin</a>() and get this property's value with <a href="#itemMargin">itemMargin</a>().
<h3 class=fn>bool <a name="multiSelection-prop"></a>multiSelection</h3> <b>This function is obsolete.</b> It is provided to keep old source working. We strongly advise against using it in new code.
<p> <p>This property holds whether the list view is in multi-selection or extended-selection mode.
<p>If you enable multi-selection, <a href="#SelectionMode-enum">Multi</a>, mode, it is possible to
specify whether or not this mode should be extended. <a href="#SelectionMode-enum">Extended</a>
means that the user can select multiple items only when pressing
the Shift or Ctrl key at the same time.
<p> The default selection mode is <a href="#SelectionMode-enum">Single</a>.
<p> <p>See also <a href="#selectionMode-prop">selectionMode</a>.
<p>Set this property's value with <a href="#setMultiSelection">setMultiSelection</a>() and get this property's value with <a href="#isMultiSelection">isMultiSelection</a>().
<h3 class=fn><a href="tqlistview.html#ResizeMode-enum">ResizeMode</a> <a name="resizeMode-prop"></a>resizeMode</h3>
<p>This property holds whether all, none or the only the last column should be resized.
<p>Specifies whether all, none or only the last column should be
resized to fit the full width of the list view. The values for this
property can be one of: <a href="#ResizeMode-enum">NoColumn</a> (the default), <a href="#ResizeMode-enum">AllColumns</a>
or <a href="#ResizeMode-enum">LastColumn</a>.
<p> <b>Warning:</b> Setting the resize mode should be done after all necessary
columns have been added to the list view, otherwise the behavior is
undefined.
<p> <p>See also <a href="tqheader.html">TQHeader</a> and <a href="#header">header</a>().
<p>Set this property's value with <a href="#setResizeMode">setResizeMode</a>() and get this property's value with <a href="#resizeMode">resizeMode</a>().
<h3 class=fn>bool <a name="rootIsDecorated-prop"></a>rootIsDecorated</h3>
<p>This property holds whether the list view shows open/close signs on root items.
<p>Open/close signs are small <b>+</b> or <b>-</b> symbols in windows
style, or arrows in <a href="motif-extension.html#Motif">Motif</a> style. The default is FALSE.
<p>Set this property's value with <a href="#setRootIsDecorated">setRootIsDecorated</a>() and get this property's value with <a href="#rootIsDecorated">rootIsDecorated</a>().
<h3 class=fn><a href="tqlistview.html#SelectionMode-enum">SelectionMode</a> <a name="selectionMode-prop"></a>selectionMode</h3>
<p>This property holds the list view's selection mode.
<p>The mode can be <a href="#SelectionMode-enum">Single</a> (the default), <a href="#SelectionMode-enum">Extended</a>, <a href="#SelectionMode-enum">Multi</a> or
<a href="#SelectionMode-enum">NoSelection</a>.
<p> <p>See also <a href="#multiSelection-prop">multiSelection</a>.
<p>Set this property's value with <a href="#setSelectionMode">setSelectionMode</a>() and get this property's value with <a href="#selectionMode">selectionMode</a>().
<h3 class=fn>bool <a name="showSortIndicator-prop"></a>showSortIndicator</h3>
<p>This property holds whether the list view header should display a sort indicator.
<p>If this property is TRUE, an arrow is drawn in the header of the
list view to indicate the sort order of the list view contents.
The arrow will be drawn in the correct column and will point up or
down, depending on the current sort direction. The default is
FALSE (don't show an indicator).
<p> <p>See also <a href="tqheader.html#setSortIndicator">TQHeader::setSortIndicator</a>().
<p>Set this property's value with <a href="#setShowSortIndicator">setShowSortIndicator</a>() and get this property's value with <a href="#showSortIndicator">showSortIndicator</a>().
<h3 class=fn>bool <a name="showToolTips-prop"></a>showToolTips</h3>
<p>This property holds whether this list view should show tooltips for truncated column texts.
<p>The default is TRUE.
<p>Set this property's value with <a href="#setShowToolTips">setShowToolTips</a>() and get this property's value with <a href="#showToolTips">showToolTips</a>().
<h3 class=fn>int <a name="treeStepSize-prop"></a>treeStepSize</h3>
<p>This property holds the number of pixels a child is offset from its parent.
<p>The default is 20 pixels.
<p> Of course, this property is only meaningful for hierarchical list
views.
<p>Set this property's value with <a href="#setTreeStepSize">setTreeStepSize</a>() and get this property's value with <a href="#treeStepSize">treeStepSize</a>().
<!-- eof -->
<hr><p>
This file is part of the <a href="index.html">TQt toolkit</a>.
Copyright © 1995-2007
<a href="http://www.trolltech.com/">Trolltech</a>. All Rights Reserved.<p><address><hr><div align=center>
<table width=100% cellspacing=0 border=0><tr>
<td>Copyright © 2007
<a href="troll.html">Trolltech</a><td align=center><a href="trademarks.html">Trademarks</a>
<td align=right><div align=right>TQt 3.3.8</div>
</table></div></address></body>
</html>
|