Sunteți pe pagina 1din 871

KD Chart 2 Reference Manual

[rev.2.0]

Generated by Doxygen 1.3.6

Fri Sep 29 03:56:26 2006


Contents

1 KD Chart 2 Namespace Index 1


1.1 KD Chart 2 Namespace List . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1

2 KD Chart 2 Hierarchical Index 3


2.1 KD Chart 2 Class Hierarchy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

3 KD Chart 2 Class Index 5


3.1 KD Chart 2 Class List . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

4 KD Chart 2 File Index 7


4.1 KD Chart 2 File List . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

5 KD Chart 2 Namespace Documentation 11


5.1 BackgroundAttributes Namespace Reference . . . . . . . . . . . . . . . . . . . . . . . . 11
5.2 BarAttributes Namespace Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
5.3 DataValueAttributes Namespace Reference . . . . . . . . . . . . . . . . . . . . . . . . . 13
5.4 FrameAttributes Namespace Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
5.5 GridAttributes Namespace Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
5.6 KDChart Namespace Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
5.7 LineAttributes Namespace Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
5.8 MarkerAttributes Namespace Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
5.9 PaintContext Namespace Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
5.10 Palette Namespace Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
5.11 RelativePosition Namespace Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
5.12 TextAttributes Namespace Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
5.13 Ui Namespace Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27

6 KD Chart 2 Class Documentation 29


6.1 KDChart::AbstractArea Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
6.2 KDChart::AbstractAreaBase Class Reference . . . . . . . . . . . . . . . . . . . . . . . . 38
ii CONTENTS

6.3 KDChart::AbstractAreaWidget Class Reference . . . . . . . . . . . . . . . . . . . . . . . 43


6.4 KDChart::AbstractAxis Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
6.5 KDChart::AbstractCartesianDiagram Class Reference . . . . . . . . . . . . . . . . . . . . 63
6.6 KDChart::AbstractCoordinatePlane Class Reference . . . . . . . . . . . . . . . . . . . . 93
6.7 KDChart::AbstractDiagram Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . 114
6.8 KDChart::AbstractLayoutItem Class Reference . . . . . . . . . . . . . . . . . . . . . . . 141
6.9 KDChart::AbstractPieDiagram Class Reference . . . . . . . . . . . . . . . . . . . . . . . 144
6.10 KDChart::AbstractPolarDiagram Class Reference . . . . . . . . . . . . . . . . . . . . . . 176
6.11 KDChart::AbstractProxyModel Class Reference . . . . . . . . . . . . . . . . . . . . . . . 204
6.12 KDChart::AbstractThreeDAttributes Class Reference . . . . . . . . . . . . . . . . . . . . 206
6.13 KDChart::AttributesModel Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . 209
6.14 KDChart::BackgroundAttributes Class Reference . . . . . . . . . . . . . . . . . . . . . . 219
6.15 KDChart::BarAttributes Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . 222
6.16 KDChart::BarDiagram Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . 225
6.17 KDChart::CartesianAxis Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . 265
6.18 KDChart::CartesianCoordinatePlane Class Reference . . . . . . . . . . . . . . . . . . . . 294
6.19 KDChart::Chart Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 326
6.20 KDChart::DataDimension Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . 342
6.21 KDChart::DatasetProxyModel Class Reference . . . . . . . . . . . . . . . . . . . . . . . 345
6.22 KDChart::DatasetSelectorWidget Class Reference . . . . . . . . . . . . . . . . . . . . . . 352
6.23 KDChart::DataValueAttributes Class Reference . . . . . . . . . . . . . . . . . . . . . . . 355
6.24 KDChart::DiagramObserver Class Reference . . . . . . . . . . . . . . . . . . . . . . . . 361
6.25 KDChart::FrameAttributes Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . 364
6.26 KDChart::GridAttributes Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . 366
6.27 KDChart::HeaderFooter Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . 369
6.28 KDChart::HorizontalLineLayoutItem Class Reference . . . . . . . . . . . . . . . . . . . 385
6.29 KDChartEnums Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 390
6.30 KDTextDocument Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 400
6.31 KDChart::Legend Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 402
6.32 KDChart::LineAttributes Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . 428
6.33 KDChart::LineDiagram Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . 431
6.34 KDChart::MarkerAttributes Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . 473
6.35 KDChart::MarkerLayoutItem Class Reference . . . . . . . . . . . . . . . . . . . . . . . . 476
6.36 KDChart::Measure Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 481
6.37 KDChart::PaintContext Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . 486
6.38 KDChart::Palette Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 488

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


CONTENTS iii

6.39 KDChart::PieAttributes Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . 491


6.40 KDChart::PieDiagram Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . 494
6.41 KDChart::PolarCoordinatePlane Class Reference . . . . . . . . . . . . . . . . . . . . . . 530
6.42 KDChart::PolarDiagram Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . 557
6.43 KDChart::Position Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 590
6.44 QAbstractItemView Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 598
6.45 QAbstractProxyModel Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . 599
6.46 QFrame Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 600
6.47 QLayoutItem Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 601
6.48 QObject Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 602
6.49 QSortFilterProxyModel Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . 603
6.50 QTextDocument Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 604
6.51 QWidget Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 605
6.52 KDChart::RelativePosition Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . 606
6.53 KDChart::RingDiagram Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . 608
6.54 KDChart::TextArea Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 642
6.55 KDChart::TextAttributes Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . 656
6.56 KDChart::TextLayoutItem Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . 661
6.57 KDChart::ThreeDBarAttributes Class Reference . . . . . . . . . . . . . . . . . . . . . . . 670
6.58 KDChart::ThreeDLineAttributes Class Reference . . . . . . . . . . . . . . . . . . . . . . 675
6.59 KDChart::ThreeDPieAttributes Class Reference . . . . . . . . . . . . . . . . . . . . . . . 680
6.60 KDChart::VerticalLineLayoutItem Class Reference . . . . . . . . . . . . . . . . . . . . . 684
6.61 KDChart::Widget Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 689
6.62 KDChart::ZoomParameters Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . 704

7 KD Chart 2 File Documentation 707


7.1 KDChartAbstractArea.cpp File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . 707
7.2 KDChartAbstractArea.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . 708
7.3 KDChartAbstractAreaBase.cpp File Reference . . . . . . . . . . . . . . . . . . . . . . . 709
7.4 KDChartAbstractAreaBase.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . 713
7.5 KDChartAbstractAreaWidget.cpp File Reference . . . . . . . . . . . . . . . . . . . . . . 714
7.6 KDChartAbstractAreaWidget.h File Reference . . . . . . . . . . . . . . . . . . . . . . . 715
7.7 KDChartAbstractAxis.cpp File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . 716
7.8 KDChartAbstractAxis.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . 717
7.9 KDChartAbstractCartesianDiagram.cpp File Reference . . . . . . . . . . . . . . . . . . . 718
7.10 KDChartAbstractCartesianDiagram.h File Reference . . . . . . . . . . . . . . . . . . . . 719
7.11 KDChartAbstractCoordinatePlane.cpp File Reference . . . . . . . . . . . . . . . . . . . . 720

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


iv CONTENTS

7.12 KDChartAbstractCoordinatePlane.h File Reference . . . . . . . . . . . . . . . . . . . . . 721


7.13 KDChartAbstractDiagram.cpp File Reference . . . . . . . . . . . . . . . . . . . . . . . . 722
7.14 KDChartAbstractDiagram.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . 723
7.15 KDChartAbstractPieDiagram.cpp File Reference . . . . . . . . . . . . . . . . . . . . . . 724
7.16 KDChartAbstractPieDiagram.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . 725
7.17 KDChartAbstractPolarDiagram.cpp File Reference . . . . . . . . . . . . . . . . . . . . . 726
7.18 KDChartAbstractPolarDiagram.h File Reference . . . . . . . . . . . . . . . . . . . . . . 727
7.19 KDChartAbstractProxyModel.cpp File Reference . . . . . . . . . . . . . . . . . . . . . . 728
7.20 KDChartAbstractProxyModel.h File Reference . . . . . . . . . . . . . . . . . . . . . . . 729
7.21 KDChartAbstractThreeDAttributes.cpp File Reference . . . . . . . . . . . . . . . . . . . 730
7.22 KDChartAbstractThreeDAttributes.h File Reference . . . . . . . . . . . . . . . . . . . . . 731
7.23 KDChartAttributesModel.cpp File Reference . . . . . . . . . . . . . . . . . . . . . . . . 732
7.24 KDChartAttributesModel.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . 733
7.25 KDChartBackgroundAttributes.cpp File Reference . . . . . . . . . . . . . . . . . . . . . 734
7.26 KDChartBackgroundAttributes.h File Reference . . . . . . . . . . . . . . . . . . . . . . . 735
7.27 KDChartBarAttributes.cpp File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . 736
7.28 KDChartBarAttributes.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . 737
7.29 KDChartBarDiagram.cpp File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . 738
7.30 KDChartBarDiagram.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . 739
7.31 KDChartCartesianAxis.cpp File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . 740
7.32 KDChartCartesianAxis.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . 741
7.33 KDChartCartesianCoordinatePlane.cpp File Reference . . . . . . . . . . . . . . . . . . . 742
7.34 KDChartCartesianCoordinatePlane.h File Reference . . . . . . . . . . . . . . . . . . . . 743
7.35 KDChartChart.cpp File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 744
7.36 KDChartChart.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 746
7.37 KDChartDatasetProxyModel.cpp File Reference . . . . . . . . . . . . . . . . . . . . . . 747
7.38 KDChartDatasetProxyModel.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . 748
7.39 KDChartDatasetSelector.cpp File Reference . . . . . . . . . . . . . . . . . . . . . . . . . 749
7.40 KDChartDatasetSelector.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . 750
7.41 KDChartDataValueAttributes.cpp File Reference . . . . . . . . . . . . . . . . . . . . . . 751
7.42 KDChartDataValueAttributes.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . 753
7.43 KDChartDiagramObserver.cpp File Reference . . . . . . . . . . . . . . . . . . . . . . . . 754
7.44 KDChartDiagramObserver.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . 755
7.45 KDChartEnums.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 756
7.46 KDChartFrameAttributes.cpp File Reference . . . . . . . . . . . . . . . . . . . . . . . . 757
7.47 KDChartFrameAttributes.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . 758

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


CONTENTS v

7.48 KDChartGlobal.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 759


7.49 KDChartGridAttributes.cpp File Reference . . . . . . . . . . . . . . . . . . . . . . . . . 764
7.50 KDChartGridAttributes.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . 765
7.51 KDChartHeaderFooter.cpp File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . 766
7.52 KDChartHeaderFooter.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . 767
7.53 KDChartLayoutItems.cpp File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . 768
7.54 KDChartLayoutItems.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . 769
7.55 KDChartLegend.cpp File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 770
7.56 KDChartLegend.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 771
7.57 KDChartLineAttributes.cpp File Reference . . . . . . . . . . . . . . . . . . . . . . . . . 772
7.58 KDChartLineAttributes.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . 773
7.59 KDChartLineDiagram.cpp File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . 774
7.60 KDChartLineDiagram.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . 775
7.61 KDChartMarkerAttributes.cpp File Reference . . . . . . . . . . . . . . . . . . . . . . . . 776
7.62 KDChartMarkerAttributes.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . 777
7.63 KDChartMeasure.cpp File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 778
7.64 KDChartMeasure.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 779
7.65 KDChartPaintContext.cpp File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . 780
7.66 KDChartPaintContext.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . 781
7.67 KDChartPalette.cpp File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 782
7.68 KDChartPalette.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 784
7.69 KDChartPieAttributes.cpp File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . 785
7.70 KDChartPieAttributes.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . 786
7.71 KDChartPieDiagram.cpp File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . 787
7.72 KDChartPieDiagram.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . 789
7.73 KDChartPolarCoordinatePlane.cpp File Reference . . . . . . . . . . . . . . . . . . . . . 790
7.74 KDChartPolarCoordinatePlane.h File Reference . . . . . . . . . . . . . . . . . . . . . . . 791
7.75 KDChartPolarDiagram.cpp File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . 792
7.76 KDChartPolarDiagram.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . 793
7.77 KDChartPosition.cpp File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 794
7.78 KDChartPosition.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 797
7.79 KDChartRelativePosition.cpp File Reference . . . . . . . . . . . . . . . . . . . . . . . . 798
7.80 KDChartRelativePosition.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . 799
7.81 KDChartRingDiagram.cpp File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . 800
7.82 KDChartRingDiagram.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . 801
7.83 KDChartTextArea.cpp File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . 802

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


vi CONTENTS

7.84 KDChartTextArea.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 803


7.85 KDChartTextAttributes.cpp File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . 804
7.86 KDChartTextAttributes.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . 805
7.87 KDChartThreeDBarAttributes.cpp File Reference . . . . . . . . . . . . . . . . . . . . . . 806
7.88 KDChartThreeDBarAttributes.h File Reference . . . . . . . . . . . . . . . . . . . . . . . 807
7.89 KDChartThreeDLineAttributes.cpp File Reference . . . . . . . . . . . . . . . . . . . . . 808
7.90 KDChartThreeDLineAttributes.h File Reference . . . . . . . . . . . . . . . . . . . . . . . 809
7.91 KDChartThreeDPieAttributes.cpp File Reference . . . . . . . . . . . . . . . . . . . . . . 810
7.92 KDChartThreeDPieAttributes.h File Reference . . . . . . . . . . . . . . . . . . . . . . . 811
7.93 KDChartWidget.cpp File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 812
7.94 KDChartWidget.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 814
7.95 KDChartZoomParameters.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . 815
7.96 KDTextDocument.cpp File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . 816
7.97 KDTextDocument.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 817

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


Chapter 1

KD Chart 2 Namespace Index

1.1 KD Chart 2 Namespace List


Here is a list of all namespaces with brief descriptions:
BackgroundAttributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
BarAttributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
DataValueAttributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
FrameAttributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
GridAttributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
KDChart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
LineAttributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
MarkerAttributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
PaintContext . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
Palette . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
RelativePosition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
TextAttributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
Ui . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
2 KD Chart 2 Namespace Index

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


Chapter 2

KD Chart 2 Hierarchical Index

2.1 KD Chart 2 Class Hierarchy


This inheritance list is sorted roughly, but not completely, alphabetically:
KDChart::AbstractAreaBase . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
KDChart::AbstractArea . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
KDChart::AbstractAxis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
KDChart::CartesianAxis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 265
KDChart::AbstractCoordinatePlane . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
KDChart::CartesianCoordinatePlane . . . . . . . . . . . . . . . . . . . . . . . . . . 294
KDChart::PolarCoordinatePlane . . . . . . . . . . . . . . . . . . . . . . . . . . . . 530
KDChart::AbstractAreaWidget . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
KDChart::Legend . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 402
KDChart::TextArea . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 642
KDChart::HeaderFooter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 369
KDChart::AbstractThreeDAttributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 206
KDChart::ThreeDBarAttributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 670
KDChart::ThreeDLineAttributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 675
KDChart::ThreeDPieAttributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 680
KDChart::BackgroundAttributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219
BackgroundAttributes::Private
KDChart::BarAttributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222
BarAttributes::Private
KDChart::DataDimension . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 342
KDChart::DataValueAttributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 355
DataValueAttributes::Private
KDChart::FrameAttributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 364
FrameAttributes::Private
KDChart::GridAttributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 366
GridAttributes::Private
KDChart::KDPrivateModelIndex
KDChart::LineAttributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 428
LineAttributes::Private
KDChart::MarkerAttributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 473
MarkerAttributes::Private
KDChart::Measure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 481
4 KD Chart 2 Hierarchical Index

KDChart::PaintContext . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 486
PaintContext::Private
Palette::Private
KDChart::PieAttributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 491
KDChart::Position . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 590
QAbstractItemView . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 598
KDChart::AbstractDiagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
KDChart::AbstractCartesianDiagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
KDChart::BarDiagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225
KDChart::LineDiagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 431
KDChart::AbstractPolarDiagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 176
KDChart::AbstractPieDiagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144
KDChart::PieDiagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 494
KDChart::RingDiagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 608
KDChart::PolarDiagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 557
QAbstractProxyModel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 599
KDChart::AbstractProxyModel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204
KDChart::AttributesModel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209
KDChart::PrivateAttributesModel
QFrame . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 600
KDChart::DatasetSelectorWidget . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 352
QLayoutItem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 601
KDChart::AbstractLayoutItem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141
KDChart::AbstractArea . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
KDChart::HorizontalLineLayoutItem . . . . . . . . . . . . . . . . . . . . . . . . . . . . 385
KDChart::MarkerLayoutItem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 476
KDChart::TextLayoutItem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 661
KDChart::TextArea . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 642
KDChart::VerticalLineLayoutItem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 684
QObject . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 602
KDChart::AbstractArea . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
KDChart::DiagramObserver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 361
KDChart::Palette . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 488
KDChart::TextArea . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 642
KDChartEnums . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 390
QSortFilterProxyModel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 603
KDChart::DatasetProxyModel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 345
QTextDocument . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 604
KDTextDocument . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 400
QWidget . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 605
KDChart::AbstractAreaWidget . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
KDChart::Chart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 326
KDChart::Widget . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 689
KDChart::RelativePosition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 606
RelativePosition::Private
KDChart::TextAttributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 656
TextAttributes::Private
Widget
KDChart::ZoomParameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 704

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


Chapter 3

KD Chart 2 Class Index

3.1 KD Chart 2 Class List

Here are the classes, structs, unions and interfaces with brief descriptions:
KDChart::AbstractArea (An area in the chart with a background, a frame, etc ) . . . . . . . . . . 29
KDChart::AbstractAreaBase (Base class for AbstractArea and AbstractAreaWidget: An area in
the chart with a background, a frame, etc ) . . . . . . . . . . . . . . . . . . . . . . . . 38
KDChart::AbstractAreaWidget (An area in the chart with a background, a frame, etc ) . . . . . . 43
KDChart::AbstractAxis (The base class for axes ) . . . . . . . . . . . . . . . . . . . . . . . . . 50
KDChart::AbstractCartesianDiagram (Base class for diagrams based on a cartesian coordianate
system ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
KDChart::AbstractCoordinatePlane . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
KDChart::AbstractDiagram (AbstractDiagram defines the interface for diagram classes ) . . . . 114
KDChart::AbstractLayoutItem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141
KDChart::AbstractPieDiagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144
KDChart::AbstractPolarDiagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 176
KDChart::AbstractProxyModel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204
KDChart::AbstractThreeDAttributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 206
KDChart::AttributesModel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209
KDChart::BackgroundAttributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219
KDChart::BarAttributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222
KDChart::BarDiagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225
KDChart::CartesianAxis (The class for cartesian axes ) . . . . . . . . . . . . . . . . . . . . . . 265
KDChart::CartesianCoordinatePlane . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 294
KDChart::Chart (A chart with one or more diagrams ) . . . . . . . . . . . . . . . . . . . . . . . 326
KDChart::DataDimension (Helper class for one dimension of data, e.g. for the rows in a data
model, or for the labels of an axis, or for the vertical lines in a grid ) . . . . . . . . . . 342
KDChart::DatasetProxyModel (DatasetProxyModel takes a KDChart dataset configuration and
translates it into a filtering proxy model ) . . . . . . . . . . . . . . . . . . . . . . . . . 345
KDChart::DatasetSelectorWidget . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 352
KDChart::DataValueAttributes (Diagram attributes dealing with data value labels ) . . . . . . . 355
KDChart::DiagramObserver (A DiagramObserver watches the associated diagram for changes
and deletion and emits corresponsing signals ) . . . . . . . . . . . . . . . . . . . . . . 361
KDChart::FrameAttributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 364
KDChart::GridAttributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 366
KDChart::HeaderFooter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 369
KDChart::HorizontalLineLayoutItem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 385
6 KD Chart 2 Class Index

KDChartEnums (Project global class providing some enums needed both by KDChartParams
and by KDChartCustomBox ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 390
KDTextDocument . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 400
KDChart::Legend (Legend defines the interface for the legend drawing class ) . . . . . . . . . . 402
KDChart::LineAttributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 428
KDChart::LineDiagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 431
KDChart::MarkerAttributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 473
KDChart::MarkerLayoutItem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 476
KDChart::Measure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 481
KDChart::PaintContext . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 486
KDChart::Palette (A Palette is a set of brushes (or colors) to be used for painting data sets ) . . . 488
KDChart::PieAttributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 491
KDChart::PieDiagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 494
KDChart::PolarCoordinatePlane . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 530
KDChart::PolarDiagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 557
KDChart::Position (Defines a position, using compass terminology ) . . . . . . . . . . . . . . . 590
QAbstractItemView . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 598
QAbstractProxyModel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 599
QFrame . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 600
QLayoutItem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 601
QObject . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 602
QSortFilterProxyModel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 603
QTextDocument . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 604
QWidget . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 605
KDChart::RelativePosition (Defines relative position information: reference area, position in this
area, horizontal / vertical padding, and rotating ) . . . . . . . . . . . . . . . . . . . . . 606
KDChart::RingDiagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 608
KDChart::TextArea (A text area in the chart with a background, a frame, etc ) . . . . . . . . . . 642
KDChart::TextAttributes (A set of text attributes ) . . . . . . . . . . . . . . . . . . . . . . . . . 656
KDChart::TextLayoutItem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 661
KDChart::ThreeDBarAttributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 670
KDChart::ThreeDLineAttributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 675
KDChart::ThreeDPieAttributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 680
KDChart::VerticalLineLayoutItem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 684
KDChart::Widget (The KD Chart widget for usage without Model/View ) . . . . . . . . . . . . 689
KDChart::ZoomParameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 704

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


Chapter 4

KD Chart 2 File Index

4.1 KD Chart 2 File List


Here is a list of all files with brief descriptions:
KDChartAbstractArea.cpp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 707
KDChartAbstractArea.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 708
KDChartAbstractAreaBase.cpp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 709
KDChartAbstractAreaBase.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 713
KDChartAbstractAreaWidget.cpp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 714
KDChartAbstractAreaWidget.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 715
KDChartAbstractAxis.cpp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 716
KDChartAbstractAxis.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 717
KDChartAbstractCartesianDiagram.cpp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 718
KDChartAbstractCartesianDiagram.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 719
KDChartAbstractCoordinatePlane.cpp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 720
KDChartAbstractCoordinatePlane.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 721
KDChartAbstractDiagram.cpp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 722
KDChartAbstractDiagram.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 723
KDChartAbstractPieDiagram.cpp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 724
KDChartAbstractPieDiagram.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 725
KDChartAbstractPolarDiagram.cpp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 726
KDChartAbstractPolarDiagram.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 727
KDChartAbstractProxyModel.cpp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 728
KDChartAbstractProxyModel.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 729
KDChartAbstractThreeDAttributes.cpp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 730
KDChartAbstractThreeDAttributes.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 731
KDChartAttributesModel.cpp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 732
KDChartAttributesModel.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 733
KDChartBackgroundAttributes.cpp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 734
KDChartBackgroundAttributes.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 735
KDChartBarAttributes.cpp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 736
KDChartBarAttributes.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 737
KDChartBarDiagram.cpp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 738
KDChartBarDiagram.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 739
KDChartCartesianAxis.cpp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 740
KDChartCartesianAxis.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 741
KDChartCartesianCoordinatePlane.cpp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 742
8 KD Chart 2 File Index

KDChartCartesianCoordinatePlane.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 743
KDChartChart.cpp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 744
KDChartChart.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 746
KDChartDatasetProxyModel.cpp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 747
KDChartDatasetProxyModel.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 748
KDChartDatasetSelector.cpp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 749
KDChartDatasetSelector.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 750
KDChartDataValueAttributes.cpp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 751
KDChartDataValueAttributes.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 753
KDChartDiagramObserver.cpp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 754
KDChartDiagramObserver.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 755
KDChartEnums.h (Definition of global enums ) . . . . . . . . . . . . . . . . . . . . . . . . . . 756
KDChartFrameAttributes.cpp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 757
KDChartFrameAttributes.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 758
KDChartGlobal.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 759
KDChartGridAttributes.cpp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 764
KDChartGridAttributes.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 765
KDChartHeaderFooter.cpp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 766
KDChartHeaderFooter.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 767
KDChartLayoutItems.cpp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 768
KDChartLayoutItems.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 769
KDChartLegend.cpp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 770
KDChartLegend.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 771
KDChartLineAttributes.cpp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 772
KDChartLineAttributes.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 773
KDChartLineDiagram.cpp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 774
KDChartLineDiagram.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 775
KDChartMarkerAttributes.cpp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 776
KDChartMarkerAttributes.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 777
KDChartMeasure.cpp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 778
KDChartMeasure.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 779
KDChartPaintContext.cpp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 780
KDChartPaintContext.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 781
KDChartPalette.cpp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 782
KDChartPalette.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 784
KDChartPieAttributes.cpp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 785
KDChartPieAttributes.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 786
KDChartPieDiagram.cpp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 787
KDChartPieDiagram.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 789
KDChartPolarCoordinatePlane.cpp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 790
KDChartPolarCoordinatePlane.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 791
KDChartPolarDiagram.cpp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 792
KDChartPolarDiagram.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 793
KDChartPosition.cpp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 794
KDChartPosition.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 797
KDChartRelativePosition.cpp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 798
KDChartRelativePosition.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 799
KDChartRingDiagram.cpp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 800
KDChartRingDiagram.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 801
KDChartTextArea.cpp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 802
KDChartTextArea.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 803
KDChartTextAttributes.cpp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 804
KDChartTextAttributes.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 805
KDChartThreeDBarAttributes.cpp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 806

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


4.1 KD Chart 2 File List 9

KDChartThreeDBarAttributes.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 807
KDChartThreeDLineAttributes.cpp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 808
KDChartThreeDLineAttributes.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 809
KDChartThreeDPieAttributes.cpp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 810
KDChartThreeDPieAttributes.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 811
KDChartWidget.cpp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 812
KDChartWidget.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 814
KDChartZoomParameters.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 815
KDTextDocument.cpp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 816
KDTextDocument.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 817

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


10 KD Chart 2 File Index

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


Chapter 5

KD Chart 2 Namespace Documentation

5.1 BackgroundAttributes Namespace Reference


12 KD Chart 2 Namespace Documentation

5.2 BarAttributes Namespace Reference

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


5.3 DataValueAttributes Namespace Reference 13

5.3 DataValueAttributes Namespace Reference

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


14 KD Chart 2 Namespace Documentation

5.4 FrameAttributes Namespace Reference

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


5.5 GridAttributes Namespace Reference 15

5.5 GridAttributes Namespace Reference

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


16 KD Chart 2 Namespace Documentation

5.6 KDChart Namespace Reference

Classes
• class AbstractArea
An area in the chart with a background, a frame, etc.

• class AbstractAreaBase
Base class for AbstractArea and AbstractAreaWidget: An area in the chart with a background, a frame, etc.

• class AbstractAreaWidget
An area in the chart with a background, a frame, etc.

• class AbstractAxis
The base class for axes.

• class AbstractCartesianDiagram
Base class for diagrams based on a cartesian coordianate system.

• class AbstractCoordinatePlane
• class AbstractDiagram
AbstractDiagram defines the interface for diagram classes.

• class AbstractLayoutItem
• class AbstractPieDiagram
• class AbstractPolarDiagram
• class AbstractProxyModel
• class AbstractThreeDAttributes
• class AttributesModel
• class BackgroundAttributes
• class BarAttributes
• class BarDiagram
• class CartesianAxis
The class for cartesian axes.

• class CartesianCoordinatePlane
• class Chart
A chart with one or more diagrams.

• class DataDimension
Helper class for one dimension of data, e.g. for the rows in a data model, or for the labels of an axis, or for
the vertical lines in a grid.

• class DatasetProxyModel
DatasetProxyModel takes a KDChart dataset configuration and translates it into a filtering proxy model.

• class DatasetSelectorWidget
• class DataValueAttributes
Diagram attributes dealing with data value labels.

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


5.6 KDChart Namespace Reference 17

• class DiagramObserver
A DiagramObserver watches the associated diagram for changes and deletion and emits corresponsing
signals.

• class FrameAttributes
• class GridAttributes
• class HeaderFooter
• class HorizontalLineLayoutItem
• class Legend
Legend defines the interface for the legend drawing class.

• class LineAttributes
• class LineDiagram
• class MarkerAttributes
• class MarkerLayoutItem
• class Measure
• class PaintContext
• class Palette
A Palette is a set of brushes (or colors) to be used for painting data sets.

• class PieAttributes
• class PieDiagram
• class PolarCoordinatePlane
• class PolarDiagram
• class Position
Defines a position, using compass terminology.

• class RelativePosition
Defines relative position information: reference area, position in this area, horizontal / vertical padding,
and rotating.

• class RingDiagram
• class TextArea
A text area in the chart with a background, a frame, etc.

• class TextAttributes
A set of text attributes.

• class TextLayoutItem
• class ThreeDBarAttributes
• class ThreeDLineAttributes
• class ThreeDPieAttributes
• class VerticalLineLayoutItem
• class Widget
The KD Chart widget for usage without Model/View.

• class ZoomParameters

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


18 KD Chart 2 Namespace Documentation

Typedefs

• typedef QList< AbstractDiagram ∗ > AbstractDiagramList


• typedef QList< CartesianAxis ∗ > CartesianAxisList
• typedef QList< const AbstractDiagram ∗ > ConstAbstractDiagramList
• typedef QList< AbstractCoordinatePlane ∗ > CoordinatePlaneList
• typedef QList< DataDimension > DataDimensionsList
• typedef QVector< int > DatasetDescriptionVector
• typedef QList< AbstractDiagram ∗ > DiagramList
• typedef QList< HeaderFooter ∗ > HeaderFooterList
• typedef QList< Legend ∗ > LegendList

Enumerations

• enum DisplayRoles {
DatasetPenRole = 0x0A79EF95,
DatasetBrushRole,
DataValueLabelAttributesRole,
ThreeDAttributesRole,
LineAttributesRole,
ThreeDLineAttributesRole,
BarAttributesRole,
ThreeDBarAttributesRole,
PieAttributesRole,
ThreeDPieAttributesRole }

5.6.1 Typedef Documentation

5.6.1.1 typedef QList<AbstractDiagram∗> KDChart::AbstractDiagramList

Definition at line 520 of file KDChartAbstractDiagram.h.


Referenced by KDChart::AbstractCoordinatePlane::diagrams(), KDChart::PolarCoordinatePlane::paint(),
and KDChart::CartesianCoordinatePlane::paint().

5.6.1.2 typedef QList<CartesianAxis∗> KDChart::CartesianAxisList

Definition at line 128 of file KDChartCartesianAxis.h.


Referenced by KDChart::AbstractCartesianDiagram::axes().

5.6.1.3 typedef QList<const AbstractDiagram∗> KDChart::ConstAbstractDiagramList

Definition at line 521 of file KDChartAbstractDiagram.h.


Referenced by KDChart::AbstractCoordinatePlane::diagrams().

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


5.6 KDChart Namespace Reference 19

5.6.1.4 typedef QList<AbstractCoordinatePlane∗> KDChart::CoordinatePlaneList

Definition at line 41 of file KDChartChart.h.


Referenced by KDChart::Chart::coordinatePlanes().

5.6.1.5 typedef QList<DataDimension> KDChart::DataDimensionsList

Definition at line 42 of file KDChartAbstractCoordinatePlane.h.


Referenced by KDChart::PolarCoordinatePlane::getDataDimensionsList(), KDChart::Cartesian-
CoordinatePlane::getDataDimensionsList(), KDChart::AbstractCoordinatePlane::gridDimensionsList(),
KDChart::CartesianCoordinatePlane::layoutDiagrams(), and KDChart::CartesianAxis::paintCtx().

5.6.1.6 typedef QVector<int> KDChart::DatasetDescriptionVector

Definition at line 38 of file KDChartDatasetProxyModel.h.


Referenced by KDChart::DatasetProxyModel::setDatasetColumnDescriptionVector(), KDChart::Dataset-
ProxyModel::setDatasetDescriptionVectors(), and KDChart::DatasetProxyModel::setDatasetRow-
DescriptionVector().

5.6.1.7 typedef QList<AbstractDiagram∗> KDChart::DiagramList

Definition at line 42 of file KDChartLegend.h.


Referenced by KDChart::Legend::diagrams().

5.6.1.8 typedef QList<HeaderFooter∗> KDChart::HeaderFooterList

Definition at line 42 of file KDChartChart.h.


Referenced by KDChart::Chart::headerFooters().

5.6.1.9 typedef QList<Legend∗> KDChart::LegendList

Definition at line 43 of file KDChartChart.h.


Referenced by KDChart::Chart::legends().

5.6.2 Enumeration Type Documentation

5.6.2.1 enum KDChart::DisplayRoles

Enumeration values:
DatasetPenRole
DatasetBrushRole
DataValueLabelAttributesRole
ThreeDAttributesRole
LineAttributesRole
ThreeDLineAttributesRole

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


20 KD Chart 2 Namespace Documentation

BarAttributesRole
ThreeDBarAttributesRole
PieAttributesRole
ThreeDPieAttributesRole

Definition at line 244 of file KDChartGlobal.h.

244 {
245 DatasetPenRole = 0x0A79EF95,
246 DatasetBrushRole,
247 DataValueLabelAttributesRole,
248 ThreeDAttributesRole,
249 LineAttributesRole,
250 ThreeDLineAttributesRole,
251 BarAttributesRole,
252 ThreeDBarAttributesRole,
253 PieAttributesRole,
254 ThreeDPieAttributesRole
255 };

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


5.7 LineAttributes Namespace Reference 21

5.7 LineAttributes Namespace Reference

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


22 KD Chart 2 Namespace Documentation

5.8 MarkerAttributes Namespace Reference

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


5.9 PaintContext Namespace Reference 23

5.9 PaintContext Namespace Reference

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


24 KD Chart 2 Namespace Documentation

5.10 Palette Namespace Reference

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


5.11 RelativePosition Namespace Reference 25

5.11 RelativePosition Namespace Reference

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


26 KD Chart 2 Namespace Documentation

5.12 TextAttributes Namespace Reference

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


5.13 Ui Namespace Reference 27

5.13 Ui Namespace Reference

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


28 KD Chart 2 Namespace Documentation

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


Chapter 6

KD Chart 2 Class Documentation

6.1 KDChart::AbstractArea Class Reference


#include <KDChartAbstractArea.h>
Inheritance diagram for KDChart::AbstractArea:Collaboration diagram for KDChart::AbstractArea:

6.1.1 Detailed Description

An area in the chart with a background, a frame, etc.


AbstractArea is the base class for all non-widget chart elements that have a set of background attributes
and frame attributes, such as coordinate planes or axes.

Note:
This class inherits from AbstractAreaBase, AbstractLayoutItem, QObject. The reason for this tripple
inheritance is that neither AbstractAreaBase nor AbstractLayoutItem are QObject.

Definition at line 54 of file KDChartAbstractArea.h.

Public Member Functions


• void alignToReferencePoint (const RelativePosition &position)
• BackgroundAttributes backgroundAttributes () const
• FrameAttributes frameAttributes () const
• virtual void paint (QPainter ∗)=0
• void paintAll (QPainter &painter)
Call paintAll, if you want the background and the frame to be drawn before the normal paint() is invoked
automatically.

• virtual void paintBackground (QPainter &painter, const QRect &rectangle)


• virtual void paintCtx (PaintContext ∗context)
Default impl: Paint the complete item using its layouted position and size.

• virtual void paintFrame (QPainter &painter, const QRect &rectangle)


• virtual void paintIntoRect (QPainter &painter, const QRect &rect)
30 KD Chart 2 Class Documentation

Draws the background and frame, then calls paint().

• void removeFromParentLayout ()
• void setBackgroundAttributes (const BackgroundAttributes &a)
• void setFrameAttributes (const FrameAttributes &a)
• void setParentLayout (QLayout ∗lay)
• virtual void setParentWidget (QWidget ∗widget)
Inform the item about its widget: This enables the item, to trigger that widget’s update, whenever the size
of the item’s contents has changed.

• virtual void sizeHintChanged () const


Report changed size hint: ask the parent widget to recalculate the layout.

• virtual ∼AbstractArea ()

Protected Member Functions


• AbstractArea ()
• virtual QRect areaGeometry () const
• QRect innerRect () const
• virtual void positionHasChanged ()

Protected Attributes
• Q_SIGNALS __pad0__: void positionChanged( AbstractArea ∗ )
• QWidget ∗ mParent
• QLayout ∗ mParentLayout

6.1.2 Constructor & Destructor Documentation

6.1.2.1 AbstractArea::∼AbstractArea () [virtual]

Definition at line 60 of file KDChartAbstractArea.cpp.

61 {
62 // this bloc left empty intentionally
63 }

6.1.2.2 AbstractArea::AbstractArea () [protected]

Definition at line 52 of file KDChartAbstractArea.cpp.

53 : QObject()
54 , KDChart::AbstractAreaBase()
55 , KDChart::AbstractLayoutItem()
56 {
57 // this bloc left empty intentionally
58 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.1 KDChart::AbstractArea Class Reference 31

6.1.3 Member Function Documentation

6.1.3.1 void AbstractAreaBase::alignToReferencePoint (const RelativePosition & position)


[inherited]

Definition at line 75 of file KDChartAbstractAreaBase.cpp.

76 {
77 Q_UNUSED( position );
78 // PENDING(kalle) FIXME
79 qWarning( "Sorry, not implemented: void AbstractAreaBase::alignToReferencePoint( const RelativePosi
80 }

6.1.3.2 QRect AbstractArea::areaGeometry () const [protected, virtual]

Implements KDChart::AbstractAreaBase.
Definition at line 105 of file KDChartAbstractArea.cpp.
Referenced by KDChart::CartesianCoordinatePlane::drawingArea(), KDChart::PolarCoordinate-
Plane::layoutDiagrams(), KDChart::CartesianAxis::paint(), paintAll(), and KDChart::Cartesian-
Axis::paintCtx().

106 {
107 return geometry();
108 }

6.1.3.3 BackgroundAttributes AbstractAreaBase::backgroundAttributes () const [inherited]

Definition at line 97 of file KDChartAbstractAreaBase.cpp.


References d.

98 {
99 return d->backgroundAttributes;
100 }

6.1.3.4 FrameAttributes AbstractAreaBase::frameAttributes () const [inherited]

Definition at line 87 of file KDChartAbstractAreaBase.cpp.


References d.
Referenced by KDChart::Legend::clone().

88 {
89 return d->frameAttributes;
90 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


32 KD Chart 2 Class Documentation

6.1.3.5 QRect AbstractAreaBase::innerRect () const [protected, inherited]

Definition at line 175 of file KDChartAbstractAreaBase.cpp.


References KDChart::AbstractAreaBase::areaGeometry(), and d.
Referenced by KDChart::TextArea::paintAll(), KDChart::AbstractAreaWidget::paintAll(), and paintAll().

176 {
177 Q_ASSERT_X ( d != 0, "AbstractAreaBase::innerRect()",
178 "Private class was not initialized!" );
179
180 const int padding
181 = d->frameAttributes.isVisible()
182 ? qMax( d->frameAttributes.padding(), 0 ) : 0;
183 return
184 QRect( QPoint(0,0), areaGeometry().size() )
185 .adjusted( padding, padding, -padding, -padding );
186 }

6.1.3.6 virtual void KDChart::AbstractLayoutItem::paint (QPainter ∗) [pure virtual,


inherited]

Implemented in KDChart::CartesianAxis, KDChart::CartesianCoordinatePlane, KDChart::TextLayout-


Item, KDChart::MarkerLayoutItem, KDChart::HorizontalLineLayoutItem, KDChart::VerticalLineLayout-
Item, and KDChart::PolarCoordinatePlane.
Referenced by KDChart::Legend::paint(), paintAll(), and KDChart::AbstractLayoutItem::paintCtx().

6.1.3.7 void AbstractArea::paintAll (QPainter & painter)

Call paintAll, if you want the background and the frame to be drawn before the normal paint() is invoked
automatically.
Definition at line 83 of file KDChartAbstractArea.cpp.
References areaGeometry(), KDChart::AbstractAreaBase::innerRect(), KDChart::AbstractLayout-
Item::paint(), KDChart::AbstractAreaBase::paintBackground(), and KDChart::AbstractAreaBase::paint-
Frame().
Referenced by KDChart::Chart::paint(), and paintIntoRect().

84 {
85 // Paint the background and frame
86 paintBackground( painter, geometry() );
87 paintFrame( painter, geometry() );
88
89 // temporarily adjust the widget size, to be sure all content gets calculated
90 // to fit into the inner rectangle
91 const QRect oldGeometry( areaGeometry() );
92 QRect inner( innerRect() );
93 inner.moveTo(
94 oldGeometry.left() + inner.left(),
95 oldGeometry.top() + inner.top() );
96 const bool needAdjustGeometry = oldGeometry != inner;
97 if( needAdjustGeometry )
98 setGeometry( inner );
99 paint( &painter );
100 if( needAdjustGeometry )
101 setGeometry( oldGeometry );

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.1 KDChart::AbstractArea Class Reference 33

102 //qDebug() << "AbstractAreaWidget::paintAll() done.";


103 }

6.1.3.8 void AbstractAreaBase::paintBackground (QPainter & painter, const QRect & rectangle)
[virtual, inherited]

Definition at line 103 of file KDChartAbstractAreaBase.cpp.


References attributes, and d.
Referenced by KDChart::TextArea::paintAll(), KDChart::AbstractAreaWidget::paintAll(), and paintAll().

104 {
105 Q_ASSERT_X ( d != 0, "AbstractAreaBase::paintBackground()",
106 "Private class was not initialized!" );
107
108 #define attributes d->backgroundAttributes
109
110 if( !attributes.isVisible() ) return;
111
112 /* first draw the brush (may contain a pixmap)*/
113 if( Qt::NoBrush != attributes.brush().style() ) {
114 KDChart::PainterSaver painterSaver( &painter );
115 painter.setPen( Qt::NoPen );
116 const QPointF newTopLeft( painter.deviceMatrix().map( rect.topLeft() ) );
117 painter.setBrushOrigin( newTopLeft );
118 painter.setBrush( attributes.brush() );
119 painter.drawRect( rect );
120 }
121 /* next draw the backPixmap over the brush */
122 if( !attributes.pixmap().isNull() &&
123 attributes.pixmapMode() != BackgroundAttributes::BackgroundPixmapModeNone ) {
124 QPointF ol = rect.topLeft();
125 if( BackgroundAttributes::BackgroundPixmapModeCentered == attributes.pixmapMode() )
126 {
127 ol.setX( rect.center().x() - attributes.pixmap().width() / 2 );
128 ol.setY( rect.center().y() - attributes.pixmap().height()/ 2 );
129 painter.drawPixmap( ol, attributes.pixmap() );
130 } else {
131 QMatrix m;
132 double zW = (double)rect.width() / (double)attributes.pixmap().width();
133 double zH = (double)rect.height() / (double)attributes.pixmap().height();
134 switch( attributes.pixmapMode() ) {
135 case BackgroundAttributes::BackgroundPixmapModeScaled:
136 {
137 double z;
138 z = qMin( zW, zH );
139 m.scale( z, z );
140 }
141 break;
142 case BackgroundAttributes::BackgroundPixmapModeStretched:
143 m.scale( zW, zH );
144 break;
145 default:
146 ; // Cannot happen, previously checked
147 }
148 QPixmap pm = attributes.pixmap().transformed( m );
149 ol.setX( rect.center().x() - pm.width() / 2 );
150 ol.setY( rect.center().y() - pm.height()/ 2 );
151 painter.drawPixmap( ol, pm );
152 }
153 }
154 #undef attributes
155 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


34 KD Chart 2 Class Documentation

6.1.3.9 void KDChart::AbstractLayoutItem::paintCtx (PaintContext ∗ context) [virtual,


inherited]

Default impl: Paint the complete item using its layouted position and size.
Reimplemented in KDChart::CartesianAxis.
Definition at line 64 of file KDChartLayoutItems.cpp.
References KDChart::AbstractLayoutItem::paint(), and KDChart::PaintContext::painter().

65 {
66 if( context )
67 paint( context->painter() );
68 }

6.1.3.10 void AbstractAreaBase::paintFrame (QPainter & painter, const QRect & rectangle)
[virtual, inherited]

Definition at line 158 of file KDChartAbstractAreaBase.cpp.


References attributes, and d.
Referenced by KDChart::TextArea::paintAll(), KDChart::AbstractAreaWidget::paintAll(), and paintAll().

159 {
160 Q_ASSERT_X ( d != 0, "AbstractAreaBase::paintFrame()",
161 "Private class was not initialized!" );
162
163 #define attributes d->frameAttributes
164
165 if( !attributes.isVisible() ) return;
166
167 const QPen oldPen( painter.pen() );
168 painter.setPen( attributes.pen() );
169 painter.drawRect( rect );
170 painter.setPen( oldPen );
171 #undef attributes
172 }

6.1.3.11 void AbstractArea::paintIntoRect (QPainter & painter, const QRect & rect)
[virtual]

Draws the background and frame, then calls paint().


In most cases there is no need to overwrite this method in a derived class, but you would overwrite Abstract-
LayoutItem::paint() instead.
Definition at line 71 of file KDChartAbstractArea.cpp.
References paintAll().

72 {
73 const QRect oldGeometry( geometry() );
74 if( oldGeometry != rect )
75 setGeometry( rect );
76 painter.translate( rect.left(), rect.top() );
77 paintAll( painter );
78 painter.translate( -rect.left(), -rect.top() );

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.1 KDChart::AbstractArea Class Reference 35

79 if( oldGeometry != rect )


80 setGeometry( oldGeometry );
81 }

6.1.3.12 void AbstractArea::positionHasChanged () [protected, virtual]

Reimplemented from KDChart::AbstractAreaBase.


Definition at line 110 of file KDChartAbstractArea.cpp.

111 {
112 emit positionChanged( this );
113 }

6.1.3.13 void KDChart::AbstractLayoutItem::removeFromParentLayout () [inherited]

Definition at line 66 of file KDChartLayoutItems.h.


Referenced by KDChart::Chart::takeCoordinatePlane().

67 {
68 if( mParentLayout ){
69 if( widget() )
70 mParentLayout->removeWidget( widget() );
71 else
72 mParentLayout->removeItem( this );
73 }
74 }

6.1.3.14 void AbstractAreaBase::setBackgroundAttributes (const BackgroundAttributes & a)


[inherited]

Definition at line 92 of file KDChartAbstractAreaBase.cpp.


References d.

93 {
94 d->backgroundAttributes = a;
95 }

6.1.3.15 void AbstractAreaBase::setFrameAttributes (const FrameAttributes & a)


[inherited]

Definition at line 82 of file KDChartAbstractAreaBase.cpp.


References d.
Referenced by KDChart::Legend::clone().

83 {
84 d->frameAttributes = a;
85 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


36 KD Chart 2 Class Documentation

6.1.3.16 void KDChart::AbstractLayoutItem::setParentLayout (QLayout ∗ lay) [inherited]

Definition at line 62 of file KDChartLayoutItems.h.

63 {
64 mParentLayout = lay;
65 }

6.1.3.17 void KDChart::AbstractLayoutItem::setParentWidget (QWidget ∗ widget) [virtual,


inherited]

Inform the item about its widget: This enables the item, to trigger that widget’s update, whenever the size
of the item’s contents has changed.
Thus, you need to call setParentWidget on every item, that has a non-fixed size.
Definition at line 56 of file KDChartLayoutItems.cpp.
References KDChart::AbstractLayoutItem::mParent.
Referenced by KDChart::Legend::buildLegend(), and KDChart::AbstractCartesianDiagram::takeAxis().

57 {
58 mParent = widget;
59 }

6.1.3.18 void KDChart::AbstractLayoutItem::sizeHintChanged () const [virtual,


inherited]

Report changed size hint: ask the parent widget to recalculate the layout.
Definition at line 73 of file KDChartLayoutItems.cpp.
Referenced by KDChart::TextLayoutItem::sizeHint().

74 {
75 // This is exactly like what QWidget::updateGeometry does.
76 // qDebug("KDChart::AbstractLayoutItem::sizeHintChanged() called");
77 if( mParent ) {
78 if ( mParent->layout() )
79 mParent->layout()->invalidate();
80 else
81 QApplication::postEvent( mParent, new QEvent( QEvent::LayoutRequest ) );
82 }
83 }

6.1.4 Member Data Documentation

6.1.4.1 Q_SIGNALS KDChart::AbstractArea::__pad0__ [protected]

Reimplemented in KDChart::AbstractCoordinatePlane.
Definition at line 86 of file KDChartAbstractArea.h.

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.1 KDChart::AbstractArea Class Reference 37

6.1.4.2 QWidget∗ KDChart::AbstractLayoutItem::mParent [protected, inherited]

Definition at line 76 of file KDChartLayoutItems.h.


Referenced by KDChart::AbstractLayoutItem::setParentWidget().

6.1.4.3 QLayout∗ KDChart::AbstractLayoutItem::mParentLayout [protected,


inherited]

Definition at line 77 of file KDChartLayoutItems.h.


The documentation for this class was generated from the following files:

• KDChartAbstractArea.h
• KDChartAbstractArea.cpp

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


38 KD Chart 2 Class Documentation

6.2 KDChart::AbstractAreaBase Class Reference


#include <KDChartAbstractAreaBase.h>
Inheritance diagram for KDChart::AbstractAreaBase:

6.2.1 Detailed Description

Base class for AbstractArea and AbstractAreaWidget: An area in the chart with a background, a frame, etc.
AbstractAreaBase is the base class for all chart elements that have a set of background attributes and frame
attributes, such as legends or axes.

Note:
Normally you should not use AbstractAreaBase directly, but derive your classes from AbstractArea or
AbstractAreaWidget.
This classis not a QObject, so it is easier to inherit from it, if your are inheriting from a QObject too
like AbstractAreaWidget does it.

See also:
AbstractArea, AbstractAreaWidget

Definition at line 68 of file KDChartAbstractAreaBase.h.

Public Member Functions


• void alignToReferencePoint (const RelativePosition &position)
• BackgroundAttributes backgroundAttributes () const
• FrameAttributes frameAttributes () const
• virtual void paintBackground (QPainter &painter, const QRect &rectangle)
• virtual void paintFrame (QPainter &painter, const QRect &rectangle)
• void setBackgroundAttributes (const BackgroundAttributes &a)
• void setFrameAttributes (const FrameAttributes &a)

Protected Member Functions


• AbstractAreaBase ()
• virtual QRect areaGeometry () const=0
• QRect innerRect () const
• virtual void positionHasChanged ()
• virtual ∼AbstractAreaBase ()

6.2.2 Constructor & Destructor Documentation

6.2.2.1 AbstractAreaBase::AbstractAreaBase () [protected]

Definition at line 57 of file KDChartAbstractAreaBase.cpp.

57 :
58 _d( new Private() )
59 {
60 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.2 KDChart::AbstractAreaBase Class Reference 39

6.2.2.2 AbstractAreaBase::∼AbstractAreaBase () [protected, virtual]

Definition at line 62 of file KDChartAbstractAreaBase.cpp.

63 {
64 delete _d; _d = 0;
65 }

6.2.3 Member Function Documentation

6.2.3.1 void AbstractAreaBase::alignToReferencePoint (const RelativePosition & position)

Definition at line 75 of file KDChartAbstractAreaBase.cpp.

76 {
77 Q_UNUSED( position );
78 // PENDING(kalle) FIXME
79 qWarning( "Sorry, not implemented: void AbstractAreaBase::alignToReferencePoint( const RelativePosi
80 }

6.2.3.2 virtual QRect KDChart::AbstractAreaBase::areaGeometry () const [protected,


pure virtual]

Implemented in KDChart::AbstractArea, KDChart::AbstractAreaWidget, and KDChart::TextArea.


Referenced by innerRect().

6.2.3.3 BackgroundAttributes AbstractAreaBase::backgroundAttributes () const

Definition at line 97 of file KDChartAbstractAreaBase.cpp.


References d.

98 {
99 return d->backgroundAttributes;
100 }

6.2.3.4 FrameAttributes AbstractAreaBase::frameAttributes () const

Definition at line 87 of file KDChartAbstractAreaBase.cpp.


References d.
Referenced by KDChart::Legend::clone().

88 {
89 return d->frameAttributes;
90 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


40 KD Chart 2 Class Documentation

6.2.3.5 QRect AbstractAreaBase::innerRect () const [protected]

Definition at line 175 of file KDChartAbstractAreaBase.cpp.


References areaGeometry(), and d.
Referenced by KDChart::TextArea::paintAll(), KDChart::AbstractAreaWidget::paintAll(), and
KDChart::AbstractArea::paintAll().

176 {
177 Q_ASSERT_X ( d != 0, "AbstractAreaBase::innerRect()",
178 "Private class was not initialized!" );
179
180 const int padding
181 = d->frameAttributes.isVisible()
182 ? qMax( d->frameAttributes.padding(), 0 ) : 0;
183 return
184 QRect( QPoint(0,0), areaGeometry().size() )
185 .adjusted( padding, padding, -padding, -padding );
186 }

6.2.3.6 void AbstractAreaBase::paintBackground (QPainter & painter, const QRect & rectangle)
[virtual]

Definition at line 103 of file KDChartAbstractAreaBase.cpp.


References attributes, and d.
Referenced by KDChart::TextArea::paintAll(), KDChart::AbstractAreaWidget::paintAll(), and
KDChart::AbstractArea::paintAll().

104 {
105 Q_ASSERT_X ( d != 0, "AbstractAreaBase::paintBackground()",
106 "Private class was not initialized!" );
107
108 #define attributes d->backgroundAttributes
109
110 if( !attributes.isVisible() ) return;
111
112 /* first draw the brush (may contain a pixmap)*/
113 if( Qt::NoBrush != attributes.brush().style() ) {
114 KDChart::PainterSaver painterSaver( &painter );
115 painter.setPen( Qt::NoPen );
116 const QPointF newTopLeft( painter.deviceMatrix().map( rect.topLeft() ) );
117 painter.setBrushOrigin( newTopLeft );
118 painter.setBrush( attributes.brush() );
119 painter.drawRect( rect );
120 }
121 /* next draw the backPixmap over the brush */
122 if( !attributes.pixmap().isNull() &&
123 attributes.pixmapMode() != BackgroundAttributes::BackgroundPixmapModeNone ) {
124 QPointF ol = rect.topLeft();
125 if( BackgroundAttributes::BackgroundPixmapModeCentered == attributes.pixmapMode() )
126 {
127 ol.setX( rect.center().x() - attributes.pixmap().width() / 2 );
128 ol.setY( rect.center().y() - attributes.pixmap().height()/ 2 );
129 painter.drawPixmap( ol, attributes.pixmap() );
130 } else {
131 QMatrix m;
132 double zW = (double)rect.width() / (double)attributes.pixmap().width();
133 double zH = (double)rect.height() / (double)attributes.pixmap().height();
134 switch( attributes.pixmapMode() ) {
135 case BackgroundAttributes::BackgroundPixmapModeScaled:

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.2 KDChart::AbstractAreaBase Class Reference 41

136 {
137 double z;
138 z = qMin( zW, zH );
139 m.scale( z, z );
140 }
141 break;
142 case BackgroundAttributes::BackgroundPixmapModeStretched:
143 m.scale( zW, zH );
144 break;
145 default:
146 ; // Cannot happen, previously checked
147 }
148 QPixmap pm = attributes.pixmap().transformed( m );
149 ol.setX( rect.center().x() - pm.width() / 2 );
150 ol.setY( rect.center().y() - pm.height()/ 2 );
151 painter.drawPixmap( ol, pm );
152 }
153 }
154 #undef attributes
155 }

6.2.3.7 void AbstractAreaBase::paintFrame (QPainter & painter, const QRect & rectangle)
[virtual]

Definition at line 158 of file KDChartAbstractAreaBase.cpp.


References attributes, and d.
Referenced by KDChart::TextArea::paintAll(), KDChart::AbstractAreaWidget::paintAll(), and
KDChart::AbstractArea::paintAll().

159 {
160 Q_ASSERT_X ( d != 0, "AbstractAreaBase::paintFrame()",
161 "Private class was not initialized!" );
162
163 #define attributes d->frameAttributes
164
165 if( !attributes.isVisible() ) return;
166
167 const QPen oldPen( painter.pen() );
168 painter.setPen( attributes.pen() );
169 painter.drawRect( rect );
170 painter.setPen( oldPen );
171 #undef attributes
172 }

6.2.3.8 void AbstractAreaBase::positionHasChanged () [protected, virtual]

Reimplemented in KDChart::AbstractArea, KDChart::AbstractAreaWidget, and KDChart::TextArea.


Definition at line 188 of file KDChartAbstractAreaBase.cpp.

189 {
190 // this bloc left empty intentionally
191 }

6.2.3.9 void AbstractAreaBase::setBackgroundAttributes (const BackgroundAttributes & a)

Definition at line 92 of file KDChartAbstractAreaBase.cpp.

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


42 KD Chart 2 Class Documentation

References d.

93 {
94 d->backgroundAttributes = a;
95 }

6.2.3.10 void AbstractAreaBase::setFrameAttributes (const FrameAttributes & a)

Definition at line 82 of file KDChartAbstractAreaBase.cpp.


References d.
Referenced by KDChart::Legend::clone().

83 {
84 d->frameAttributes = a;
85 }

The documentation for this class was generated from the following files:

• KDChartAbstractAreaBase.h
• KDChartAbstractAreaBase.cpp

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.3 KDChart::AbstractAreaWidget Class Reference 43

6.3 KDChart::AbstractAreaWidget Class Reference


#include <KDChartAbstractAreaWidget.h>
Inheritance diagram for KDChart::AbstractAreaWidget:Collaboration diagram for KDChart::Abstract-
AreaWidget:

6.3.1 Detailed Description

An area in the chart with a background, a frame, etc.


AbstractAreaWidget is the base for all widget classes that have a set of background attributes and frame
attributes, such as KDChart::Chart and KDChart::Legend.
Definition at line 51 of file KDChartAbstractAreaWidget.h.

Public Member Functions


• AbstractAreaWidget (QWidget ∗parent=0)
• void alignToReferencePoint (const RelativePosition &position)
• BackgroundAttributes backgroundAttributes () const
• virtual void forceRebuild ()
• FrameAttributes frameAttributes () const
• virtual void paint (QPainter ∗painter)=0
Overwrite this to paint the inner contents of your widget.

• void paintAll (QPainter &painter)


Call paintAll, if you want the background and the frame to be drawn before the normal paint() is invoked
automatically.

• virtual void paintBackground (QPainter &painter, const QRect &rectangle)


• virtual void paintEvent (QPaintEvent ∗event)
Draws the background and frame, then calls paint().

• virtual void paintFrame (QPainter &painter, const QRect &rectangle)


• virtual void paintIntoRect (QPainter &painter, const QRect &rect)
Draws the background and frame, then calls paint().

• void setBackgroundAttributes (const BackgroundAttributes &a)


• void setFrameAttributes (const FrameAttributes &a)

Public Attributes
• Q_SIGNALS __pad0__: void positionChanged( AbstractAreaWidget ∗ )

Protected Member Functions


• virtual QRect areaGeometry () const
• QRect innerRect () const
• virtual void positionHasChanged ()
• virtual ∼AbstractAreaWidget ()

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


44 KD Chart 2 Class Documentation

6.3.2 Constructor & Destructor Documentation

6.3.2.1 AbstractAreaWidget::AbstractAreaWidget (QWidget ∗ parent = 0) [explicit]

Definition at line 46 of file KDChartAbstractAreaWidget.cpp.

47 : QWidget( parent )
48 , AbstractAreaBase( new Private() )
49 {
50 init();
51 }

6.3.2.2 AbstractAreaWidget::∼AbstractAreaWidget () [protected, virtual]

Definition at line 53 of file KDChartAbstractAreaWidget.cpp.

54 {
55 // this bloc left empty intentionally
56 }

6.3.3 Member Function Documentation

6.3.3.1 void AbstractAreaBase::alignToReferencePoint (const RelativePosition & position)


[inherited]

Definition at line 75 of file KDChartAbstractAreaBase.cpp.

76 {
77 Q_UNUSED( position );
78 // PENDING(kalle) FIXME
79 qWarning( "Sorry, not implemented: void AbstractAreaBase::alignToReferencePoint( const RelativePosi
80 }

6.3.3.2 QRect AbstractAreaWidget::areaGeometry () const [protected, virtual]

Implements KDChart::AbstractAreaBase.
Definition at line 116 of file KDChartAbstractAreaWidget.cpp.
Referenced by KDChart::Legend::buildLegend(), KDChart::Legend::paint(), and paintAll().

117 {
118 return geometry();
119 }

6.3.3.3 BackgroundAttributes AbstractAreaBase::backgroundAttributes () const [inherited]

Definition at line 97 of file KDChartAbstractAreaBase.cpp.


References d.

98 {
99 return d->backgroundAttributes;
100 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.3 KDChart::AbstractAreaWidget Class Reference 45

6.3.3.4 void AbstractAreaWidget::forceRebuild () [virtual]

Reimplemented in KDChart::Legend.
Definition at line 84 of file KDChartAbstractAreaWidget.cpp.

85 {
86 //bloc left empty intentionally
87 }

6.3.3.5 FrameAttributes AbstractAreaBase::frameAttributes () const [inherited]

Definition at line 87 of file KDChartAbstractAreaBase.cpp.


References d.
Referenced by KDChart::Legend::clone().

88 {
89 return d->frameAttributes;
90 }

6.3.3.6 QRect AbstractAreaBase::innerRect () const [protected, inherited]

Definition at line 175 of file KDChartAbstractAreaBase.cpp.


References KDChart::AbstractAreaBase::areaGeometry(), and d.
Referenced by KDChart::TextArea::paintAll(), paintAll(), and KDChart::AbstractArea::paintAll().

176 {
177 Q_ASSERT_X ( d != 0, "AbstractAreaBase::innerRect()",
178 "Private class was not initialized!" );
179
180 const int padding
181 = d->frameAttributes.isVisible()
182 ? qMax( d->frameAttributes.padding(), 0 ) : 0;
183 return
184 QRect( QPoint(0,0), areaGeometry().size() )
185 .adjusted( padding, padding, -padding, -padding );
186 }

6.3.3.7 virtual void KDChart::AbstractAreaWidget::paint (QPainter ∗ painter) [pure


virtual]

Overwrite this to paint the inner contents of your widget.

Note:
When overriding this method, please let your widget draw itself at the top/left corner of the painter.
You should call rect() (or width(), height(), resp.) to find the drawable area’s size: While the paint()
method is being executed the frame of the widget is outside of its rect(), so you can use all of rect() for
your custom drawing!

See also:
paint, paintIntoRect

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


46 KD Chart 2 Class Documentation

Implemented in KDChart::Legend.
Referenced by paintAll().

6.3.3.8 void AbstractAreaWidget::paintAll (QPainter & painter)

Call paintAll, if you want the background and the frame to be drawn before the normal paint() is invoked
automatically.
Definition at line 89 of file KDChartAbstractAreaWidget.cpp.
References areaGeometry(), KDChart::AbstractAreaBase::innerRect(), paint(), KDChart::AbstractArea-
Base::paintBackground(), and KDChart::AbstractAreaBase::paintFrame().
Referenced by paintEvent(), and paintIntoRect().

90 {
91 //qDebug() << "AbstractAreaWidget::paintAll() called";
92 // Paint the background and frame
93 paintBackground( painter, rect() );
94 paintFrame( painter, rect().adjusted(0,0,-1,-1) );
95
96 // adjust the widget’s content margins,
97 // to be sure all content gets calculated
98 // to fit into the inner rectangle
99 const QRect oldGeometry( areaGeometry() );
100 const QRect inner( innerRect() );
101 //qDebug() << "areaGeometry():" << oldGeometry
102 // << " contentsRect():" << contentsRect() << " inner:" << inner;
103 if( contentsRect() != inner ){
104 //qDebug() << "old contentsRect():" << contentsRect() << " new innerRect:" << inner;
105 setContentsMargins(
106 inner.left(),
107 inner.top(),
108 oldGeometry.width() -inner.width()-1,
109 oldGeometry.height()-inner.height()-1 );
110 //forceRebuild();
111 }
112 paint( &painter );
113 //qDebug() << "AbstractAreaWidget::paintAll() done.";
114 }

6.3.3.9 void AbstractAreaBase::paintBackground (QPainter & painter, const QRect & rectangle)
[virtual, inherited]

Definition at line 103 of file KDChartAbstractAreaBase.cpp.


References attributes, and d.
Referenced by KDChart::TextArea::paintAll(), paintAll(), and KDChart::AbstractArea::paintAll().

104 {
105 Q_ASSERT_X ( d != 0, "AbstractAreaBase::paintBackground()",
106 "Private class was not initialized!" );
107
108 #define attributes d->backgroundAttributes
109
110 if( !attributes.isVisible() ) return;
111
112 /* first draw the brush (may contain a pixmap)*/
113 if( Qt::NoBrush != attributes.brush().style() ) {
114 KDChart::PainterSaver painterSaver( &painter );

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.3 KDChart::AbstractAreaWidget Class Reference 47

115 painter.setPen( Qt::NoPen );


116 const QPointF newTopLeft( painter.deviceMatrix().map( rect.topLeft() ) );
117 painter.setBrushOrigin( newTopLeft );
118 painter.setBrush( attributes.brush() );
119 painter.drawRect( rect );
120 }
121 /* next draw the backPixmap over the brush */
122 if( !attributes.pixmap().isNull() &&
123 attributes.pixmapMode() != BackgroundAttributes::BackgroundPixmapModeNone ) {
124 QPointF ol = rect.topLeft();
125 if( BackgroundAttributes::BackgroundPixmapModeCentered == attributes.pixmapMode() )
126 {
127 ol.setX( rect.center().x() - attributes.pixmap().width() / 2 );
128 ol.setY( rect.center().y() - attributes.pixmap().height()/ 2 );
129 painter.drawPixmap( ol, attributes.pixmap() );
130 } else {
131 QMatrix m;
132 double zW = (double)rect.width() / (double)attributes.pixmap().width();
133 double zH = (double)rect.height() / (double)attributes.pixmap().height();
134 switch( attributes.pixmapMode() ) {
135 case BackgroundAttributes::BackgroundPixmapModeScaled:
136 {
137 double z;
138 z = qMin( zW, zH );
139 m.scale( z, z );
140 }
141 break;
142 case BackgroundAttributes::BackgroundPixmapModeStretched:
143 m.scale( zW, zH );
144 break;
145 default:
146 ; // Cannot happen, previously checked
147 }
148 QPixmap pm = attributes.pixmap().transformed( m );
149 ol.setX( rect.center().x() - pm.width() / 2 );
150 ol.setY( rect.center().y() - pm.height()/ 2 );
151 painter.drawPixmap( ol, pm );
152 }
153 }
154 #undef attributes
155 }

6.3.3.10 void AbstractAreaWidget::paintEvent (QPaintEvent ∗ event) [virtual]

Draws the background and frame, then calls paint().


In most cases there is no need to overwrite this method in a derived class, but you would overwrite paint()
instead.

See also:
paint

Definition at line 65 of file KDChartAbstractAreaWidget.cpp.


References paintAll().

66 {
67 Q_UNUSED( event );
68 QPainter painter( this );
69 paintAll( painter );
70 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


48 KD Chart 2 Class Documentation

6.3.3.11 void AbstractAreaBase::paintFrame (QPainter & painter, const QRect & rectangle)
[virtual, inherited]

Definition at line 158 of file KDChartAbstractAreaBase.cpp.


References attributes, and d.
Referenced by KDChart::TextArea::paintAll(), paintAll(), and KDChart::AbstractArea::paintAll().

159 {
160 Q_ASSERT_X ( d != 0, "AbstractAreaBase::paintFrame()",
161 "Private class was not initialized!" );
162
163 #define attributes d->frameAttributes
164
165 if( !attributes.isVisible() ) return;
166
167 const QPen oldPen( painter.pen() );
168 painter.setPen( attributes.pen() );
169 painter.drawRect( rect );
170 painter.setPen( oldPen );
171 #undef attributes
172 }

6.3.3.12 void AbstractAreaWidget::paintIntoRect (QPainter & painter, const QRect & rect)
[virtual]

Draws the background and frame, then calls paint().


In most cases there is no need to overwrite this method in a derived class, but you would overwrite paint()
instead.
Definition at line 72 of file KDChartAbstractAreaWidget.cpp.
References paintAll().
Referenced by KDChart::Chart::paint().

73 {
74 const QRect oldGeometry( geometry() );
75 if( oldGeometry != rect )
76 setGeometry( rect );
77 painter.translate( rect.left(), rect.top() );
78 paintAll( painter );
79 painter.translate( -rect.left(), -rect.top() );
80 if( oldGeometry != rect )
81 setGeometry( oldGeometry );
82 }

6.3.3.13 void AbstractAreaWidget::positionHasChanged () [protected, virtual]

Reimplemented from KDChart::AbstractAreaBase.


Definition at line 121 of file KDChartAbstractAreaWidget.cpp.

122 {
123 emit positionChanged( this );
124 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.3 KDChart::AbstractAreaWidget Class Reference 49

6.3.3.14 void AbstractAreaBase::setBackgroundAttributes (const BackgroundAttributes & a)


[inherited]

Definition at line 92 of file KDChartAbstractAreaBase.cpp.


References d.

93 {
94 d->backgroundAttributes = a;
95 }

6.3.3.15 void AbstractAreaBase::setFrameAttributes (const FrameAttributes & a)


[inherited]

Definition at line 82 of file KDChartAbstractAreaBase.cpp.


References d.
Referenced by KDChart::Legend::clone().

83 {
84 d->frameAttributes = a;
85 }

6.3.4 Member Data Documentation

6.3.4.1 Q_SIGNALS KDChart::AbstractAreaWidget::__pad0__

Reimplemented in KDChart::Legend.
Definition at line 108 of file KDChartAbstractAreaWidget.h.
The documentation for this class was generated from the following files:

• KDChartAbstractAreaWidget.h
• KDChartAbstractAreaWidget.cpp

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


50 KD Chart 2 Class Documentation

6.4 KDChart::AbstractAxis Class Reference


#include <KDChartAbstractAxis.h>
Inheritance diagram for KDChart::AbstractAxis:Collaboration diagram for KDChart::AbstractAxis:

6.4.1 Detailed Description

The base class for axes.


For being useful, axes need to be assigned to a diagram, see AbstractCartesianDiagram::addAxis and
AbstractCartesianDiagram::takeAxis.

See also:
PolarAxis, AbstractCartesianDiagram

Definition at line 63 of file KDChartAbstractAxis.h.

Public Member Functions


• AbstractAxis (AbstractDiagram ∗diagram=0)
• void alignToReferencePoint (const RelativePosition &position)
• BackgroundAttributes backgroundAttributes () const
• virtual void connectSignals ()
Wireing the signal/slot connections.

• const AbstractCoordinatePlane ∗ coordinatePlane () const


Convenience function, returns the coordinate plane, in which this axis is used.

• void createObserver (AbstractDiagram ∗diagram)


• void deleteObserver (AbstractDiagram ∗diagram)
• const AbstractDiagram ∗ diagram () const
• FrameAttributes frameAttributes () const
• virtual QRect geometry () const=0
• QStringList labels () const
Returns a list of strings, that are used as axis labels, as set via setLabels.

• bool observedBy (AbstractDiagram ∗diagram) const


• virtual void paint (QPainter ∗)=0
• void paintAll (QPainter &painter)
Call paintAll, if you want the background and the frame to be drawn before the normal paint() is invoked
automatically.

• virtual void paintBackground (QPainter &painter, const QRect &rectangle)


• virtual void paintCtx (PaintContext ∗context)
Default impl: Paint the complete item using its layouted position and size.

• virtual void paintFrame (QPainter &painter, const QRect &rectangle)


• virtual void paintIntoRect (QPainter &painter, const QRect &rect)
Draws the background and frame, then calls paint().

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.4 KDChart::AbstractAxis Class Reference 51

• void removeFromParentLayout ()
• void setBackgroundAttributes (const BackgroundAttributes &a)
• void setFrameAttributes (const FrameAttributes &a)
• virtual void setGeometry (const QRect &rect)=0
• void setLabels (const QStringList &list)
Use this to specify your own set of strings, to be used as axis labels.

• void setParentLayout (QLayout ∗lay)


• virtual void setParentWidget (QWidget ∗widget)
Inform the item about its widget: This enables the item, to trigger that widget’s update, whenever the size
of the item’s contents has changed.

• void setShortLabels (const QStringList &list)


Use this to specify your own set of strings, to be used as axis labels, in case the normal labels are too long.

• void setTextAttributes (const TextAttributes &a)


Use this to specify the text attributes to be used for axis labels.

• QStringList shortLabels () const


Returns a list of strings, that are used as axis labels, as set via setShortLabels.

• virtual void sizeHintChanged () const


Report changed size hint: ask the parent widget to recalculate the layout.

• TextAttributes textAttributes () const


Returns the text attributes to be used for axis labels.

• virtual ∼AbstractAxis ()

Public Attributes

• public Q_SLOTS: void update()


• protected Q_SLOTS: virtual void delayedInit()

Protected Member Functions

• virtual QRect areaGeometry () const


• QRect innerRect () const
• virtual void positionHasChanged ()

Protected Attributes

• Q_SIGNALS __pad0__: void positionChanged( AbstractArea ∗ )


• QWidget ∗ mParent
• QLayout ∗ mParentLayout

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


52 KD Chart 2 Class Documentation

6.4.2 Constructor & Destructor Documentation

6.4.2.1 AbstractAxis::AbstractAxis (AbstractDiagram ∗ diagram = 0) [explicit]

Definition at line 114 of file KDChartAbstractAxis.cpp.

115 : AbstractArea( new Private( diagram, this ) )


116 {
117 init();
118 QTimer::singleShot(0, this, SLOT(delayedInit()));
119 }

6.4.2.2 AbstractAxis::∼AbstractAxis () [virtual]

Definition at line 121 of file KDChartAbstractAxis.cpp.


References d.

122 {
123 d->mDiagram = 0;
124 d->secondaryDiagrams.clear();
125 }

6.4.3 Member Function Documentation

6.4.3.1 void AbstractAreaBase::alignToReferencePoint (const RelativePosition & position)


[inherited]

Definition at line 75 of file KDChartAbstractAreaBase.cpp.

76 {
77 Q_UNUSED( position );
78 // PENDING(kalle) FIXME
79 qWarning( "Sorry, not implemented: void AbstractAreaBase::alignToReferencePoint( const RelativePosi
80 }

6.4.3.2 QRect AbstractArea::areaGeometry () const [protected, virtual, inherited]

Implements KDChart::AbstractAreaBase.
Definition at line 105 of file KDChartAbstractArea.cpp.
Referenced by KDChart::CartesianCoordinatePlane::drawingArea(), KDChart::PolarCoordinate-
Plane::layoutDiagrams(), KDChart::CartesianAxis::paint(), KDChart::AbstractArea::paintAll(), and
KDChart::CartesianAxis::paintCtx().

106 {
107 return geometry();
108 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.4 KDChart::AbstractAxis Class Reference 53

6.4.3.3 BackgroundAttributes AbstractAreaBase::backgroundAttributes () const [inherited]

Definition at line 97 of file KDChartAbstractAreaBase.cpp.


References d.

98 {
99 return d->backgroundAttributes;
100 }

6.4.3.4 void AbstractAxis::connectSignals () [virtual]

Wireing the signal/slot connections.


This method gets called automatically, each time, when you assign the axis to a diagram, either by passing
a diagram∗ to the c’tor, or by calling the diagram’s setAxis method, resp.
If overwriting this method in derived classes, make sure to call this base method AbstractAxis::connect-
Signals(), so your axis gets connected to the diagram’s built-in signals.

See also:
AbstractCartesianDiagram::addAxis()

Definition at line 192 of file KDChartAbstractAxis.cpp.


References d.
Referenced by createObserver().

193 {
194 if( d->observer ){
195 connect( d->observer, SIGNAL( diagramDataChanged( AbstractDiagram *) ),
196 this, SLOT( update() ) );
197 }
198 }

6.4.3.5 const AbstractCoordinatePlane ∗ AbstractAxis::coordinatePlane () const

Convenience function, returns the coordinate plane, in which this axis is used.
If the axis is not used in a coordinate plane, the return value is Zero.
Definition at line 293 of file KDChartAbstractAxis.cpp.
References d.

294 {
295 if( d->diagram() )
296 return d->diagram()->coordinatePlane();
297 return 0;
298 }

6.4.3.6 void AbstractAxis::createObserver (AbstractDiagram ∗ diagram)

Definition at line 158 of file KDChartAbstractAxis.cpp.

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


54 KD Chart 2 Class Documentation

References connectSignals(), and d.


Referenced by KDChart::AbstractCartesianDiagram::addAxis().

159 {
160 if( d->setDiagram( diagram, this ) )
161 connectSignals();
162 }

6.4.3.7 void AbstractAxis::deleteObserver (AbstractDiagram ∗ diagram)

Definition at line 174 of file KDChartAbstractAxis.cpp.


References d.
Referenced by KDChart::AbstractCartesianDiagram::takeAxis(), and KDChart::AbstractCartesian-
Diagram::∼AbstractCartesianDiagram().

175 {
176 d->unsetDiagram( diagram, this );
177 }

6.4.3.8 const AbstractDiagram ∗ KDChart::AbstractAxis::diagram () const

Definition at line 300 of file KDChartAbstractAxis.cpp.


References d.

301 {
302 return d->diagram();
303 }

6.4.3.9 FrameAttributes AbstractAreaBase::frameAttributes () const [inherited]

Definition at line 87 of file KDChartAbstractAreaBase.cpp.


References d.
Referenced by KDChart::Legend::clone().

88 {
89 return d->frameAttributes;
90 }

6.4.3.10 virtual QRect KDChart::AbstractAxis::geometry () const [pure virtual]

Implemented in KDChart::CartesianAxis.

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.4 KDChart::AbstractAxis Class Reference 55

6.4.3.11 QRect AbstractAreaBase::innerRect () const [protected, inherited]

Definition at line 175 of file KDChartAbstractAreaBase.cpp.


References KDChart::AbstractAreaBase::areaGeometry(), and d.
Referenced by KDChart::TextArea::paintAll(), KDChart::AbstractAreaWidget::paintAll(), and
KDChart::AbstractArea::paintAll().

176 {
177 Q_ASSERT_X ( d != 0, "AbstractAreaBase::innerRect()",
178 "Private class was not initialized!" );
179
180 const int padding
181 = d->frameAttributes.isVisible()
182 ? qMax( d->frameAttributes.padding(), 0 ) : 0;
183 return
184 QRect( QPoint(0,0), areaGeometry().size() )
185 .adjusted( padding, padding, -padding, -padding );
186 }

6.4.3.12 QStringList AbstractAxis::labels () const

Returns a list of strings, that are used as axis labels, as set via setLabels.

See also:
setLabels

Definition at line 254 of file KDChartAbstractAxis.cpp.


References d.
Referenced by KDChart::CartesianAxis::maximumSize(), and KDChart::CartesianAxis::paintCtx().

255 {
256 return d->hardLabels;
257 }

6.4.3.13 bool KDChart::AbstractAxis::observedBy (AbstractDiagram ∗ diagram) const

Definition at line 305 of file KDChartAbstractAxis.cpp.


References d.

306 {
307 return d->hasDiagram( diagram );
308 }

6.4.3.14 virtual void KDChart::AbstractLayoutItem::paint (QPainter ∗) [pure virtual,


inherited]

Implemented in KDChart::CartesianAxis, KDChart::CartesianCoordinatePlane, KDChart::TextLayout-


Item, KDChart::MarkerLayoutItem, KDChart::HorizontalLineLayoutItem, KDChart::VerticalLineLayout-
Item, and KDChart::PolarCoordinatePlane.
Referenced by KDChart::Legend::paint(), KDChart::AbstractArea::paintAll(), and KDChart::Abstract-
LayoutItem::paintCtx().

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


56 KD Chart 2 Class Documentation

6.4.3.15 void AbstractArea::paintAll (QPainter & painter) [inherited]

Call paintAll, if you want the background and the frame to be drawn before the normal paint() is invoked
automatically.
Definition at line 83 of file KDChartAbstractArea.cpp.
References KDChart::AbstractArea::areaGeometry(), KDChart::AbstractAreaBase::innerRect(),
KDChart::AbstractLayoutItem::paint(), KDChart::AbstractAreaBase::paintBackground(), and
KDChart::AbstractAreaBase::paintFrame().
Referenced by KDChart::Chart::paint(), and KDChart::AbstractArea::paintIntoRect().

84 {
85 // Paint the background and frame
86 paintBackground( painter, geometry() );
87 paintFrame( painter, geometry() );
88
89 // temporarily adjust the widget size, to be sure all content gets calculated
90 // to fit into the inner rectangle
91 const QRect oldGeometry( areaGeometry() );
92 QRect inner( innerRect() );
93 inner.moveTo(
94 oldGeometry.left() + inner.left(),
95 oldGeometry.top() + inner.top() );
96 const bool needAdjustGeometry = oldGeometry != inner;
97 if( needAdjustGeometry )
98 setGeometry( inner );
99 paint( &painter );
100 if( needAdjustGeometry )
101 setGeometry( oldGeometry );
102 //qDebug() << "AbstractAreaWidget::paintAll() done.";
103 }

6.4.3.16 void AbstractAreaBase::paintBackground (QPainter & painter, const QRect & rectangle)
[virtual, inherited]

Definition at line 103 of file KDChartAbstractAreaBase.cpp.


References attributes, and d.
Referenced by KDChart::TextArea::paintAll(), KDChart::AbstractAreaWidget::paintAll(), and
KDChart::AbstractArea::paintAll().

104 {
105 Q_ASSERT_X ( d != 0, "AbstractAreaBase::paintBackground()",
106 "Private class was not initialized!" );
107
108 #define attributes d->backgroundAttributes
109
110 if( !attributes.isVisible() ) return;
111
112 /* first draw the brush (may contain a pixmap)*/
113 if( Qt::NoBrush != attributes.brush().style() ) {
114 KDChart::PainterSaver painterSaver( &painter );
115 painter.setPen( Qt::NoPen );
116 const QPointF newTopLeft( painter.deviceMatrix().map( rect.topLeft() ) );
117 painter.setBrushOrigin( newTopLeft );
118 painter.setBrush( attributes.brush() );
119 painter.drawRect( rect );
120 }
121 /* next draw the backPixmap over the brush */

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.4 KDChart::AbstractAxis Class Reference 57

122 if( !attributes.pixmap().isNull() &&


123 attributes.pixmapMode() != BackgroundAttributes::BackgroundPixmapModeNone ) {
124 QPointF ol = rect.topLeft();
125 if( BackgroundAttributes::BackgroundPixmapModeCentered == attributes.pixmapMode() )
126 {
127 ol.setX( rect.center().x() - attributes.pixmap().width() / 2 );
128 ol.setY( rect.center().y() - attributes.pixmap().height()/ 2 );
129 painter.drawPixmap( ol, attributes.pixmap() );
130 } else {
131 QMatrix m;
132 double zW = (double)rect.width() / (double)attributes.pixmap().width();
133 double zH = (double)rect.height() / (double)attributes.pixmap().height();
134 switch( attributes.pixmapMode() ) {
135 case BackgroundAttributes::BackgroundPixmapModeScaled:
136 {
137 double z;
138 z = qMin( zW, zH );
139 m.scale( z, z );
140 }
141 break;
142 case BackgroundAttributes::BackgroundPixmapModeStretched:
143 m.scale( zW, zH );
144 break;
145 default:
146 ; // Cannot happen, previously checked
147 }
148 QPixmap pm = attributes.pixmap().transformed( m );
149 ol.setX( rect.center().x() - pm.width() / 2 );
150 ol.setY( rect.center().y() - pm.height()/ 2 );
151 painter.drawPixmap( ol, pm );
152 }
153 }
154 #undef attributes
155 }

6.4.3.17 void KDChart::AbstractLayoutItem::paintCtx (PaintContext ∗ context) [virtual,


inherited]

Default impl: Paint the complete item using its layouted position and size.
Reimplemented in KDChart::CartesianAxis.
Definition at line 64 of file KDChartLayoutItems.cpp.
References KDChart::AbstractLayoutItem::paint(), and KDChart::PaintContext::painter().

65 {
66 if( context )
67 paint( context->painter() );
68 }

6.4.3.18 void AbstractAreaBase::paintFrame (QPainter & painter, const QRect & rectangle)
[virtual, inherited]

Definition at line 158 of file KDChartAbstractAreaBase.cpp.


References attributes, and d.
Referenced by KDChart::TextArea::paintAll(), KDChart::AbstractAreaWidget::paintAll(), and
KDChart::AbstractArea::paintAll().

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


58 KD Chart 2 Class Documentation

159 {
160 Q_ASSERT_X ( d != 0, "AbstractAreaBase::paintFrame()",
161 "Private class was not initialized!" );
162
163 #define attributes d->frameAttributes
164
165 if( !attributes.isVisible() ) return;
166
167 const QPen oldPen( painter.pen() );
168 painter.setPen( attributes.pen() );
169 painter.drawRect( rect );
170 painter.setPen( oldPen );
171 #undef attributes
172 }

6.4.3.19 void AbstractArea::paintIntoRect (QPainter & painter, const QRect & rect)
[virtual, inherited]

Draws the background and frame, then calls paint().


In most cases there is no need to overwrite this method in a derived class, but you would overwrite Abstract-
LayoutItem::paint() instead.
Definition at line 71 of file KDChartAbstractArea.cpp.
References KDChart::AbstractArea::paintAll().

72 {
73 const QRect oldGeometry( geometry() );
74 if( oldGeometry != rect )
75 setGeometry( rect );
76 painter.translate( rect.left(), rect.top() );
77 paintAll( painter );
78 painter.translate( -rect.left(), -rect.top() );
79 if( oldGeometry != rect )
80 setGeometry( oldGeometry );
81 }

6.4.3.20 void AbstractArea::positionHasChanged () [protected, virtual, inherited]

Reimplemented from KDChart::AbstractAreaBase.


Definition at line 110 of file KDChartAbstractArea.cpp.

111 {
112 emit positionChanged( this );
113 }

6.4.3.21 void KDChart::AbstractLayoutItem::removeFromParentLayout () [inherited]

Definition at line 66 of file KDChartLayoutItems.h.


Referenced by KDChart::Chart::takeCoordinatePlane().

67 {
68 if( mParentLayout ){
69 if( widget() )

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.4 KDChart::AbstractAxis Class Reference 59

70 mParentLayout->removeWidget( widget() );
71 else
72 mParentLayout->removeItem( this );
73 }
74 }

6.4.3.22 void AbstractAreaBase::setBackgroundAttributes (const BackgroundAttributes & a)


[inherited]

Definition at line 92 of file KDChartAbstractAreaBase.cpp.


References d.

93 {
94 d->backgroundAttributes = a;
95 }

6.4.3.23 void AbstractAreaBase::setFrameAttributes (const FrameAttributes & a)


[inherited]

Definition at line 82 of file KDChartAbstractAreaBase.cpp.


References d.
Referenced by KDChart::Legend::clone().

83 {
84 d->frameAttributes = a;
85 }

6.4.3.24 virtual void KDChart::AbstractAxis::setGeometry (const QRect & rect) [pure


virtual]

Implemented in KDChart::CartesianAxis.

6.4.3.25 void AbstractAxis::setLabels (const QStringList & list)

Use this to specify your own set of strings, to be used as axis labels.
Labels specified via setLabels take precedence: If a non-empty list is passed, KD Chart will use these
strings as axis labels, instead of calculating them.
If you a smaller number of strings than the number od labels drawn at this axis, KD Chart will iterate over
the list, repeating the strings, until all labels are drawn. As an example you could specify the seven days of
the week as abscissa labels, which would be repeatedly used then.
By passing an empty QStringList you can reset the default behaviour.

See also:
labels, setShortLabels

Definition at line 244 of file KDChartAbstractAxis.cpp.


References d.

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


60 KD Chart 2 Class Documentation

245 {
246 d->hardLabels = list;
247 }

6.4.3.26 void KDChart::AbstractLayoutItem::setParentLayout (QLayout ∗ lay) [inherited]

Definition at line 62 of file KDChartLayoutItems.h.

63 {
64 mParentLayout = lay;
65 }

6.4.3.27 void KDChart::AbstractLayoutItem::setParentWidget (QWidget ∗ widget) [virtual,


inherited]

Inform the item about its widget: This enables the item, to trigger that widget’s update, whenever the size
of the item’s contents has changed.
Thus, you need to call setParentWidget on every item, that has a non-fixed size.
Definition at line 56 of file KDChartLayoutItems.cpp.
References KDChart::AbstractLayoutItem::mParent.
Referenced by KDChart::Legend::buildLegend(), and KDChart::AbstractCartesianDiagram::takeAxis().

57 {
58 mParent = widget;
59 }

6.4.3.28 void AbstractAxis::setShortLabels (const QStringList & list)

Use this to specify your own set of strings, to be used as axis labels, in case the normal labels are too long.

Note:
Setting done via setShortLabels will be ignored, if you did not pass a non-empty string list via set-
Labels too!

By passing an empty QStringList you can reset the default behaviour.

See also:
shortLabels, setLabels

Definition at line 270 of file KDChartAbstractAxis.cpp.


References d.

271 {
272 d->hardShortLabels = list;
273 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.4 KDChart::AbstractAxis Class Reference 61

6.4.3.29 void AbstractAxis::setTextAttributes (const TextAttributes & a)

Use this to specify the text attributes to be used for axis labels.
By default, the reference area will be set at painting time. It will be the then-valid coordinate plane’s
parent widget, so normally, it will be the KDChart::Chart. Thus the labels of all of your axes in all of your
diagrams within that Chart will be drawn in same font size, by default.

See also:
textAttributes, setLabels

Definition at line 212 of file KDChartAbstractAxis.cpp.


References d.

213 {
214 d->textAttributes = a;
215 }

6.4.3.30 QStringList AbstractAxis::shortLabels () const

Returns a list of strings, that are used as axis labels, as set via setShortLabels.

Note:
Setting done via setShortLabels will be ignored, if you did not pass a non-empty string list via set-
Labels too!
See also:
setShortLabels

Definition at line 283 of file KDChartAbstractAxis.cpp.


References d.
Referenced by KDChart::CartesianAxis::paintCtx().

284 {
285 return d->hardShortLabels;
286 }

6.4.3.31 void KDChart::AbstractLayoutItem::sizeHintChanged () const [virtual,


inherited]

Report changed size hint: ask the parent widget to recalculate the layout.
Definition at line 73 of file KDChartLayoutItems.cpp.
Referenced by KDChart::TextLayoutItem::sizeHint().

74 {
75 // This is exactly like what QWidget::updateGeometry does.
76 // qDebug("KDChart::AbstractLayoutItem::sizeHintChanged() called");
77 if( mParent ) {
78 if ( mParent->layout() )
79 mParent->layout()->invalidate();
80 else
81 QApplication::postEvent( mParent, new QEvent( QEvent::LayoutRequest ) );
82 }
83 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


62 KD Chart 2 Class Documentation

6.4.3.32 TextAttributes AbstractAxis::textAttributes () const

Returns the text attributes to be used for axis labels.

See also:
setTextAttributes

Definition at line 222 of file KDChartAbstractAxis.cpp.


References d.
Referenced by KDChart::CartesianAxis::maximumSize(), KDChart::CartesianAxis::paintCtx(), and
KDChart::CartesianAxis::titleTextAttributes().

223 {
224 return d->textAttributes;
225 }

6.4.4 Member Data Documentation

6.4.4.1 Q_SIGNALS KDChart::AbstractArea::__pad0__ [protected, inherited]

Reimplemented in KDChart::AbstractCoordinatePlane.
Definition at line 86 of file KDChartAbstractArea.h.

6.4.4.2 QWidget∗ KDChart::AbstractLayoutItem::mParent [protected, inherited]

Definition at line 76 of file KDChartLayoutItems.h.


Referenced by KDChart::AbstractLayoutItem::setParentWidget().

6.4.4.3 QLayout∗ KDChart::AbstractLayoutItem::mParentLayout [protected,


inherited]

Definition at line 77 of file KDChartLayoutItems.h.

6.4.4.4 public KDChart::AbstractAxis::Q_SLOTS

Definition at line 108 of file KDChartAbstractAxis.h.

6.4.4.5 protected KDChart::AbstractAxis::Q_SLOTS

Definition at line 105 of file KDChartAbstractAxis.h.


The documentation for this class was generated from the following files:

• KDChartAbstractAxis.h
• KDChartAbstractAxis.cpp

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.5 KDChart::AbstractCartesianDiagram Class Reference 63

6.5 KDChart::AbstractCartesianDiagram Class Reference


#include <KDChartAbstractCartesianDiagram.h>
Inheritance diagram for KDChart::AbstractCartesianDiagram:Collaboration diagram for
KDChart::AbstractCartesianDiagram:

6.5.1 Detailed Description

Base class for diagrams based on a cartesian coordianate system.


The AbstractCartesianDiagram interface adds those elements that are specific to diagrams based on a carte-
sian coordinate system to the basic AbstractDiagram interface.
Definition at line 45 of file KDChartAbstractCartesianDiagram.h.

Public Member Functions


• AbstractCartesianDiagram (QWidget ∗parent=0, CartesianCoordinatePlane ∗plane=0)
• virtual void addAxis (CartesianAxis ∗axis)
Add the axis to the diagram.

• bool allowOverlappingDataValueTexts () const


• bool antiAliasing () const
• virtual AttributesModel ∗ attributesModel () const
Returns the AttributesModel, that is used by this diagram.

• virtual KDChart::CartesianAxisList axes () const


• QBrush brush (const QModelIndex &index) const
Retrieve the brush to be used, for painting the datapoint at the given index in the model.

• QBrush brush (int dataset) const


Retrieve the brush to be used for the given dataset.

• QBrush brush () const


Retrieve the brush to be used for painting datapoints globally.

• AbstractCoordinatePlane ∗ coordinatePlane () const


The coordinate plane associated with the diagram.

• const QPair< QPointF, QPointF > dataBoundaries () const


Return the bottom left and top right data point, that the diagram will display (unless the grid adjusts these
values).

• virtual void dataChanged (const QModelIndex &topLeft, const QModelIndex &bottomRight)


[reimplemented]

• QList< QBrush > datasetBrushes () const


The set of dataset brushes currently used, for use in legends, etc.

• int datasetDimension () const

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


64 KD Chart 2 Class Documentation

The dataset dimension of a diagram determines, how many value dimensions it expects each datapoint to
have.

• QStringList datasetLabels () const


The set of dataset labels currently displayed, for use in legends, etc.

• QList< MarkerAttributes > datasetMarkers () const


The set of dataset markers currently used, for use in legends, etc.

• QList< QPen > datasetPens () const


The set of dataset pens currently used, for use in legends, etc.

• DataValueAttributes dataValueAttributes (const QModelIndex &index) const


Retrieve the DataValueAttributes for the given index.

• DataValueAttributes dataValueAttributes (int column) const


Retrieve the DataValueAttributes for the given dataset.

• DataValueAttributes dataValueAttributes () const


Retrieve the DataValueAttributes speficied globally.

• virtual void doItemsLayout ()


[reimplemented]

• virtual int horizontalOffset () const


[reimplemented]

• virtual QModelIndex indexAt (const QPoint &point) const


[reimplemented]

• virtual bool isIndexHidden (const QModelIndex &index) const


[reimplemented]

• QStringList itemRowLabels () const


The set of item row labels currently displayed, for use in Abscissa axes, etc.

• virtual void layoutPlanes ()


• virtual QModelIndex moveCursor (CursorAction cursorAction, Qt::KeyboardModifiers modifiers)
[reimplemented]

• virtual const int numberOfAbscissaSegments () const=0


• virtual const int numberOfOrdinateSegments () const=0
• virtual void paintMarker (QPainter ∗painter, const MarkerAttributes &markerAttributes, const
QBrush &brush, const QPen &, const QPointF &point, const QSizeF &size)
• QPen pen (const QModelIndex &index) const
Retrieve the pen to be used, for painting the datapoint at the given index in the model.

• QPen pen (int dataset) const


Retrieve the pen to be used for the given dataset.

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.5 KDChart::AbstractCartesianDiagram Class Reference 65

• QPen pen () const


Retrieve the pen to be used for painting datapoints globally.

• bool percentMode () const


• virtual AbstractCartesianDiagram ∗ referenceDiagram () const
• virtual QPointF referenceDiagramOffset () const
• virtual void resize (const QSizeF &area)=0
Called by the widget’s sizeEvent.

• virtual void scrollTo (const QModelIndex &index, ScrollHint hint=EnsureVisible)


[reimplemented]

• void setAllowOverlappingDataValueTexts (bool allow)


Set whether data value labels are allowed to overlap.

• void setAntiAliasing (bool enabled)


Set whether anti-aliasing is to be used while rendering this diagram.

• virtual void setAttributesModel (AttributesModel ∗model)


Associate an AttributesModel with this diagram.

• void setBrush (const QBrush &brush)


Set the brush to be used, for painting all datasets in the model.

• void setBrush (int dataset, const QBrush &brush)


Set the brush to be used, for painting the given dataset.

• void setBrush (const QModelIndex &index, const QBrush &brush)


Set the brush to be used, for painting the datapoint at the given index.

• virtual void setCoordinatePlane (AbstractCoordinatePlane ∗plane)


Set the coordinate plane associated with the diagram.

• void setDatasetDimension (int dimension)


Sets the dataset dimension of the diagram.

• void setDataValueAttributes (const DataValueAttributes &a)


Set the DataValueAttributes for all datapoints in the model.

• void setDataValueAttributes (int dataset, const DataValueAttributes &a)


Set the DataValueAttributes for the given dataset.

• void setDataValueAttributes (const QModelIndex &index, const DataValueAttributes &a)


Set the DataValueAttributes for the given index.

• virtual void setModel (QAbstractItemModel ∗model)


Associate a model with the diagram.

• void setPen (const QPen &pen)


Set the pen to be used, for painting all datasets in the model.

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


66 KD Chart 2 Class Documentation

• void setPen (int dataset, const QPen &pen)


Set the pen to be used, for painting the given dataset.

• void setPen (const QModelIndex &index, const QPen &pen)


Set the pen to be used, for painting the datapoint at the given index.

• void setPercentMode (bool percent)


• virtual void setReferenceDiagram (AbstractCartesianDiagram ∗diagram, const QPointF
&offset=QPointF())
• virtual void setRootIndex (const QModelIndex &idx)
Set the root index in the model, where the diagram starts referencing data for display.

• virtual void setSelection (const QRect &rect, QItemSelectionModel::SelectionFlags command)


[reimplemented]

• virtual void takeAxis (CartesianAxis ∗axis)


Removes the axis from the diagram, without deleting it.

• void update () const


• void useDefaultColors ()
Set the palette to be used, for painting datasets to the default palette.

• void useRainbowColors ()
Set the palette to be used, for painting datasets to the rainbow palette.

• void useSubduedColors ()
Set the palette to be used, for painting datasets to the subdued palette.

• virtual int verticalOffset () const


[reimplemented]

• virtual QRect visualRect (const QModelIndex &index) const


[reimplemented]

• virtual QRegion visualRegionForSelection (const QItemSelection &selection) const


[reimplemented]

• virtual ∼AbstractCartesianDiagram ()

Protected Member Functions


• QModelIndex attributesModelRootIndex () const
• virtual const QPair< QPointF, QPointF > calculateDataBoundaries () const=0
• virtual bool checkInvariants (bool justReturnTheStatus=false) const
• QModelIndex columnToIndex (int column) const
• void modelsChanged ()
This signal is emitted, when either the model or the AttributesModel is replaced.

• virtual void paint (PaintContext ∗paintContext)=0

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.5 KDChart::AbstractCartesianDiagram Class Reference 67

Draw the diagram contents to the rectangle and painter, that are passed in as part of the paint context.

• void paintDataValueText (QPainter ∗painter, const QModelIndex &index, const QPointF &pos, dou-
ble value)
• virtual void paintDataValueTexts (QPainter ∗painter)
• void paintMarker (QPainter ∗painter, const QModelIndex &index, const QPointF &pos)
• virtual void paintMarkers (QPainter ∗painter)
• void propertiesChanged ()
Emitted upon change of a property of the Diagram.

• void setAttributesModelRootIndex (const QModelIndex &)


• void setDataBoundariesDirty () const
• virtual double threeDItemDepth (int column) const=0
• virtual double threeDItemDepth (const QModelIndex &index) const=0
• double valueForCell (int row, int column) const
Helper method, retrieving the data value (DisplayRole) for a given row and column.

Protected Attributes
• Q_SIGNALS __pad0__: void layoutChanged( AbstractDiagram∗ )

6.5.2 Constructor & Destructor Documentation

6.5.2.1 AbstractCartesianDiagram::AbstractCartesianDiagram (QWidget ∗ parent = 0,


CartesianCoordinatePlane ∗ plane = 0) [explicit]

Definition at line 53 of file KDChartAbstractCartesianDiagram.cpp.

54 : AbstractDiagram ( new Private(), parent, plane )


55 {
56 }

6.5.2.2 KDChart::AbstractCartesianDiagram::∼AbstractCartesianDiagram () [virtual]

Definition at line 58 of file KDChartAbstractCartesianDiagram.cpp.


References d, and KDChart::AbstractAxis::deleteObserver().

59 {
60 Q_FOREACH( CartesianAxis* axis, d->axesList ) {
61 axis->deleteObserver( this );
62 }
63 d->axesList.clear();
64 }

6.5.3 Member Function Documentation

6.5.3.1 void AbstractCartesianDiagram::addAxis (CartesianAxis ∗ axis) [virtual]

Add the axis to the diagram.

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


68 KD Chart 2 Class Documentation

The diagram takes ownership of the axis and will delete it.
To gain back ownership (e.g. for assigning the axis to another diagram) use the takeAxis method, before
calling addAxis on the other diagram.

See also:
takeAxis

Definition at line 66 of file KDChartAbstractCartesianDiagram.cpp.


References KDChart::AbstractAxis::createObserver(), d, and layoutPlanes().

67 {
68 if ( !d->axesList.contains( axis ) ) {
69 d->axesList.append( axis );
70 axis->createObserver( this );
71 layoutPlanes();
72 }
73 }

6.5.3.2 bool AbstractDiagram::allowOverlappingDataValueTexts () const [inherited]

Returns:
Whether data value labels are allowed to overlap.

Definition at line 291 of file KDChartAbstractDiagram.cpp.


References d.

295 {

6.5.3.3 bool AbstractDiagram::antiAliasing () const [inherited]

Returns:
Whether anti-aliasing is to be used for rendering this diagram.

Definition at line 302 of file KDChartAbstractDiagram.cpp.


References d.
Referenced by KDChart::LineDiagram::paint().

306 {

6.5.3.4 AttributesModel ∗ AbstractDiagram::attributesModel () const [virtual,


inherited]

Returns the AttributesModel, that is used by this diagram.


By default each diagram owns its own AttributesModel, which should never be deleted. Only if a user-
supplied AttributesModel has been set does the pointer returned here not belong to the diagram.

Returns:
The AttributesModel associated with the diagram.

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.5 KDChart::AbstractCartesianDiagram Class Reference 69

See also:
setAttributesModel

Definition at line 180 of file KDChartAbstractDiagram.cpp.


References d.
Referenced by KDChart::RingDiagram::paint(), KDChart::PolarDiagram::paint(), and KDChart::Bar-
Diagram::setBarAttributes().

181 {
182 return d->attributesModel;
183 }

6.5.3.5 QModelIndex AbstractDiagram::attributesModelRootIndex () const [protected,


inherited]

returns a QModelIndex pointing into the AttributesModel that corresponds to the root index of the diagram.
Definition at line 204 of file KDChartAbstractDiagram.cpp.
References d.
Referenced by KDChart::LineDiagram::calculateDataBoundaries(), KDChart::BarDiagram::calculate-
DataBoundaries(), KDChart::LineDiagram::numberOfAbscissaSegments(), KDChart::Bar-
Diagram::numberOfAbscissaSegments(), KDChart::LineDiagram::numberOfOrdinateSegments(),
KDChart::BarDiagram::numberOfOrdinateSegments(), KDChart::LineDiagram::paint(), KDChart::Bar-
Diagram::paint(), and KDChart::AbstractDiagram::valueForCell().

210 {

6.5.3.6 KDChart::CartesianAxisList AbstractCartesianDiagram::axes () const [virtual]

Definition at line 85 of file KDChartAbstractCartesianDiagram.cpp.


References KDChart::CartesianAxisList, and d.

86 {
87 return d->axesList;
88 }

6.5.3.7 QBrush AbstractDiagram::brush (const QModelIndex & index) const [inherited]

Retrieve the brush to be used, for painting the datapoint at the given index in the model.

Parameters:
index The index of the datapoint in the model.

Returns:
The brush to use for painting.

Definition at line 632 of file KDChartAbstractDiagram.cpp.

638 :
QRect AbstractDiagram::visualRect(const QModelIndex &) const

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


70 KD Chart 2 Class Documentation

6.5.3.8 QBrush AbstractDiagram::brush (int dataset) const [inherited]

Retrieve the brush to be used for the given dataset.


This will fall back automatically to what was set at model level, if there are no dataset specific settings.

Parameters:
dataset The dataset to retrieve the brush for.

Returns:
The brush to use for painting.

Definition at line 624 of file KDChartAbstractDiagram.cpp.

631 {

6.5.3.9 QBrush AbstractDiagram::brush () const [inherited]

Retrieve the brush to be used for painting datapoints globally.


This will fall back automatically to the default settings, if there are no specific settings.

Returns:
The brush to use for painting.

Definition at line 618 of file KDChartAbstractDiagram.cpp.


Referenced by KDChart::PieDiagram::paint(), and KDChart::AbstractDiagram::paintMarker().

623 {

6.5.3.10 virtual const QPair<QPointF, QPointF> KDChart::Abstract-


Diagram::calculateDataBoundaries () const [protected, pure virtual,
inherited]

Implemented in KDChart::BarDiagram, KDChart::LineDiagram, KDChart::PieDiagram, KDChart::Polar-


Diagram, and KDChart::RingDiagram.
Referenced by KDChart::AbstractDiagram::dataBoundaries().

6.5.3.11 bool AbstractDiagram::checkInvariants (bool justReturnTheStatus = false) const


[protected, virtual, inherited]

Definition at line 746 of file KDChartAbstractDiagram.cpp.


References KDChart::AbstractDiagram::coordinatePlane().
Referenced by KDChart::RingDiagram::calculateDataBoundaries(), KDChart::PolarDiagram::calculate-
DataBoundaries(), KDChart::PieDiagram::calculateDataBoundaries(), KDChart::LineDiagram::calculate-
DataBoundaries(), KDChart::BarDiagram::calculateDataBoundaries(), KDChart::RingDiagram::paint(),
KDChart::PolarDiagram::paint(), KDChart::PieDiagram::paint(), KDChart::LineDiagram::paint(),
KDChart::BarDiagram::paint(), and KDChart::AbstractDiagram::paintMarker().

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.5 KDChart::AbstractCartesianDiagram Class Reference 71

746 {
747 Q_ASSERT_X ( model(), "AbstractDiagram::checkInvariants()",
748 "There is no usable model set, for the diagram." );
749
750 Q_ASSERT_X ( coordinatePlane(), "AbstractDiagram::checkInvariants()",
751 "There is no usable coordinate plane set, for the diagram." );
752 }
753 return model() && coordinatePlane();
754 }
755
756 int AbstractDiagram::datasetDimension( ) const

6.5.3.12 QModelIndex AbstractDiagram::columnToIndex (int column) const [protected,


inherited]

Definition at line 211 of file KDChartAbstractDiagram.cpp.

217 {

6.5.3.13 AbstractCoordinatePlane ∗ AbstractDiagram::coordinatePlane () const [inherited]

The coordinate plane associated with the diagram.


This determines how coordinates in value space are mapped into pixel space. By default this is a Cartesian-
CoordinatePlane.

Returns:
The coordinate plane associated with the diagram.

Definition at line 125 of file KDChartAbstractDiagram.cpp.


References d.
Referenced by KDChart::BarDiagram::calculateDataBoundaries(), KDChart::AbstractDiagram::check-
Invariants(), layoutPlanes(), KDChart::PolarDiagram::paint(), KDChart::LineDiagram::paint(),
KDChart::BarDiagram::paint(), KDChart::AbstractPolarDiagram::polarCoordinatePlane(), and set-
CoordinatePlane().

126 {
127 return d->plane;
128 }

6.5.3.14 const QPair< QPointF, QPointF > AbstractDiagram::dataBoundaries () const


[inherited]

Return the bottom left and top right data point, that the diagram will display (unless the grid adjusts these
values).
This method returns a chached result of calculations done by calculateDataBoundaries. Classes derived
from AbstractDiagram must implement the calculateDataBoundaries function, to specify their own way of
calculating the data boundaries. If derived classes want to force recalculation of the data boundaries, they
can call setDataBoundariesDirty()
Returned value is in diagram coordinates.

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


72 KD Chart 2 Class Documentation

Definition at line 130 of file KDChartAbstractDiagram.cpp.


References KDChart::AbstractDiagram::calculateDataBoundaries(), and d.
Referenced by KDChart::CartesianCoordinatePlane::calculateRawDataBoundingRect(), KDChart::Polar-
CoordinatePlane::layoutDiagrams(), KDChart::LineDiagram::paint(), and KDChart::BarDiagram::paint().

131 {
132 if( d->databoundariesDirty ){
133 d->databoundaries = calculateDataBoundaries ();
134 d->databoundariesDirty = false;
135 }
136 return d->databoundaries;
137 }

6.5.3.15 void AbstractDiagram::dataChanged (const QModelIndex & topLeft, const QModelIndex


& bottomRight) [virtual, inherited]

[reimplemented]
Definition at line 232 of file KDChartAbstractDiagram.cpp.
References d.

232 {
233 // We are still too dumb to do intelligent updates...
234 d->databoundariesDirty = true;
235 scheduleDelayedItemsLayout();
236 }
237
238 void AbstractDiagram::setDataValueAttributes( const QModelIndex & index,

6.5.3.16 QList< QBrush > AbstractDiagram::datasetBrushes () const [inherited]

The set of dataset brushes currently used, for use in legends, etc.

Note:
Cell-level override brushes, if set, take precedence over the dataset values, so you might need to check
these too, in order to find the brush, that is used for a single cell.

Returns:
The current set of dataset brushes.

Definition at line 710 of file KDChartAbstractDiagram.cpp.


Referenced by KDChart::Legend::buildLegend(), KDChart::Legend::datasetCount(), and
KDChart::Legend::setBrushesFromDiagram().

712 {
713 QBrush brush = qVariantValue<QBrush>( attributesModel()->headerData( i, Qt::Vertical, DatasetB
714 ret << brush;
715 }
716
717 return ret;
718 }
719
720 QList<QPen> AbstractDiagram::datasetPens() const

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.5 KDChart::AbstractCartesianDiagram Class Reference 73

6.5.3.17 int AbstractDiagram::datasetDimension () const [inherited]

The dataset dimension of a diagram determines, how many value dimensions it expects each datapoint to
have.
For each dimension it will expect one column of values in the model. If the dimensionality is 1, automatic
values will be used for the abscissa.
For example a diagram with the default dimension of 1, will have one column per datapoint (the y values)
and will use automatic values for the x axis (1, 2, 3, ... n). If the dimension is 2, the diagram will use the
first, (and the third, fifth, etc) columns as X values, and the second, (and the fourth, sixth, etc) column as Y
values.

Returns:
The dataset dimension of the diagram.

Definition at line 758 of file KDChartAbstractDiagram.cpp.


References d.
Referenced by KDChart::LineDiagram::calculateDataBoundaries(), KDChart::LineDiagram::get-
CellValues(), KDChart::CartesianCoordinatePlane::getDataDimensionsList(), KDChart::Line-
Diagram::paint(), and KDChart::LineDiagram::setType().

762 {

6.5.3.18 QStringList AbstractDiagram::datasetLabels () const [inherited]

The set of dataset labels currently displayed, for use in legends, etc.

Returns:
The set of dataset labels currently displayed.

Definition at line 698 of file KDChartAbstractDiagram.cpp.


Referenced by KDChart::Legend::buildLegend(), and KDChart::Legend::datasetCount().

699 : " << attributesModel()->columnCount(attributesModel


700 const int columnCount = attributesModel()->columnCount(attributesModelRootIndex());
701 for( int i = datasetDimension()-1; i < columnCount; i += datasetDimension() ){
702 //qDebug() << "label: " << attributesModel()->headerData( i, Qt::Horizontal, Qt::DisplayRole )
703 ret << attributesModel()->headerData( i, Qt::Horizontal, Qt::DisplayRole ).toString();
704 }
705 return ret;
706 }
707
708 QList<QBrush> AbstractDiagram::datasetBrushes() const

6.5.3.19 QList< MarkerAttributes > AbstractDiagram::datasetMarkers () const [inherited]

The set of dataset markers currently used, for use in legends, etc.

Note:
Cell-level override markers, if set, take precedence over the dataset values, so you might need to check
these too, in order to find the marker, that is shown for a single cell.

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


74 KD Chart 2 Class Documentation

Returns:
The current set of dataset brushes.

Definition at line 733 of file KDChartAbstractDiagram.cpp.


Referenced by KDChart::Legend::buildLegend().

735 {
736 DataValueAttributes a =
737 qVariantValue<DataValueAttributes>( attributesModel()->headerData( i, Qt::Vertical, DataVa
738 const MarkerAttributes &ma = a.markerAttributes();
739 ret << ma;
740 }
741 return ret;
742 }
743
744 bool AbstractDiagram::checkInvariants( bool justReturnTheStatus ) const

6.5.3.20 QList< QPen > AbstractDiagram::datasetPens () const [inherited]

The set of dataset pens currently used, for use in legends, etc.

Note:
Cell-level override pens, if set, take precedence over the dataset values, so you might need to check
these too, in order to find the pens, that is used for a single cell.

Returns:
The current set of dataset pens.

Definition at line 722 of file KDChartAbstractDiagram.cpp.


Referenced by KDChart::Legend::buildLegend().

724 {
725 QPen pen = qVariantValue<QPen>( attributesModel()->headerData( i, Qt::Vertical, DatasetPenRole
726 ret << pen;
727 }
728 return ret;
729 }
730
731 QList<MarkerAttributes> AbstractDiagram::datasetMarkers() const

6.5.3.21 DataValueAttributes AbstractDiagram::dataValueAttributes (const QModelIndex &


index) const [inherited]

Retrieve the DataValueAttributes for the given index.


This will fall back automatically to what was set at dataset or model level, if there are no datapoint specific
settings.

Parameters:
index The datapoint to retrieve the attributes for.

Returns:
The DataValueAttributes for the given index.

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.5 KDChart::AbstractCartesianDiagram Class Reference 75

Definition at line 272 of file KDChartAbstractDiagram.cpp.

278 {

6.5.3.22 DataValueAttributes AbstractDiagram::dataValueAttributes (int column) const


[inherited]

Retrieve the DataValueAttributes for the given dataset.


This will fall back automatically to what was set at model level, if there are no dataset specific settings.

Parameters:
dataset The dataset to retrieve the attributes for.

Returns:
The DataValueAttributes for the given dataset.

Definition at line 265 of file KDChartAbstractDiagram.cpp.

271 {

6.5.3.23 DataValueAttributes AbstractDiagram::dataValueAttributes () const [inherited]

Retrieve the DataValueAttributes speficied globally.


This will fall back automatically to the default settings, if there are no specific settings.

Returns:
The global DataValueAttributes.

Definition at line 260 of file KDChartAbstractDiagram.cpp.


Referenced by KDChart::AbstractDiagram::paintDataValueText(), and KDChart::AbstractDiagram::paint-
Marker().

264 {

6.5.3.24 void AbstractDiagram::doItemsLayout () [virtual, inherited]

[reimplemented]
Definition at line 223 of file KDChartAbstractDiagram.cpp.
References d, and KDChart::AbstractDiagram::update().

223 {
224 d->plane->layoutDiagrams();
225 update();
226 }
227 QAbstractItemView::doItemsLayout();
228 }
229
230 void AbstractDiagram::dataChanged( const QModelIndex &topLeft,

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


76 KD Chart 2 Class Documentation

6.5.3.25 int AbstractDiagram::horizontalOffset () const [virtual, inherited]

[reimplemented]
Definition at line 655 of file KDChartAbstractDiagram.cpp.

657 { return 0; }

6.5.3.26 QModelIndex AbstractDiagram::indexAt (const QPoint & point) const [virtual,


inherited]

[reimplemented]
Definition at line 649 of file KDChartAbstractDiagram.cpp.

651 { return QModelIndex(); }

6.5.3.27 bool AbstractDiagram::isIndexHidden (const QModelIndex & index) const [virtual,


inherited]

[reimplemented]
Definition at line 661 of file KDChartAbstractDiagram.cpp.

663 {}

6.5.3.28 QStringList AbstractDiagram::itemRowLabels () const [inherited]

The set of item row labels currently displayed, for use in Abscissa axes, etc.

Returns:
The set of item row labels currently displayed.

Definition at line 686 of file KDChartAbstractDiagram.cpp.

687 : " << attributesModel()->rowCount(attributesModelRoo


688 const int rowCount = attributesModel()->rowCount(attributesModelRootIndex());
689 for( int i = 0; i < rowCount; ++i ){
690 //qDebug() << "label: " << attributesModel()->headerData( i, Qt::Vertical, Qt::DisplayRole ).t
691 ret << attributesModel()->headerData( i, Qt::Vertical, Qt::DisplayRole ).toString();
692 }
693 return ret;
694 }
695
696 QStringList AbstractDiagram::datasetLabels() const

6.5.3.29 void KDChart::AbstractCartesianDiagram::layoutPlanes () [virtual]

Definition at line 90 of file KDChartAbstractCartesianDiagram.cpp.


References KDChart::AbstractDiagram::coordinatePlane(), and KDChart::AbstractCoordinate-
Plane::layoutPlanes().
Referenced by addAxis(), and takeAxis().

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.5 KDChart::AbstractCartesianDiagram Class Reference 77

91 {
92 //qDebug() << "KDChart::AbstractCartesianDiagram::layoutPlanes()";
93 AbstractCoordinatePlane* plane = coordinatePlane();
94 if( plane ){
95 plane->layoutPlanes();
96 //qDebug() << "KDChart::AbstractCartesianDiagram::layoutPlanes() OK";
97 }
98 }

6.5.3.30 void KDChart::AbstractDiagram::modelsChanged () [protected, inherited]

This signal is emitted, when either the model or the AttributesModel is replaced.
Referenced by KDChart::AbstractDiagram::setAttributesModel(), and KDChart::AbstractDiagram::set-
Model().

6.5.3.31 QModelIndex AbstractDiagram::moveCursor (CursorAction cursorAction,


Qt::KeyboardModifiers modifiers) [virtual, inherited]

[reimplemented]
Definition at line 652 of file KDChartAbstractDiagram.cpp.

654 { return 0; }

6.5.3.32 virtual const int KDChart::AbstractCartesianDiagram::numberOfAbscissaSegments ()


const [pure virtual]

Implemented in KDChart::BarDiagram, and KDChart::LineDiagram.

6.5.3.33 virtual const int KDChart::AbstractCartesianDiagram::numberOfOrdinateSegments ()


const [pure virtual]

Implemented in KDChart::BarDiagram, and KDChart::LineDiagram.

6.5.3.34 virtual void KDChart::AbstractDiagram::paint (PaintContext ∗ paintContext)


[protected, pure virtual, inherited]

Draw the diagram contents to the rectangle and painter, that are passed in as part of the paint context.

Parameters:
paintContext All information needed for painting.

Implemented in KDChart::BarDiagram, KDChart::LineDiagram, KDChart::PieDiagram, KDChart::Polar-


Diagram, and KDChart::RingDiagram.

6.5.3.35 void AbstractDiagram::paintDataValueText (QPainter ∗ painter, const QModelIndex &


index, const QPointF & pos, double value) [protected, inherited]

Definition at line 318 of file KDChartAbstractDiagram.cpp.

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


78 KD Chart 2 Class Documentation

References KDChart::DataValueAttributes::dataLabel(), KDChart::AbstractDiagram::dataValue-


Attributes(), KDChart::DataValueAttributes::decimalDigits(), KDChart::TextAttributes::font(),
KDChart::TextAttributes::isVisible(), KDChart::DataValueAttributes::isVisible(), KDChart::Text-
Attributes::pen(), KDChart::DataValueAttributes::prefix(), KDChart::TextAttributes::rotation(),
KDChart::DataValueAttributes::suffix(), and KDChart::DataValueAttributes::textAttributes().
Referenced by KDChart::RingDiagram::paint(), KDChart::PolarDiagram::paint(), KDChart::Line-
Diagram::paint(), and KDChart::BarDiagram::paint().

320 {
321 // paint one data series
322 DataValueAttributes a = dataValueAttributes(index);
323 if ( !a.isVisible() ) return;
324
325 // handle decimal digits
326 int decimalDigits = a.decimalDigits();
327 int decimalPos = QString::number( value ).indexOf( QLatin1Char( ’.’ ) );
328 QString roundedValue;
329 if ( a.dataLabel().isNull() ) {
330 if ( decimalPos > 0 && value != 0 )
331 roundedValue = roundValues ( value, decimalPos, decimalDigits );
332 else
333 roundedValue = QString::number( value );
334 } else
335 roundedValue = a.dataLabel();
336 // handle prefix and suffix
337 if ( !a.prefix().isNull() )
338 roundedValue.prepend( a.prefix() );
339
340 if ( !a.suffix().isNull() )
341 roundedValue.append( a.suffix() );
342
343 PainterSaver painterSaver( painter );
344 // FIXME draw the non-text bits, background, etc
345 const TextAttributes &ta = a.textAttributes();
346 if ( ta.isVisible() ) {
347 painter->setPen( ta.pen() );
348 painter->setFont( ta.font() );
349 painter->translate( pos );
350 painter->rotate( ta.rotation() );
351 painter->drawText( QPointF(0, 0), roundedValue );
352 }
353 }
354
355 QString AbstractDiagram::roundValues( double value,

6.5.3.36 void AbstractDiagram::paintDataValueTexts (QPainter ∗ painter) [protected,


virtual, inherited]

Definition at line 382 of file KDChartAbstractDiagram.cpp.

385 {
386 for ( int j=0; j< rowCount; ++j ) {
387 const QModelIndex index = model()->index( j, i, rootIndex() );
388 double value = model()->data( index ).toDouble();
389 const QPointF pos = coordinatePlane()->translate( QPointF( j, value ) );
390 paintDataValueText( painter, index, pos, value );
391 }
392 }
393 }
394
395

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.5 KDChart::AbstractCartesianDiagram Class Reference 79

6.5.3.37 void AbstractDiagram::paintMarker (QPainter ∗ painter, const QModelIndex & index,


const QPointF & pos) [protected, inherited]

Definition at line 398 of file KDChartAbstractDiagram.cpp.


References KDChart::AbstractDiagram::brush(), KDChart::AbstractDiagram::checkInvariants(),
KDChart::AbstractDiagram::dataValueAttributes(), KDChart::MarkerAttributes::isVisible(),
KDChart::DataValueAttributes::isVisible(), KDChart::DataValueAttributes::markerAttributes(),
KDChart::MarkerAttributes::markerColor(), KDChart::MarkerAttributes::markerSize(),
KDChart::AbstractDiagram::paintMarker(), and KDChart::MarkerAttributes::pen().

399 {
400
401 if ( !checkInvariants() ) return;
402 DataValueAttributes a = dataValueAttributes(index);
403 if ( !a.isVisible() ) return;
404 const MarkerAttributes &ma = a.markerAttributes();
405 if ( !ma.isVisible() ) return;
406
407 PainterSaver painterSaver( painter );
408 QSizeF maSize( ma.markerSize() );
409 QBrush indexBrush( brush( index ) );
410 QPen indexPen( ma.pen() );
411 if ( ma.markerColor().isValid() )
412 indexBrush.setColor( ma.markerColor() );
413
414 paintMarker( painter, ma, indexBrush, indexPen, pos, maSize );
415 }
416
417

6.5.3.38 void AbstractDiagram::paintMarker (QPainter ∗ painter, const MarkerAttributes &


markerAttributes, const QBrush & brush, const QPen &, const QPointF & point, const
QSizeF & size) [virtual, inherited]

Definition at line 420 of file KDChartAbstractDiagram.cpp.


References KDChart::MarkerAttributes::markerStyle().
Referenced by KDChart::LineDiagram::paint(), KDChart::MarkerLayoutItem::paint(), and
KDChart::AbstractDiagram::paintMarker().

424 {
425 PainterSaver painterSaver( painter );
426 painter->setBrush( brush );
427 painter->setPen( pen );
428 painter->setRenderHint ( QPainter::Antialiasing );
429 painter->translate( pos );
430 switch ( markerAttributes.markerStyle() ) {
431 case MarkerAttributes::MarkerCircle:
432 painter->drawEllipse( QRectF( 0 - maSize.height()/2, 0 - maSize.width()/2,
433 maSize.height(), maSize.width()) );
434 break;
435 case MarkerAttributes::MarkerSquare:
436 {
437 QRectF rect( 0 - maSize.height()/2, 0 - maSize.width()/2,
438 maSize.height(), maSize.width() );
439 painter->drawRect( rect );
440 painter->fillRect( rect, painter->brush() );
441 break;
442 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


80 KD Chart 2 Class Documentation

443 case MarkerAttributes::MarkerDiamond:


444 {
445 QVector <QPointF > diamondPoints;
446 QPointF top, left, bottom, right;
447 top = QPointF( 0, 0 - maSize.height()/2 );
448 left = QPointF( 0 - maSize.width()/2, 0 );
449 bottom = QPointF( 0, maSize.height()/2 );
450 right = QPointF( maSize.width()/2, 0 );
451 diamondPoints << top << left << bottom << right;
452 painter->drawPolygon( diamondPoints );
453 break;
454 }
455 //Pending Michel: do we need that? Ask: What is the idea about
456 // Marker1Pixel and Marker4Pixels.
457 case MarkerAttributes::Marker1Pixel:
458 {
459 QSizeF pSize(4,4);
460 QPen pen1Pixel;
461 pen1Pixel.setColor( painter->background().color() );
462 QRectF centerRect( -pSize.height()/2, -pSize.width()/2,
463 pSize.height(), pSize.width() );
464 painter->setPen( pen1Pixel );
465 painter->drawEllipse( centerRect );
466 break;
467 }
468 case MarkerAttributes::Marker4Pixels:
469 {
470 QSizeF pSize(8, 8);
471 QPen pen4Pixel;
472 pen4Pixel.setColor( painter->background().color() );
473 QRectF centerRect( -pSize.height()/2, -pSize.width()/2,
474 pSize.height(), pSize.width() );
475 painter->setPen( pen4Pixel );
476 painter->drawEllipse( centerRect );
477 break;
478 }
479 case MarkerAttributes::MarkerRing:
480 {
481 painter->setBrush( Qt::NoBrush );
482 painter->drawEllipse( QRectF( 0 - maSize.height()/2, 0 - maSize.width()/2,
483 maSize.height(), maSize.width()) );
484 break;
485 }
486 case MarkerAttributes::MarkerCross:
487 {
488 QVector <QPointF > crossPoints;
489 QPointF leftTop, leftBottom, centerBottomLeft, bottomLeft, bottomRight,
490 centerBottomRight,rightBottom, rightTop, centerTopRight, topRight, topLeft,
491 centerTopLeft;
492 leftTop = QPointF( -maSize.width()/2, -maSize.height()/4 );
493 leftBottom = QPointF( -maSize.width()/2, maSize.height()/4 );
494 centerBottomLeft = QPointF( -maSize.width()/4, maSize.height()/4 );
495 bottomLeft = QPointF( -maSize.width()/4, maSize.height()/2 );
496 bottomRight = QPointF( maSize.width()/4, maSize.height()/2 );
497 centerBottomRight = QPointF( maSize.width()/4, maSize.height()/4 );
498 rightBottom = QPointF( maSize.width()/2, maSize.height()/4 );
499 rightTop = QPointF( maSize.width()/2, -maSize.height()/4 );
500 centerTopRight = QPointF( maSize.width()/4, -maSize.height()/4 );
501 topRight = QPointF( maSize.width()/4, -maSize.height()/2 );
502 topLeft = QPointF( -maSize.width()/4, -maSize.height()/2 );
503 centerTopLeft = QPointF( -maSize.width()/4, -maSize.height()/4 );
504
505 crossPoints << leftTop << leftBottom << centerBottomLeft
506 << bottomLeft << bottomRight << centerBottomRight
507 << rightBottom << rightTop << centerTopRight
508 << topRight << topLeft << centerTopLeft;
509

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.5 KDChart::AbstractCartesianDiagram Class Reference 81

510 painter->drawPolygon( crossPoints );


511 break;
512 }
513 case MarkerAttributes::MarkerFastCross:
514 {
515 QPointF left, right, top, bottom;
516 left = QPointF( -maSize.width()/2, 0 );
517 right = QPointF( maSize.width()/2, 0 );
518 top = QPointF( 0, -maSize.height()/2 );
519 bottom= QPointF( 0, maSize.height()/2 );
520 painter->drawLine( left, right );
521 painter->drawLine( top, bottom );
522 break;
523 }
524 default:
525 Q_ASSERT_X ( false, "paintMarkers()",
526 "Type item does not match a defined Marker Type." );
527 }
528 }
529
530 void AbstractDiagram::paintMarkers( QPainter* painter )

6.5.3.39 void AbstractDiagram::paintMarkers (QPainter ∗ painter) [protected, virtual,


inherited]

Definition at line 532 of file KDChartAbstractDiagram.cpp.

535 {
536 for ( int j=0; j< rowCount; ++j ) {
537 const QModelIndex index = model()->index( j, i, rootIndex() );
538 double value = model()->data( index ).toDouble();
539 const QPointF pos = coordinatePlane()->translate( QPointF( j, value ) );
540 paintMarker( painter, index, pos );
541 }
542 }
543 }
544
545

6.5.3.40 QPen AbstractDiagram::pen (const QModelIndex & index) const [inherited]

Retrieve the pen to be used, for painting the datapoint at the given index in the model.

Parameters:
index The index of the datapoint in the model.

Returns:
The pen to use for painting.

Definition at line 586 of file KDChartAbstractDiagram.cpp.

593 {

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


82 KD Chart 2 Class Documentation

6.5.3.41 QPen AbstractDiagram::pen (int dataset) const [inherited]

Retrieve the pen to be used for the given dataset.


This will fall back automatically to what was set at model level, if there are no dataset specific settings.

Parameters:
dataset The dataset to retrieve the pen for.

Returns:
The pen to use for painting.

Definition at line 578 of file KDChartAbstractDiagram.cpp.

585 {

6.5.3.42 QPen AbstractDiagram::pen () const [inherited]

Retrieve the pen to be used for painting datapoints globally.


This will fall back automatically to the default settings, if there are no specific settings.

Returns:
The pen to use for painting.

Definition at line 572 of file KDChartAbstractDiagram.cpp.


Referenced by KDChart::PieDiagram::paint().

577 {

6.5.3.43 bool AbstractDiagram::percentMode () const [inherited]

Definition at line 313 of file KDChartAbstractDiagram.cpp.


References d.
Referenced by KDChart::CartesianCoordinatePlane::getDataDimensionsList().

320 {

6.5.3.44 void KDChart::AbstractDiagram::propertiesChanged () [protected, inherited]

Emitted upon change of a property of the Diagram.


Referenced by KDChart::AbstractDiagram::setDataValueAttributes(), KDChart::LineDiagram::setLine-
Attributes(), KDChart::LineDiagram::setThreeDLineAttributes(), and KDChart::LineDiagram::setType().

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.5 KDChart::AbstractCartesianDiagram Class Reference 83

6.5.3.45 AbstractCartesianDiagram ∗ AbstractCartesianDiagram::referenceDiagram () const


[virtual]

Definition at line 123 of file KDChartAbstractCartesianDiagram.cpp.


References d.

124 {
125 return d->referenceDiagram;
126 }

6.5.3.46 QPointF AbstractCartesianDiagram::referenceDiagramOffset () const [virtual]

Definition at line 128 of file KDChartAbstractCartesianDiagram.cpp.


References d.

129 {
130 return d->referenceDiagramOffset;
131 }

6.5.3.47 virtual void KDChart::AbstractDiagram::resize (const QSizeF & area) [pure


virtual, inherited]

Called by the widget’s sizeEvent.


Adjust all internal structures, that are calculated, dependending on the size of the widget.

Parameters:
area

Implemented in KDChart::BarDiagram, KDChart::LineDiagram, KDChart::PieDiagram, KDChart::Polar-


Diagram, and KDChart::RingDiagram.

6.5.3.48 void AbstractDiagram::scrollTo (const QModelIndex & index, ScrollHint hint =


EnsureVisible) [virtual, inherited]

[reimplemented]
Definition at line 646 of file KDChartAbstractDiagram.cpp.

648 { return QModelIndex(); }

6.5.3.49 void AbstractDiagram::setAllowOverlappingDataValueTexts (bool allow)


[inherited]

Set whether data value labels are allowed to overlap.

Parameters:
allow True means that overlapping labels are allowed.

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


84 KD Chart 2 Class Documentation

Definition at line 285 of file KDChartAbstractDiagram.cpp.


References d.

290 {

6.5.3.50 void AbstractDiagram::setAntiAliasing (bool enabled) [inherited]

Set whether anti-aliasing is to be used while rendering this diagram.

Parameters:
enabled True means that AA is enabled.

Definition at line 296 of file KDChartAbstractDiagram.cpp.


References d.

301 {

6.5.3.51 void AbstractDiagram::setAttributesModel (AttributesModel ∗ model) [virtual,


inherited]

Associate an AttributesModel with this diagram.


Note that the diagram does _not_ take ownership of the AttributesModel. This should thus only be used
with AttributesModels that have been explicitely created by the user, and are owned by her. Setting an
AttributesModel that is internal to another diagram is an error.
Correct:

AttributesModel *am = new AttributesModel( model, 0 );


diagram1->setAttributesModel( am );
diagram2->setAttributesModel( am );

Wrong:

diagram1->setAttributesModel( diagram2->attributesModel() );

Parameters:
model The AttributesModel to use for this diagram.

See also:
AttributesModel

Definition at line 160 of file KDChartAbstractDiagram.cpp.


References d, and KDChart::AbstractDiagram::modelsChanged().

161 {
162 if( amodel->sourceModel() != model() ) {
163 qWarning("KDChart::AbstractDiagram::setAttributesModel() failed: "
164 "Trying to set an attributesmodel which works on a different "
165 "model than the diagram.");
166 return;

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.5 KDChart::AbstractCartesianDiagram Class Reference 85

167 }
168 if( qobject_cast<PrivateAttributesModel*>(amodel) ) {
169 qWarning("KDChart::AbstractDiagram::setAttributesModel() failed: "
170 "Trying to set an attributesmodel that is private to another diagram.");
171 return;
172 }
173 d->setAttributesModel(amodel);
174 scheduleDelayedItemsLayout();
175 d->databoundariesDirty = true;
176 emit modelsChanged();
177 }

6.5.3.52 void AbstractDiagram::setAttributesModelRootIndex (const QModelIndex & idx)


[protected, inherited]

Definition at line 195 of file KDChartAbstractDiagram.cpp.


References d.

6.5.3.53 void AbstractDiagram::setBrush (const QBrush & brush) [inherited]

Set the brush to be used, for painting all datasets in the model.

Parameters:
brush The brush to use.

Definition at line 602 of file KDChartAbstractDiagram.cpp.

608 {

6.5.3.54 void AbstractDiagram::setBrush (int dataset, const QBrush & brush) [inherited]

Set the brush to be used, for painting the given dataset.

Parameters:
dataset The dataset’s column in the model.
pen The brush to use.

Definition at line 609 of file KDChartAbstractDiagram.cpp.

617 {

6.5.3.55 void AbstractDiagram::setBrush (const QModelIndex & index, const QBrush & brush)
[inherited]

Set the brush to be used, for painting the datapoint at the given index.

Parameters:
index The datapoint’s index in the model.
brush The brush to use.

Definition at line 594 of file KDChartAbstractDiagram.cpp.

601 {

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


86 KD Chart 2 Class Documentation

6.5.3.56 void KDChart::AbstractCartesianDiagram::setCoordinatePlane


(AbstractCoordinatePlane ∗ plane) [virtual]

Set the coordinate plane associated with the diagram.


This determines how coordinates in value space are mapped into pixel space. The chart takes ownership.

Returns:
The coordinate plane associated with the diagram.

Reimplemented from KDChart::AbstractDiagram.


Definition at line 100 of file KDChartAbstractCartesianDiagram.cpp.
References KDChart::AbstractDiagram::coordinatePlane(), and KDChart::AbstractDiagram::set-
CoordinatePlane().

101 {
102 if( coordinatePlane() ) disconnect( coordinatePlane() );
103 AbstractDiagram::setCoordinatePlane(plane);
104
105 // show the axes, after all have been adjusted
106 // (because they might be dependend on each other)
107 /*
108 if( plane )
109 Q_FOREACH( CartesianAxis* axis, d->axesList )
110 axis->show();
111 else
112 Q_FOREACH( CartesianAxis* axis, d->axesList )
113 axis->hide();
114 */
115 }

6.5.3.57 void AbstractDiagram::setDataBoundariesDirty () const [protected, inherited]

Definition at line 139 of file KDChartAbstractDiagram.cpp.


References d.
Referenced by KDChart::BarDiagram::setThreeDBarAttributes(), KDChart::LineDiagram::setThree-
DLineAttributes(), KDChart::LineDiagram::setType(), and KDChart::BarDiagram::setType().

140 {
141 d->databoundariesDirty = true;
142 }

6.5.3.58 void AbstractDiagram::setDatasetDimension (int dimension) [inherited]

Sets the dataset dimension of the diagram.

See also:
datasetDimension.

Parameters:
dimension

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.5 KDChart::AbstractCartesianDiagram Class Reference 87

Definition at line 763 of file KDChartAbstractDiagram.cpp.


References d.

770 {

6.5.3.59 void AbstractDiagram::setDataValueAttributes (const DataValueAttributes & a)


[inherited]

Set the DataValueAttributes for all datapoints in the model.

Parameters:
a The attributes to set.

Definition at line 279 of file KDChartAbstractDiagram.cpp.


References d.

284 {

6.5.3.60 void AbstractDiagram::setDataValueAttributes (int dataset, const DataValueAttributes &


a) [inherited]

Set the DataValueAttributes for the given dataset.

Parameters:
dataset The dataset to set the attributes for.
a The attributes to set.

Definition at line 251 of file KDChartAbstractDiagram.cpp.


References d.

259 {

6.5.3.61 void AbstractDiagram::setDataValueAttributes (const QModelIndex & index, const


DataValueAttributes & a) [inherited]

Set the DataValueAttributes for the given index.

Parameters:
index The datapoint to set the attributes for.
a The attributes to set.

Definition at line 240 of file KDChartAbstractDiagram.cpp.


References d, KDChart::DataValueLabelAttributesRole, and KDChart::AbstractDiagram::properties-
Changed().

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


88 KD Chart 2 Class Documentation

240 {
241 d->attributesModel->setData(
242 d->attributesModel->mapFromSource( index ),
243 qVariantFromValue( a ),
244 DataValueLabelAttributesRole );
245 emit propertiesChanged();
246 }
247
248

6.5.3.62 void AbstractDiagram::setModel (QAbstractItemModel ∗ model) [virtual,


inherited]

Associate a model with the diagram.


Definition at line 144 of file KDChartAbstractDiagram.cpp.
References d, KDChart::AttributesModel::initFrom(), and KDChart::AbstractDiagram::modelsChanged().

145 {
146 QAbstractItemView::setModel( newModel );
147 AttributesModel* amodel = new PrivateAttributesModel( newModel, this );
148 amodel->initFrom( d->attributesModel );
149 d->setAttributesModel(amodel);
150 scheduleDelayedItemsLayout();
151 d->databoundariesDirty = true;
152 emit modelsChanged();
153 }

6.5.3.63 void AbstractDiagram::setPen (const QPen & pen) [inherited]

Set the pen to be used, for painting all datasets in the model.

Parameters:
pen The pen to use.

Definition at line 556 of file KDChartAbstractDiagram.cpp.

562 {

6.5.3.64 void AbstractDiagram::setPen (int dataset, const QPen & pen) [inherited]

Set the pen to be used, for painting the given dataset.

Parameters:
dataset The dataset’s row in the model.
pen The pen to use.

Definition at line 563 of file KDChartAbstractDiagram.cpp.

571 {

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.5 KDChart::AbstractCartesianDiagram Class Reference 89

6.5.3.65 void AbstractDiagram::setPen (const QModelIndex & index, const QPen & pen)
[inherited]

Set the pen to be used, for painting the datapoint at the given index.

Parameters:
index The datapoint’s index in the model.
pen The pen to use.

Definition at line 548 of file KDChartAbstractDiagram.cpp.

555 {

6.5.3.66 void AbstractDiagram::setPercentMode (bool percent) [inherited]

Definition at line 307 of file KDChartAbstractDiagram.cpp.


References d.
Referenced by KDChart::LineDiagram::setType(), and KDChart::BarDiagram::setType().

312 {

6.5.3.67 void AbstractCartesianDiagram::setReferenceDiagram (AbstractCartesianDiagram ∗


diagram, const QPointF & offset = QPointF()) [virtual]

Definition at line 117 of file KDChartAbstractCartesianDiagram.cpp.


References d.

118 {
119 d->referenceDiagram = diagram;
120 d->referenceDiagramOffset = offset;
121 }

6.5.3.68 void AbstractDiagram::setRootIndex (const QModelIndex & idx) [virtual,


inherited]

Set the root index in the model, where the diagram starts referencing data for display.
[reimplemented]
Definition at line 188 of file KDChartAbstractDiagram.cpp.
References d.

6.5.3.69 void AbstractDiagram::setSelection (const QRect & rect, QItemSelection-


Model::SelectionFlags command) [virtual, inherited]

[reimplemented]
Definition at line 664 of file KDChartAbstractDiagram.cpp.

666 { return QRegion(); }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


90 KD Chart 2 Class Documentation

6.5.3.70 void AbstractCartesianDiagram::takeAxis (CartesianAxis ∗ axis) [virtual]

Removes the axis from the diagram, without deleting it.


The diagram no longer owns the axis, so it is the caller’s responsibility to delete the axis.

See also:
addAxis

Definition at line 75 of file KDChartAbstractCartesianDiagram.cpp.


References d, KDChart::AbstractAxis::deleteObserver(), layoutPlanes(), and KDChart::AbstractLayout-
Item::setParentWidget().
Referenced by KDChart::CartesianAxis::∼CartesianAxis().

76 {
77 const int idx = d->axesList.indexOf( axis );
78 if( idx != -1 )
79 d->axesList.takeAt( idx );
80 axis->deleteObserver( this );
81 axis->setParentWidget( 0 );
82 layoutPlanes();
83 }

6.5.3.71 virtual double KDChart::AbstractCartesianDiagram::threeDItemDepth (int column)


const [protected, pure virtual]

Implemented in KDChart::BarDiagram, and KDChart::LineDiagram.

6.5.3.72 virtual double KDChart::AbstractCartesianDiagram::threeDItemDepth (const


QModelIndex & index) const [protected, pure virtual]

Implemented in KDChart::BarDiagram, and KDChart::LineDiagram.

6.5.3.73 void AbstractDiagram::update () const [inherited]

Definition at line 777 of file KDChartAbstractDiagram.cpp.


References d.
Referenced by KDChart::AbstractDiagram::doItemsLayout().

6.5.3.74 void KDChart::AbstractDiagram::useDefaultColors () [inherited]

Set the palette to be used, for painting datasets to the default palette.

See also:
KDChart::Palette. FIXME: fold into one usePalette (KDChart::Palette&) method

Definition at line 671 of file KDChartAbstractDiagram.cpp.


References d.

675 {

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.5 KDChart::AbstractCartesianDiagram Class Reference 91

6.5.3.75 void KDChart::AbstractDiagram::useRainbowColors () [inherited]

Set the palette to be used, for painting datasets to the rainbow palette.

See also:
KDChart::Palette.

Definition at line 681 of file KDChartAbstractDiagram.cpp.


References d.

685 {

6.5.3.76 void KDChart::AbstractDiagram::useSubduedColors () [inherited]

Set the palette to be used, for painting datasets to the subdued palette.

See also:
KDChart::Palette.

Definition at line 676 of file KDChartAbstractDiagram.cpp.


References d.

680 {

6.5.3.77 double AbstractDiagram::valueForCell (int row, int column) const [protected,


inherited]

Helper method, retrieving the data value (DisplayRole) for a given row and column.

Parameters:
row The row to query.
column The column to query.

Returns:
The value of the display role at the given row and column as a double.

Definition at line 771 of file KDChartAbstractDiagram.cpp.


References KDChart::AbstractDiagram::attributesModelRootIndex(), and d.
Referenced by KDChart::LineDiagram::paint().

776 {

6.5.3.78 int AbstractDiagram::verticalOffset () const [virtual, inherited]

[reimplemented]
Definition at line 658 of file KDChartAbstractDiagram.cpp.

660 { return true; }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


92 KD Chart 2 Class Documentation

6.5.3.79 QRect AbstractDiagram::visualRect (const QModelIndex & index) const [virtual,


inherited]

[reimplemented]
Definition at line 641 of file KDChartAbstractDiagram.cpp.

645 {}

6.5.3.80 QRegion AbstractDiagram::visualRegionForSelection (const QItemSelection & selection)


const [virtual, inherited]

[reimplemented]
Definition at line 667 of file KDChartAbstractDiagram.cpp.

6.5.4 Member Data Documentation

6.5.4.1 Q_SIGNALS KDChart::AbstractDiagram::__pad0__ [protected, inherited]

Definition at line 506 of file KDChartAbstractDiagram.h.


The documentation for this class was generated from the following files:

• KDChartAbstractCartesianDiagram.h
• KDChartAbstractCartesianDiagram.cpp

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.6 KDChart::AbstractCoordinatePlane Class Reference 93

6.6 KDChart::AbstractCoordinatePlane Class Reference


#include <KDChartAbstractCoordinatePlane.h>
Inheritance diagram for KDChart::AbstractCoordinatePlane:Collaboration diagram for
KDChart::AbstractCoordinatePlane:

Public Types
• enum AxesCalcMode {
Linear,
Logarithmic }

Public Member Functions


• virtual void addDiagram (AbstractDiagram ∗diagram)
Adds a diagram to this coordinate plane.

• void alignToReferencePoint (const RelativePosition &position)


• BackgroundAttributes backgroundAttributes () const
• AbstractDiagram ∗ diagram ()
• ConstAbstractDiagramList diagrams () const
• AbstractDiagramList diagrams ()
• virtual Qt::Orientations expandingDirections () const
pure virtual in QLayoutItem

• FrameAttributes frameAttributes () const


• virtual QRect geometry () const
pure virtual in QLayoutItem

• GridAttributes globalGridAttributes () const


• DataDimensionsList gridDimensionsList ()
Returns the dimensions used for drawing the grid lines.

• virtual bool isEmpty () const


pure virtual in QLayoutItem

• virtual void layoutDiagrams ()=0


Distribute the available space among the diagrams and axes.

• void layoutPlanes ()
Calling layoutPlanes() on the plane triggers the global KDChart::Chart::slotLayoutPlanes().

• virtual QSize maximumSize () const


pure virtual in QLayoutItem

• virtual QSize minimumSize () const


pure virtual in QLayoutItem

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


94 KD Chart 2 Class Documentation

• virtual QSize minimumSizeHint () const


[reimplemented]

• void needLayoutPlanes ()
Emitted when plane needs to trigger the Chart’s layouting of the coord.

• void needRelayout ()
Emitted when plane needs to trigger the Chart’s layouting.

• void needUpdate ()
Emitted when plane needs to update its drawings.

• virtual void paint (QPainter ∗)=0


• void paintAll (QPainter &painter)
Call paintAll, if you want the background and the frame to be drawn before the normal paint() is invoked
automatically.

• virtual void paintBackground (QPainter &painter, const QRect &rectangle)


• virtual void paintCtx (PaintContext ∗context)
Default impl: Paint the complete item using its layouted position and size.

• virtual void paintFrame (QPainter &painter, const QRect &rectangle)


• virtual void paintIntoRect (QPainter &painter, const QRect &rect)
Draws the background and frame, then calls paint().

• const Chart ∗ parent () const


• Chart ∗ parent ()
• void propertiesChanged ()
Emitted upon change of a property of the Coordinate Plane or any of its components.

• AbstractCoordinatePlane ∗ referenceCoordinatePlane () const


There are two ways, in which planes can be caused to interact, in where they are put layouting wise: The
first is the reference plane.

• void relayout ()
Calling relayout() on the plane triggers the global KDChart::Chart::slotRelayout().

• void removeFromParentLayout ()
• virtual void replaceDiagram (AbstractDiagram ∗diagram, AbstractDiagram ∗oldDiagram=0)
Replaces the old diagram, or appends the diagram, it there is none yet.

• void setBackgroundAttributes (const BackgroundAttributes &a)


• void setFrameAttributes (const FrameAttributes &a)
• virtual void setGeometry (const QRect &r)
pure virtual in QLayoutItem

• void setGlobalGridAttributes (const GridAttributes &)


Set the grid attributes to be used by this coordinate plane.

• void setParent (Chart ∗parent)

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.6 KDChart::AbstractCoordinatePlane Class Reference 95

Called internally by KDChart::Chart.

• void setParentLayout (QLayout ∗lay)


• virtual void setParentWidget (QWidget ∗widget)
Inform the item about its widget: This enables the item, to trigger that widget’s update, whenever the size
of the item’s contents has changed.

• void setReferenceCoordinatePlane (AbstractCoordinatePlane ∗plane)


Set another coordinate plane to be used as the reference plane for this one.

• virtual void setZoomCenter (QPointF)


Set the point (in value coordinates) to be used as the center point in zoom operations.

• virtual void setZoomFactorX (double)


Sets the zoom factor in horizontal direction, that is applied to all coordinate transformations.

• virtual void setZoomFactorY (double)


Sets the zoom factor in vertical direction, that is applied to all coordinate transformations.

• virtual QSize sizeHint () const


pure virtual in QLayoutItem

• virtual void sizeHintChanged () const


Report changed size hint: ask the parent widget to recalculate the layout.

• virtual QSizePolicy sizePolicy () const


[reimplemented]

• virtual void takeDiagram (AbstractDiagram ∗diagram)


Removes the diagram from the plane, without deleting it.

• virtual const QPointF translate (const QPointF &diagramPoint) const=0


Translate the given point in value space coordinates to a position in pixel space.

• virtual QPointF zoomCenter () const


• virtual double zoomFactorX () const
• virtual double zoomFactorY () const
• virtual ∼AbstractCoordinatePlane ()

Public Attributes
• Q_SIGNALS __pad0__: void destroyedCoordinatePlane( AbstractCoordinatePlane∗ )
• public Q_SLOTS: void update()

Protected Member Functions


• AbstractCoordinatePlane (Chart ∗parent=0)
• virtual QRect areaGeometry () const
• virtual DataDimensionsList getDataDimensionsList () const=0
• QRect innerRect () const
• virtual void positionHasChanged ()

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


96 KD Chart 2 Class Documentation

Protected Attributes
• QWidget ∗ mParent
• QLayout ∗ mParentLayout

6.6.1 Member Enumeration Documentation

6.6.1.1 enum KDChart::AbstractCoordinatePlane::AxesCalcMode

Enumeration values:
Linear
Logarithmic

Definition at line 55 of file KDChartAbstractCoordinatePlane.h.

55 { Linear, Logarithmic };

6.6.2 Constructor & Destructor Documentation

6.6.2.1 AbstractCoordinatePlane::AbstractCoordinatePlane (Chart ∗ parent = 0) [explicit,


protected]

Definition at line 51 of file KDChartAbstractCoordinatePlane.cpp.


References d.

52 : AbstractArea ( new Private() )


53 {
54 d->parent = parent;
55 d->init();
56 }

6.6.2.2 AbstractCoordinatePlane::∼AbstractCoordinatePlane () [virtual]

Definition at line 58 of file KDChartAbstractCoordinatePlane.cpp.

59 {
60 emit destroyedCoordinatePlane( this );
61 }

6.6.3 Member Function Documentation

6.6.3.1 void AbstractCoordinatePlane::addDiagram (AbstractDiagram ∗ diagram) [virtual]

Adds a diagram to this coordinate plane.

Parameters:
diagram The diagram to add.

See also:
replaceDiagram, takeDiagram

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.6 KDChart::AbstractCoordinatePlane Class Reference 97

Reimplemented in KDChart::CartesianCoordinatePlane, and KDChart::PolarCoordinatePlane.


Definition at line 68 of file KDChartAbstractCoordinatePlane.cpp.
References d, layoutDiagrams(), layoutPlanes(), and KDChart::AbstractDiagram::setCoordinatePlane().
Referenced by KDChart::PolarCoordinatePlane::addDiagram(), KDChart::CartesianCoordinate-
Plane::addDiagram(), and replaceDiagram().

69 {
70 // diagrams are invisible and paint through their paint() method
71 diagram->hide();
72
73 d->diagrams.append( diagram );
74 diagram->setParent( d->parent );
75 diagram->setCoordinatePlane( this );
76 layoutDiagrams();
77 layoutPlanes(); // there might be new axes, etc
78 update();
79 }

6.6.3.2 void AbstractAreaBase::alignToReferencePoint (const RelativePosition & position)


[inherited]

Definition at line 75 of file KDChartAbstractAreaBase.cpp.

76 {
77 Q_UNUSED( position );
78 // PENDING(kalle) FIXME
79 qWarning( "Sorry, not implemented: void AbstractAreaBase::alignToReferencePoint( const RelativePosi
80 }

6.6.3.3 QRect AbstractArea::areaGeometry () const [protected, virtual, inherited]

Implements KDChart::AbstractAreaBase.
Definition at line 105 of file KDChartAbstractArea.cpp.
Referenced by KDChart::CartesianCoordinatePlane::drawingArea(), KDChart::PolarCoordinate-
Plane::layoutDiagrams(), KDChart::CartesianAxis::paint(), KDChart::AbstractArea::paintAll(), and
KDChart::CartesianAxis::paintCtx().

106 {
107 return geometry();
108 }

6.6.3.4 BackgroundAttributes AbstractAreaBase::backgroundAttributes () const [inherited]

Definition at line 97 of file KDChartAbstractAreaBase.cpp.


References d.

98 {
99 return d->backgroundAttributes;
100 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


98 KD Chart 2 Class Documentation

6.6.3.5 AbstractDiagram ∗ AbstractCoordinatePlane::diagram ()

Returns:
The first diagram associated with this coordinate plane.

Definition at line 113 of file KDChartAbstractCoordinatePlane.cpp.


References d.
Referenced by KDChart::Widget::diagram().

114 {
115 if ( d->diagrams.isEmpty() )
116 {
117 return 0;
118 } else {
119 return d->diagrams.first();
120 }
121 }

6.6.3.6 ConstAbstractDiagramList AbstractCoordinatePlane::diagrams () const

Returns:
The list of diagrams associated with this coordinate plane.

Definition at line 128 of file KDChartAbstractCoordinatePlane.cpp.


References KDChart::ConstAbstractDiagramList, and d.

129 {
130 ConstAbstractDiagramList list;
131 #ifndef QT_NO_STL
132 qCopy( d->diagrams.begin(), d->diagrams.end(), std::back_inserter( list ) );
133 #else
134 Q_FOREACH( AbstractDiagram * a, d->diagrams )
135 list.push_back( a );
136 #endif
137 return list;
138 }

6.6.3.7 AbstractDiagramList AbstractCoordinatePlane::diagrams ()

Returns:
The list of diagrams associated with this coordinate plane.

Definition at line 123 of file KDChartAbstractCoordinatePlane.cpp.


References KDChart::AbstractDiagramList, and d.
Referenced by KDChart::CartesianCoordinatePlane::calculateRawDataBoundingRect(),
KDChart::CartesianCoordinatePlane::getDataDimensionsList(), KDChart::PolarCoordinatePlane::layout-
Diagrams(), KDChart::CartesianCoordinatePlane::layoutDiagrams(), KDChart::PolarCoordinate-
Plane::paint(), and KDChart::CartesianCoordinatePlane::paint().

124 {
125 return d->diagrams;
126 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.6 KDChart::AbstractCoordinatePlane Class Reference 99

6.6.3.8 Qt::Orientations KDChart::AbstractCoordinatePlane::expandingDirections () const


[virtual]

pure virtual in QLayoutItem


Definition at line 200 of file KDChartAbstractCoordinatePlane.cpp.

201 {
202 return Qt::Vertical | Qt::Horizontal;
203 }

6.6.3.9 FrameAttributes AbstractAreaBase::frameAttributes () const [inherited]

Definition at line 87 of file KDChartAbstractAreaBase.cpp.


References d.
Referenced by KDChart::Legend::clone().

88 {
89 return d->frameAttributes;
90 }

6.6.3.10 QRect KDChart::AbstractCoordinatePlane::geometry () const [virtual]

pure virtual in QLayoutItem


Definition at line 237 of file KDChartAbstractCoordinatePlane.cpp.
References d.
Referenced by KDChart::PolarCoordinatePlane::paint().

238 {
239 return d->geometry;
240 }

6.6.3.11 virtual DataDimensionsList KDChart::AbstractCoordinatePlane::getDataDimensions-


List () const [protected, pure virtual]

Implemented in KDChart::CartesianCoordinatePlane, and KDChart::PolarCoordinatePlane.

6.6.3.12 GridAttributes KDChart::AbstractCoordinatePlane::globalGridAttributes () const

Returns:
The grid attributes used by this coordinate plane.

See also:
setGlobalGridAttributes
CartesianCoordinatePlane::gridAttributes

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


100 KD Chart 2 Class Documentation

Definition at line 157 of file KDChartAbstractCoordinatePlane.cpp.


References d.
Referenced by KDChart::PolarCoordinatePlane::gridAttributes(), and KDChart::CartesianCoordinate-
Plane::gridAttributes().

158 {
159 return d->gridAttributes;
160 }

6.6.3.13 KDChart::DataDimensionsList KDChart::AbstractCoordinatePlane::gridDimensions-


List ()

Returns the dimensions used for drawing the grid lines.


Returned data is the result of (cached) grid calculations, so - if you need that information for your own
tasks - make sure to call again this function after every data modification that has changed the data range,
since grid calculation is based upon the data range, thus the grid start/end might have changed if the data
was changed.

Note:
Returned list will contain different numbers of DataDimension, depending on the kind of coordinate
plane used. For CartesianCoordinatePlane two DataDimension are returned: the first representing
grid lines in X direction (matching the Abscissa axes) and the second indicating vertical grid lines (or
Ordinate axes, resp.).

Returns:
The dimensions used for drawing the grid lines.

See also:
DataDimension

Definition at line 162 of file KDChartAbstractCoordinatePlane.cpp.


References d, and KDChart::DataDimensionsList.
Referenced by KDChart::CartesianCoordinatePlane::layoutDiagrams(), KDChart::Cartesian-
Axis::maximumSize(), and KDChart::CartesianAxis::paintCtx().

163 {
164 return d->grid->updateData( this );
165 }

6.6.3.14 QRect AbstractAreaBase::innerRect () const [protected, inherited]

Definition at line 175 of file KDChartAbstractAreaBase.cpp.


References KDChart::AbstractAreaBase::areaGeometry(), and d.
Referenced by KDChart::TextArea::paintAll(), KDChart::AbstractAreaWidget::paintAll(), and
KDChart::AbstractArea::paintAll().

176 {
177 Q_ASSERT_X ( d != 0, "AbstractAreaBase::innerRect()",

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.6 KDChart::AbstractCoordinatePlane Class Reference 101

178 "Private class was not initialized!" );


179
180 const int padding
181 = d->frameAttributes.isVisible()
182 ? qMax( d->frameAttributes.padding(), 0 ) : 0;
183 return
184 QRect( QPoint(0,0), areaGeometry().size() )
185 .adjusted( padding, padding, -padding, -padding );
186 }

6.6.3.15 bool KDChart::AbstractCoordinatePlane::isEmpty () const [virtual]

pure virtual in QLayoutItem


Definition at line 193 of file KDChartAbstractCoordinatePlane.cpp.

194 {
195 return false; // never empty!
196 // coordinate planes with no associated diagrams
197 // are showing a default grid of ()1..10, 1..10) stepWidth 1
198 }

6.6.3.16 virtual void KDChart::AbstractCoordinatePlane::layoutDiagrams () [pure


virtual]

Distribute the available space among the diagrams and axes.


Implemented in KDChart::CartesianCoordinatePlane, and KDChart::PolarCoordinatePlane.
Referenced by addDiagram(), replaceDiagram(), and takeDiagram().

6.6.3.17 void KDChart::AbstractCoordinatePlane::layoutPlanes ()

Calling layoutPlanes() on the plane triggers the global KDChart::Chart::slotLayoutPlanes().


Definition at line 254 of file KDChartAbstractCoordinatePlane.cpp.
References needLayoutPlanes().
Referenced by addDiagram(), KDChart::CartesianAxis::layoutPlanes(), KDChart::AbstractCartesian-
Diagram::layoutPlanes(), and replaceDiagram().

255 {
256 //qDebug("KDChart::AbstractCoordinatePlane::relayout() called");
257 emit needLayoutPlanes();
258 }

6.6.3.18 QSize KDChart::AbstractCoordinatePlane::maximumSize () const [virtual]

pure virtual in QLayoutItem


Definition at line 205 of file KDChartAbstractCoordinatePlane.cpp.
References d.
Referenced by sizeHint().

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


102 KD Chart 2 Class Documentation

206 {
207 if( d->parent )
208 return d->parent->size();
209 // Note: At external layut calculation time the coord.plane *will*
210 // have a parent widget, so returning a default size here
211 // will not affect its real drawing size.
212 return QSize(1000, 1000);
213 }

6.6.3.19 QSize KDChart::AbstractCoordinatePlane::minimumSize () const [virtual]

pure virtual in QLayoutItem


Definition at line 215 of file KDChartAbstractCoordinatePlane.cpp.

216 {
217 return QSize(60, 60); // this default can be overwritten by derived classes
218 }

6.6.3.20 QSize KDChart::AbstractCoordinatePlane::minimumSizeHint () const [virtual]

[reimplemented]
Definition at line 140 of file KDChartAbstractCoordinatePlane.cpp.

141 {
142 return QSize( 200, 200 );
143 }

6.6.3.21 void KDChart::AbstractCoordinatePlane::needLayoutPlanes ()

Emitted when plane needs to trigger the Chart’s layouting of the coord.
planes.
Referenced by layoutPlanes().

6.6.3.22 void KDChart::AbstractCoordinatePlane::needRelayout ()

Emitted when plane needs to trigger the Chart’s layouting.


Referenced by relayout().

6.6.3.23 void KDChart::AbstractCoordinatePlane::needUpdate ()

Emitted when plane needs to update its drawings.

6.6.3.24 virtual void KDChart::AbstractLayoutItem::paint (QPainter ∗) [pure virtual,


inherited]

Implemented in KDChart::CartesianAxis, KDChart::CartesianCoordinatePlane, KDChart::TextLayout-


Item, KDChart::MarkerLayoutItem, KDChart::HorizontalLineLayoutItem, KDChart::VerticalLineLayout-
Item, and KDChart::PolarCoordinatePlane.

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.6 KDChart::AbstractCoordinatePlane Class Reference 103

Referenced by KDChart::Legend::paint(), KDChart::AbstractArea::paintAll(), and KDChart::Abstract-


LayoutItem::paintCtx().

6.6.3.25 void AbstractArea::paintAll (QPainter & painter) [inherited]

Call paintAll, if you want the background and the frame to be drawn before the normal paint() is invoked
automatically.
Definition at line 83 of file KDChartAbstractArea.cpp.
References KDChart::AbstractArea::areaGeometry(), KDChart::AbstractAreaBase::innerRect(),
KDChart::AbstractLayoutItem::paint(), KDChart::AbstractAreaBase::paintBackground(), and
KDChart::AbstractAreaBase::paintFrame().
Referenced by KDChart::Chart::paint(), and KDChart::AbstractArea::paintIntoRect().

84 {
85 // Paint the background and frame
86 paintBackground( painter, geometry() );
87 paintFrame( painter, geometry() );
88
89 // temporarily adjust the widget size, to be sure all content gets calculated
90 // to fit into the inner rectangle
91 const QRect oldGeometry( areaGeometry() );
92 QRect inner( innerRect() );
93 inner.moveTo(
94 oldGeometry.left() + inner.left(),
95 oldGeometry.top() + inner.top() );
96 const bool needAdjustGeometry = oldGeometry != inner;
97 if( needAdjustGeometry )
98 setGeometry( inner );
99 paint( &painter );
100 if( needAdjustGeometry )
101 setGeometry( oldGeometry );
102 //qDebug() << "AbstractAreaWidget::paintAll() done.";
103 }

6.6.3.26 void AbstractAreaBase::paintBackground (QPainter & painter, const QRect & rectangle)
[virtual, inherited]

Definition at line 103 of file KDChartAbstractAreaBase.cpp.


References attributes, and d.
Referenced by KDChart::TextArea::paintAll(), KDChart::AbstractAreaWidget::paintAll(), and
KDChart::AbstractArea::paintAll().

104 {
105 Q_ASSERT_X ( d != 0, "AbstractAreaBase::paintBackground()",
106 "Private class was not initialized!" );
107
108 #define attributes d->backgroundAttributes
109
110 if( !attributes.isVisible() ) return;
111
112 /* first draw the brush (may contain a pixmap)*/
113 if( Qt::NoBrush != attributes.brush().style() ) {
114 KDChart::PainterSaver painterSaver( &painter );
115 painter.setPen( Qt::NoPen );
116 const QPointF newTopLeft( painter.deviceMatrix().map( rect.topLeft() ) );
117 painter.setBrushOrigin( newTopLeft );

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


104 KD Chart 2 Class Documentation

118 painter.setBrush( attributes.brush() );


119 painter.drawRect( rect );
120 }
121 /* next draw the backPixmap over the brush */
122 if( !attributes.pixmap().isNull() &&
123 attributes.pixmapMode() != BackgroundAttributes::BackgroundPixmapModeNone ) {
124 QPointF ol = rect.topLeft();
125 if( BackgroundAttributes::BackgroundPixmapModeCentered == attributes.pixmapMode() )
126 {
127 ol.setX( rect.center().x() - attributes.pixmap().width() / 2 );
128 ol.setY( rect.center().y() - attributes.pixmap().height()/ 2 );
129 painter.drawPixmap( ol, attributes.pixmap() );
130 } else {
131 QMatrix m;
132 double zW = (double)rect.width() / (double)attributes.pixmap().width();
133 double zH = (double)rect.height() / (double)attributes.pixmap().height();
134 switch( attributes.pixmapMode() ) {
135 case BackgroundAttributes::BackgroundPixmapModeScaled:
136 {
137 double z;
138 z = qMin( zW, zH );
139 m.scale( z, z );
140 }
141 break;
142 case BackgroundAttributes::BackgroundPixmapModeStretched:
143 m.scale( zW, zH );
144 break;
145 default:
146 ; // Cannot happen, previously checked
147 }
148 QPixmap pm = attributes.pixmap().transformed( m );
149 ol.setX( rect.center().x() - pm.width() / 2 );
150 ol.setY( rect.center().y() - pm.height()/ 2 );
151 painter.drawPixmap( ol, pm );
152 }
153 }
154 #undef attributes
155 }

6.6.3.27 void KDChart::AbstractLayoutItem::paintCtx (PaintContext ∗ context) [virtual,


inherited]

Default impl: Paint the complete item using its layouted position and size.
Reimplemented in KDChart::CartesianAxis.
Definition at line 64 of file KDChartLayoutItems.cpp.
References KDChart::AbstractLayoutItem::paint(), and KDChart::PaintContext::painter().

65 {
66 if( context )
67 paint( context->painter() );
68 }

6.6.3.28 void AbstractAreaBase::paintFrame (QPainter & painter, const QRect & rectangle)
[virtual, inherited]

Definition at line 158 of file KDChartAbstractAreaBase.cpp.


References attributes, and d.

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.6 KDChart::AbstractCoordinatePlane Class Reference 105

Referenced by KDChart::TextArea::paintAll(), KDChart::AbstractAreaWidget::paintAll(), and


KDChart::AbstractArea::paintAll().

159 {
160 Q_ASSERT_X ( d != 0, "AbstractAreaBase::paintFrame()",
161 "Private class was not initialized!" );
162
163 #define attributes d->frameAttributes
164
165 if( !attributes.isVisible() ) return;
166
167 const QPen oldPen( painter.pen() );
168 painter.setPen( attributes.pen() );
169 painter.drawRect( rect );
170 painter.setPen( oldPen );
171 #undef attributes
172 }

6.6.3.29 void AbstractArea::paintIntoRect (QPainter & painter, const QRect & rect)
[virtual, inherited]

Draws the background and frame, then calls paint().


In most cases there is no need to overwrite this method in a derived class, but you would overwrite Abstract-
LayoutItem::paint() instead.
Definition at line 71 of file KDChartAbstractArea.cpp.
References KDChart::AbstractArea::paintAll().

72 {
73 const QRect oldGeometry( geometry() );
74 if( oldGeometry != rect )
75 setGeometry( rect );
76 painter.translate( rect.left(), rect.top() );
77 paintAll( painter );
78 painter.translate( -rect.left(), -rect.top() );
79 if( oldGeometry != rect )
80 setGeometry( oldGeometry );
81 }

6.6.3.30 const KDChart::Chart ∗ KDChart::AbstractCoordinatePlane::parent () const

Definition at line 182 of file KDChartAbstractCoordinatePlane.cpp.


References d.

183 {
184 return d->parent;
185 }

6.6.3.31 KDChart::Chart ∗ KDChart::AbstractCoordinatePlane::parent ()

Definition at line 187 of file KDChartAbstractCoordinatePlane.cpp.


References d.
Referenced by KDChart::CartesianAxis::maximumSize(), and KDChart::CartesianAxis::paintCtx().

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


106 KD Chart 2 Class Documentation

188 {
189 return d->parent;
190 }

6.6.3.32 void AbstractArea::positionHasChanged () [protected, virtual, inherited]

Reimplemented from KDChart::AbstractAreaBase.


Definition at line 110 of file KDChartAbstractArea.cpp.

111 {
112 emit positionChanged( this );
113 }

6.6.3.33 void KDChart::AbstractCoordinatePlane::propertiesChanged ()

Emitted upon change of a property of the Coordinate Plane or any of its components.
Referenced by KDChart::CartesianCoordinatePlane::addDiagram(), KDChart::Cartesian-
CoordinatePlane::setAxesCalcModes(), KDChart::CartesianCoordinatePlane::setAxesCalcModeX(),
KDChart::CartesianCoordinatePlane::setAxesCalcModeY(), KDChart::PolarCoordinatePlane::set-
GridAttributes(), KDChart::CartesianCoordinatePlane::setGridAttributes(), KDChart::Cartesian-
CoordinatePlane::setHorizontalRange(), KDChart::CartesianCoordinatePlane::setIsometricScaling(),
KDChart::CartesianCoordinatePlane::setVerticalRange(), KDChart::CartesianCoordinatePlane::setZoom-
Center(), KDChart::CartesianCoordinatePlane::setZoomFactorX(), and KDChart::CartesianCoordinate-
Plane::setZoomFactorY().

6.6.3.34 AbstractCoordinatePlane ∗ KDChart::AbstractCoordinatePlane::referenceCoordinate-


Plane () const

There are two ways, in which planes can be caused to interact, in where they are put layouting wise: The
first is the reference plane.
If such a reference plane is set, on a plane, it will use the same cell in the layout as that one. In addition
to this, planes can share an axis. In that case they will be layed out in relation to each other as suggested
by the position of the axis. If, for example Plane1 and Plane2 share an axis at position Left, that will result
in the layout: Axis Plane1 Plane 2, vertically. If Plane1 also happens to be Plane2’s reference plane, both
planes are drawn over each other. The reference plane concept allows two planes to share the same space
even if neither has any axis, and in case there are shared axis, it is used to decided, whether the planes
should be painted on top of each other or layed out vertically or horizontally next to each other.

Returns:
The reference coordinate plane associated with this one.

Definition at line 172 of file KDChartAbstractCoordinatePlane.cpp.


References d.

173 {
174 return d->referenceCoordinatePlane;
175 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.6 KDChart::AbstractCoordinatePlane Class Reference 107

6.6.3.35 void KDChart::AbstractCoordinatePlane::relayout ()

Calling relayout() on the plane triggers the global KDChart::Chart::slotRelayout().


Definition at line 248 of file KDChartAbstractCoordinatePlane.cpp.
References needRelayout().

249 {
250 //qDebug("KDChart::AbstractCoordinatePlane::relayout() called");
251 emit needRelayout();
252 }

6.6.3.36 void KDChart::AbstractLayoutItem::removeFromParentLayout () [inherited]

Definition at line 66 of file KDChartLayoutItems.h.


Referenced by KDChart::Chart::takeCoordinatePlane().

67 {
68 if( mParentLayout ){
69 if( widget() )
70 mParentLayout->removeWidget( widget() );
71 else
72 mParentLayout->removeItem( this );
73 }
74 }

6.6.3.37 void AbstractCoordinatePlane::replaceDiagram (AbstractDiagram ∗ diagram,


AbstractDiagram ∗ oldDiagram = 0) [virtual]

Replaces the old diagram, or appends the diagram, it there is none yet.

Parameters:
diagram The diagram to be used instead of the old diagram. This parameter must not be zero, or the
method will do nothing.
oldDiagram The diagram to be removed by the new diagram. This diagram will be deleted automat-
ically. If the parameter is omitted, the very first diagram will be replaced. In case, there was no
diagram yet, the new diagram will just be added.

Note:
If you want to re-use the old diagram, call takeDiagram and addDiagram, instead of using replace-
Diagram.

See also:
addDiagram, takeDiagram

Definition at line 82 of file KDChartAbstractCoordinatePlane.cpp.


References addDiagram(), d, layoutDiagrams(), layoutPlanes(), and takeDiagram().

83 {
84 if( diagram && oldDiagram_ != diagram ){
85 AbstractDiagram* oldDiagram = oldDiagram_;

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


108 KD Chart 2 Class Documentation

86 if( d->diagrams.count() ){
87 if( ! oldDiagram )
88 oldDiagram = d->diagrams.first();
89 takeDiagram( oldDiagram );
90 }
91 delete oldDiagram;
92 addDiagram( diagram );
93 layoutDiagrams();
94 layoutPlanes(); // there might be new axes, etc
95 update();
96 }
97 }

6.6.3.38 void AbstractAreaBase::setBackgroundAttributes (const BackgroundAttributes & a)


[inherited]

Definition at line 92 of file KDChartAbstractAreaBase.cpp.


References d.

93 {
94 d->backgroundAttributes = a;
95 }

6.6.3.39 void AbstractAreaBase::setFrameAttributes (const FrameAttributes & a)


[inherited]

Definition at line 82 of file KDChartAbstractAreaBase.cpp.


References d.
Referenced by KDChart::Legend::clone().

83 {
84 d->frameAttributes = a;
85 }

6.6.3.40 void KDChart::AbstractCoordinatePlane::setGeometry (const QRect & r) [virtual]

pure virtual in QLayoutItem

Note:
Do not call this function directly, unless you know exactly what you are doing. Geometry management
is done by KD Chart’s internal layouting measures.

Definition at line 227 of file KDChartAbstractCoordinatePlane.cpp.


References d.

228 {
229 // qDebug() << "KDChart::AbstractCoordinatePlane::setGeometry(" << r << ") called";
230 if( d->geometry != r ){
231 d->geometry = r;
232 // Note: We do *not* call update() here
233 // because it would invoke KDChart::update() recursively.
234 }
235 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.6 KDChart::AbstractCoordinatePlane Class Reference 109

6.6.3.41 void KDChart::AbstractCoordinatePlane::setGlobalGridAttributes (const


GridAttributes &)

Set the grid attributes to be used by this coordinate plane.


To disable grid painting, for example, your code should like this:

GridAttributes ga = plane->globalGridAttributes();
ga.setGlobalGridVisible( false );
plane->setGlobalGridAttributes( ga );

See also:
globalGridAttributes
CartesianCoordinatePlane::setGridAttributes

Definition at line 151 of file KDChartAbstractCoordinatePlane.cpp.


References d.

152 {
153 d->gridAttributes = a;
154 update();
155 }

6.6.3.42 void KDChart::AbstractCoordinatePlane::setParent (Chart ∗ parent)

Called internally by KDChart::Chart.


Definition at line 177 of file KDChartAbstractCoordinatePlane.cpp.
References d.
Referenced by KDChart::Chart::addCoordinatePlane(), and KDChart::Chart::takeCoordinatePlane().

178 {
179 d->parent = parent;
180 }

6.6.3.43 void KDChart::AbstractLayoutItem::setParentLayout (QLayout ∗ lay) [inherited]

Definition at line 62 of file KDChartLayoutItems.h.

63 {
64 mParentLayout = lay;
65 }

6.6.3.44 void KDChart::AbstractLayoutItem::setParentWidget (QWidget ∗ widget) [virtual,


inherited]

Inform the item about its widget: This enables the item, to trigger that widget’s update, whenever the size
of the item’s contents has changed.
Thus, you need to call setParentWidget on every item, that has a non-fixed size.

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


110 KD Chart 2 Class Documentation

Definition at line 56 of file KDChartLayoutItems.cpp.


References KDChart::AbstractLayoutItem::mParent.
Referenced by KDChart::Legend::buildLegend(), and KDChart::AbstractCartesianDiagram::takeAxis().

57 {
58 mParent = widget;
59 }

6.6.3.45 void KDChart::AbstractCoordinatePlane::setReferenceCoordinatePlane


(AbstractCoordinatePlane ∗ plane)

Set another coordinate plane to be used as the reference plane for this one.

Parameters:
plane The coordinate plane to be used the reference plane for this one.

See also:
referenceCoordinatePlane

Definition at line 167 of file KDChartAbstractCoordinatePlane.cpp.


References d.

168 {
169 d->referenceCoordinatePlane = plane;
170 }

6.6.3.46 virtual void KDChart::AbstractCoordinatePlane::setZoomCenter (QPointF)


[virtual]

Set the point (in value coordinates) to be used as the center point in zoom operations.

Parameters:
center The point to use.

Reimplemented in KDChart::CartesianCoordinatePlane, and KDChart::PolarCoordinatePlane.


Definition at line 172 of file KDChartAbstractCoordinatePlane.h.

172 :
* \code

6.6.3.47 virtual void KDChart::AbstractCoordinatePlane::setZoomFactorX (double)


[virtual]

Sets the zoom factor in horizontal direction, that is applied to all coordinate transformations.
Reimplemented in KDChart::CartesianCoordinatePlane, and KDChart::PolarCoordinatePlane.
Definition at line 153 of file KDChartAbstractCoordinatePlane.h.

155 {}

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.6 KDChart::AbstractCoordinatePlane Class Reference 111

6.6.3.48 virtual void KDChart::AbstractCoordinatePlane::setZoomFactorY (double)


[virtual]

Sets the zoom factor in vertical direction, that is applied to all coordinate transformations.
Reimplemented in KDChart::CartesianCoordinatePlane, and KDChart::PolarCoordinatePlane.
Definition at line 159 of file KDChartAbstractCoordinatePlane.h.

161 { return QPointF(0.0, 0.0); }

6.6.3.49 QSize KDChart::AbstractCoordinatePlane::sizeHint () const [virtual]

pure virtual in QLayoutItem


Definition at line 220 of file KDChartAbstractCoordinatePlane.cpp.
References maximumSize().

221 {
222 // we return our maxiumu (which is the full size of the Chart)
223 // even if we know the plane will be smaller
224 return maximumSize();
225 }

6.6.3.50 void KDChart::AbstractLayoutItem::sizeHintChanged () const [virtual,


inherited]

Report changed size hint: ask the parent widget to recalculate the layout.
Definition at line 73 of file KDChartLayoutItems.cpp.
Referenced by KDChart::TextLayoutItem::sizeHint().

74 {
75 // This is exactly like what QWidget::updateGeometry does.
76 // qDebug("KDChart::AbstractLayoutItem::sizeHintChanged() called");
77 if( mParent ) {
78 if ( mParent->layout() )
79 mParent->layout()->invalidate();
80 else
81 QApplication::postEvent( mParent, new QEvent( QEvent::LayoutRequest ) );
82 }
83 }

6.6.3.51 QSizePolicy KDChart::AbstractCoordinatePlane::sizePolicy () const [virtual]

[reimplemented]
Definition at line 146 of file KDChartAbstractCoordinatePlane.cpp.

147 {
148 return QSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding );
149 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


112 KD Chart 2 Class Documentation

6.6.3.52 void AbstractCoordinatePlane::takeDiagram (AbstractDiagram ∗ diagram)


[virtual]

Removes the diagram from the plane, without deleting it.


The plane no longer owns the diagram, so it is the caller’s responsibility to delete the diagram.

See also:
addDiagram, replaceDiagram

Definition at line 100 of file KDChartAbstractCoordinatePlane.cpp.


References d, layoutDiagrams(), and KDChart::AbstractDiagram::setCoordinatePlane().
Referenced by replaceDiagram().

101 {
102 const int idx = d->diagrams.indexOf( diagram );
103 if( idx != -1 ){
104 d->diagrams.removeAt( idx );
105 diagram->setParent( 0 );
106 diagram->setCoordinatePlane( 0 );
107 layoutDiagrams();
108 update();
109 }
110 }

6.6.3.53 virtual const QPointF KDChart::AbstractCoordinatePlane::translate (const QPointF &


diagramPoint) const [pure virtual]

Translate the given point in value space coordinates to a position in pixel space.

Parameters:
diagramPoint The point in value coordinates.

Returns:
The translated point.

Implemented in KDChart::CartesianCoordinatePlane, and KDChart::PolarCoordinatePlane.


Referenced by KDChart::BarDiagram::calculateDataBoundaries(), KDChart::PolarDiagram::paint(),
KDChart::LineDiagram::paint(), and KDChart::BarDiagram::paint().

6.6.3.54 virtual QPointF KDChart::AbstractCoordinatePlane::zoomCenter () const [virtual]

Returns:
The center point (in value coordinates) of the coordinate plane, that is used for zoom operations.

Reimplemented in KDChart::CartesianCoordinatePlane, and KDChart::PolarCoordinatePlane.


Definition at line 165 of file KDChartAbstractCoordinatePlane.h.

168 {}

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.6 KDChart::AbstractCoordinatePlane Class Reference 113

6.6.3.55 virtual double KDChart::AbstractCoordinatePlane::zoomFactorX () const [virtual]

Returns:
The zoom factor in horizontal direction, that is applied to all coordinate transformations.

Reimplemented in KDChart::CartesianCoordinatePlane, and KDChart::PolarCoordinatePlane.


Definition at line 141 of file KDChartAbstractCoordinatePlane.h.

143 { return 1.0; }

6.6.3.56 virtual double KDChart::AbstractCoordinatePlane::zoomFactorY () const [virtual]

Returns:
The zoom factor in vertical direction, that is applied to all coordinate transformations.

Reimplemented in KDChart::CartesianCoordinatePlane, and KDChart::PolarCoordinatePlane.


Definition at line 147 of file KDChartAbstractCoordinatePlane.h.

149 {}

6.6.4 Member Data Documentation

6.6.4.1 Q_SIGNALS KDChart::AbstractCoordinatePlane::__pad0__

Reimplemented from KDChart::AbstractArea.


Definition at line 284 of file KDChartAbstractCoordinatePlane.h.

6.6.4.2 QWidget∗ KDChart::AbstractLayoutItem::mParent [protected, inherited]

Definition at line 76 of file KDChartLayoutItems.h.


Referenced by KDChart::AbstractLayoutItem::setParentWidget().

6.6.4.3 QLayout∗ KDChart::AbstractLayoutItem::mParentLayout [protected,


inherited]

Definition at line 77 of file KDChartLayoutItems.h.

6.6.4.4 public KDChart::AbstractCoordinatePlane::Q_SLOTS

Reimplemented in KDChart::CartesianCoordinatePlane, and KDChart::PolarCoordinatePlane.


Definition at line 272 of file KDChartAbstractCoordinatePlane.h.
The documentation for this class was generated from the following files:

• KDChartAbstractCoordinatePlane.h
• KDChartAbstractCoordinatePlane.cpp

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


114 KD Chart 2 Class Documentation

6.7 KDChart::AbstractDiagram Class Reference


#include <KDChartAbstractDiagram.h>
Inheritance diagram for KDChart::AbstractDiagram:Collaboration diagram for KDChart::Abstract-
Diagram:

6.7.1 Detailed Description

AbstractDiagram defines the interface for diagram classes.


AbstractDiagram is the base class for diagram classes ("chart types").
It defines the interface, that needs to be implemented for the diagram, to function within the KDChart
framework. It extends Interview’s QAbstractItemView.
Definition at line 53 of file KDChartAbstractDiagram.h.

Public Member Functions


• bool allowOverlappingDataValueTexts () const
• bool antiAliasing () const
• virtual AttributesModel ∗ attributesModel () const
Returns the AttributesModel, that is used by this diagram.

• QBrush brush (const QModelIndex &index) const


Retrieve the brush to be used, for painting the datapoint at the given index in the model.

• QBrush brush (int dataset) const


Retrieve the brush to be used for the given dataset.

• QBrush brush () const


Retrieve the brush to be used for painting datapoints globally.

• AbstractCoordinatePlane ∗ coordinatePlane () const


The coordinate plane associated with the diagram.

• const QPair< QPointF, QPointF > dataBoundaries () const


Return the bottom left and top right data point, that the diagram will display (unless the grid adjusts these
values).

• virtual void dataChanged (const QModelIndex &topLeft, const QModelIndex &bottomRight)


[reimplemented]

• QList< QBrush > datasetBrushes () const


The set of dataset brushes currently used, for use in legends, etc.

• int datasetDimension () const


The dataset dimension of a diagram determines, how many value dimensions it expects each datapoint to
have.

• QStringList datasetLabels () const

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.7 KDChart::AbstractDiagram Class Reference 115

The set of dataset labels currently displayed, for use in legends, etc.

• QList< MarkerAttributes > datasetMarkers () const


The set of dataset markers currently used, for use in legends, etc.

• QList< QPen > datasetPens () const


The set of dataset pens currently used, for use in legends, etc.

• DataValueAttributes dataValueAttributes (const QModelIndex &index) const


Retrieve the DataValueAttributes for the given index.

• DataValueAttributes dataValueAttributes (int column) const


Retrieve the DataValueAttributes for the given dataset.

• DataValueAttributes dataValueAttributes () const


Retrieve the DataValueAttributes speficied globally.

• virtual void doItemsLayout ()


[reimplemented]

• virtual int horizontalOffset () const


[reimplemented]

• virtual QModelIndex indexAt (const QPoint &point) const


[reimplemented]

• virtual bool isIndexHidden (const QModelIndex &index) const


[reimplemented]

• QStringList itemRowLabels () const


The set of item row labels currently displayed, for use in Abscissa axes, etc.

• virtual QModelIndex moveCursor (CursorAction cursorAction, Qt::KeyboardModifiers modifiers)


[reimplemented]

• virtual void paintMarker (QPainter ∗painter, const MarkerAttributes &markerAttributes, const


QBrush &brush, const QPen &, const QPointF &point, const QSizeF &size)
• QPen pen (const QModelIndex &index) const
Retrieve the pen to be used, for painting the datapoint at the given index in the model.

• QPen pen (int dataset) const


Retrieve the pen to be used for the given dataset.

• QPen pen () const


Retrieve the pen to be used for painting datapoints globally.

• bool percentMode () const


• virtual void resize (const QSizeF &area)=0
Called by the widget’s sizeEvent.

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


116 KD Chart 2 Class Documentation

• virtual void scrollTo (const QModelIndex &index, ScrollHint hint=EnsureVisible)


[reimplemented]

• void setAllowOverlappingDataValueTexts (bool allow)


Set whether data value labels are allowed to overlap.

• void setAntiAliasing (bool enabled)


Set whether anti-aliasing is to be used while rendering this diagram.

• virtual void setAttributesModel (AttributesModel ∗model)


Associate an AttributesModel with this diagram.

• void setBrush (const QBrush &brush)


Set the brush to be used, for painting all datasets in the model.

• void setBrush (int dataset, const QBrush &brush)


Set the brush to be used, for painting the given dataset.

• void setBrush (const QModelIndex &index, const QBrush &brush)


Set the brush to be used, for painting the datapoint at the given index.

• virtual void setCoordinatePlane (AbstractCoordinatePlane ∗plane)


Set the coordinate plane associated with the diagram.

• void setDatasetDimension (int dimension)


Sets the dataset dimension of the diagram.

• void setDataValueAttributes (const DataValueAttributes &a)


Set the DataValueAttributes for all datapoints in the model.

• void setDataValueAttributes (int dataset, const DataValueAttributes &a)


Set the DataValueAttributes for the given dataset.

• void setDataValueAttributes (const QModelIndex &index, const DataValueAttributes &a)


Set the DataValueAttributes for the given index.

• virtual void setModel (QAbstractItemModel ∗model)


Associate a model with the diagram.

• void setPen (const QPen &pen)


Set the pen to be used, for painting all datasets in the model.

• void setPen (int dataset, const QPen &pen)


Set the pen to be used, for painting the given dataset.

• void setPen (const QModelIndex &index, const QPen &pen)


Set the pen to be used, for painting the datapoint at the given index.

• void setPercentMode (bool percent)


• virtual void setRootIndex (const QModelIndex &idx)

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.7 KDChart::AbstractDiagram Class Reference 117

Set the root index in the model, where the diagram starts referencing data for display.

• virtual void setSelection (const QRect &rect, QItemSelectionModel::SelectionFlags command)


[reimplemented]

• void update () const


• void useDefaultColors ()
Set the palette to be used, for painting datasets to the default palette.

• void useRainbowColors ()
Set the palette to be used, for painting datasets to the rainbow palette.

• void useSubduedColors ()
Set the palette to be used, for painting datasets to the subdued palette.

• virtual int verticalOffset () const


[reimplemented]

• virtual QRect visualRect (const QModelIndex &index) const


[reimplemented]

• virtual QRegion visualRegionForSelection (const QItemSelection &selection) const


[reimplemented]

• virtual ∼AbstractDiagram ()

Protected Member Functions


• AbstractDiagram (QWidget ∗parent=0, AbstractCoordinatePlane ∗plane=0)
• AbstractDiagram (Private ∗p, QWidget ∗parent, AbstractCoordinatePlane ∗plane)
• QModelIndex attributesModelRootIndex () const
• virtual const QPair< QPointF, QPointF > calculateDataBoundaries () const=0
• virtual bool checkInvariants (bool justReturnTheStatus=false) const
• QModelIndex columnToIndex (int column) const
• void modelsChanged ()
This signal is emitted, when either the model or the AttributesModel is replaced.

• virtual void paint (PaintContext ∗paintContext)=0


Draw the diagram contents to the rectangle and painter, that are passed in as part of the paint context.

• void paintDataValueText (QPainter ∗painter, const QModelIndex &index, const QPointF &pos, dou-
ble value)
• virtual void paintDataValueTexts (QPainter ∗painter)
• void paintMarker (QPainter ∗painter, const QModelIndex &index, const QPointF &pos)
• virtual void paintMarkers (QPainter ∗painter)
• void propertiesChanged ()
Emitted upon change of a property of the Diagram.

• void setAttributesModelRootIndex (const QModelIndex &)


• void setDataBoundariesDirty () const

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


118 KD Chart 2 Class Documentation

• double valueForCell (int row, int column) const


Helper method, retrieving the data value (DisplayRole) for a given row and column.

Protected Attributes
• Q_SIGNALS __pad0__: void layoutChanged( AbstractDiagram∗ )

6.7.2 Constructor & Destructor Documentation

6.7.2.1 KDChart::AbstractDiagram::AbstractDiagram (Private ∗ p, QWidget ∗ parent,


AbstractCoordinatePlane ∗ plane) [explicit, protected]

6.7.2.2 AbstractDiagram::AbstractDiagram (QWidget ∗ parent = 0, AbstractCoordinatePlane ∗


plane = 0) [explicit, protected]

Definition at line 109 of file KDChartAbstractDiagram.cpp.

110 : QAbstractItemView ( parent ), _d( new Private() )


111 {
112 _d->init( plane );
113 }

6.7.2.3 AbstractDiagram::∼AbstractDiagram () [virtual]

Definition at line 115 of file KDChartAbstractDiagram.cpp.

116 {
117 delete _d;
118 }

6.7.3 Member Function Documentation

6.7.3.1 bool AbstractDiagram::allowOverlappingDataValueTexts () const

Returns:
Whether data value labels are allowed to overlap.

Definition at line 291 of file KDChartAbstractDiagram.cpp.


References d.

295 {

6.7.3.2 bool AbstractDiagram::antiAliasing () const

Returns:
Whether anti-aliasing is to be used for rendering this diagram.

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.7 KDChart::AbstractDiagram Class Reference 119

Definition at line 302 of file KDChartAbstractDiagram.cpp.


References d.
Referenced by KDChart::LineDiagram::paint().

306 {

6.7.3.3 AttributesModel ∗ AbstractDiagram::attributesModel () const [virtual]

Returns the AttributesModel, that is used by this diagram.


By default each diagram owns its own AttributesModel, which should never be deleted. Only if a user-
supplied AttributesModel has been set does the pointer returned here not belong to the diagram.

Returns:
The AttributesModel associated with the diagram.

See also:
setAttributesModel

Definition at line 180 of file KDChartAbstractDiagram.cpp.


References d.
Referenced by KDChart::RingDiagram::paint(), KDChart::PolarDiagram::paint(), and KDChart::Bar-
Diagram::setBarAttributes().

181 {
182 return d->attributesModel;
183 }

6.7.3.4 QModelIndex AbstractDiagram::attributesModelRootIndex () const [protected]

returns a QModelIndex pointing into the AttributesModel that corresponds to the root index of the diagram.
Definition at line 204 of file KDChartAbstractDiagram.cpp.
References d.
Referenced by KDChart::LineDiagram::calculateDataBoundaries(), KDChart::BarDiagram::calculate-
DataBoundaries(), KDChart::LineDiagram::numberOfAbscissaSegments(), KDChart::Bar-
Diagram::numberOfAbscissaSegments(), KDChart::LineDiagram::numberOfOrdinateSegments(),
KDChart::BarDiagram::numberOfOrdinateSegments(), KDChart::LineDiagram::paint(), KDChart::Bar-
Diagram::paint(), and valueForCell().

210 {

6.7.3.5 QBrush AbstractDiagram::brush (const QModelIndex & index) const

Retrieve the brush to be used, for painting the datapoint at the given index in the model.

Parameters:
index The index of the datapoint in the model.

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


120 KD Chart 2 Class Documentation

Returns:
The brush to use for painting.

Definition at line 632 of file KDChartAbstractDiagram.cpp.

638 :
QRect AbstractDiagram::visualRect(const QModelIndex &) const

6.7.3.6 QBrush AbstractDiagram::brush (int dataset) const

Retrieve the brush to be used for the given dataset.


This will fall back automatically to what was set at model level, if there are no dataset specific settings.

Parameters:
dataset The dataset to retrieve the brush for.

Returns:
The brush to use for painting.

Definition at line 624 of file KDChartAbstractDiagram.cpp.

631 {

6.7.3.7 QBrush AbstractDiagram::brush () const

Retrieve the brush to be used for painting datapoints globally.


This will fall back automatically to the default settings, if there are no specific settings.

Returns:
The brush to use for painting.

Definition at line 618 of file KDChartAbstractDiagram.cpp.


Referenced by KDChart::PieDiagram::paint(), and paintMarker().

623 {

6.7.3.8 virtual const QPair<QPointF, QPointF> KDChart::AbstractDiagram::calculateData-


Boundaries () const [protected, pure virtual]

Implemented in KDChart::BarDiagram, KDChart::LineDiagram, KDChart::PieDiagram, KDChart::Polar-


Diagram, and KDChart::RingDiagram.
Referenced by dataBoundaries().

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.7 KDChart::AbstractDiagram Class Reference 121

6.7.3.9 bool AbstractDiagram::checkInvariants (bool justReturnTheStatus = false) const


[protected, virtual]

Definition at line 746 of file KDChartAbstractDiagram.cpp.


References coordinatePlane().
Referenced by KDChart::RingDiagram::calculateDataBoundaries(), KDChart::PolarDiagram::calculate-
DataBoundaries(), KDChart::PieDiagram::calculateDataBoundaries(), KDChart::LineDiagram::calculate-
DataBoundaries(), KDChart::BarDiagram::calculateDataBoundaries(), KDChart::RingDiagram::paint(),
KDChart::PolarDiagram::paint(), KDChart::PieDiagram::paint(), KDChart::LineDiagram::paint(),
KDChart::BarDiagram::paint(), and paintMarker().

746 {
747 Q_ASSERT_X ( model(), "AbstractDiagram::checkInvariants()",
748 "There is no usable model set, for the diagram." );
749
750 Q_ASSERT_X ( coordinatePlane(), "AbstractDiagram::checkInvariants()",
751 "There is no usable coordinate plane set, for the diagram." );
752 }
753 return model() && coordinatePlane();
754 }
755
756 int AbstractDiagram::datasetDimension( ) const

6.7.3.10 QModelIndex AbstractDiagram::columnToIndex (int column) const [protected]

Definition at line 211 of file KDChartAbstractDiagram.cpp.

217 {

6.7.3.11 AbstractCoordinatePlane ∗ AbstractDiagram::coordinatePlane () const

The coordinate plane associated with the diagram.


This determines how coordinates in value space are mapped into pixel space. By default this is a Cartesian-
CoordinatePlane.

Returns:
The coordinate plane associated with the diagram.

Definition at line 125 of file KDChartAbstractDiagram.cpp.


References d.
Referenced by KDChart::BarDiagram::calculateDataBoundaries(), checkInvariants(), KDChart::Abstract-
CartesianDiagram::layoutPlanes(), KDChart::PolarDiagram::paint(), KDChart::LineDiagram::paint(),
KDChart::BarDiagram::paint(), KDChart::AbstractPolarDiagram::polarCoordinatePlane(), and
KDChart::AbstractCartesianDiagram::setCoordinatePlane().

126 {
127 return d->plane;
128 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


122 KD Chart 2 Class Documentation

6.7.3.12 const QPair< QPointF, QPointF > AbstractDiagram::dataBoundaries () const

Return the bottom left and top right data point, that the diagram will display (unless the grid adjusts these
values).
This method returns a chached result of calculations done by calculateDataBoundaries. Classes derived
from AbstractDiagram must implement the calculateDataBoundaries function, to specify their own way of
calculating the data boundaries. If derived classes want to force recalculation of the data boundaries, they
can call setDataBoundariesDirty()
Returned value is in diagram coordinates.
Definition at line 130 of file KDChartAbstractDiagram.cpp.
References calculateDataBoundaries(), and d.
Referenced by KDChart::CartesianCoordinatePlane::calculateRawDataBoundingRect(), KDChart::Polar-
CoordinatePlane::layoutDiagrams(), KDChart::LineDiagram::paint(), and KDChart::BarDiagram::paint().

131 {
132 if( d->databoundariesDirty ){
133 d->databoundaries = calculateDataBoundaries ();
134 d->databoundariesDirty = false;
135 }
136 return d->databoundaries;
137 }

6.7.3.13 void AbstractDiagram::dataChanged (const QModelIndex & topLeft, const QModelIndex


& bottomRight) [virtual]

[reimplemented]
Definition at line 232 of file KDChartAbstractDiagram.cpp.
References d.

232 {
233 // We are still too dumb to do intelligent updates...
234 d->databoundariesDirty = true;
235 scheduleDelayedItemsLayout();
236 }
237
238 void AbstractDiagram::setDataValueAttributes( const QModelIndex & index,

6.7.3.14 QList< QBrush > AbstractDiagram::datasetBrushes () const

The set of dataset brushes currently used, for use in legends, etc.

Note:
Cell-level override brushes, if set, take precedence over the dataset values, so you might need to check
these too, in order to find the brush, that is used for a single cell.

Returns:
The current set of dataset brushes.

Definition at line 710 of file KDChartAbstractDiagram.cpp.


Referenced by KDChart::Legend::buildLegend(), KDChart::Legend::datasetCount(), and
KDChart::Legend::setBrushesFromDiagram().

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.7 KDChart::AbstractDiagram Class Reference 123

712 {
713 QBrush brush = qVariantValue<QBrush>( attributesModel()->headerData( i, Qt::Vertical, DatasetB
714 ret << brush;
715 }
716
717 return ret;
718 }
719
720 QList<QPen> AbstractDiagram::datasetPens() const

6.7.3.15 int AbstractDiagram::datasetDimension () const

The dataset dimension of a diagram determines, how many value dimensions it expects each datapoint to
have.
For each dimension it will expect one column of values in the model. If the dimensionality is 1, automatic
values will be used for the abscissa.
For example a diagram with the default dimension of 1, will have one column per datapoint (the y values)
and will use automatic values for the x axis (1, 2, 3, ... n). If the dimension is 2, the diagram will use the
first, (and the third, fifth, etc) columns as X values, and the second, (and the fourth, sixth, etc) column as Y
values.

Returns:
The dataset dimension of the diagram.

Definition at line 758 of file KDChartAbstractDiagram.cpp.


References d.
Referenced by KDChart::LineDiagram::calculateDataBoundaries(), KDChart::LineDiagram::get-
CellValues(), KDChart::CartesianCoordinatePlane::getDataDimensionsList(), KDChart::Line-
Diagram::paint(), and KDChart::LineDiagram::setType().

762 {

6.7.3.16 QStringList AbstractDiagram::datasetLabels () const

The set of dataset labels currently displayed, for use in legends, etc.

Returns:
The set of dataset labels currently displayed.

Definition at line 698 of file KDChartAbstractDiagram.cpp.


Referenced by KDChart::Legend::buildLegend(), and KDChart::Legend::datasetCount().

699 : " << attributesModel()->columnCount(attributesModel


700 const int columnCount = attributesModel()->columnCount(attributesModelRootIndex());
701 for( int i = datasetDimension()-1; i < columnCount; i += datasetDimension() ){
702 //qDebug() << "label: " << attributesModel()->headerData( i, Qt::Horizontal, Qt::DisplayRole )
703 ret << attributesModel()->headerData( i, Qt::Horizontal, Qt::DisplayRole ).toString();
704 }
705 return ret;
706 }
707
708 QList<QBrush> AbstractDiagram::datasetBrushes() const

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


124 KD Chart 2 Class Documentation

6.7.3.17 QList< MarkerAttributes > AbstractDiagram::datasetMarkers () const

The set of dataset markers currently used, for use in legends, etc.

Note:
Cell-level override markers, if set, take precedence over the dataset values, so you might need to check
these too, in order to find the marker, that is shown for a single cell.

Returns:
The current set of dataset brushes.

Definition at line 733 of file KDChartAbstractDiagram.cpp.


Referenced by KDChart::Legend::buildLegend().

735 {
736 DataValueAttributes a =
737 qVariantValue<DataValueAttributes>( attributesModel()->headerData( i, Qt::Vertical, DataVa
738 const MarkerAttributes &ma = a.markerAttributes();
739 ret << ma;
740 }
741 return ret;
742 }
743
744 bool AbstractDiagram::checkInvariants( bool justReturnTheStatus ) const

6.7.3.18 QList< QPen > AbstractDiagram::datasetPens () const

The set of dataset pens currently used, for use in legends, etc.

Note:
Cell-level override pens, if set, take precedence over the dataset values, so you might need to check
these too, in order to find the pens, that is used for a single cell.

Returns:
The current set of dataset pens.

Definition at line 722 of file KDChartAbstractDiagram.cpp.


Referenced by KDChart::Legend::buildLegend().

724 {
725 QPen pen = qVariantValue<QPen>( attributesModel()->headerData( i, Qt::Vertical, DatasetPenRole
726 ret << pen;
727 }
728 return ret;
729 }
730
731 QList<MarkerAttributes> AbstractDiagram::datasetMarkers() const

6.7.3.19 DataValueAttributes AbstractDiagram::dataValueAttributes (const QModelIndex &


index) const

Retrieve the DataValueAttributes for the given index.


This will fall back automatically to what was set at dataset or model level, if there are no datapoint specific
settings.

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.7 KDChart::AbstractDiagram Class Reference 125

Parameters:
index The datapoint to retrieve the attributes for.

Returns:
The DataValueAttributes for the given index.

Definition at line 272 of file KDChartAbstractDiagram.cpp.

278 {

6.7.3.20 DataValueAttributes AbstractDiagram::dataValueAttributes (int column) const

Retrieve the DataValueAttributes for the given dataset.


This will fall back automatically to what was set at model level, if there are no dataset specific settings.

Parameters:
dataset The dataset to retrieve the attributes for.
Returns:
The DataValueAttributes for the given dataset.

Definition at line 265 of file KDChartAbstractDiagram.cpp.

271 {

6.7.3.21 DataValueAttributes AbstractDiagram::dataValueAttributes () const

Retrieve the DataValueAttributes speficied globally.


This will fall back automatically to the default settings, if there are no specific settings.

Returns:
The global DataValueAttributes.

Definition at line 260 of file KDChartAbstractDiagram.cpp.


Referenced by paintDataValueText(), and paintMarker().

264 {

6.7.3.22 void AbstractDiagram::doItemsLayout () [virtual]

[reimplemented]
Definition at line 223 of file KDChartAbstractDiagram.cpp.
References d, and update().

223 {
224 d->plane->layoutDiagrams();
225 update();
226 }
227 QAbstractItemView::doItemsLayout();
228 }
229
230 void AbstractDiagram::dataChanged( const QModelIndex &topLeft,

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


126 KD Chart 2 Class Documentation

6.7.3.23 int AbstractDiagram::horizontalOffset () const [virtual]

[reimplemented]
Definition at line 655 of file KDChartAbstractDiagram.cpp.

657 { return 0; }

6.7.3.24 QModelIndex AbstractDiagram::indexAt (const QPoint & point) const [virtual]

[reimplemented]
Definition at line 649 of file KDChartAbstractDiagram.cpp.

651 { return QModelIndex(); }

6.7.3.25 bool AbstractDiagram::isIndexHidden (const QModelIndex & index) const [virtual]

[reimplemented]
Definition at line 661 of file KDChartAbstractDiagram.cpp.

663 {}

6.7.3.26 QStringList AbstractDiagram::itemRowLabels () const

The set of item row labels currently displayed, for use in Abscissa axes, etc.

Returns:
The set of item row labels currently displayed.

Definition at line 686 of file KDChartAbstractDiagram.cpp.

687 : " << attributesModel()->rowCount(attributesModelRoo


688 const int rowCount = attributesModel()->rowCount(attributesModelRootIndex());
689 for( int i = 0; i < rowCount; ++i ){
690 //qDebug() << "label: " << attributesModel()->headerData( i, Qt::Vertical, Qt::DisplayRole ).t
691 ret << attributesModel()->headerData( i, Qt::Vertical, Qt::DisplayRole ).toString();
692 }
693 return ret;
694 }
695
696 QStringList AbstractDiagram::datasetLabels() const

6.7.3.27 void KDChart::AbstractDiagram::modelsChanged () [protected]

This signal is emitted, when either the model or the AttributesModel is replaced.
Referenced by setAttributesModel(), and setModel().

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.7 KDChart::AbstractDiagram Class Reference 127

6.7.3.28 QModelIndex AbstractDiagram::moveCursor (CursorAction cursorAction,


Qt::KeyboardModifiers modifiers) [virtual]

[reimplemented]
Definition at line 652 of file KDChartAbstractDiagram.cpp.

654 { return 0; }

6.7.3.29 virtual void KDChart::AbstractDiagram::paint (PaintContext ∗ paintContext)


[protected, pure virtual]

Draw the diagram contents to the rectangle and painter, that are passed in as part of the paint context.

Parameters:
paintContext All information needed for painting.

Implemented in KDChart::BarDiagram, KDChart::LineDiagram, KDChart::PieDiagram, KDChart::Polar-


Diagram, and KDChart::RingDiagram.

6.7.3.30 void AbstractDiagram::paintDataValueText (QPainter ∗ painter, const QModelIndex &


index, const QPointF & pos, double value) [protected]

Definition at line 318 of file KDChartAbstractDiagram.cpp.


References KDChart::DataValueAttributes::dataLabel(), dataValueAttributes(), KDChart::DataValue-
Attributes::decimalDigits(), KDChart::TextAttributes::font(), KDChart::TextAttributes::isVisible(),
KDChart::DataValueAttributes::isVisible(), KDChart::TextAttributes::pen(), KDChart::DataValue-
Attributes::prefix(), KDChart::TextAttributes::rotation(), KDChart::DataValueAttributes::suffix(), and
KDChart::DataValueAttributes::textAttributes().
Referenced by KDChart::RingDiagram::paint(), KDChart::PolarDiagram::paint(), KDChart::Line-
Diagram::paint(), and KDChart::BarDiagram::paint().

320 {
321 // paint one data series
322 DataValueAttributes a = dataValueAttributes(index);
323 if ( !a.isVisible() ) return;
324
325 // handle decimal digits
326 int decimalDigits = a.decimalDigits();
327 int decimalPos = QString::number( value ).indexOf( QLatin1Char( ’.’ ) );
328 QString roundedValue;
329 if ( a.dataLabel().isNull() ) {
330 if ( decimalPos > 0 && value != 0 )
331 roundedValue = roundValues ( value, decimalPos, decimalDigits );
332 else
333 roundedValue = QString::number( value );
334 } else
335 roundedValue = a.dataLabel();
336 // handle prefix and suffix
337 if ( !a.prefix().isNull() )
338 roundedValue.prepend( a.prefix() );
339
340 if ( !a.suffix().isNull() )
341 roundedValue.append( a.suffix() );
342

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


128 KD Chart 2 Class Documentation

343 PainterSaver painterSaver( painter );


344 // FIXME draw the non-text bits, background, etc
345 const TextAttributes &ta = a.textAttributes();
346 if ( ta.isVisible() ) {
347 painter->setPen( ta.pen() );
348 painter->setFont( ta.font() );
349 painter->translate( pos );
350 painter->rotate( ta.rotation() );
351 painter->drawText( QPointF(0, 0), roundedValue );
352 }
353 }
354
355 QString AbstractDiagram::roundValues( double value,

6.7.3.31 void AbstractDiagram::paintDataValueTexts (QPainter ∗ painter) [protected,


virtual]

Definition at line 382 of file KDChartAbstractDiagram.cpp.

385 {
386 for ( int j=0; j< rowCount; ++j ) {
387 const QModelIndex index = model()->index( j, i, rootIndex() );
388 double value = model()->data( index ).toDouble();
389 const QPointF pos = coordinatePlane()->translate( QPointF( j, value ) );
390 paintDataValueText( painter, index, pos, value );
391 }
392 }
393 }
394
395

6.7.3.32 void AbstractDiagram::paintMarker (QPainter ∗ painter, const QModelIndex & index,


const QPointF & pos) [protected]

Definition at line 398 of file KDChartAbstractDiagram.cpp.


References brush(), checkInvariants(), dataValueAttributes(), KDChart::MarkerAttributes::isVisible(),
KDChart::DataValueAttributes::isVisible(), KDChart::DataValueAttributes::markerAttributes(),
KDChart::MarkerAttributes::markerColor(), KDChart::MarkerAttributes::markerSize(), paintMarker(),
and KDChart::MarkerAttributes::pen().

399 {
400
401 if ( !checkInvariants() ) return;
402 DataValueAttributes a = dataValueAttributes(index);
403 if ( !a.isVisible() ) return;
404 const MarkerAttributes &ma = a.markerAttributes();
405 if ( !ma.isVisible() ) return;
406
407 PainterSaver painterSaver( painter );
408 QSizeF maSize( ma.markerSize() );
409 QBrush indexBrush( brush( index ) );
410 QPen indexPen( ma.pen() );
411 if ( ma.markerColor().isValid() )
412 indexBrush.setColor( ma.markerColor() );
413
414 paintMarker( painter, ma, indexBrush, indexPen, pos, maSize );
415 }
416
417

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.7 KDChart::AbstractDiagram Class Reference 129

6.7.3.33 void AbstractDiagram::paintMarker (QPainter ∗ painter, const MarkerAttributes &


markerAttributes, const QBrush & brush, const QPen &, const QPointF & point, const
QSizeF & size) [virtual]

Definition at line 420 of file KDChartAbstractDiagram.cpp.


References KDChart::MarkerAttributes::markerStyle().
Referenced by KDChart::LineDiagram::paint(), KDChart::MarkerLayoutItem::paint(), and paintMarker().

424 {
425 PainterSaver painterSaver( painter );
426 painter->setBrush( brush );
427 painter->setPen( pen );
428 painter->setRenderHint ( QPainter::Antialiasing );
429 painter->translate( pos );
430 switch ( markerAttributes.markerStyle() ) {
431 case MarkerAttributes::MarkerCircle:
432 painter->drawEllipse( QRectF( 0 - maSize.height()/2, 0 - maSize.width()/2,
433 maSize.height(), maSize.width()) );
434 break;
435 case MarkerAttributes::MarkerSquare:
436 {
437 QRectF rect( 0 - maSize.height()/2, 0 - maSize.width()/2,
438 maSize.height(), maSize.width() );
439 painter->drawRect( rect );
440 painter->fillRect( rect, painter->brush() );
441 break;
442 }
443 case MarkerAttributes::MarkerDiamond:
444 {
445 QVector <QPointF > diamondPoints;
446 QPointF top, left, bottom, right;
447 top = QPointF( 0, 0 - maSize.height()/2 );
448 left = QPointF( 0 - maSize.width()/2, 0 );
449 bottom = QPointF( 0, maSize.height()/2 );
450 right = QPointF( maSize.width()/2, 0 );
451 diamondPoints << top << left << bottom << right;
452 painter->drawPolygon( diamondPoints );
453 break;
454 }
455 //Pending Michel: do we need that? Ask: What is the idea about
456 // Marker1Pixel and Marker4Pixels.
457 case MarkerAttributes::Marker1Pixel:
458 {
459 QSizeF pSize(4,4);
460 QPen pen1Pixel;
461 pen1Pixel.setColor( painter->background().color() );
462 QRectF centerRect( -pSize.height()/2, -pSize.width()/2,
463 pSize.height(), pSize.width() );
464 painter->setPen( pen1Pixel );
465 painter->drawEllipse( centerRect );
466 break;
467 }
468 case MarkerAttributes::Marker4Pixels:
469 {
470 QSizeF pSize(8, 8);
471 QPen pen4Pixel;
472 pen4Pixel.setColor( painter->background().color() );
473 QRectF centerRect( -pSize.height()/2, -pSize.width()/2,
474 pSize.height(), pSize.width() );
475 painter->setPen( pen4Pixel );
476 painter->drawEllipse( centerRect );
477 break;
478 }
479 case MarkerAttributes::MarkerRing:

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


130 KD Chart 2 Class Documentation

480 {
481 painter->setBrush( Qt::NoBrush );
482 painter->drawEllipse( QRectF( 0 - maSize.height()/2, 0 - maSize.width()/2,
483 maSize.height(), maSize.width()) );
484 break;
485 }
486 case MarkerAttributes::MarkerCross:
487 {
488 QVector <QPointF > crossPoints;
489 QPointF leftTop, leftBottom, centerBottomLeft, bottomLeft, bottomRight,
490 centerBottomRight,rightBottom, rightTop, centerTopRight, topRight, topLeft,
491 centerTopLeft;
492 leftTop = QPointF( -maSize.width()/2, -maSize.height()/4 );
493 leftBottom = QPointF( -maSize.width()/2, maSize.height()/4 );
494 centerBottomLeft = QPointF( -maSize.width()/4, maSize.height()/4 );
495 bottomLeft = QPointF( -maSize.width()/4, maSize.height()/2 );
496 bottomRight = QPointF( maSize.width()/4, maSize.height()/2 );
497 centerBottomRight = QPointF( maSize.width()/4, maSize.height()/4 );
498 rightBottom = QPointF( maSize.width()/2, maSize.height()/4 );
499 rightTop = QPointF( maSize.width()/2, -maSize.height()/4 );
500 centerTopRight = QPointF( maSize.width()/4, -maSize.height()/4 );
501 topRight = QPointF( maSize.width()/4, -maSize.height()/2 );
502 topLeft = QPointF( -maSize.width()/4, -maSize.height()/2 );
503 centerTopLeft = QPointF( -maSize.width()/4, -maSize.height()/4 );
504
505 crossPoints << leftTop << leftBottom << centerBottomLeft
506 << bottomLeft << bottomRight << centerBottomRight
507 << rightBottom << rightTop << centerTopRight
508 << topRight << topLeft << centerTopLeft;
509
510 painter->drawPolygon( crossPoints );
511 break;
512 }
513 case MarkerAttributes::MarkerFastCross:
514 {
515 QPointF left, right, top, bottom;
516 left = QPointF( -maSize.width()/2, 0 );
517 right = QPointF( maSize.width()/2, 0 );
518 top = QPointF( 0, -maSize.height()/2 );
519 bottom= QPointF( 0, maSize.height()/2 );
520 painter->drawLine( left, right );
521 painter->drawLine( top, bottom );
522 break;
523 }
524 default:
525 Q_ASSERT_X ( false, "paintMarkers()",
526 "Type item does not match a defined Marker Type." );
527 }
528 }
529
530 void AbstractDiagram::paintMarkers( QPainter* painter )

6.7.3.34 void AbstractDiagram::paintMarkers (QPainter ∗ painter) [protected, virtual]

Definition at line 532 of file KDChartAbstractDiagram.cpp.

535 {
536 for ( int j=0; j< rowCount; ++j ) {
537 const QModelIndex index = model()->index( j, i, rootIndex() );
538 double value = model()->data( index ).toDouble();
539 const QPointF pos = coordinatePlane()->translate( QPointF( j, value ) );
540 paintMarker( painter, index, pos );
541 }
542 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.7 KDChart::AbstractDiagram Class Reference 131

543 }
544
545

6.7.3.35 QPen AbstractDiagram::pen (const QModelIndex & index) const

Retrieve the pen to be used, for painting the datapoint at the given index in the model.

Parameters:
index The index of the datapoint in the model.

Returns:
The pen to use for painting.

Definition at line 586 of file KDChartAbstractDiagram.cpp.

593 {

6.7.3.36 QPen AbstractDiagram::pen (int dataset) const

Retrieve the pen to be used for the given dataset.


This will fall back automatically to what was set at model level, if there are no dataset specific settings.

Parameters:
dataset The dataset to retrieve the pen for.

Returns:
The pen to use for painting.

Definition at line 578 of file KDChartAbstractDiagram.cpp.

585 {

6.7.3.37 QPen AbstractDiagram::pen () const

Retrieve the pen to be used for painting datapoints globally.


This will fall back automatically to the default settings, if there are no specific settings.

Returns:
The pen to use for painting.

Definition at line 572 of file KDChartAbstractDiagram.cpp.


Referenced by KDChart::PieDiagram::paint().

577 {

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


132 KD Chart 2 Class Documentation

6.7.3.38 bool AbstractDiagram::percentMode () const

Definition at line 313 of file KDChartAbstractDiagram.cpp.


References d.
Referenced by KDChart::CartesianCoordinatePlane::getDataDimensionsList().

320 {

6.7.3.39 void KDChart::AbstractDiagram::propertiesChanged () [protected]

Emitted upon change of a property of the Diagram.


Referenced by setDataValueAttributes(), KDChart::LineDiagram::setLineAttributes(), KDChart::Line-
Diagram::setThreeDLineAttributes(), and KDChart::LineDiagram::setType().

6.7.3.40 virtual void KDChart::AbstractDiagram::resize (const QSizeF & area) [pure


virtual]

Called by the widget’s sizeEvent.


Adjust all internal structures, that are calculated, dependending on the size of the widget.

Parameters:
area

Implemented in KDChart::BarDiagram, KDChart::LineDiagram, KDChart::PieDiagram, KDChart::Polar-


Diagram, and KDChart::RingDiagram.

6.7.3.41 void AbstractDiagram::scrollTo (const QModelIndex & index, ScrollHint hint =


EnsureVisible) [virtual]

[reimplemented]
Definition at line 646 of file KDChartAbstractDiagram.cpp.

648 { return QModelIndex(); }

6.7.3.42 void AbstractDiagram::setAllowOverlappingDataValueTexts (bool allow)

Set whether data value labels are allowed to overlap.

Parameters:
allow True means that overlapping labels are allowed.

Definition at line 285 of file KDChartAbstractDiagram.cpp.


References d.

290 {

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.7 KDChart::AbstractDiagram Class Reference 133

6.7.3.43 void AbstractDiagram::setAntiAliasing (bool enabled)

Set whether anti-aliasing is to be used while rendering this diagram.

Parameters:
enabled True means that AA is enabled.

Definition at line 296 of file KDChartAbstractDiagram.cpp.


References d.

301 {

6.7.3.44 void AbstractDiagram::setAttributesModel (AttributesModel ∗ model) [virtual]

Associate an AttributesModel with this diagram.


Note that the diagram does _not_ take ownership of the AttributesModel. This should thus only be used
with AttributesModels that have been explicitely created by the user, and are owned by her. Setting an
AttributesModel that is internal to another diagram is an error.
Correct:

AttributesModel *am = new AttributesModel( model, 0 );


diagram1->setAttributesModel( am );
diagram2->setAttributesModel( am );

Wrong:

diagram1->setAttributesModel( diagram2->attributesModel() );

Parameters:
model The AttributesModel to use for this diagram.

See also:
AttributesModel

Definition at line 160 of file KDChartAbstractDiagram.cpp.


References d, and modelsChanged().

161 {
162 if( amodel->sourceModel() != model() ) {
163 qWarning("KDChart::AbstractDiagram::setAttributesModel() failed: "
164 "Trying to set an attributesmodel which works on a different "
165 "model than the diagram.");
166 return;
167 }
168 if( qobject_cast<PrivateAttributesModel*>(amodel) ) {
169 qWarning("KDChart::AbstractDiagram::setAttributesModel() failed: "
170 "Trying to set an attributesmodel that is private to another diagram.");
171 return;
172 }
173 d->setAttributesModel(amodel);
174 scheduleDelayedItemsLayout();
175 d->databoundariesDirty = true;
176 emit modelsChanged();
177 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


134 KD Chart 2 Class Documentation

6.7.3.45 void AbstractDiagram::setAttributesModelRootIndex (const QModelIndex & idx)


[protected]

Definition at line 195 of file KDChartAbstractDiagram.cpp.


References d.

6.7.3.46 void AbstractDiagram::setBrush (const QBrush & brush)

Set the brush to be used, for painting all datasets in the model.

Parameters:
brush The brush to use.

Definition at line 602 of file KDChartAbstractDiagram.cpp.

608 {

6.7.3.47 void AbstractDiagram::setBrush (int dataset, const QBrush & brush)

Set the brush to be used, for painting the given dataset.

Parameters:
dataset The dataset’s column in the model.
pen The brush to use.

Definition at line 609 of file KDChartAbstractDiagram.cpp.

617 {

6.7.3.48 void AbstractDiagram::setBrush (const QModelIndex & index, const QBrush & brush)

Set the brush to be used, for painting the datapoint at the given index.

Parameters:
index The datapoint’s index in the model.
brush The brush to use.

Definition at line 594 of file KDChartAbstractDiagram.cpp.

601 {

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.7 KDChart::AbstractDiagram Class Reference 135

6.7.3.49 void AbstractDiagram::setCoordinatePlane (AbstractCoordinatePlane ∗ plane)


[virtual]

Set the coordinate plane associated with the diagram.


This determines how coordinates in value space are mapped into pixel space. The chart takes ownership.

Returns:
The coordinate plane associated with the diagram.

Reimplemented in KDChart::AbstractCartesianDiagram.
Definition at line 218 of file KDChartAbstractDiagram.cpp.
References d.
Referenced by KDChart::AbstractCoordinatePlane::addDiagram(), KDChart::AbstractCartesian-
Diagram::setCoordinatePlane(), and KDChart::AbstractCoordinatePlane::takeDiagram().

222 {

6.7.3.50 void AbstractDiagram::setDataBoundariesDirty () const [protected]

Definition at line 139 of file KDChartAbstractDiagram.cpp.


References d.
Referenced by KDChart::BarDiagram::setThreeDBarAttributes(), KDChart::LineDiagram::setThree-
DLineAttributes(), KDChart::LineDiagram::setType(), and KDChart::BarDiagram::setType().

140 {
141 d->databoundariesDirty = true;
142 }

6.7.3.51 void AbstractDiagram::setDatasetDimension (int dimension)

Sets the dataset dimension of the diagram.

See also:
datasetDimension.

Parameters:
dimension

Definition at line 763 of file KDChartAbstractDiagram.cpp.


References d.

770 {

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


136 KD Chart 2 Class Documentation

6.7.3.52 void AbstractDiagram::setDataValueAttributes (const DataValueAttributes & a)

Set the DataValueAttributes for all datapoints in the model.

Parameters:
a The attributes to set.

Definition at line 279 of file KDChartAbstractDiagram.cpp.


References d.

284 {

6.7.3.53 void AbstractDiagram::setDataValueAttributes (int dataset, const DataValueAttributes &


a)

Set the DataValueAttributes for the given dataset.

Parameters:
dataset The dataset to set the attributes for.
a The attributes to set.

Definition at line 251 of file KDChartAbstractDiagram.cpp.


References d.

259 {

6.7.3.54 void AbstractDiagram::setDataValueAttributes (const QModelIndex & index, const


DataValueAttributes & a)

Set the DataValueAttributes for the given index.

Parameters:
index The datapoint to set the attributes for.
a The attributes to set.

Definition at line 240 of file KDChartAbstractDiagram.cpp.


References d, KDChart::DataValueLabelAttributesRole, and propertiesChanged().

240 {
241 d->attributesModel->setData(
242 d->attributesModel->mapFromSource( index ),
243 qVariantFromValue( a ),
244 DataValueLabelAttributesRole );
245 emit propertiesChanged();
246 }
247
248

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.7 KDChart::AbstractDiagram Class Reference 137

6.7.3.55 void AbstractDiagram::setModel (QAbstractItemModel ∗ model) [virtual]

Associate a model with the diagram.


Definition at line 144 of file KDChartAbstractDiagram.cpp.
References d, KDChart::AttributesModel::initFrom(), and modelsChanged().

145 {
146 QAbstractItemView::setModel( newModel );
147 AttributesModel* amodel = new PrivateAttributesModel( newModel, this );
148 amodel->initFrom( d->attributesModel );
149 d->setAttributesModel(amodel);
150 scheduleDelayedItemsLayout();
151 d->databoundariesDirty = true;
152 emit modelsChanged();
153 }

6.7.3.56 void AbstractDiagram::setPen (const QPen & pen)

Set the pen to be used, for painting all datasets in the model.

Parameters:
pen The pen to use.

Definition at line 556 of file KDChartAbstractDiagram.cpp.

562 {

6.7.3.57 void AbstractDiagram::setPen (int dataset, const QPen & pen)

Set the pen to be used, for painting the given dataset.

Parameters:
dataset The dataset’s row in the model.
pen The pen to use.

Definition at line 563 of file KDChartAbstractDiagram.cpp.

571 {

6.7.3.58 void AbstractDiagram::setPen (const QModelIndex & index, const QPen & pen)

Set the pen to be used, for painting the datapoint at the given index.

Parameters:
index The datapoint’s index in the model.
pen The pen to use.

Definition at line 548 of file KDChartAbstractDiagram.cpp.

555 {

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


138 KD Chart 2 Class Documentation

6.7.3.59 void AbstractDiagram::setPercentMode (bool percent)

Definition at line 307 of file KDChartAbstractDiagram.cpp.


References d.
Referenced by KDChart::LineDiagram::setType(), and KDChart::BarDiagram::setType().

312 {

6.7.3.60 void AbstractDiagram::setRootIndex (const QModelIndex & idx) [virtual]

Set the root index in the model, where the diagram starts referencing data for display.
[reimplemented]
Definition at line 188 of file KDChartAbstractDiagram.cpp.
References d.

6.7.3.61 void AbstractDiagram::setSelection (const QRect & rect, QItemSelection-


Model::SelectionFlags command) [virtual]

[reimplemented]
Definition at line 664 of file KDChartAbstractDiagram.cpp.

666 { return QRegion(); }

6.7.3.62 void AbstractDiagram::update () const

Definition at line 777 of file KDChartAbstractDiagram.cpp.


References d.
Referenced by doItemsLayout().

6.7.3.63 void KDChart::AbstractDiagram::useDefaultColors ()

Set the palette to be used, for painting datasets to the default palette.

See also:
KDChart::Palette. FIXME: fold into one usePalette (KDChart::Palette&) method

Definition at line 671 of file KDChartAbstractDiagram.cpp.


References d.

675 {

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.7 KDChart::AbstractDiagram Class Reference 139

6.7.3.64 void KDChart::AbstractDiagram::useRainbowColors ()

Set the palette to be used, for painting datasets to the rainbow palette.

See also:
KDChart::Palette.

Definition at line 681 of file KDChartAbstractDiagram.cpp.


References d.

685 {

6.7.3.65 void KDChart::AbstractDiagram::useSubduedColors ()

Set the palette to be used, for painting datasets to the subdued palette.

See also:
KDChart::Palette.

Definition at line 676 of file KDChartAbstractDiagram.cpp.


References d.

680 {

6.7.3.66 double AbstractDiagram::valueForCell (int row, int column) const [protected]

Helper method, retrieving the data value (DisplayRole) for a given row and column.

Parameters:
row The row to query.
column The column to query.

Returns:
The value of the display role at the given row and column as a double.

Definition at line 771 of file KDChartAbstractDiagram.cpp.


References attributesModelRootIndex(), and d.
Referenced by KDChart::LineDiagram::paint().

776 {

6.7.3.67 int AbstractDiagram::verticalOffset () const [virtual]

[reimplemented]
Definition at line 658 of file KDChartAbstractDiagram.cpp.

660 { return true; }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


140 KD Chart 2 Class Documentation

6.7.3.68 QRect AbstractDiagram::visualRect (const QModelIndex & index) const [virtual]

[reimplemented]
Definition at line 641 of file KDChartAbstractDiagram.cpp.

645 {}

6.7.3.69 QRegion AbstractDiagram::visualRegionForSelection (const QItemSelection & selection)


const [virtual]

[reimplemented]
Definition at line 667 of file KDChartAbstractDiagram.cpp.

6.7.4 Member Data Documentation

6.7.4.1 Q_SIGNALS KDChart::AbstractDiagram::__pad0__ [protected]

Definition at line 506 of file KDChartAbstractDiagram.h.


The documentation for this class was generated from the following files:

• KDChartAbstractDiagram.h
• KDChartAbstractDiagram.cpp

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.8 KDChart::AbstractLayoutItem Class Reference 141

6.8 KDChart::AbstractLayoutItem Class Reference


#include <KDChartLayoutItems.h>
Inheritance diagram for KDChart::AbstractLayoutItem:Collaboration diagram for KDChart::Abstract-
LayoutItem:

Public Member Functions


• AbstractLayoutItem (Qt::Alignment itemAlignment=0)
• virtual void paint (QPainter ∗)=0
• virtual void paintCtx (PaintContext ∗context)
Default impl: Paint the complete item using its layouted position and size.

• void removeFromParentLayout ()
• void setParentLayout (QLayout ∗lay)
• virtual void setParentWidget (QWidget ∗widget)
Inform the item about its widget: This enables the item, to trigger that widget’s update, whenever the size
of the item’s contents has changed.

• virtual void sizeHintChanged () const


Report changed size hint: ask the parent widget to recalculate the layout.

Protected Attributes
• QWidget ∗ mParent
• QLayout ∗ mParentLayout

6.8.1 Constructor & Destructor Documentation

6.8.1.1 KDChart::AbstractLayoutItem::AbstractLayoutItem (Qt::Alignment itemAlignment = 0)

Definition at line 51 of file KDChartLayoutItems.h.

51 :
52 QLayoutItem( itemAlignment ),
53 mParent( 0 ),
54 mParentLayout( 0 ) {}

6.8.2 Member Function Documentation

6.8.2.1 virtual void KDChart::AbstractLayoutItem::paint (QPainter ∗) [pure virtual]

Implemented in KDChart::CartesianAxis, KDChart::CartesianCoordinatePlane, KDChart::TextLayout-


Item, KDChart::MarkerLayoutItem, KDChart::HorizontalLineLayoutItem, KDChart::VerticalLineLayout-
Item, and KDChart::PolarCoordinatePlane.
Referenced by KDChart::Legend::paint(), KDChart::AbstractArea::paintAll(), and paintCtx().

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


142 KD Chart 2 Class Documentation

6.8.2.2 void KDChart::AbstractLayoutItem::paintCtx (PaintContext ∗ context) [virtual]

Default impl: Paint the complete item using its layouted position and size.
Reimplemented in KDChart::CartesianAxis.
Definition at line 64 of file KDChartLayoutItems.cpp.
References paint(), and KDChart::PaintContext::painter().

65 {
66 if( context )
67 paint( context->painter() );
68 }

6.8.2.3 void KDChart::AbstractLayoutItem::removeFromParentLayout ()

Definition at line 66 of file KDChartLayoutItems.h.


Referenced by KDChart::Chart::takeCoordinatePlane().

67 {
68 if( mParentLayout ){
69 if( widget() )
70 mParentLayout->removeWidget( widget() );
71 else
72 mParentLayout->removeItem( this );
73 }
74 }

6.8.2.4 void KDChart::AbstractLayoutItem::setParentLayout (QLayout ∗ lay)

Definition at line 62 of file KDChartLayoutItems.h.

63 {
64 mParentLayout = lay;
65 }

6.8.2.5 void KDChart::AbstractLayoutItem::setParentWidget (QWidget ∗ widget) [virtual]

Inform the item about its widget: This enables the item, to trigger that widget’s update, whenever the size
of the item’s contents has changed.
Thus, you need to call setParentWidget on every item, that has a non-fixed size.
Definition at line 56 of file KDChartLayoutItems.cpp.
References mParent.
Referenced by KDChart::Legend::buildLegend(), and KDChart::AbstractCartesianDiagram::takeAxis().

57 {
58 mParent = widget;
59 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.8 KDChart::AbstractLayoutItem Class Reference 143

6.8.2.6 void KDChart::AbstractLayoutItem::sizeHintChanged () const [virtual]

Report changed size hint: ask the parent widget to recalculate the layout.
Definition at line 73 of file KDChartLayoutItems.cpp.
Referenced by KDChart::TextLayoutItem::sizeHint().

74 {
75 // This is exactly like what QWidget::updateGeometry does.
76 // qDebug("KDChart::AbstractLayoutItem::sizeHintChanged() called");
77 if( mParent ) {
78 if ( mParent->layout() )
79 mParent->layout()->invalidate();
80 else
81 QApplication::postEvent( mParent, new QEvent( QEvent::LayoutRequest ) );
82 }
83 }

6.8.3 Member Data Documentation

6.8.3.1 QWidget∗ KDChart::AbstractLayoutItem::mParent [protected]

Definition at line 76 of file KDChartLayoutItems.h.


Referenced by setParentWidget().

6.8.3.2 QLayout∗ KDChart::AbstractLayoutItem::mParentLayout [protected]

Definition at line 77 of file KDChartLayoutItems.h.


The documentation for this class was generated from the following files:

• KDChartLayoutItems.h
• KDChartLayoutItems.cpp

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


144 KD Chart 2 Class Documentation

6.9 KDChart::AbstractPieDiagram Class Reference


#include <KDChartAbstractPieDiagram.h>
Inheritance diagram for KDChart::AbstractPieDiagram:Collaboration diagram for KDChart::AbstractPie-
Diagram:

Public Member Functions


• AbstractPieDiagram (QWidget ∗parent=0, PolarCoordinatePlane ∗plane=0)
• bool allowOverlappingDataValueTexts () const
• bool antiAliasing () const
• virtual AttributesModel ∗ attributesModel () const
Returns the AttributesModel, that is used by this diagram.

• QBrush brush (const QModelIndex &index) const


Retrieve the brush to be used, for painting the datapoint at the given index in the model.

• QBrush brush (int dataset) const


Retrieve the brush to be used for the given dataset.

• QBrush brush () const


Retrieve the brush to be used for painting datapoints globally.

• int columnCount () const


• AbstractCoordinatePlane ∗ coordinatePlane () const
The coordinate plane associated with the diagram.

• const QPair< QPointF, QPointF > dataBoundaries () const


Return the bottom left and top right data point, that the diagram will display (unless the grid adjusts these
values).

• virtual void dataChanged (const QModelIndex &topLeft, const QModelIndex &bottomRight)


[reimplemented]

• QList< QBrush > datasetBrushes () const


The set of dataset brushes currently used, for use in legends, etc.

• int datasetDimension () const


The dataset dimension of a diagram determines, how many value dimensions it expects each datapoint to
have.

• QStringList datasetLabels () const


The set of dataset labels currently displayed, for use in legends, etc.

• QList< MarkerAttributes > datasetMarkers () const


The set of dataset markers currently used, for use in legends, etc.

• QList< QPen > datasetPens () const


The set of dataset pens currently used, for use in legends, etc.

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.9 KDChart::AbstractPieDiagram Class Reference 145

• DataValueAttributes dataValueAttributes (const QModelIndex &index) const


Retrieve the DataValueAttributes for the given index.

• DataValueAttributes dataValueAttributes (int column) const


Retrieve the DataValueAttributes for the given dataset.

• DataValueAttributes dataValueAttributes () const


Retrieve the DataValueAttributes speficied globally.

• virtual void doItemsLayout ()


[reimplemented]

• qreal granularity () const


• virtual int horizontalOffset () const
[reimplemented]

• virtual QModelIndex indexAt (const QPoint &point) const


[reimplemented]

• virtual bool isIndexHidden (const QModelIndex &index) const


[reimplemented]

• QStringList itemRowLabels () const


The set of item row labels currently displayed, for use in Abscissa axes, etc.

• virtual QModelIndex moveCursor (CursorAction cursorAction, Qt::KeyboardModifiers modifiers)


[reimplemented]

• virtual double numberOfGridRings () const=0


• virtual double numberOfValuesPerDataset () const=0
• virtual void paintMarker (QPainter ∗painter, const MarkerAttributes &markerAttributes, const
QBrush &brush, const QPen &, const QPointF &point, const QSizeF &size)
• QPen pen (const QModelIndex &index) const
Retrieve the pen to be used, for painting the datapoint at the given index in the model.

• QPen pen (int dataset) const


Retrieve the pen to be used for the given dataset.

• QPen pen () const


Retrieve the pen to be used for painting datapoints globally.

• bool percentMode () const


• PieAttributes pieAttributes (const QModelIndex &index) const
• PieAttributes pieAttributes (int column) const
• PieAttributes pieAttributes () const
• const PolarCoordinatePlane ∗ polarCoordinatePlane () const
• virtual void resize (const QSizeF &area)=0
Called by the widget’s sizeEvent.

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


146 KD Chart 2 Class Documentation

• virtual void scrollTo (const QModelIndex &index, ScrollHint hint=EnsureVisible)


[reimplemented]

• void setAllowOverlappingDataValueTexts (bool allow)


Set whether data value labels are allowed to overlap.

• void setAntiAliasing (bool enabled)


Set whether anti-aliasing is to be used while rendering this diagram.

• virtual void setAttributesModel (AttributesModel ∗model)


Associate an AttributesModel with this diagram.

• void setBrush (const QBrush &brush)


Set the brush to be used, for painting all datasets in the model.

• void setBrush (int dataset, const QBrush &brush)


Set the brush to be used, for painting the given dataset.

• void setBrush (const QModelIndex &index, const QBrush &brush)


Set the brush to be used, for painting the datapoint at the given index.

• virtual void setCoordinatePlane (AbstractCoordinatePlane ∗plane)


Set the coordinate plane associated with the diagram.

• void setDatasetDimension (int dimension)


Sets the dataset dimension of the diagram.

• void setDataValueAttributes (const DataValueAttributes &a)


Set the DataValueAttributes for all datapoints in the model.

• void setDataValueAttributes (int dataset, const DataValueAttributes &a)


Set the DataValueAttributes for the given dataset.

• void setDataValueAttributes (const QModelIndex &index, const DataValueAttributes &a)


Set the DataValueAttributes for the given index.

• void setGranularity (qreal value)


Set the granularity: the smaller the granularity the more your diagram segments will show facettes instead
of rounded segments.

• virtual void setModel (QAbstractItemModel ∗model)


Associate a model with the diagram.

• void setPen (const QPen &pen)


Set the pen to be used, for painting all datasets in the model.

• void setPen (int dataset, const QPen &pen)


Set the pen to be used, for painting the given dataset.

• void setPen (const QModelIndex &index, const QPen &pen)

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.9 KDChart::AbstractPieDiagram Class Reference 147

Set the pen to be used, for painting the datapoint at the given index.

• void setPercentMode (bool percent)


• void setPieAttributes (int column, const PieAttributes &a)
• void setPieAttributes (const PieAttributes &a)
• virtual void setRootIndex (const QModelIndex &idx)
Set the root index in the model, where the diagram starts referencing data for display.

• virtual void setSelection (const QRect &rect, QItemSelectionModel::SelectionFlags command)


[reimplemented]

• void setStartPosition (qreal degrees)


Set the starting angle for the first dataset.

• void setThreeDPieAttributes (const QModelIndex &index, const ThreeDPieAttributes &a)


• void setThreeDPieAttributes (int column, const ThreeDPieAttributes &a)
• void setThreeDPieAttributes (const ThreeDPieAttributes &a)
• qreal startPosition () const
• ThreeDPieAttributes threeDPieAttributes (const QModelIndex &index) const
• ThreeDPieAttributes threeDPieAttributes (int column) const
• ThreeDPieAttributes threeDPieAttributes () const
• void update () const
• void useDefaultColors ()
Set the palette to be used, for painting datasets to the default palette.

• void useRainbowColors ()
Set the palette to be used, for painting datasets to the rainbow palette.

• void useSubduedColors ()
Set the palette to be used, for painting datasets to the subdued palette.

• virtual double valueTotals () const=0


• virtual int verticalOffset () const
[reimplemented]

• virtual QRect visualRect (const QModelIndex &index) const


[reimplemented]

• virtual QRegion visualRegionForSelection (const QItemSelection &selection) const


[reimplemented]

• virtual ∼AbstractPieDiagram ()

Protected Member Functions


• QModelIndex attributesModelRootIndex () const
• virtual const QPair< QPointF, QPointF > calculateDataBoundaries () const=0
• virtual bool checkInvariants (bool justReturnTheStatus=false) const
• QModelIndex columnToIndex (int column) const
• void modelsChanged ()

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


148 KD Chart 2 Class Documentation

This signal is emitted, when either the model or the AttributesModel is replaced.

• virtual void paint (PaintContext ∗paintContext)=0


Draw the diagram contents to the rectangle and painter, that are passed in as part of the paint context.

• void paintDataValueText (QPainter ∗painter, const QModelIndex &index, const QPointF &pos, dou-
ble value)
• virtual void paintDataValueTexts (QPainter ∗painter)
• void paintMarker (QPainter ∗painter, const QModelIndex &index, const QPointF &pos)
• virtual void paintMarkers (QPainter ∗painter)
• void propertiesChanged ()
Emitted upon change of a property of the Diagram.

• void setAttributesModelRootIndex (const QModelIndex &)


• void setDataBoundariesDirty () const
• double valueForCell (int row, int column) const
Helper method, retrieving the data value (DisplayRole) for a given row and column.

Protected Attributes
• Q_SIGNALS __pad0__: void layoutChanged( AbstractDiagram∗ )

6.9.1 Constructor & Destructor Documentation

6.9.1.1 AbstractPieDiagram::AbstractPieDiagram (QWidget ∗ parent = 0, PolarCoordinatePlane


∗ plane = 0) [explicit]

Definition at line 47 of file KDChartAbstractPieDiagram.cpp.

47 :
48 AbstractPolarDiagram( new Private(), parent, plane )
49 {
50 init();
51 }

6.9.1.2 AbstractPieDiagram::∼AbstractPieDiagram () [virtual]

Definition at line 53 of file KDChartAbstractPieDiagram.cpp.

54 {
55 }

6.9.2 Member Function Documentation

6.9.2.1 bool AbstractDiagram::allowOverlappingDataValueTexts () const [inherited]

Returns:
Whether data value labels are allowed to overlap.

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.9 KDChart::AbstractPieDiagram Class Reference 149

Definition at line 291 of file KDChartAbstractDiagram.cpp.


References d.

295 {

6.9.2.2 bool AbstractDiagram::antiAliasing () const [inherited]

Returns:
Whether anti-aliasing is to be used for rendering this diagram.

Definition at line 302 of file KDChartAbstractDiagram.cpp.


References d.
Referenced by KDChart::LineDiagram::paint().

306 {

6.9.2.3 AttributesModel ∗ AbstractDiagram::attributesModel () const [virtual,


inherited]

Returns the AttributesModel, that is used by this diagram.


By default each diagram owns its own AttributesModel, which should never be deleted. Only if a user-
supplied AttributesModel has been set does the pointer returned here not belong to the diagram.

Returns:
The AttributesModel associated with the diagram.

See also:
setAttributesModel

Definition at line 180 of file KDChartAbstractDiagram.cpp.


References d.
Referenced by KDChart::RingDiagram::paint(), KDChart::PolarDiagram::paint(), and KDChart::Bar-
Diagram::setBarAttributes().

181 {
182 return d->attributesModel;
183 }

6.9.2.4 QModelIndex AbstractDiagram::attributesModelRootIndex () const [protected,


inherited]

returns a QModelIndex pointing into the AttributesModel that corresponds to the root index of the diagram.
Definition at line 204 of file KDChartAbstractDiagram.cpp.
References d.

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


150 KD Chart 2 Class Documentation

Referenced by KDChart::LineDiagram::calculateDataBoundaries(), KDChart::BarDiagram::calculate-


DataBoundaries(), KDChart::LineDiagram::numberOfAbscissaSegments(), KDChart::Bar-
Diagram::numberOfAbscissaSegments(), KDChart::LineDiagram::numberOfOrdinateSegments(),
KDChart::BarDiagram::numberOfOrdinateSegments(), KDChart::LineDiagram::paint(), KDChart::Bar-
Diagram::paint(), and KDChart::AbstractDiagram::valueForCell().

210 {

6.9.2.5 QBrush AbstractDiagram::brush (const QModelIndex & index) const [inherited]

Retrieve the brush to be used, for painting the datapoint at the given index in the model.

Parameters:
index The index of the datapoint in the model.

Returns:
The brush to use for painting.

Definition at line 632 of file KDChartAbstractDiagram.cpp.

638 :
QRect AbstractDiagram::visualRect(const QModelIndex &) const

6.9.2.6 QBrush AbstractDiagram::brush (int dataset) const [inherited]

Retrieve the brush to be used for the given dataset.


This will fall back automatically to what was set at model level, if there are no dataset specific settings.

Parameters:
dataset The dataset to retrieve the brush for.

Returns:
The brush to use for painting.

Definition at line 624 of file KDChartAbstractDiagram.cpp.

631 {

6.9.2.7 QBrush AbstractDiagram::brush () const [inherited]

Retrieve the brush to be used for painting datapoints globally.


This will fall back automatically to the default settings, if there are no specific settings.

Returns:
The brush to use for painting.

Definition at line 618 of file KDChartAbstractDiagram.cpp.


Referenced by KDChart::PieDiagram::paint(), and KDChart::AbstractDiagram::paintMarker().

623 {

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.9 KDChart::AbstractPieDiagram Class Reference 151

6.9.2.8 virtual const QPair<QPointF, QPointF> KDChart::Abstract-


Diagram::calculateDataBoundaries () const [protected, pure virtual,
inherited]

Implemented in KDChart::BarDiagram, KDChart::LineDiagram, KDChart::PieDiagram, KDChart::Polar-


Diagram, and KDChart::RingDiagram.
Referenced by KDChart::AbstractDiagram::dataBoundaries().

6.9.2.9 bool AbstractDiagram::checkInvariants (bool justReturnTheStatus = false) const


[protected, virtual, inherited]

Definition at line 746 of file KDChartAbstractDiagram.cpp.


References KDChart::AbstractDiagram::coordinatePlane().
Referenced by KDChart::RingDiagram::calculateDataBoundaries(), KDChart::PolarDiagram::calculate-
DataBoundaries(), KDChart::PieDiagram::calculateDataBoundaries(), KDChart::LineDiagram::calculate-
DataBoundaries(), KDChart::BarDiagram::calculateDataBoundaries(), KDChart::RingDiagram::paint(),
KDChart::PolarDiagram::paint(), KDChart::PieDiagram::paint(), KDChart::LineDiagram::paint(),
KDChart::BarDiagram::paint(), and KDChart::AbstractDiagram::paintMarker().

746 {
747 Q_ASSERT_X ( model(), "AbstractDiagram::checkInvariants()",
748 "There is no usable model set, for the diagram." );
749
750 Q_ASSERT_X ( coordinatePlane(), "AbstractDiagram::checkInvariants()",
751 "There is no usable coordinate plane set, for the diagram." );
752 }
753 return model() && coordinatePlane();
754 }
755
756 int AbstractDiagram::datasetDimension( ) const

6.9.2.10 int AbstractPolarDiagram::columnCount () const [inherited]

Definition at line 58 of file KDChartAbstractPolarDiagram.cpp.


References KDChart::AbstractPolarDiagram::numberOfValuesPerDataset().
Referenced by KDChart::PieDiagram::calculateDataBoundaries(), KDChart::PieDiagram::paint(), and
KDChart::PieDiagram::valueTotals().

59 {
60 return static_cast<int>( numberOfValuesPerDataset() );
61 }

6.9.2.11 QModelIndex AbstractDiagram::columnToIndex (int column) const [protected,


inherited]

Definition at line 211 of file KDChartAbstractDiagram.cpp.

217 {

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


152 KD Chart 2 Class Documentation

6.9.2.12 AbstractCoordinatePlane ∗ AbstractDiagram::coordinatePlane () const [inherited]

The coordinate plane associated with the diagram.


This determines how coordinates in value space are mapped into pixel space. By default this is a Cartesian-
CoordinatePlane.
Returns:
The coordinate plane associated with the diagram.

Definition at line 125 of file KDChartAbstractDiagram.cpp.


References d.
Referenced by KDChart::BarDiagram::calculateDataBoundaries(), KDChart::AbstractDiagram::check-
Invariants(), KDChart::AbstractCartesianDiagram::layoutPlanes(), KDChart::PolarDiagram::paint(),
KDChart::LineDiagram::paint(), KDChart::BarDiagram::paint(), KDChart::AbstractPolarDiagram::polar-
CoordinatePlane(), and KDChart::AbstractCartesianDiagram::setCoordinatePlane().

126 {
127 return d->plane;
128 }

6.9.2.13 const QPair< QPointF, QPointF > AbstractDiagram::dataBoundaries () const


[inherited]

Return the bottom left and top right data point, that the diagram will display (unless the grid adjusts these
values).
This method returns a chached result of calculations done by calculateDataBoundaries. Classes derived
from AbstractDiagram must implement the calculateDataBoundaries function, to specify their own way of
calculating the data boundaries. If derived classes want to force recalculation of the data boundaries, they
can call setDataBoundariesDirty()
Returned value is in diagram coordinates.
Definition at line 130 of file KDChartAbstractDiagram.cpp.
References KDChart::AbstractDiagram::calculateDataBoundaries(), and d.
Referenced by KDChart::CartesianCoordinatePlane::calculateRawDataBoundingRect(), KDChart::Polar-
CoordinatePlane::layoutDiagrams(), KDChart::LineDiagram::paint(), and KDChart::BarDiagram::paint().

131 {
132 if( d->databoundariesDirty ){
133 d->databoundaries = calculateDataBoundaries ();
134 d->databoundariesDirty = false;
135 }
136 return d->databoundaries;
137 }

6.9.2.14 void AbstractDiagram::dataChanged (const QModelIndex & topLeft, const QModelIndex


& bottomRight) [virtual, inherited]

[reimplemented]
Definition at line 232 of file KDChartAbstractDiagram.cpp.
References d.

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.9 KDChart::AbstractPieDiagram Class Reference 153

232 {
233 // We are still too dumb to do intelligent updates...
234 d->databoundariesDirty = true;
235 scheduleDelayedItemsLayout();
236 }
237
238 void AbstractDiagram::setDataValueAttributes( const QModelIndex & index,

6.9.2.15 QList< QBrush > AbstractDiagram::datasetBrushes () const [inherited]

The set of dataset brushes currently used, for use in legends, etc.

Note:
Cell-level override brushes, if set, take precedence over the dataset values, so you might need to check
these too, in order to find the brush, that is used for a single cell.

Returns:
The current set of dataset brushes.

Definition at line 710 of file KDChartAbstractDiagram.cpp.


Referenced by KDChart::Legend::buildLegend(), KDChart::Legend::datasetCount(), and
KDChart::Legend::setBrushesFromDiagram().

712 {
713 QBrush brush = qVariantValue<QBrush>( attributesModel()->headerData( i, Qt::Vertical, DatasetB
714 ret << brush;
715 }
716
717 return ret;
718 }
719
720 QList<QPen> AbstractDiagram::datasetPens() const

6.9.2.16 int AbstractDiagram::datasetDimension () const [inherited]

The dataset dimension of a diagram determines, how many value dimensions it expects each datapoint to
have.
For each dimension it will expect one column of values in the model. If the dimensionality is 1, automatic
values will be used for the abscissa.
For example a diagram with the default dimension of 1, will have one column per datapoint (the y values)
and will use automatic values for the x axis (1, 2, 3, ... n). If the dimension is 2, the diagram will use the
first, (and the third, fifth, etc) columns as X values, and the second, (and the fourth, sixth, etc) column as Y
values.

Returns:
The dataset dimension of the diagram.

Definition at line 758 of file KDChartAbstractDiagram.cpp.


References d.
Referenced by KDChart::LineDiagram::calculateDataBoundaries(), KDChart::LineDiagram::get-
CellValues(), KDChart::CartesianCoordinatePlane::getDataDimensionsList(), KDChart::Line-
Diagram::paint(), and KDChart::LineDiagram::setType().

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


154 KD Chart 2 Class Documentation

762 {

6.9.2.17 QStringList AbstractDiagram::datasetLabels () const [inherited]

The set of dataset labels currently displayed, for use in legends, etc.

Returns:
The set of dataset labels currently displayed.

Definition at line 698 of file KDChartAbstractDiagram.cpp.


Referenced by KDChart::Legend::buildLegend(), and KDChart::Legend::datasetCount().

699 : " << attributesModel()->columnCount(attributesModel


700 const int columnCount = attributesModel()->columnCount(attributesModelRootIndex());
701 for( int i = datasetDimension()-1; i < columnCount; i += datasetDimension() ){
702 //qDebug() << "label: " << attributesModel()->headerData( i, Qt::Horizontal, Qt::DisplayRole )
703 ret << attributesModel()->headerData( i, Qt::Horizontal, Qt::DisplayRole ).toString();
704 }
705 return ret;
706 }
707
708 QList<QBrush> AbstractDiagram::datasetBrushes() const

6.9.2.18 QList< MarkerAttributes > AbstractDiagram::datasetMarkers () const [inherited]

The set of dataset markers currently used, for use in legends, etc.

Note:
Cell-level override markers, if set, take precedence over the dataset values, so you might need to check
these too, in order to find the marker, that is shown for a single cell.

Returns:
The current set of dataset brushes.

Definition at line 733 of file KDChartAbstractDiagram.cpp.


Referenced by KDChart::Legend::buildLegend().

735 {
736 DataValueAttributes a =
737 qVariantValue<DataValueAttributes>( attributesModel()->headerData( i, Qt::Vertical, DataVa
738 const MarkerAttributes &ma = a.markerAttributes();
739 ret << ma;
740 }
741 return ret;
742 }
743
744 bool AbstractDiagram::checkInvariants( bool justReturnTheStatus ) const

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.9 KDChart::AbstractPieDiagram Class Reference 155

6.9.2.19 QList< QPen > AbstractDiagram::datasetPens () const [inherited]

The set of dataset pens currently used, for use in legends, etc.

Note:
Cell-level override pens, if set, take precedence over the dataset values, so you might need to check
these too, in order to find the pens, that is used for a single cell.

Returns:
The current set of dataset pens.

Definition at line 722 of file KDChartAbstractDiagram.cpp.


Referenced by KDChart::Legend::buildLegend().

724 {
725 QPen pen = qVariantValue<QPen>( attributesModel()->headerData( i, Qt::Vertical, DatasetPenRole
726 ret << pen;
727 }
728 return ret;
729 }
730
731 QList<MarkerAttributes> AbstractDiagram::datasetMarkers() const

6.9.2.20 DataValueAttributes AbstractDiagram::dataValueAttributes (const QModelIndex &


index) const [inherited]

Retrieve the DataValueAttributes for the given index.


This will fall back automatically to what was set at dataset or model level, if there are no datapoint specific
settings.

Parameters:
index The datapoint to retrieve the attributes for.

Returns:
The DataValueAttributes for the given index.

Definition at line 272 of file KDChartAbstractDiagram.cpp.

278 {

6.9.2.21 DataValueAttributes AbstractDiagram::dataValueAttributes (int column) const


[inherited]

Retrieve the DataValueAttributes for the given dataset.


This will fall back automatically to what was set at model level, if there are no dataset specific settings.

Parameters:
dataset The dataset to retrieve the attributes for.

Returns:
The DataValueAttributes for the given dataset.

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


156 KD Chart 2 Class Documentation

Definition at line 265 of file KDChartAbstractDiagram.cpp.

271 {

6.9.2.22 DataValueAttributes AbstractDiagram::dataValueAttributes () const [inherited]

Retrieve the DataValueAttributes speficied globally.


This will fall back automatically to the default settings, if there are no specific settings.

Returns:
The global DataValueAttributes.

Definition at line 260 of file KDChartAbstractDiagram.cpp.


Referenced by KDChart::AbstractDiagram::paintDataValueText(), and KDChart::AbstractDiagram::paint-
Marker().

264 {

6.9.2.23 void AbstractDiagram::doItemsLayout () [virtual, inherited]

[reimplemented]
Definition at line 223 of file KDChartAbstractDiagram.cpp.
References d, and KDChart::AbstractDiagram::update().

223 {
224 d->plane->layoutDiagrams();
225 update();
226 }
227 QAbstractItemView::doItemsLayout();
228 }
229
230 void AbstractDiagram::dataChanged( const QModelIndex &topLeft,

6.9.2.24 qreal AbstractPieDiagram::granularity () const

Returns:
the granularity.

Definition at line 81 of file KDChartAbstractPieDiagram.cpp.


References d.
Referenced by KDChart::PieDiagram::paint().

82 {
83 return (d->granularity < 0.05 || d->granularity > 36.0)
84 ? 1.0
85 : d->granularity;
86 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.9 KDChart::AbstractPieDiagram Class Reference 157

6.9.2.25 int AbstractDiagram::horizontalOffset () const [virtual, inherited]

[reimplemented]
Definition at line 655 of file KDChartAbstractDiagram.cpp.

657 { return 0; }

6.9.2.26 QModelIndex AbstractDiagram::indexAt (const QPoint & point) const [virtual,


inherited]

[reimplemented]
Definition at line 649 of file KDChartAbstractDiagram.cpp.

651 { return QModelIndex(); }

6.9.2.27 bool AbstractDiagram::isIndexHidden (const QModelIndex & index) const [virtual,


inherited]

[reimplemented]
Definition at line 661 of file KDChartAbstractDiagram.cpp.

663 {}

6.9.2.28 QStringList AbstractDiagram::itemRowLabels () const [inherited]

The set of item row labels currently displayed, for use in Abscissa axes, etc.

Returns:
The set of item row labels currently displayed.

Definition at line 686 of file KDChartAbstractDiagram.cpp.

687 : " << attributesModel()->rowCount(attributesModelRoo


688 const int rowCount = attributesModel()->rowCount(attributesModelRootIndex());
689 for( int i = 0; i < rowCount; ++i ){
690 //qDebug() << "label: " << attributesModel()->headerData( i, Qt::Vertical, Qt::DisplayRole ).t
691 ret << attributesModel()->headerData( i, Qt::Vertical, Qt::DisplayRole ).toString();
692 }
693 return ret;
694 }
695
696 QStringList AbstractDiagram::datasetLabels() const

6.9.2.29 void KDChart::AbstractDiagram::modelsChanged () [protected, inherited]

This signal is emitted, when either the model or the AttributesModel is replaced.
Referenced by KDChart::AbstractDiagram::setAttributesModel(), and KDChart::AbstractDiagram::set-
Model().

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


158 KD Chart 2 Class Documentation

6.9.2.30 QModelIndex AbstractDiagram::moveCursor (CursorAction cursorAction,


Qt::KeyboardModifiers modifiers) [virtual, inherited]

[reimplemented]
Definition at line 652 of file KDChartAbstractDiagram.cpp.

654 { return 0; }

6.9.2.31 virtual double KDChart::AbstractPolarDiagram::numberOfGridRings () const [pure


virtual, inherited]

Implemented in KDChart::PieDiagram, KDChart::PolarDiagram, and KDChart::RingDiagram.

6.9.2.32 virtual double KDChart::AbstractPolarDiagram::numberOfValuesPerDataset () const


[pure virtual, inherited]

Implemented in KDChart::PieDiagram, KDChart::PolarDiagram, and KDChart::RingDiagram.


Referenced by KDChart::AbstractPolarDiagram::columnCount().

6.9.2.33 virtual void KDChart::AbstractDiagram::paint (PaintContext ∗ paintContext)


[protected, pure virtual, inherited]

Draw the diagram contents to the rectangle and painter, that are passed in as part of the paint context.

Parameters:
paintContext All information needed for painting.

Implemented in KDChart::BarDiagram, KDChart::LineDiagram, KDChart::PieDiagram, KDChart::Polar-


Diagram, and KDChart::RingDiagram.

6.9.2.34 void AbstractDiagram::paintDataValueText (QPainter ∗ painter, const QModelIndex &


index, const QPointF & pos, double value) [protected, inherited]

Definition at line 318 of file KDChartAbstractDiagram.cpp.


References KDChart::DataValueAttributes::dataLabel(), KDChart::AbstractDiagram::dataValue-
Attributes(), KDChart::DataValueAttributes::decimalDigits(), KDChart::TextAttributes::font(),
KDChart::TextAttributes::isVisible(), KDChart::DataValueAttributes::isVisible(), KDChart::Text-
Attributes::pen(), KDChart::DataValueAttributes::prefix(), KDChart::TextAttributes::rotation(),
KDChart::DataValueAttributes::suffix(), and KDChart::DataValueAttributes::textAttributes().
Referenced by KDChart::RingDiagram::paint(), KDChart::PolarDiagram::paint(), KDChart::Line-
Diagram::paint(), and KDChart::BarDiagram::paint().

320 {
321 // paint one data series
322 DataValueAttributes a = dataValueAttributes(index);
323 if ( !a.isVisible() ) return;
324
325 // handle decimal digits
326 int decimalDigits = a.decimalDigits();

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.9 KDChart::AbstractPieDiagram Class Reference 159

327 int decimalPos = QString::number( value ).indexOf( QLatin1Char( ’.’ ) );


328 QString roundedValue;
329 if ( a.dataLabel().isNull() ) {
330 if ( decimalPos > 0 && value != 0 )
331 roundedValue = roundValues ( value, decimalPos, decimalDigits );
332 else
333 roundedValue = QString::number( value );
334 } else
335 roundedValue = a.dataLabel();
336 // handle prefix and suffix
337 if ( !a.prefix().isNull() )
338 roundedValue.prepend( a.prefix() );
339
340 if ( !a.suffix().isNull() )
341 roundedValue.append( a.suffix() );
342
343 PainterSaver painterSaver( painter );
344 // FIXME draw the non-text bits, background, etc
345 const TextAttributes &ta = a.textAttributes();
346 if ( ta.isVisible() ) {
347 painter->setPen( ta.pen() );
348 painter->setFont( ta.font() );
349 painter->translate( pos );
350 painter->rotate( ta.rotation() );
351 painter->drawText( QPointF(0, 0), roundedValue );
352 }
353 }
354
355 QString AbstractDiagram::roundValues( double value,

6.9.2.35 void AbstractDiagram::paintDataValueTexts (QPainter ∗ painter) [protected,


virtual, inherited]

Definition at line 382 of file KDChartAbstractDiagram.cpp.

385 {
386 for ( int j=0; j< rowCount; ++j ) {
387 const QModelIndex index = model()->index( j, i, rootIndex() );
388 double value = model()->data( index ).toDouble();
389 const QPointF pos = coordinatePlane()->translate( QPointF( j, value ) );
390 paintDataValueText( painter, index, pos, value );
391 }
392 }
393 }
394
395

6.9.2.36 void AbstractDiagram::paintMarker (QPainter ∗ painter, const QModelIndex & index,


const QPointF & pos) [protected, inherited]

Definition at line 398 of file KDChartAbstractDiagram.cpp.


References KDChart::AbstractDiagram::brush(), KDChart::AbstractDiagram::checkInvariants(),
KDChart::AbstractDiagram::dataValueAttributes(), KDChart::MarkerAttributes::isVisible(),
KDChart::DataValueAttributes::isVisible(), KDChart::DataValueAttributes::markerAttributes(),
KDChart::MarkerAttributes::markerColor(), KDChart::MarkerAttributes::markerSize(),
KDChart::AbstractDiagram::paintMarker(), and KDChart::MarkerAttributes::pen().

399 {

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


160 KD Chart 2 Class Documentation

400
401 if ( !checkInvariants() ) return;
402 DataValueAttributes a = dataValueAttributes(index);
403 if ( !a.isVisible() ) return;
404 const MarkerAttributes &ma = a.markerAttributes();
405 if ( !ma.isVisible() ) return;
406
407 PainterSaver painterSaver( painter );
408 QSizeF maSize( ma.markerSize() );
409 QBrush indexBrush( brush( index ) );
410 QPen indexPen( ma.pen() );
411 if ( ma.markerColor().isValid() )
412 indexBrush.setColor( ma.markerColor() );
413
414 paintMarker( painter, ma, indexBrush, indexPen, pos, maSize );
415 }
416
417

6.9.2.37 void AbstractDiagram::paintMarker (QPainter ∗ painter, const MarkerAttributes &


markerAttributes, const QBrush & brush, const QPen &, const QPointF & point, const
QSizeF & size) [virtual, inherited]

Definition at line 420 of file KDChartAbstractDiagram.cpp.


References KDChart::MarkerAttributes::markerStyle().
Referenced by KDChart::LineDiagram::paint(), KDChart::MarkerLayoutItem::paint(), and
KDChart::AbstractDiagram::paintMarker().

424 {
425 PainterSaver painterSaver( painter );
426 painter->setBrush( brush );
427 painter->setPen( pen );
428 painter->setRenderHint ( QPainter::Antialiasing );
429 painter->translate( pos );
430 switch ( markerAttributes.markerStyle() ) {
431 case MarkerAttributes::MarkerCircle:
432 painter->drawEllipse( QRectF( 0 - maSize.height()/2, 0 - maSize.width()/2,
433 maSize.height(), maSize.width()) );
434 break;
435 case MarkerAttributes::MarkerSquare:
436 {
437 QRectF rect( 0 - maSize.height()/2, 0 - maSize.width()/2,
438 maSize.height(), maSize.width() );
439 painter->drawRect( rect );
440 painter->fillRect( rect, painter->brush() );
441 break;
442 }
443 case MarkerAttributes::MarkerDiamond:
444 {
445 QVector <QPointF > diamondPoints;
446 QPointF top, left, bottom, right;
447 top = QPointF( 0, 0 - maSize.height()/2 );
448 left = QPointF( 0 - maSize.width()/2, 0 );
449 bottom = QPointF( 0, maSize.height()/2 );
450 right = QPointF( maSize.width()/2, 0 );
451 diamondPoints << top << left << bottom << right;
452 painter->drawPolygon( diamondPoints );
453 break;
454 }
455 //Pending Michel: do we need that? Ask: What is the idea about
456 // Marker1Pixel and Marker4Pixels.
457 case MarkerAttributes::Marker1Pixel:

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.9 KDChart::AbstractPieDiagram Class Reference 161

458 {
459 QSizeF pSize(4,4);
460 QPen pen1Pixel;
461 pen1Pixel.setColor( painter->background().color() );
462 QRectF centerRect( -pSize.height()/2, -pSize.width()/2,
463 pSize.height(), pSize.width() );
464 painter->setPen( pen1Pixel );
465 painter->drawEllipse( centerRect );
466 break;
467 }
468 case MarkerAttributes::Marker4Pixels:
469 {
470 QSizeF pSize(8, 8);
471 QPen pen4Pixel;
472 pen4Pixel.setColor( painter->background().color() );
473 QRectF centerRect( -pSize.height()/2, -pSize.width()/2,
474 pSize.height(), pSize.width() );
475 painter->setPen( pen4Pixel );
476 painter->drawEllipse( centerRect );
477 break;
478 }
479 case MarkerAttributes::MarkerRing:
480 {
481 painter->setBrush( Qt::NoBrush );
482 painter->drawEllipse( QRectF( 0 - maSize.height()/2, 0 - maSize.width()/2,
483 maSize.height(), maSize.width()) );
484 break;
485 }
486 case MarkerAttributes::MarkerCross:
487 {
488 QVector <QPointF > crossPoints;
489 QPointF leftTop, leftBottom, centerBottomLeft, bottomLeft, bottomRight,
490 centerBottomRight,rightBottom, rightTop, centerTopRight, topRight, topLeft,
491 centerTopLeft;
492 leftTop = QPointF( -maSize.width()/2, -maSize.height()/4 );
493 leftBottom = QPointF( -maSize.width()/2, maSize.height()/4 );
494 centerBottomLeft = QPointF( -maSize.width()/4, maSize.height()/4 );
495 bottomLeft = QPointF( -maSize.width()/4, maSize.height()/2 );
496 bottomRight = QPointF( maSize.width()/4, maSize.height()/2 );
497 centerBottomRight = QPointF( maSize.width()/4, maSize.height()/4 );
498 rightBottom = QPointF( maSize.width()/2, maSize.height()/4 );
499 rightTop = QPointF( maSize.width()/2, -maSize.height()/4 );
500 centerTopRight = QPointF( maSize.width()/4, -maSize.height()/4 );
501 topRight = QPointF( maSize.width()/4, -maSize.height()/2 );
502 topLeft = QPointF( -maSize.width()/4, -maSize.height()/2 );
503 centerTopLeft = QPointF( -maSize.width()/4, -maSize.height()/4 );
504
505 crossPoints << leftTop << leftBottom << centerBottomLeft
506 << bottomLeft << bottomRight << centerBottomRight
507 << rightBottom << rightTop << centerTopRight
508 << topRight << topLeft << centerTopLeft;
509
510 painter->drawPolygon( crossPoints );
511 break;
512 }
513 case MarkerAttributes::MarkerFastCross:
514 {
515 QPointF left, right, top, bottom;
516 left = QPointF( -maSize.width()/2, 0 );
517 right = QPointF( maSize.width()/2, 0 );
518 top = QPointF( 0, -maSize.height()/2 );
519 bottom= QPointF( 0, maSize.height()/2 );
520 painter->drawLine( left, right );
521 painter->drawLine( top, bottom );
522 break;
523 }
524 default:

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


162 KD Chart 2 Class Documentation

525 Q_ASSERT_X ( false, "paintMarkers()",


526 "Type item does not match a defined Marker Type." );
527 }
528 }
529
530 void AbstractDiagram::paintMarkers( QPainter* painter )

6.9.2.38 void AbstractDiagram::paintMarkers (QPainter ∗ painter) [protected, virtual,


inherited]

Definition at line 532 of file KDChartAbstractDiagram.cpp.

535 {
536 for ( int j=0; j< rowCount; ++j ) {
537 const QModelIndex index = model()->index( j, i, rootIndex() );
538 double value = model()->data( index ).toDouble();
539 const QPointF pos = coordinatePlane()->translate( QPointF( j, value ) );
540 paintMarker( painter, index, pos );
541 }
542 }
543 }
544
545

6.9.2.39 QPen AbstractDiagram::pen (const QModelIndex & index) const [inherited]

Retrieve the pen to be used, for painting the datapoint at the given index in the model.

Parameters:
index The index of the datapoint in the model.

Returns:
The pen to use for painting.

Definition at line 586 of file KDChartAbstractDiagram.cpp.

593 {

6.9.2.40 QPen AbstractDiagram::pen (int dataset) const [inherited]

Retrieve the pen to be used for the given dataset.


This will fall back automatically to what was set at model level, if there are no dataset specific settings.

Parameters:
dataset The dataset to retrieve the pen for.

Returns:
The pen to use for painting.

Definition at line 578 of file KDChartAbstractDiagram.cpp.

585 {

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.9 KDChart::AbstractPieDiagram Class Reference 163

6.9.2.41 QPen AbstractDiagram::pen () const [inherited]

Retrieve the pen to be used for painting datapoints globally.


This will fall back automatically to the default settings, if there are no specific settings.

Returns:
The pen to use for painting.

Definition at line 572 of file KDChartAbstractDiagram.cpp.


Referenced by KDChart::PieDiagram::paint().

577 {

6.9.2.42 bool AbstractDiagram::percentMode () const [inherited]

Definition at line 313 of file KDChartAbstractDiagram.cpp.


References d.
Referenced by KDChart::CartesianCoordinatePlane::getDataDimensionsList().

320 {

6.9.2.43 PieAttributes AbstractPieDiagram::pieAttributes (const QModelIndex & index) const

Definition at line 122 of file KDChartAbstractPieDiagram.cpp.


References d, and KDChart::PieAttributesRole.

123 {
124 return qVariantValue<PieAttributes>(
125 d->attributesModel->data(
126 d->attributesModel->mapFromSource( index ),
127 PieAttributesRole ) );
128 }

6.9.2.44 PieAttributes AbstractPieDiagram::pieAttributes (int column) const

Definition at line 114 of file KDChartAbstractPieDiagram.cpp.


References d, and KDChart::PieAttributesRole.

115 {
116 return qVariantValue<PieAttributes>(
117 d->attributesModel->data(
118 d->attributesModel->mapFromSource( columnToIndex( column ) ).column(),
119 PieAttributesRole ) );
120 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


164 KD Chart 2 Class Documentation

6.9.2.45 PieAttributes AbstractPieDiagram::pieAttributes () const

Definition at line 105 of file KDChartAbstractPieDiagram.cpp.


References d, and KDChart::PieAttributesRole.
Referenced by KDChart::PieDiagram::calculateDataBoundaries(), and KDChart::PieDiagram::paint().

106 {
107 return qVariantValue<PieAttributes>(
108 d->attributesModel->data( PieAttributesRole ) );
109 }

6.9.2.46 const PolarCoordinatePlane ∗ AbstractPolarDiagram::polarCoordinatePlane () const


[inherited]

Definition at line 53 of file KDChartAbstractPolarDiagram.cpp.


References KDChart::AbstractDiagram::coordinatePlane().
Referenced by KDChart::PieDiagram::paint().

54 {
55 return dynamic_cast<const PolarCoordinatePlane*>( coordinatePlane() );
56 }

6.9.2.47 void KDChart::AbstractDiagram::propertiesChanged () [protected, inherited]

Emitted upon change of a property of the Diagram.


Referenced by KDChart::AbstractDiagram::setDataValueAttributes(), KDChart::LineDiagram::setLine-
Attributes(), KDChart::LineDiagram::setThreeDLineAttributes(), and KDChart::LineDiagram::setType().

6.9.2.48 virtual void KDChart::AbstractDiagram::resize (const QSizeF & area) [pure


virtual, inherited]

Called by the widget’s sizeEvent.


Adjust all internal structures, that are calculated, dependending on the size of the widget.

Parameters:
area

Implemented in KDChart::BarDiagram, KDChart::LineDiagram, KDChart::PieDiagram, KDChart::Polar-


Diagram, and KDChart::RingDiagram.

6.9.2.49 void AbstractDiagram::scrollTo (const QModelIndex & index, ScrollHint hint =


EnsureVisible) [virtual, inherited]

[reimplemented]
Definition at line 646 of file KDChartAbstractDiagram.cpp.

648 { return QModelIndex(); }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.9 KDChart::AbstractPieDiagram Class Reference 165

6.9.2.50 void AbstractDiagram::setAllowOverlappingDataValueTexts (bool allow)


[inherited]

Set whether data value labels are allowed to overlap.

Parameters:
allow True means that overlapping labels are allowed.

Definition at line 285 of file KDChartAbstractDiagram.cpp.


References d.

290 {

6.9.2.51 void AbstractDiagram::setAntiAliasing (bool enabled) [inherited]

Set whether anti-aliasing is to be used while rendering this diagram.

Parameters:
enabled True means that AA is enabled.

Definition at line 296 of file KDChartAbstractDiagram.cpp.


References d.

301 {

6.9.2.52 void AbstractDiagram::setAttributesModel (AttributesModel ∗ model) [virtual,


inherited]

Associate an AttributesModel with this diagram.


Note that the diagram does _not_ take ownership of the AttributesModel. This should thus only be used
with AttributesModels that have been explicitely created by the user, and are owned by her. Setting an
AttributesModel that is internal to another diagram is an error.
Correct:

AttributesModel *am = new AttributesModel( model, 0 );


diagram1->setAttributesModel( am );
diagram2->setAttributesModel( am );

Wrong:

diagram1->setAttributesModel( diagram2->attributesModel() );

Parameters:
model The AttributesModel to use for this diagram.

See also:
AttributesModel

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


166 KD Chart 2 Class Documentation

Definition at line 160 of file KDChartAbstractDiagram.cpp.


References d, and KDChart::AbstractDiagram::modelsChanged().

161 {
162 if( amodel->sourceModel() != model() ) {
163 qWarning("KDChart::AbstractDiagram::setAttributesModel() failed: "
164 "Trying to set an attributesmodel which works on a different "
165 "model than the diagram.");
166 return;
167 }
168 if( qobject_cast<PrivateAttributesModel*>(amodel) ) {
169 qWarning("KDChart::AbstractDiagram::setAttributesModel() failed: "
170 "Trying to set an attributesmodel that is private to another diagram.");
171 return;
172 }
173 d->setAttributesModel(amodel);
174 scheduleDelayedItemsLayout();
175 d->databoundariesDirty = true;
176 emit modelsChanged();
177 }

6.9.2.53 void AbstractDiagram::setAttributesModelRootIndex (const QModelIndex & idx)


[protected, inherited]

Definition at line 195 of file KDChartAbstractDiagram.cpp.


References d.

6.9.2.54 void AbstractDiagram::setBrush (const QBrush & brush) [inherited]

Set the brush to be used, for painting all datasets in the model.

Parameters:
brush The brush to use.

Definition at line 602 of file KDChartAbstractDiagram.cpp.

608 {

6.9.2.55 void AbstractDiagram::setBrush (int dataset, const QBrush & brush) [inherited]

Set the brush to be used, for painting the given dataset.

Parameters:
dataset The dataset’s column in the model.
pen The brush to use.

Definition at line 609 of file KDChartAbstractDiagram.cpp.

617 {

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.9 KDChart::AbstractPieDiagram Class Reference 167

6.9.2.56 void AbstractDiagram::setBrush (const QModelIndex & index, const QBrush & brush)
[inherited]

Set the brush to be used, for painting the datapoint at the given index.

Parameters:
index The datapoint’s index in the model.
brush The brush to use.

Definition at line 594 of file KDChartAbstractDiagram.cpp.

601 {

6.9.2.57 void AbstractDiagram::setCoordinatePlane (AbstractCoordinatePlane ∗ plane)


[virtual, inherited]

Set the coordinate plane associated with the diagram.


This determines how coordinates in value space are mapped into pixel space. The chart takes ownership.

Returns:
The coordinate plane associated with the diagram.

Reimplemented in KDChart::AbstractCartesianDiagram.
Definition at line 218 of file KDChartAbstractDiagram.cpp.
References d.
Referenced by KDChart::AbstractCoordinatePlane::addDiagram(), KDChart::AbstractCartesian-
Diagram::setCoordinatePlane(), and KDChart::AbstractCoordinatePlane::takeDiagram().

222 {

6.9.2.58 void AbstractDiagram::setDataBoundariesDirty () const [protected, inherited]

Definition at line 139 of file KDChartAbstractDiagram.cpp.


References d.
Referenced by KDChart::BarDiagram::setThreeDBarAttributes(), KDChart::LineDiagram::setThree-
DLineAttributes(), KDChart::LineDiagram::setType(), and KDChart::BarDiagram::setType().

140 {
141 d->databoundariesDirty = true;
142 }

6.9.2.59 void AbstractDiagram::setDatasetDimension (int dimension) [inherited]

Sets the dataset dimension of the diagram.

See also:
datasetDimension.

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


168 KD Chart 2 Class Documentation

Parameters:
dimension

Definition at line 763 of file KDChartAbstractDiagram.cpp.


References d.

770 {

6.9.2.60 void AbstractDiagram::setDataValueAttributes (const DataValueAttributes & a)


[inherited]

Set the DataValueAttributes for all datapoints in the model.

Parameters:
a The attributes to set.

Definition at line 279 of file KDChartAbstractDiagram.cpp.


References d.

284 {

6.9.2.61 void AbstractDiagram::setDataValueAttributes (int dataset, const DataValueAttributes &


a) [inherited]

Set the DataValueAttributes for the given dataset.

Parameters:
dataset The dataset to set the attributes for.
a The attributes to set.

Definition at line 251 of file KDChartAbstractDiagram.cpp.


References d.

259 {

6.9.2.62 void AbstractDiagram::setDataValueAttributes (const QModelIndex & index, const


DataValueAttributes & a) [inherited]

Set the DataValueAttributes for the given index.

Parameters:
index The datapoint to set the attributes for.
a The attributes to set.

Definition at line 240 of file KDChartAbstractDiagram.cpp.


References d, KDChart::DataValueLabelAttributesRole, and KDChart::AbstractDiagram::properties-
Changed().

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.9 KDChart::AbstractPieDiagram Class Reference 169

240 {
241 d->attributesModel->setData(
242 d->attributesModel->mapFromSource( index ),
243 qVariantFromValue( a ),
244 DataValueLabelAttributesRole );
245 emit propertiesChanged();
246 }
247
248

6.9.2.63 void AbstractPieDiagram::setGranularity (qreal value)

Set the granularity: the smaller the granularity the more your diagram segments will show facettes instead
of rounded segments.

Parameters:
value the granularity value between 0.05 (one twentieth of a degree) and 36.0 (one tenth of a full
circle), other values will be interpreted as 1.0.

Definition at line 76 of file KDChartAbstractPieDiagram.cpp.


References d.

77 {
78 d->granularity = value;
79 }

6.9.2.64 void AbstractDiagram::setModel (QAbstractItemModel ∗ model) [virtual,


inherited]

Associate a model with the diagram.


Definition at line 144 of file KDChartAbstractDiagram.cpp.
References d, KDChart::AttributesModel::initFrom(), and KDChart::AbstractDiagram::modelsChanged().

145 {
146 QAbstractItemView::setModel( newModel );
147 AttributesModel* amodel = new PrivateAttributesModel( newModel, this );
148 amodel->initFrom( d->attributesModel );
149 d->setAttributesModel(amodel);
150 scheduleDelayedItemsLayout();
151 d->databoundariesDirty = true;
152 emit modelsChanged();
153 }

6.9.2.65 void AbstractDiagram::setPen (const QPen & pen) [inherited]

Set the pen to be used, for painting all datasets in the model.

Parameters:
pen The pen to use.

Definition at line 556 of file KDChartAbstractDiagram.cpp.

562 {

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


170 KD Chart 2 Class Documentation

6.9.2.66 void AbstractDiagram::setPen (int dataset, const QPen & pen) [inherited]

Set the pen to be used, for painting the given dataset.

Parameters:
dataset The dataset’s row in the model.
pen The pen to use.

Definition at line 563 of file KDChartAbstractDiagram.cpp.

571 {

6.9.2.67 void AbstractDiagram::setPen (const QModelIndex & index, const QPen & pen)
[inherited]

Set the pen to be used, for painting the datapoint at the given index.

Parameters:
index The datapoint’s index in the model.
pen The pen to use.

Definition at line 548 of file KDChartAbstractDiagram.cpp.

555 {

6.9.2.68 void AbstractDiagram::setPercentMode (bool percent) [inherited]

Definition at line 307 of file KDChartAbstractDiagram.cpp.


References d.
Referenced by KDChart::LineDiagram::setType(), and KDChart::BarDiagram::setType().

312 {

6.9.2.69 void AbstractPieDiagram::setPieAttributes (int column, const PieAttributes & a)

Definition at line 95 of file KDChartAbstractPieDiagram.cpp.


References d, and KDChart::PieAttributesRole.

96 {
97 d->attributesModel->setHeaderData(
98 column, Qt::Vertical, qVariantFromValue( attrs ), PieAttributesRole );
99 emit layoutChanged( this );
100 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.9 KDChart::AbstractPieDiagram Class Reference 171

6.9.2.70 void AbstractPieDiagram::setPieAttributes (const PieAttributes & a)

Definition at line 89 of file KDChartAbstractPieDiagram.cpp.


References d, and KDChart::PieAttributesRole.

90 {
91 d->attributesModel->setModelData( qVariantFromValue( attrs ), PieAttributesRole );
92 emit layoutChanged( this );
93 }

6.9.2.71 void AbstractDiagram::setRootIndex (const QModelIndex & idx) [virtual,


inherited]

Set the root index in the model, where the diagram starts referencing data for display.
[reimplemented]
Definition at line 188 of file KDChartAbstractDiagram.cpp.
References d.

6.9.2.72 void AbstractDiagram::setSelection (const QRect & rect, QItemSelection-


Model::SelectionFlags command) [virtual, inherited]

[reimplemented]
Definition at line 664 of file KDChartAbstractDiagram.cpp.

666 { return QRegion(); }

6.9.2.73 void AbstractPieDiagram::setStartPosition (qreal degrees)

Set the starting angle for the first dataset.


Definition at line 65 of file KDChartAbstractPieDiagram.cpp.
References d.

66 {
67 d->startPosition = degrees;
68 }

6.9.2.74 void AbstractPieDiagram::setThreeDPieAttributes (const QModelIndex & index, const


ThreeDPieAttributes & a)

Definition at line 144 of file KDChartAbstractPieDiagram.cpp.


References KDChart::ThreeDPieAttributesRole.

145 {
146 model()->setData( index, qVariantFromValue( tda ), ThreeDPieAttributesRole );
147 emit layoutChanged( this );
148 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


172 KD Chart 2 Class Documentation

6.9.2.75 void AbstractPieDiagram::setThreeDPieAttributes (int column, const


ThreeDPieAttributes & a)

Definition at line 137 of file KDChartAbstractPieDiagram.cpp.


References d, and KDChart::ThreeDPieAttributesRole.

138 {
139 d->attributesModel->setHeaderData(
140 column, Qt::Vertical, qVariantFromValue( tda ), ThreeDPieAttributesRole );
141 emit layoutChanged( this );
142 }

6.9.2.76 void AbstractPieDiagram::setThreeDPieAttributes (const ThreeDPieAttributes & a)

Definition at line 131 of file KDChartAbstractPieDiagram.cpp.


References d, and KDChart::ThreeDPieAttributesRole.

132 {
133 d->attributesModel->setModelData( qVariantFromValue( tda ), ThreeDPieAttributesRole );
134 emit layoutChanged( this );
135 }

6.9.2.77 qreal AbstractPieDiagram::startPosition () const

Returns:
the starting angle for the first dataset.

Definition at line 70 of file KDChartAbstractPieDiagram.cpp.


References d.
Referenced by KDChart::PieDiagram::paint().

71 {
72 return d->startPosition;
73 }

6.9.2.78 ThreeDPieAttributes AbstractPieDiagram::threeDPieAttributes (const QModelIndex &


index) const

Definition at line 170 of file KDChartAbstractPieDiagram.cpp.


References d, and KDChart::ThreeDPieAttributesRole.

171 {
172 return qVariantValue<ThreeDPieAttributes>(
173 d->attributesModel->data(
174 d->attributesModel->mapFromSource( index ),
175 ThreeDPieAttributesRole ) );
176 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.9 KDChart::AbstractPieDiagram Class Reference 173

6.9.2.79 ThreeDPieAttributes AbstractPieDiagram::threeDPieAttributes (int column) const

Definition at line 162 of file KDChartAbstractPieDiagram.cpp.


References d, and KDChart::ThreeDPieAttributesRole.

163 {
164 return qVariantValue<ThreeDPieAttributes>(
165 d->attributesModel->data(
166 d->attributesModel->mapFromSource( columnToIndex( column ) ).column(),
167 ThreeDPieAttributesRole ) );
168 }

6.9.2.80 ThreeDPieAttributes AbstractPieDiagram::threeDPieAttributes () const

Definition at line 153 of file KDChartAbstractPieDiagram.cpp.


References d, and KDChart::ThreeDPieAttributesRole.
Referenced by KDChart::PieDiagram::paint().

154 {
155 return qVariantValue<ThreeDPieAttributes>(
156 d->attributesModel->data( ThreeDPieAttributesRole ) );
157 }

6.9.2.81 void AbstractDiagram::update () const [inherited]

Definition at line 777 of file KDChartAbstractDiagram.cpp.


References d.
Referenced by KDChart::AbstractDiagram::doItemsLayout().

6.9.2.82 void KDChart::AbstractDiagram::useDefaultColors () [inherited]

Set the palette to be used, for painting datasets to the default palette.

See also:
KDChart::Palette. FIXME: fold into one usePalette (KDChart::Palette&) method

Definition at line 671 of file KDChartAbstractDiagram.cpp.


References d.

675 {

6.9.2.83 void KDChart::AbstractDiagram::useRainbowColors () [inherited]

Set the palette to be used, for painting datasets to the rainbow palette.

See also:
KDChart::Palette.

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


174 KD Chart 2 Class Documentation

Definition at line 681 of file KDChartAbstractDiagram.cpp.


References d.

685 {

6.9.2.84 void KDChart::AbstractDiagram::useSubduedColors () [inherited]

Set the palette to be used, for painting datasets to the subdued palette.

See also:
KDChart::Palette.

Definition at line 676 of file KDChartAbstractDiagram.cpp.


References d.

680 {

6.9.2.85 double AbstractDiagram::valueForCell (int row, int column) const [protected,


inherited]

Helper method, retrieving the data value (DisplayRole) for a given row and column.

Parameters:
row The row to query.
column The column to query.

Returns:
The value of the display role at the given row and column as a double.

Definition at line 771 of file KDChartAbstractDiagram.cpp.


References KDChart::AbstractDiagram::attributesModelRootIndex(), and d.
Referenced by KDChart::LineDiagram::paint().

776 {

6.9.2.86 virtual double KDChart::AbstractPolarDiagram::valueTotals () const [pure


virtual, inherited]

Implemented in KDChart::PieDiagram, KDChart::PolarDiagram, and KDChart::RingDiagram.


Referenced by KDChart::PolarCoordinatePlane::layoutDiagrams().

6.9.2.87 int AbstractDiagram::verticalOffset () const [virtual, inherited]

[reimplemented]
Definition at line 658 of file KDChartAbstractDiagram.cpp.

660 { return true; }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.9 KDChart::AbstractPieDiagram Class Reference 175

6.9.2.88 QRect AbstractDiagram::visualRect (const QModelIndex & index) const [virtual,


inherited]

[reimplemented]
Definition at line 641 of file KDChartAbstractDiagram.cpp.

645 {}

6.9.2.89 QRegion AbstractDiagram::visualRegionForSelection (const QItemSelection & selection)


const [virtual, inherited]

[reimplemented]
Definition at line 667 of file KDChartAbstractDiagram.cpp.

6.9.3 Member Data Documentation

6.9.3.1 Q_SIGNALS KDChart::AbstractDiagram::__pad0__ [protected, inherited]

Definition at line 506 of file KDChartAbstractDiagram.h.


The documentation for this class was generated from the following files:

• KDChartAbstractPieDiagram.h
• KDChartAbstractPieDiagram.cpp

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


176 KD Chart 2 Class Documentation

6.10 KDChart::AbstractPolarDiagram Class Reference


#include <KDChartAbstractPolarDiagram.h>
Inheritance diagram for KDChart::AbstractPolarDiagram:Collaboration diagram for KDChart::Abstract-
PolarDiagram:

Public Member Functions


• AbstractPolarDiagram (QWidget ∗parent=0, PolarCoordinatePlane ∗plane=0)
• bool allowOverlappingDataValueTexts () const
• bool antiAliasing () const
• virtual AttributesModel ∗ attributesModel () const
Returns the AttributesModel, that is used by this diagram.

• QBrush brush (const QModelIndex &index) const


Retrieve the brush to be used, for painting the datapoint at the given index in the model.

• QBrush brush (int dataset) const


Retrieve the brush to be used for the given dataset.

• QBrush brush () const


Retrieve the brush to be used for painting datapoints globally.

• int columnCount () const


• AbstractCoordinatePlane ∗ coordinatePlane () const
The coordinate plane associated with the diagram.

• const QPair< QPointF, QPointF > dataBoundaries () const


Return the bottom left and top right data point, that the diagram will display (unless the grid adjusts these
values).

• virtual void dataChanged (const QModelIndex &topLeft, const QModelIndex &bottomRight)


[reimplemented]

• QList< QBrush > datasetBrushes () const


The set of dataset brushes currently used, for use in legends, etc.

• int datasetDimension () const


The dataset dimension of a diagram determines, how many value dimensions it expects each datapoint to
have.

• QStringList datasetLabels () const


The set of dataset labels currently displayed, for use in legends, etc.

• QList< MarkerAttributes > datasetMarkers () const


The set of dataset markers currently used, for use in legends, etc.

• QList< QPen > datasetPens () const


The set of dataset pens currently used, for use in legends, etc.

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.10 KDChart::AbstractPolarDiagram Class Reference 177

• DataValueAttributes dataValueAttributes (const QModelIndex &index) const


Retrieve the DataValueAttributes for the given index.

• DataValueAttributes dataValueAttributes (int column) const


Retrieve the DataValueAttributes for the given dataset.

• DataValueAttributes dataValueAttributes () const


Retrieve the DataValueAttributes speficied globally.

• virtual void doItemsLayout ()


[reimplemented]

• virtual int horizontalOffset () const


[reimplemented]

• virtual QModelIndex indexAt (const QPoint &point) const


[reimplemented]

• virtual bool isIndexHidden (const QModelIndex &index) const


[reimplemented]

• QStringList itemRowLabels () const


The set of item row labels currently displayed, for use in Abscissa axes, etc.

• virtual QModelIndex moveCursor (CursorAction cursorAction, Qt::KeyboardModifiers modifiers)


[reimplemented]

• virtual double numberOfGridRings () const=0


• virtual double numberOfValuesPerDataset () const=0
• virtual void paintMarker (QPainter ∗painter, const MarkerAttributes &markerAttributes, const
QBrush &brush, const QPen &, const QPointF &point, const QSizeF &size)
• QPen pen (const QModelIndex &index) const
Retrieve the pen to be used, for painting the datapoint at the given index in the model.

• QPen pen (int dataset) const


Retrieve the pen to be used for the given dataset.

• QPen pen () const


Retrieve the pen to be used for painting datapoints globally.

• bool percentMode () const


• const PolarCoordinatePlane ∗ polarCoordinatePlane () const
• virtual void resize (const QSizeF &area)=0
Called by the widget’s sizeEvent.

• virtual void scrollTo (const QModelIndex &index, ScrollHint hint=EnsureVisible)


[reimplemented]

• void setAllowOverlappingDataValueTexts (bool allow)

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


178 KD Chart 2 Class Documentation

Set whether data value labels are allowed to overlap.

• void setAntiAliasing (bool enabled)


Set whether anti-aliasing is to be used while rendering this diagram.

• virtual void setAttributesModel (AttributesModel ∗model)


Associate an AttributesModel with this diagram.

• void setBrush (const QBrush &brush)


Set the brush to be used, for painting all datasets in the model.

• void setBrush (int dataset, const QBrush &brush)


Set the brush to be used, for painting the given dataset.

• void setBrush (const QModelIndex &index, const QBrush &brush)


Set the brush to be used, for painting the datapoint at the given index.

• virtual void setCoordinatePlane (AbstractCoordinatePlane ∗plane)


Set the coordinate plane associated with the diagram.

• void setDatasetDimension (int dimension)


Sets the dataset dimension of the diagram.

• void setDataValueAttributes (const DataValueAttributes &a)


Set the DataValueAttributes for all datapoints in the model.

• void setDataValueAttributes (int dataset, const DataValueAttributes &a)


Set the DataValueAttributes for the given dataset.

• void setDataValueAttributes (const QModelIndex &index, const DataValueAttributes &a)


Set the DataValueAttributes for the given index.

• virtual void setModel (QAbstractItemModel ∗model)


Associate a model with the diagram.

• void setPen (const QPen &pen)


Set the pen to be used, for painting all datasets in the model.

• void setPen (int dataset, const QPen &pen)


Set the pen to be used, for painting the given dataset.

• void setPen (const QModelIndex &index, const QPen &pen)


Set the pen to be used, for painting the datapoint at the given index.

• void setPercentMode (bool percent)


• virtual void setRootIndex (const QModelIndex &idx)
Set the root index in the model, where the diagram starts referencing data for display.

• virtual void setSelection (const QRect &rect, QItemSelectionModel::SelectionFlags command)


[reimplemented]

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.10 KDChart::AbstractPolarDiagram Class Reference 179

• void update () const


• void useDefaultColors ()
Set the palette to be used, for painting datasets to the default palette.

• void useRainbowColors ()
Set the palette to be used, for painting datasets to the rainbow palette.

• void useSubduedColors ()
Set the palette to be used, for painting datasets to the subdued palette.

• virtual double valueTotals () const=0


• virtual int verticalOffset () const
[reimplemented]

• virtual QRect visualRect (const QModelIndex &index) const


[reimplemented]

• virtual QRegion visualRegionForSelection (const QItemSelection &selection) const


[reimplemented]

• virtual ∼AbstractPolarDiagram ()

Protected Member Functions


• QModelIndex attributesModelRootIndex () const
• virtual const QPair< QPointF, QPointF > calculateDataBoundaries () const=0
• virtual bool checkInvariants (bool justReturnTheStatus=false) const
• QModelIndex columnToIndex (int column) const
• void modelsChanged ()
This signal is emitted, when either the model or the AttributesModel is replaced.

• virtual void paint (PaintContext ∗paintContext)=0


Draw the diagram contents to the rectangle and painter, that are passed in as part of the paint context.

• void paintDataValueText (QPainter ∗painter, const QModelIndex &index, const QPointF &pos, dou-
ble value)
• virtual void paintDataValueTexts (QPainter ∗painter)
• void paintMarker (QPainter ∗painter, const QModelIndex &index, const QPointF &pos)
• virtual void paintMarkers (QPainter ∗painter)
• void propertiesChanged ()
Emitted upon change of a property of the Diagram.

• void setAttributesModelRootIndex (const QModelIndex &)


• void setDataBoundariesDirty () const
• double valueForCell (int row, int column) const
Helper method, retrieving the data value (DisplayRole) for a given row and column.

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


180 KD Chart 2 Class Documentation

Protected Attributes

• Q_SIGNALS __pad0__: void layoutChanged( AbstractDiagram∗ )

6.10.1 Constructor & Destructor Documentation

6.10.1.1 AbstractPolarDiagram::AbstractPolarDiagram (QWidget ∗ parent = 0,


PolarCoordinatePlane ∗ plane = 0) [explicit]

Definition at line 46 of file KDChartAbstractPolarDiagram.cpp.

48 : AbstractDiagram ( new Private(), parent, plane )


49 {
50 }

6.10.1.2 virtual KDChart::AbstractPolarDiagram::∼AbstractPolarDiagram () [virtual]

Definition at line 45 of file KDChartAbstractPolarDiagram.h.

45 {}

6.10.2 Member Function Documentation

6.10.2.1 bool AbstractDiagram::allowOverlappingDataValueTexts () const [inherited]

Returns:
Whether data value labels are allowed to overlap.

Definition at line 291 of file KDChartAbstractDiagram.cpp.


References d.

295 {

6.10.2.2 bool AbstractDiagram::antiAliasing () const [inherited]

Returns:
Whether anti-aliasing is to be used for rendering this diagram.

Definition at line 302 of file KDChartAbstractDiagram.cpp.


References d.
Referenced by KDChart::LineDiagram::paint().

306 {

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.10 KDChart::AbstractPolarDiagram Class Reference 181

6.10.2.3 AttributesModel ∗ AbstractDiagram::attributesModel () const [virtual,


inherited]

Returns the AttributesModel, that is used by this diagram.


By default each diagram owns its own AttributesModel, which should never be deleted. Only if a user-
supplied AttributesModel has been set does the pointer returned here not belong to the diagram.

Returns:
The AttributesModel associated with the diagram.

See also:
setAttributesModel

Definition at line 180 of file KDChartAbstractDiagram.cpp.


References d.
Referenced by KDChart::RingDiagram::paint(), KDChart::PolarDiagram::paint(), and KDChart::Bar-
Diagram::setBarAttributes().

181 {
182 return d->attributesModel;
183 }

6.10.2.4 QModelIndex AbstractDiagram::attributesModelRootIndex () const [protected,


inherited]

returns a QModelIndex pointing into the AttributesModel that corresponds to the root index of the diagram.
Definition at line 204 of file KDChartAbstractDiagram.cpp.
References d.
Referenced by KDChart::LineDiagram::calculateDataBoundaries(), KDChart::BarDiagram::calculate-
DataBoundaries(), KDChart::LineDiagram::numberOfAbscissaSegments(), KDChart::Bar-
Diagram::numberOfAbscissaSegments(), KDChart::LineDiagram::numberOfOrdinateSegments(),
KDChart::BarDiagram::numberOfOrdinateSegments(), KDChart::LineDiagram::paint(), KDChart::Bar-
Diagram::paint(), and KDChart::AbstractDiagram::valueForCell().

210 {

6.10.2.5 QBrush AbstractDiagram::brush (const QModelIndex & index) const [inherited]

Retrieve the brush to be used, for painting the datapoint at the given index in the model.

Parameters:
index The index of the datapoint in the model.

Returns:
The brush to use for painting.

Definition at line 632 of file KDChartAbstractDiagram.cpp.

638 :
QRect AbstractDiagram::visualRect(const QModelIndex &) const

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


182 KD Chart 2 Class Documentation

6.10.2.6 QBrush AbstractDiagram::brush (int dataset) const [inherited]

Retrieve the brush to be used for the given dataset.


This will fall back automatically to what was set at model level, if there are no dataset specific settings.

Parameters:
dataset The dataset to retrieve the brush for.

Returns:
The brush to use for painting.

Definition at line 624 of file KDChartAbstractDiagram.cpp.

631 {

6.10.2.7 QBrush AbstractDiagram::brush () const [inherited]

Retrieve the brush to be used for painting datapoints globally.


This will fall back automatically to the default settings, if there are no specific settings.

Returns:
The brush to use for painting.

Definition at line 618 of file KDChartAbstractDiagram.cpp.


Referenced by KDChart::PieDiagram::paint(), and KDChart::AbstractDiagram::paintMarker().

623 {

6.10.2.8 virtual const QPair<QPointF, QPointF> KDChart::Abstract-


Diagram::calculateDataBoundaries () const [protected, pure virtual,
inherited]

Implemented in KDChart::BarDiagram, KDChart::LineDiagram, KDChart::PieDiagram, KDChart::Polar-


Diagram, and KDChart::RingDiagram.
Referenced by KDChart::AbstractDiagram::dataBoundaries().

6.10.2.9 bool AbstractDiagram::checkInvariants (bool justReturnTheStatus = false) const


[protected, virtual, inherited]

Definition at line 746 of file KDChartAbstractDiagram.cpp.


References KDChart::AbstractDiagram::coordinatePlane().
Referenced by KDChart::RingDiagram::calculateDataBoundaries(), KDChart::PolarDiagram::calculate-
DataBoundaries(), KDChart::PieDiagram::calculateDataBoundaries(), KDChart::LineDiagram::calculate-
DataBoundaries(), KDChart::BarDiagram::calculateDataBoundaries(), KDChart::RingDiagram::paint(),
KDChart::PolarDiagram::paint(), KDChart::PieDiagram::paint(), KDChart::LineDiagram::paint(),
KDChart::BarDiagram::paint(), and KDChart::AbstractDiagram::paintMarker().

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.10 KDChart::AbstractPolarDiagram Class Reference 183

746 {
747 Q_ASSERT_X ( model(), "AbstractDiagram::checkInvariants()",
748 "There is no usable model set, for the diagram." );
749
750 Q_ASSERT_X ( coordinatePlane(), "AbstractDiagram::checkInvariants()",
751 "There is no usable coordinate plane set, for the diagram." );
752 }
753 return model() && coordinatePlane();
754 }
755
756 int AbstractDiagram::datasetDimension( ) const

6.10.2.10 int AbstractPolarDiagram::columnCount () const

Definition at line 58 of file KDChartAbstractPolarDiagram.cpp.


References numberOfValuesPerDataset().
Referenced by KDChart::PieDiagram::calculateDataBoundaries(), KDChart::PieDiagram::paint(), and
KDChart::PieDiagram::valueTotals().

59 {
60 return static_cast<int>( numberOfValuesPerDataset() );
61 }

6.10.2.11 QModelIndex AbstractDiagram::columnToIndex (int column) const [protected,


inherited]

Definition at line 211 of file KDChartAbstractDiagram.cpp.

217 {

6.10.2.12 AbstractCoordinatePlane ∗ AbstractDiagram::coordinatePlane () const


[inherited]

The coordinate plane associated with the diagram.


This determines how coordinates in value space are mapped into pixel space. By default this is a Cartesian-
CoordinatePlane.

Returns:
The coordinate plane associated with the diagram.

Definition at line 125 of file KDChartAbstractDiagram.cpp.


References d.
Referenced by KDChart::BarDiagram::calculateDataBoundaries(), KDChart::AbstractDiagram::check-
Invariants(), KDChart::AbstractCartesianDiagram::layoutPlanes(), KDChart::PolarDiagram::paint(),
KDChart::LineDiagram::paint(), KDChart::BarDiagram::paint(), polarCoordinatePlane(), and
KDChart::AbstractCartesianDiagram::setCoordinatePlane().

126 {
127 return d->plane;
128 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


184 KD Chart 2 Class Documentation

6.10.2.13 const QPair< QPointF, QPointF > AbstractDiagram::dataBoundaries () const


[inherited]

Return the bottom left and top right data point, that the diagram will display (unless the grid adjusts these
values).
This method returns a chached result of calculations done by calculateDataBoundaries. Classes derived
from AbstractDiagram must implement the calculateDataBoundaries function, to specify their own way of
calculating the data boundaries. If derived classes want to force recalculation of the data boundaries, they
can call setDataBoundariesDirty()
Returned value is in diagram coordinates.
Definition at line 130 of file KDChartAbstractDiagram.cpp.
References KDChart::AbstractDiagram::calculateDataBoundaries(), and d.
Referenced by KDChart::CartesianCoordinatePlane::calculateRawDataBoundingRect(), KDChart::Polar-
CoordinatePlane::layoutDiagrams(), KDChart::LineDiagram::paint(), and KDChart::BarDiagram::paint().

131 {
132 if( d->databoundariesDirty ){
133 d->databoundaries = calculateDataBoundaries ();
134 d->databoundariesDirty = false;
135 }
136 return d->databoundaries;
137 }

6.10.2.14 void AbstractDiagram::dataChanged (const QModelIndex & topLeft, const


QModelIndex & bottomRight) [virtual, inherited]

[reimplemented]
Definition at line 232 of file KDChartAbstractDiagram.cpp.
References d.

232 {
233 // We are still too dumb to do intelligent updates...
234 d->databoundariesDirty = true;
235 scheduleDelayedItemsLayout();
236 }
237
238 void AbstractDiagram::setDataValueAttributes( const QModelIndex & index,

6.10.2.15 QList< QBrush > AbstractDiagram::datasetBrushes () const [inherited]

The set of dataset brushes currently used, for use in legends, etc.

Note:
Cell-level override brushes, if set, take precedence over the dataset values, so you might need to check
these too, in order to find the brush, that is used for a single cell.

Returns:
The current set of dataset brushes.

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.10 KDChart::AbstractPolarDiagram Class Reference 185

Definition at line 710 of file KDChartAbstractDiagram.cpp.


Referenced by KDChart::Legend::buildLegend(), KDChart::Legend::datasetCount(), and
KDChart::Legend::setBrushesFromDiagram().

712 {
713 QBrush brush = qVariantValue<QBrush>( attributesModel()->headerData( i, Qt::Vertical, DatasetB
714 ret << brush;
715 }
716
717 return ret;
718 }
719
720 QList<QPen> AbstractDiagram::datasetPens() const

6.10.2.16 int AbstractDiagram::datasetDimension () const [inherited]

The dataset dimension of a diagram determines, how many value dimensions it expects each datapoint to
have.
For each dimension it will expect one column of values in the model. If the dimensionality is 1, automatic
values will be used for the abscissa.
For example a diagram with the default dimension of 1, will have one column per datapoint (the y values)
and will use automatic values for the x axis (1, 2, 3, ... n). If the dimension is 2, the diagram will use the
first, (and the third, fifth, etc) columns as X values, and the second, (and the fourth, sixth, etc) column as Y
values.

Returns:
The dataset dimension of the diagram.

Definition at line 758 of file KDChartAbstractDiagram.cpp.


References d.
Referenced by KDChart::LineDiagram::calculateDataBoundaries(), KDChart::LineDiagram::get-
CellValues(), KDChart::CartesianCoordinatePlane::getDataDimensionsList(), KDChart::Line-
Diagram::paint(), and KDChart::LineDiagram::setType().

762 {

6.10.2.17 QStringList AbstractDiagram::datasetLabels () const [inherited]

The set of dataset labels currently displayed, for use in legends, etc.

Returns:
The set of dataset labels currently displayed.

Definition at line 698 of file KDChartAbstractDiagram.cpp.


Referenced by KDChart::Legend::buildLegend(), and KDChart::Legend::datasetCount().

699 : " << attributesModel()->columnCount(attributesModel


700 const int columnCount = attributesModel()->columnCount(attributesModelRootIndex());
701 for( int i = datasetDimension()-1; i < columnCount; i += datasetDimension() ){
702 //qDebug() << "label: " << attributesModel()->headerData( i, Qt::Horizontal, Qt::DisplayRole )

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


186 KD Chart 2 Class Documentation

703 ret << attributesModel()->headerData( i, Qt::Horizontal, Qt::DisplayRole ).toString();


704 }
705 return ret;
706 }
707
708 QList<QBrush> AbstractDiagram::datasetBrushes() const

6.10.2.18 QList< MarkerAttributes > AbstractDiagram::datasetMarkers () const


[inherited]

The set of dataset markers currently used, for use in legends, etc.

Note:
Cell-level override markers, if set, take precedence over the dataset values, so you might need to check
these too, in order to find the marker, that is shown for a single cell.

Returns:
The current set of dataset brushes.

Definition at line 733 of file KDChartAbstractDiagram.cpp.


Referenced by KDChart::Legend::buildLegend().

735 {
736 DataValueAttributes a =
737 qVariantValue<DataValueAttributes>( attributesModel()->headerData( i, Qt::Vertical, DataVa
738 const MarkerAttributes &ma = a.markerAttributes();
739 ret << ma;
740 }
741 return ret;
742 }
743
744 bool AbstractDiagram::checkInvariants( bool justReturnTheStatus ) const

6.10.2.19 QList< QPen > AbstractDiagram::datasetPens () const [inherited]

The set of dataset pens currently used, for use in legends, etc.

Note:
Cell-level override pens, if set, take precedence over the dataset values, so you might need to check
these too, in order to find the pens, that is used for a single cell.

Returns:
The current set of dataset pens.

Definition at line 722 of file KDChartAbstractDiagram.cpp.


Referenced by KDChart::Legend::buildLegend().

724 {
725 QPen pen = qVariantValue<QPen>( attributesModel()->headerData( i, Qt::Vertical, DatasetPenRole
726 ret << pen;
727 }
728 return ret;
729 }
730
731 QList<MarkerAttributes> AbstractDiagram::datasetMarkers() const

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.10 KDChart::AbstractPolarDiagram Class Reference 187

6.10.2.20 DataValueAttributes AbstractDiagram::dataValueAttributes (const QModelIndex &


index) const [inherited]

Retrieve the DataValueAttributes for the given index.


This will fall back automatically to what was set at dataset or model level, if there are no datapoint specific
settings.

Parameters:
index The datapoint to retrieve the attributes for.

Returns:
The DataValueAttributes for the given index.

Definition at line 272 of file KDChartAbstractDiagram.cpp.

278 {

6.10.2.21 DataValueAttributes AbstractDiagram::dataValueAttributes (int column) const


[inherited]

Retrieve the DataValueAttributes for the given dataset.


This will fall back automatically to what was set at model level, if there are no dataset specific settings.

Parameters:
dataset The dataset to retrieve the attributes for.

Returns:
The DataValueAttributes for the given dataset.

Definition at line 265 of file KDChartAbstractDiagram.cpp.

271 {

6.10.2.22 DataValueAttributes AbstractDiagram::dataValueAttributes () const [inherited]

Retrieve the DataValueAttributes speficied globally.


This will fall back automatically to the default settings, if there are no specific settings.

Returns:
The global DataValueAttributes.

Definition at line 260 of file KDChartAbstractDiagram.cpp.


Referenced by KDChart::AbstractDiagram::paintDataValueText(), and KDChart::AbstractDiagram::paint-
Marker().

264 {

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


188 KD Chart 2 Class Documentation

6.10.2.23 void AbstractDiagram::doItemsLayout () [virtual, inherited]

[reimplemented]
Definition at line 223 of file KDChartAbstractDiagram.cpp.
References d, and KDChart::AbstractDiagram::update().

223 {
224 d->plane->layoutDiagrams();
225 update();
226 }
227 QAbstractItemView::doItemsLayout();
228 }
229
230 void AbstractDiagram::dataChanged( const QModelIndex &topLeft,

6.10.2.24 int AbstractDiagram::horizontalOffset () const [virtual, inherited]

[reimplemented]
Definition at line 655 of file KDChartAbstractDiagram.cpp.

657 { return 0; }

6.10.2.25 QModelIndex AbstractDiagram::indexAt (const QPoint & point) const [virtual,


inherited]

[reimplemented]
Definition at line 649 of file KDChartAbstractDiagram.cpp.

651 { return QModelIndex(); }

6.10.2.26 bool AbstractDiagram::isIndexHidden (const QModelIndex & index) const


[virtual, inherited]

[reimplemented]
Definition at line 661 of file KDChartAbstractDiagram.cpp.

663 {}

6.10.2.27 QStringList AbstractDiagram::itemRowLabels () const [inherited]

The set of item row labels currently displayed, for use in Abscissa axes, etc.

Returns:
The set of item row labels currently displayed.

Definition at line 686 of file KDChartAbstractDiagram.cpp.

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.10 KDChart::AbstractPolarDiagram Class Reference 189

687 : " << attributesModel()->rowCount(attributesModelRoo


688 const int rowCount = attributesModel()->rowCount(attributesModelRootIndex());
689 for( int i = 0; i < rowCount; ++i ){
690 //qDebug() << "label: " << attributesModel()->headerData( i, Qt::Vertical, Qt::DisplayRole ).t
691 ret << attributesModel()->headerData( i, Qt::Vertical, Qt::DisplayRole ).toString();
692 }
693 return ret;
694 }
695
696 QStringList AbstractDiagram::datasetLabels() const

6.10.2.28 void KDChart::AbstractDiagram::modelsChanged () [protected, inherited]

This signal is emitted, when either the model or the AttributesModel is replaced.
Referenced by KDChart::AbstractDiagram::setAttributesModel(), and KDChart::AbstractDiagram::set-
Model().

6.10.2.29 QModelIndex AbstractDiagram::moveCursor (CursorAction cursorAction,


Qt::KeyboardModifiers modifiers) [virtual, inherited]

[reimplemented]
Definition at line 652 of file KDChartAbstractDiagram.cpp.

654 { return 0; }

6.10.2.30 virtual double KDChart::AbstractPolarDiagram::numberOfGridRings () const [pure


virtual]

Implemented in KDChart::PieDiagram, KDChart::PolarDiagram, and KDChart::RingDiagram.

6.10.2.31 virtual double KDChart::AbstractPolarDiagram::numberOfValuesPerDataset () const


[pure virtual]

Implemented in KDChart::PieDiagram, KDChart::PolarDiagram, and KDChart::RingDiagram.


Referenced by columnCount().

6.10.2.32 virtual void KDChart::AbstractDiagram::paint (PaintContext ∗ paintContext)


[protected, pure virtual, inherited]

Draw the diagram contents to the rectangle and painter, that are passed in as part of the paint context.

Parameters:
paintContext All information needed for painting.

Implemented in KDChart::BarDiagram, KDChart::LineDiagram, KDChart::PieDiagram, KDChart::Polar-


Diagram, and KDChart::RingDiagram.

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


190 KD Chart 2 Class Documentation

6.10.2.33 void AbstractDiagram::paintDataValueText (QPainter ∗ painter, const QModelIndex &


index, const QPointF & pos, double value) [protected, inherited]

Definition at line 318 of file KDChartAbstractDiagram.cpp.


References KDChart::DataValueAttributes::dataLabel(), KDChart::AbstractDiagram::dataValue-
Attributes(), KDChart::DataValueAttributes::decimalDigits(), KDChart::TextAttributes::font(),
KDChart::TextAttributes::isVisible(), KDChart::DataValueAttributes::isVisible(), KDChart::Text-
Attributes::pen(), KDChart::DataValueAttributes::prefix(), KDChart::TextAttributes::rotation(),
KDChart::DataValueAttributes::suffix(), and KDChart::DataValueAttributes::textAttributes().
Referenced by KDChart::RingDiagram::paint(), KDChart::PolarDiagram::paint(), KDChart::Line-
Diagram::paint(), and KDChart::BarDiagram::paint().

320 {
321 // paint one data series
322 DataValueAttributes a = dataValueAttributes(index);
323 if ( !a.isVisible() ) return;
324
325 // handle decimal digits
326 int decimalDigits = a.decimalDigits();
327 int decimalPos = QString::number( value ).indexOf( QLatin1Char( ’.’ ) );
328 QString roundedValue;
329 if ( a.dataLabel().isNull() ) {
330 if ( decimalPos > 0 && value != 0 )
331 roundedValue = roundValues ( value, decimalPos, decimalDigits );
332 else
333 roundedValue = QString::number( value );
334 } else
335 roundedValue = a.dataLabel();
336 // handle prefix and suffix
337 if ( !a.prefix().isNull() )
338 roundedValue.prepend( a.prefix() );
339
340 if ( !a.suffix().isNull() )
341 roundedValue.append( a.suffix() );
342
343 PainterSaver painterSaver( painter );
344 // FIXME draw the non-text bits, background, etc
345 const TextAttributes &ta = a.textAttributes();
346 if ( ta.isVisible() ) {
347 painter->setPen( ta.pen() );
348 painter->setFont( ta.font() );
349 painter->translate( pos );
350 painter->rotate( ta.rotation() );
351 painter->drawText( QPointF(0, 0), roundedValue );
352 }
353 }
354
355 QString AbstractDiagram::roundValues( double value,

6.10.2.34 void AbstractDiagram::paintDataValueTexts (QPainter ∗ painter) [protected,


virtual, inherited]

Definition at line 382 of file KDChartAbstractDiagram.cpp.

385 {
386 for ( int j=0; j< rowCount; ++j ) {
387 const QModelIndex index = model()->index( j, i, rootIndex() );
388 double value = model()->data( index ).toDouble();
389 const QPointF pos = coordinatePlane()->translate( QPointF( j, value ) );
390 paintDataValueText( painter, index, pos, value );

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.10 KDChart::AbstractPolarDiagram Class Reference 191

391 }
392 }
393 }
394
395

6.10.2.35 void AbstractDiagram::paintMarker (QPainter ∗ painter, const QModelIndex & index,


const QPointF & pos) [protected, inherited]

Definition at line 398 of file KDChartAbstractDiagram.cpp.


References KDChart::AbstractDiagram::brush(), KDChart::AbstractDiagram::checkInvariants(),
KDChart::AbstractDiagram::dataValueAttributes(), KDChart::MarkerAttributes::isVisible(),
KDChart::DataValueAttributes::isVisible(), KDChart::DataValueAttributes::markerAttributes(),
KDChart::MarkerAttributes::markerColor(), KDChart::MarkerAttributes::markerSize(),
KDChart::AbstractDiagram::paintMarker(), and KDChart::MarkerAttributes::pen().

399 {
400
401 if ( !checkInvariants() ) return;
402 DataValueAttributes a = dataValueAttributes(index);
403 if ( !a.isVisible() ) return;
404 const MarkerAttributes &ma = a.markerAttributes();
405 if ( !ma.isVisible() ) return;
406
407 PainterSaver painterSaver( painter );
408 QSizeF maSize( ma.markerSize() );
409 QBrush indexBrush( brush( index ) );
410 QPen indexPen( ma.pen() );
411 if ( ma.markerColor().isValid() )
412 indexBrush.setColor( ma.markerColor() );
413
414 paintMarker( painter, ma, indexBrush, indexPen, pos, maSize );
415 }
416
417

6.10.2.36 void AbstractDiagram::paintMarker (QPainter ∗ painter, const MarkerAttributes &


markerAttributes, const QBrush & brush, const QPen &, const QPointF & point, const
QSizeF & size) [virtual, inherited]

Definition at line 420 of file KDChartAbstractDiagram.cpp.


References KDChart::MarkerAttributes::markerStyle().
Referenced by KDChart::LineDiagram::paint(), KDChart::MarkerLayoutItem::paint(), and
KDChart::AbstractDiagram::paintMarker().

424 {
425 PainterSaver painterSaver( painter );
426 painter->setBrush( brush );
427 painter->setPen( pen );
428 painter->setRenderHint ( QPainter::Antialiasing );
429 painter->translate( pos );
430 switch ( markerAttributes.markerStyle() ) {
431 case MarkerAttributes::MarkerCircle:
432 painter->drawEllipse( QRectF( 0 - maSize.height()/2, 0 - maSize.width()/2,
433 maSize.height(), maSize.width()) );
434 break;

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


192 KD Chart 2 Class Documentation

435 case MarkerAttributes::MarkerSquare:


436 {
437 QRectF rect( 0 - maSize.height()/2, 0 - maSize.width()/2,
438 maSize.height(), maSize.width() );
439 painter->drawRect( rect );
440 painter->fillRect( rect, painter->brush() );
441 break;
442 }
443 case MarkerAttributes::MarkerDiamond:
444 {
445 QVector <QPointF > diamondPoints;
446 QPointF top, left, bottom, right;
447 top = QPointF( 0, 0 - maSize.height()/2 );
448 left = QPointF( 0 - maSize.width()/2, 0 );
449 bottom = QPointF( 0, maSize.height()/2 );
450 right = QPointF( maSize.width()/2, 0 );
451 diamondPoints << top << left << bottom << right;
452 painter->drawPolygon( diamondPoints );
453 break;
454 }
455 //Pending Michel: do we need that? Ask: What is the idea about
456 // Marker1Pixel and Marker4Pixels.
457 case MarkerAttributes::Marker1Pixel:
458 {
459 QSizeF pSize(4,4);
460 QPen pen1Pixel;
461 pen1Pixel.setColor( painter->background().color() );
462 QRectF centerRect( -pSize.height()/2, -pSize.width()/2,
463 pSize.height(), pSize.width() );
464 painter->setPen( pen1Pixel );
465 painter->drawEllipse( centerRect );
466 break;
467 }
468 case MarkerAttributes::Marker4Pixels:
469 {
470 QSizeF pSize(8, 8);
471 QPen pen4Pixel;
472 pen4Pixel.setColor( painter->background().color() );
473 QRectF centerRect( -pSize.height()/2, -pSize.width()/2,
474 pSize.height(), pSize.width() );
475 painter->setPen( pen4Pixel );
476 painter->drawEllipse( centerRect );
477 break;
478 }
479 case MarkerAttributes::MarkerRing:
480 {
481 painter->setBrush( Qt::NoBrush );
482 painter->drawEllipse( QRectF( 0 - maSize.height()/2, 0 - maSize.width()/2,
483 maSize.height(), maSize.width()) );
484 break;
485 }
486 case MarkerAttributes::MarkerCross:
487 {
488 QVector <QPointF > crossPoints;
489 QPointF leftTop, leftBottom, centerBottomLeft, bottomLeft, bottomRight,
490 centerBottomRight,rightBottom, rightTop, centerTopRight, topRight, topLeft,
491 centerTopLeft;
492 leftTop = QPointF( -maSize.width()/2, -maSize.height()/4 );
493 leftBottom = QPointF( -maSize.width()/2, maSize.height()/4 );
494 centerBottomLeft = QPointF( -maSize.width()/4, maSize.height()/4 );
495 bottomLeft = QPointF( -maSize.width()/4, maSize.height()/2 );
496 bottomRight = QPointF( maSize.width()/4, maSize.height()/2 );
497 centerBottomRight = QPointF( maSize.width()/4, maSize.height()/4 );
498 rightBottom = QPointF( maSize.width()/2, maSize.height()/4 );
499 rightTop = QPointF( maSize.width()/2, -maSize.height()/4 );
500 centerTopRight = QPointF( maSize.width()/4, -maSize.height()/4 );
501 topRight = QPointF( maSize.width()/4, -maSize.height()/2 );

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.10 KDChart::AbstractPolarDiagram Class Reference 193

502 topLeft = QPointF( -maSize.width()/4, -maSize.height()/2 );


503 centerTopLeft = QPointF( -maSize.width()/4, -maSize.height()/4 );
504
505 crossPoints << leftTop << leftBottom << centerBottomLeft
506 << bottomLeft << bottomRight << centerBottomRight
507 << rightBottom << rightTop << centerTopRight
508 << topRight << topLeft << centerTopLeft;
509
510 painter->drawPolygon( crossPoints );
511 break;
512 }
513 case MarkerAttributes::MarkerFastCross:
514 {
515 QPointF left, right, top, bottom;
516 left = QPointF( -maSize.width()/2, 0 );
517 right = QPointF( maSize.width()/2, 0 );
518 top = QPointF( 0, -maSize.height()/2 );
519 bottom= QPointF( 0, maSize.height()/2 );
520 painter->drawLine( left, right );
521 painter->drawLine( top, bottom );
522 break;
523 }
524 default:
525 Q_ASSERT_X ( false, "paintMarkers()",
526 "Type item does not match a defined Marker Type." );
527 }
528 }
529
530 void AbstractDiagram::paintMarkers( QPainter* painter )

6.10.2.37 void AbstractDiagram::paintMarkers (QPainter ∗ painter) [protected,


virtual, inherited]

Definition at line 532 of file KDChartAbstractDiagram.cpp.

535 {
536 for ( int j=0; j< rowCount; ++j ) {
537 const QModelIndex index = model()->index( j, i, rootIndex() );
538 double value = model()->data( index ).toDouble();
539 const QPointF pos = coordinatePlane()->translate( QPointF( j, value ) );
540 paintMarker( painter, index, pos );
541 }
542 }
543 }
544
545

6.10.2.38 QPen AbstractDiagram::pen (const QModelIndex & index) const [inherited]

Retrieve the pen to be used, for painting the datapoint at the given index in the model.

Parameters:
index The index of the datapoint in the model.

Returns:
The pen to use for painting.

Definition at line 586 of file KDChartAbstractDiagram.cpp.

593 {

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


194 KD Chart 2 Class Documentation

6.10.2.39 QPen AbstractDiagram::pen (int dataset) const [inherited]

Retrieve the pen to be used for the given dataset.


This will fall back automatically to what was set at model level, if there are no dataset specific settings.

Parameters:
dataset The dataset to retrieve the pen for.

Returns:
The pen to use for painting.

Definition at line 578 of file KDChartAbstractDiagram.cpp.

585 {

6.10.2.40 QPen AbstractDiagram::pen () const [inherited]

Retrieve the pen to be used for painting datapoints globally.


This will fall back automatically to the default settings, if there are no specific settings.

Returns:
The pen to use for painting.

Definition at line 572 of file KDChartAbstractDiagram.cpp.


Referenced by KDChart::PieDiagram::paint().

577 {

6.10.2.41 bool AbstractDiagram::percentMode () const [inherited]

Definition at line 313 of file KDChartAbstractDiagram.cpp.


References d.
Referenced by KDChart::CartesianCoordinatePlane::getDataDimensionsList().

320 {

6.10.2.42 const PolarCoordinatePlane ∗ AbstractPolarDiagram::polarCoordinatePlane () const

Definition at line 53 of file KDChartAbstractPolarDiagram.cpp.


References KDChart::AbstractDiagram::coordinatePlane().
Referenced by KDChart::PieDiagram::paint().

54 {
55 return dynamic_cast<const PolarCoordinatePlane*>( coordinatePlane() );
56 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.10 KDChart::AbstractPolarDiagram Class Reference 195

6.10.2.43 void KDChart::AbstractDiagram::propertiesChanged () [protected,


inherited]

Emitted upon change of a property of the Diagram.


Referenced by KDChart::AbstractDiagram::setDataValueAttributes(), KDChart::LineDiagram::setLine-
Attributes(), KDChart::LineDiagram::setThreeDLineAttributes(), and KDChart::LineDiagram::setType().

6.10.2.44 virtual void KDChart::AbstractDiagram::resize (const QSizeF & area) [pure


virtual, inherited]

Called by the widget’s sizeEvent.


Adjust all internal structures, that are calculated, dependending on the size of the widget.

Parameters:
area

Implemented in KDChart::BarDiagram, KDChart::LineDiagram, KDChart::PieDiagram, KDChart::Polar-


Diagram, and KDChart::RingDiagram.

6.10.2.45 void AbstractDiagram::scrollTo (const QModelIndex & index, ScrollHint hint =


EnsureVisible) [virtual, inherited]

[reimplemented]
Definition at line 646 of file KDChartAbstractDiagram.cpp.

648 { return QModelIndex(); }

6.10.2.46 void AbstractDiagram::setAllowOverlappingDataValueTexts (bool allow)


[inherited]

Set whether data value labels are allowed to overlap.

Parameters:
allow True means that overlapping labels are allowed.

Definition at line 285 of file KDChartAbstractDiagram.cpp.


References d.

290 {

6.10.2.47 void AbstractDiagram::setAntiAliasing (bool enabled) [inherited]

Set whether anti-aliasing is to be used while rendering this diagram.

Parameters:
enabled True means that AA is enabled.

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


196 KD Chart 2 Class Documentation

Definition at line 296 of file KDChartAbstractDiagram.cpp.


References d.

301 {

6.10.2.48 void AbstractDiagram::setAttributesModel (AttributesModel ∗ model) [virtual,


inherited]

Associate an AttributesModel with this diagram.


Note that the diagram does _not_ take ownership of the AttributesModel. This should thus only be used
with AttributesModels that have been explicitely created by the user, and are owned by her. Setting an
AttributesModel that is internal to another diagram is an error.
Correct:

AttributesModel *am = new AttributesModel( model, 0 );


diagram1->setAttributesModel( am );
diagram2->setAttributesModel( am );

Wrong:

diagram1->setAttributesModel( diagram2->attributesModel() );

Parameters:
model The AttributesModel to use for this diagram.

See also:
AttributesModel

Definition at line 160 of file KDChartAbstractDiagram.cpp.


References d, and KDChart::AbstractDiagram::modelsChanged().

161 {
162 if( amodel->sourceModel() != model() ) {
163 qWarning("KDChart::AbstractDiagram::setAttributesModel() failed: "
164 "Trying to set an attributesmodel which works on a different "
165 "model than the diagram.");
166 return;
167 }
168 if( qobject_cast<PrivateAttributesModel*>(amodel) ) {
169 qWarning("KDChart::AbstractDiagram::setAttributesModel() failed: "
170 "Trying to set an attributesmodel that is private to another diagram.");
171 return;
172 }
173 d->setAttributesModel(amodel);
174 scheduleDelayedItemsLayout();
175 d->databoundariesDirty = true;
176 emit modelsChanged();
177 }

6.10.2.49 void AbstractDiagram::setAttributesModelRootIndex (const QModelIndex & idx)


[protected, inherited]

Definition at line 195 of file KDChartAbstractDiagram.cpp.


References d.

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.10 KDChart::AbstractPolarDiagram Class Reference 197

6.10.2.50 void AbstractDiagram::setBrush (const QBrush & brush) [inherited]

Set the brush to be used, for painting all datasets in the model.

Parameters:
brush The brush to use.

Definition at line 602 of file KDChartAbstractDiagram.cpp.

608 {

6.10.2.51 void AbstractDiagram::setBrush (int dataset, const QBrush & brush) [inherited]

Set the brush to be used, for painting the given dataset.

Parameters:
dataset The dataset’s column in the model.
pen The brush to use.

Definition at line 609 of file KDChartAbstractDiagram.cpp.

617 {

6.10.2.52 void AbstractDiagram::setBrush (const QModelIndex & index, const QBrush & brush)
[inherited]

Set the brush to be used, for painting the datapoint at the given index.

Parameters:
index The datapoint’s index in the model.
brush The brush to use.

Definition at line 594 of file KDChartAbstractDiagram.cpp.

601 {

6.10.2.53 void AbstractDiagram::setCoordinatePlane (AbstractCoordinatePlane ∗ plane)


[virtual, inherited]

Set the coordinate plane associated with the diagram.


This determines how coordinates in value space are mapped into pixel space. The chart takes ownership.

Returns:
The coordinate plane associated with the diagram.

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


198 KD Chart 2 Class Documentation

Reimplemented in KDChart::AbstractCartesianDiagram.
Definition at line 218 of file KDChartAbstractDiagram.cpp.
References d.
Referenced by KDChart::AbstractCoordinatePlane::addDiagram(), KDChart::AbstractCartesian-
Diagram::setCoordinatePlane(), and KDChart::AbstractCoordinatePlane::takeDiagram().

222 {

6.10.2.54 void AbstractDiagram::setDataBoundariesDirty () const [protected,


inherited]

Definition at line 139 of file KDChartAbstractDiagram.cpp.


References d.
Referenced by KDChart::BarDiagram::setThreeDBarAttributes(), KDChart::LineDiagram::setThree-
DLineAttributes(), KDChart::LineDiagram::setType(), and KDChart::BarDiagram::setType().

140 {
141 d->databoundariesDirty = true;
142 }

6.10.2.55 void AbstractDiagram::setDatasetDimension (int dimension) [inherited]

Sets the dataset dimension of the diagram.

See also:
datasetDimension.

Parameters:
dimension

Definition at line 763 of file KDChartAbstractDiagram.cpp.


References d.

770 {

6.10.2.56 void AbstractDiagram::setDataValueAttributes (const DataValueAttributes & a)


[inherited]

Set the DataValueAttributes for all datapoints in the model.

Parameters:
a The attributes to set.

Definition at line 279 of file KDChartAbstractDiagram.cpp.


References d.

284 {

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.10 KDChart::AbstractPolarDiagram Class Reference 199

6.10.2.57 void AbstractDiagram::setDataValueAttributes (int dataset, const DataValueAttributes


& a) [inherited]

Set the DataValueAttributes for the given dataset.

Parameters:
dataset The dataset to set the attributes for.
a The attributes to set.

Definition at line 251 of file KDChartAbstractDiagram.cpp.


References d.

259 {

6.10.2.58 void AbstractDiagram::setDataValueAttributes (const QModelIndex & index, const


DataValueAttributes & a) [inherited]

Set the DataValueAttributes for the given index.

Parameters:
index The datapoint to set the attributes for.
a The attributes to set.

Definition at line 240 of file KDChartAbstractDiagram.cpp.


References d, KDChart::DataValueLabelAttributesRole, and KDChart::AbstractDiagram::properties-
Changed().

240 {
241 d->attributesModel->setData(
242 d->attributesModel->mapFromSource( index ),
243 qVariantFromValue( a ),
244 DataValueLabelAttributesRole );
245 emit propertiesChanged();
246 }
247
248

6.10.2.59 void AbstractDiagram::setModel (QAbstractItemModel ∗ model) [virtual,


inherited]

Associate a model with the diagram.


Definition at line 144 of file KDChartAbstractDiagram.cpp.
References d, KDChart::AttributesModel::initFrom(), and KDChart::AbstractDiagram::modelsChanged().

145 {
146 QAbstractItemView::setModel( newModel );
147 AttributesModel* amodel = new PrivateAttributesModel( newModel, this );
148 amodel->initFrom( d->attributesModel );
149 d->setAttributesModel(amodel);
150 scheduleDelayedItemsLayout();
151 d->databoundariesDirty = true;
152 emit modelsChanged();
153 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


200 KD Chart 2 Class Documentation

6.10.2.60 void AbstractDiagram::setPen (const QPen & pen) [inherited]

Set the pen to be used, for painting all datasets in the model.

Parameters:
pen The pen to use.

Definition at line 556 of file KDChartAbstractDiagram.cpp.

562 {

6.10.2.61 void AbstractDiagram::setPen (int dataset, const QPen & pen) [inherited]

Set the pen to be used, for painting the given dataset.

Parameters:
dataset The dataset’s row in the model.
pen The pen to use.

Definition at line 563 of file KDChartAbstractDiagram.cpp.

571 {

6.10.2.62 void AbstractDiagram::setPen (const QModelIndex & index, const QPen & pen)
[inherited]

Set the pen to be used, for painting the datapoint at the given index.

Parameters:
index The datapoint’s index in the model.
pen The pen to use.

Definition at line 548 of file KDChartAbstractDiagram.cpp.

555 {

6.10.2.63 void AbstractDiagram::setPercentMode (bool percent) [inherited]

Definition at line 307 of file KDChartAbstractDiagram.cpp.


References d.
Referenced by KDChart::LineDiagram::setType(), and KDChart::BarDiagram::setType().

312 {

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.10 KDChart::AbstractPolarDiagram Class Reference 201

6.10.2.64 void AbstractDiagram::setRootIndex (const QModelIndex & idx) [virtual,


inherited]

Set the root index in the model, where the diagram starts referencing data for display.
[reimplemented]
Definition at line 188 of file KDChartAbstractDiagram.cpp.
References d.

6.10.2.65 void AbstractDiagram::setSelection (const QRect & rect,


QItemSelectionModel::SelectionFlags command) [virtual, inherited]

[reimplemented]
Definition at line 664 of file KDChartAbstractDiagram.cpp.

666 { return QRegion(); }

6.10.2.66 void AbstractDiagram::update () const [inherited]

Definition at line 777 of file KDChartAbstractDiagram.cpp.


References d.
Referenced by KDChart::AbstractDiagram::doItemsLayout().

6.10.2.67 void KDChart::AbstractDiagram::useDefaultColors () [inherited]

Set the palette to be used, for painting datasets to the default palette.

See also:
KDChart::Palette. FIXME: fold into one usePalette (KDChart::Palette&) method

Definition at line 671 of file KDChartAbstractDiagram.cpp.


References d.

675 {

6.10.2.68 void KDChart::AbstractDiagram::useRainbowColors () [inherited]

Set the palette to be used, for painting datasets to the rainbow palette.

See also:
KDChart::Palette.

Definition at line 681 of file KDChartAbstractDiagram.cpp.


References d.

685 {

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


202 KD Chart 2 Class Documentation

6.10.2.69 void KDChart::AbstractDiagram::useSubduedColors () [inherited]

Set the palette to be used, for painting datasets to the subdued palette.

See also:
KDChart::Palette.

Definition at line 676 of file KDChartAbstractDiagram.cpp.


References d.

680 {

6.10.2.70 double AbstractDiagram::valueForCell (int row, int column) const [protected,


inherited]

Helper method, retrieving the data value (DisplayRole) for a given row and column.

Parameters:
row The row to query.
column The column to query.

Returns:
The value of the display role at the given row and column as a double.

Definition at line 771 of file KDChartAbstractDiagram.cpp.


References KDChart::AbstractDiagram::attributesModelRootIndex(), and d.
Referenced by KDChart::LineDiagram::paint().

776 {

6.10.2.71 virtual double KDChart::AbstractPolarDiagram::valueTotals () const [pure


virtual]

Implemented in KDChart::PieDiagram, KDChart::PolarDiagram, and KDChart::RingDiagram.


Referenced by KDChart::PolarCoordinatePlane::layoutDiagrams().

6.10.2.72 int AbstractDiagram::verticalOffset () const [virtual, inherited]

[reimplemented]
Definition at line 658 of file KDChartAbstractDiagram.cpp.

660 { return true; }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.10 KDChart::AbstractPolarDiagram Class Reference 203

6.10.2.73 QRect AbstractDiagram::visualRect (const QModelIndex & index) const [virtual,


inherited]

[reimplemented]
Definition at line 641 of file KDChartAbstractDiagram.cpp.

645 {}

6.10.2.74 QRegion AbstractDiagram::visualRegionForSelection (const QItemSelection &


selection) const [virtual, inherited]

[reimplemented]
Definition at line 667 of file KDChartAbstractDiagram.cpp.

6.10.3 Member Data Documentation

6.10.3.1 Q_SIGNALS KDChart::AbstractDiagram::__pad0__ [protected, inherited]

Definition at line 506 of file KDChartAbstractDiagram.h.


The documentation for this class was generated from the following files:

• KDChartAbstractPolarDiagram.h
• KDChartAbstractPolarDiagram.cpp

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


204 KD Chart 2 Class Documentation

6.11 KDChart::AbstractProxyModel Class Reference


#include <KDChartAbstractProxyModel.h>
Inheritance diagram for KDChart::AbstractProxyModel:Collaboration diagram for KDChart::Abstract-
ProxyModel:

Public Member Functions


• AbstractProxyModel (QObject ∗parent=0)
This is basically KDAbstractProxyModel, but only the bits that we really need from it.

• QModelIndex index (int row, int col, const QModelIndex &index) const
• QModelIndex mapFromSource (const QModelIndex &sourceIndex) const
• QModelIndex mapToSource (const QModelIndex &proxyIndex) const
• QModelIndex parent (const QModelIndex &index) const

6.11.1 Constructor & Destructor Documentation

6.11.1.1 KDChart::AbstractProxyModel::AbstractProxyModel (QObject ∗ parent = 0)


[explicit]

This is basically KDAbstractProxyModel, but only the bits that we really need from it.
Definition at line 12 of file KDChartAbstractProxyModel.cpp.

13 : QAbstractProxyModel(parent) {}

6.11.2 Member Function Documentation

6.11.2.1 QModelIndex KDChart::AbstractProxyModel::index (int row, int col, const


QModelIndex & index) const

Definition at line 53 of file KDChartAbstractProxyModel.cpp.


References mapFromSource(), and mapToSource().
Referenced by KDChart::AttributesModel::setHeaderData(), and KDChart::AttributesModel::setModel-
Data().

54 {
55 Q_ASSERT(sourceModel());
56 return mapFromSource(sourceModel()->index( row, col, mapToSource(index) ));
57 }

6.11.2.2 QModelIndex KDChart::AbstractProxyModel::mapFromSource (const QModelIndex &


sourceIndex) const

Definition at line 23 of file KDChartAbstractProxyModel.cpp.


Referenced by index(), and parent().

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.11 KDChart::AbstractProxyModel Class Reference 205

24 {
25 if ( !sourceIndex.isValid() )
26 return QModelIndex();
27 //qDebug() << "sourceIndex.model()="<<sourceIndex.model();
28 //qDebug() << "model()="<<sourceModel();
29 Q_ASSERT( sourceIndex.model() == sourceModel() );
30
31 // Create an index that preserves the internal pointer from the source;
32 // this way AbstractProxyModel preserves the structure of the source model
33 return createIndex( sourceIndex.row(), sourceIndex.column(), sourceIndex.internalPointer() );
34 }

6.11.2.3 QModelIndex KDChart::AbstractProxyModel::mapToSource (const QModelIndex &


proxyIndex) const

Definition at line 36 of file KDChartAbstractProxyModel.cpp.


Referenced by KDChart::AttributesModel::columnCount(), KDChart::AttributesModel::data(), index(),
parent(), KDChart::AttributesModel::rowCount(), and KDChart::AttributesModel::setData().

37 {
38 if ( !proxyIndex.isValid() )
39 return QModelIndex();
40 Q_ASSERT( proxyIndex.model() == this );
41 // So here we need to create a source index which holds that internal pointer.
42 // No way to pass it to sourceModel()->index... so we have to do the ugly way:
43 QModelIndex sourceIndex;
44 KDPrivateModelIndex* hack = reinterpret_cast<KDPrivateModelIndex*>(&sourceIndex);
45 hack->r = proxyIndex.row();
46 hack->c = proxyIndex.column();
47 hack->p = proxyIndex.internalPointer();
48 hack->m = sourceModel();
49 Q_ASSERT( sourceIndex.isValid() );
50 return sourceIndex;
51 }

6.11.2.4 QModelIndex KDChart::AbstractProxyModel::parent (const QModelIndex & index)


const

Definition at line 59 of file KDChartAbstractProxyModel.cpp.


References mapFromSource(), and mapToSource().

60 {
61 Q_ASSERT(sourceModel());
62 return mapFromSource(sourceModel()->parent( mapToSource(index) ));
63 }

The documentation for this class was generated from the following files:

• KDChartAbstractProxyModel.h
• KDChartAbstractProxyModel.cpp

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


206 KD Chart 2 Class Documentation

6.12 KDChart::AbstractThreeDAttributes Class Reference


#include <KDChartAbstractThreeDAttributes.h>
Inheritance diagram for KDChart::AbstractThreeDAttributes:

Public Member Functions


• AbstractThreeDAttributes (const AbstractThreeDAttributes &)
• AbstractThreeDAttributes ()
• double depth () const
• bool isEnabled () const
• bool operator!= (const AbstractThreeDAttributes &other) const
• AbstractThreeDAttributes & operator= (const AbstractThreeDAttributes &)
• bool operator== (const AbstractThreeDAttributes &) const
• void setDepth (double depth)
• void setEnabled (bool enabled)
• double validDepth () const
• virtual ∼AbstractThreeDAttributes ()=0

6.12.1 Constructor & Destructor Documentation

6.12.1.1 AbstractThreeDAttributes::AbstractThreeDAttributes ()

Definition at line 46 of file KDChartAbstractThreeDAttributes.cpp.

47 : _d( new Private() )


48 {
49 }

6.12.1.2 AbstractThreeDAttributes::AbstractThreeDAttributes (const AbstractThreeDAttributes


&)

Definition at line 51 of file KDChartAbstractThreeDAttributes.cpp.


References d.

52 : _d( new Private( *r.d ) )


53 {
54 }

6.12.1.3 AbstractThreeDAttributes::∼AbstractThreeDAttributes () [pure virtual]

Definition at line 66 of file KDChartAbstractThreeDAttributes.cpp.

67 {
68 delete _d; _d = 0;
69 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.12 KDChart::AbstractThreeDAttributes Class Reference 207

6.12.2 Member Function Documentation

6.12.2.1 double AbstractThreeDAttributes::depth () const

Definition at line 103 of file KDChartAbstractThreeDAttributes.cpp.


References d.
Referenced by operator<<(), operator==(), KDChart::PieDiagram::paint(), and KDChart::Bar-
Diagram::paint().

104 {
105 return d->depth;
106 }

6.12.2.2 bool AbstractThreeDAttributes::isEnabled () const

Definition at line 92 of file KDChartAbstractThreeDAttributes.cpp.


References d.
Referenced by operator<<(), operator==(), KDChart::PieDiagram::paint(), KDChart::Bar-
Diagram::paint(), and validDepth().

93 {
94 return d->enabled;
95 }

6.12.2.3 bool KDChart::AbstractThreeDAttributes::operator!= (const AbstractThreeDAttributes


& other) const

Definition at line 57 of file KDChartAbstractThreeDAttributes.h.

57 { return !operator==(other); }

6.12.2.4 AbstractThreeDAttributes & AbstractThreeDAttributes::operator= (const


AbstractThreeDAttributes &)

Definition at line 56 of file KDChartAbstractThreeDAttributes.cpp.


References d.

57 {
58 if( this == &r )
59 return *this;
60
61 *d = *r.d;
62
63 return *this;
64 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


208 KD Chart 2 Class Documentation

6.12.2.5 bool AbstractThreeDAttributes::operator== (const AbstractThreeDAttributes &) const

Definition at line 72 of file KDChartAbstractThreeDAttributes.cpp.


References depth(), and isEnabled().
Referenced by KDChart::ThreeDPieAttributes::operator==(), KDChart::ThreeDLine-
Attributes::operator==(), and KDChart::ThreeDBarAttributes::operator==().

73 {
74 if( isEnabled() == r.isEnabled() &&
75 depth() == r.depth() )
76 return true;
77 else
78 return false;
79 }

6.12.2.6 void AbstractThreeDAttributes::setDepth (double depth)

Definition at line 97 of file KDChartAbstractThreeDAttributes.cpp.


References d.

98 {
99 d->depth = depth;
100 }

6.12.2.7 void AbstractThreeDAttributes::setEnabled (bool enabled)

Definition at line 87 of file KDChartAbstractThreeDAttributes.cpp.


References d.

88 {
89 d->enabled = enabled;
90 }

6.12.2.8 double AbstractThreeDAttributes::validDepth () const

Definition at line 109 of file KDChartAbstractThreeDAttributes.cpp.


References d, and isEnabled().
Referenced by KDChart::LineDiagram::threeDItemDepth(), and KDChart::BarDiagram::threeDItem-
Depth().

110 {
111 return isEnabled() ? d->depth : 0.0;
112 }

The documentation for this class was generated from the following files:

• KDChartAbstractThreeDAttributes.h
• KDChartAbstractThreeDAttributes.cpp

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.13 KDChart::AttributesModel Class Reference 209

6.13 KDChart::AttributesModel Class Reference


#include <KDChartAttributesModel.h>
Inheritance diagram for KDChart::AttributesModel:Collaboration diagram for KDChart::AttributesModel:

Public Types
• enum PaletteType {
PaletteTypeDefault = 0,
PaletteTypeRainbow = 1,
PaletteTypeSubdued = 2 }

Public Member Functions


• AttributesModel (QAbstractItemModel ∗model, QObject ∗parent=0)
• int columnCount (const QModelIndex &) const
[reimplemented]

• QVariant data (const QModelIndex &, int role=Qt::DisplayRole) const


[reimplemented]

• QVariant data (int column, int role) const


Returns the data that were specified at per column level, or the globally set data, or the default data, or
QVariant().

• QVariant data (int role) const


Returns the data that were specified at global level, or the default data, or QVariant().

• QVariant headerData (int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const


[reimplemented]

• QModelIndex index (int row, int col, const QModelIndex &index) const
• void initFrom (const AttributesModel ∗other)
• bool isKnownAttributesRole (int role) const
Returns whether the given role corresponds to one of the known internally used ones.

• QModelIndex mapFromSource (const QModelIndex &sourceIndex) const


• QModelIndex mapToSource (const QModelIndex &proxyIndex) const
• QVariant modelData (int role) const
• PaletteType paletteType () const
• QModelIndex parent (const QModelIndex &index) const
• int rowCount (const QModelIndex &) const
[reimplemented]

• bool setData (const QModelIndex &index, const QVariant &value, int role=Qt::DisplayRole)
[reimplemented]

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


210 KD Chart 2 Class Documentation

• bool setHeaderData (int section, Qt::Orientation orientation, const QVariant &value, int
role=Qt::DisplayRole)
[reimplemented]

• bool setModelData (const QVariant value, int role)


• void setPaletteType (PaletteType type)
Sets the palettetype used by this attributesmodel.

• void setSourceModel (QAbstractItemModel ∗sourceModel)


[reimplemented]

• ∼AttributesModel ()

Public Attributes

• Q_SIGNALS __pad0__: void attributesChanged( const QModelIndex&

6.13.1 Member Enumeration Documentation

6.13.1.1 enum KDChart::AttributesModel::PaletteType

Enumeration values:
PaletteTypeDefault
PaletteTypeRainbow
PaletteTypeSubdued

Definition at line 44 of file KDChartAttributesModel.h.

44 {
45 PaletteTypeDefault = 0,
46 PaletteTypeRainbow = 1,
47 PaletteTypeSubdued = 2
48 };

6.13.2 Constructor & Destructor Documentation

6.13.2.1 AttributesModel::AttributesModel (QAbstractItemModel ∗ model, QObject ∗ parent = 0)


[explicit]

Definition at line 43 of file KDChartAttributesModel.cpp.


References setSourceModel().

44 : AbstractProxyModel( parent ),
45 mPaletteType( PaletteTypeDefault )
46 {
47 setSourceModel(model);
48 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.13 KDChart::AttributesModel Class Reference 211

6.13.2.2 AttributesModel::∼AttributesModel ()

Definition at line 50 of file KDChartAttributesModel.cpp.

51 {
52 }

6.13.3 Member Function Documentation

6.13.3.1 int AttributesModel::columnCount (const QModelIndex &) const

[reimplemented]
Definition at line 272 of file KDChartAttributesModel.cpp.
References KDChart::AbstractProxyModel::mapToSource().
Referenced by setModelData().

273 {
274 Q_ASSERT(sourceModel());
275 return sourceModel()->columnCount( mapToSource(index) );
276 }

6.13.3.2 QVariant AttributesModel::data (const QModelIndex &, int role = Qt::DisplayRole) const

[reimplemented]
Definition at line 149 of file KDChartAttributesModel.cpp.
References data(), and KDChart::AbstractProxyModel::mapToSource().

150 {
151 //qDebug() << "AttributesModel::data(" << index << role << ")";
152 if( index.isValid() ) {
153 Q_ASSERT( index.model() == this );
154 }
155 QVariant sourceData = sourceModel()->data( mapToSource(index), role );
156 if ( sourceData.isValid() )
157 return sourceData;
158
159 // check if we are storing a value for this role at this cell index
160 if ( mDataMap.contains( index.column() ) ) {
161 const QMap< int, QMap< int, QVariant> > &colDataMap = mDataMap[ index.column() ];
162 if ( colDataMap.contains( index.row() ) ) {
163 const QMap<int, QVariant> &dataMap = colDataMap[ index.row() ];
164 if ( dataMap.contains( role ) )
165 return dataMap[ role ];
166 }
167 }
168 // check if there is something set for the column (dataset), or at global level
169 if( index.isValid() )
170 return data( index.column(), role ); // includes automatic fallback to default
171
172 return QVariant();
173 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


212 KD Chart 2 Class Documentation

6.13.3.3 QVariant AttributesModel::data (int column, int role) const

Returns the data that were specified at per column level, or the globally set data, or the default data, or
QVariant().
Definition at line 133 of file KDChartAttributesModel.cpp.
References data(), headerData(), and isKnownAttributesRole().

134 {
135 if ( isKnownAttributesRole( role ) ) {
136 // check if there is something set for the column (dataset)
137 QVariant v;
138 v = headerData( column, Qt::Vertical, role );
139
140 // check if there is something set at global level
141 if ( !v.isValid() )
142 v = data( role ); // includes automatic fallback to default
143 return v;
144 }
145 return QVariant();
146 }

6.13.3.4 QVariant AttributesModel::data (int role) const

Returns the data that were specified at global level, or the default data, or QVariant().
Definition at line 115 of file KDChartAttributesModel.cpp.
References isKnownAttributesRole(), and modelData().
Referenced by data().

116 {
117 if ( isKnownAttributesRole( role ) ) {
118 // check if there is something set at global level
119 QVariant v = modelData( role );
120
121 // else return the default setting, if any
122 if ( !v.isValid() )
123 v = defaultsForRole( role );
124 return v;
125 }
126 return QVariant();
127 }

6.13.3.5 QVariant AttributesModel::headerData (int section, Qt::Orientation orientation, int role


= Qt::DisplayRole) const

[reimplemented]
Definition at line 66 of file KDChartAttributesModel.cpp.
References KDChart::DatasetBrushRole, KDChart::Palette::defaultPalette(), KDChart::Palette::get-
Brush(), modelData(), paletteType(), PaletteTypeDefault, PaletteTypeRainbow, PaletteTypeSubdued,
KDChart::Palette::rainbowPalette(), and KDChart::Palette::subduedPalette().
Referenced by data(), KDChart::RingDiagram::paint(), and KDChart::PolarDiagram::paint().

69 {

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.13 KDChart::AttributesModel Class Reference 213

70 QVariant sourceData = sourceModel()->headerData( section, orientation, role );


71 if ( sourceData.isValid() ) return sourceData;
72 // the source model didn’t have data set, let’s use our stored values
73 const QMap<int, QMap<int, QVariant> >& map = orientation == Qt::Horizontal ? mHorizontalHeaderDataMap
74 if ( map.contains( section ) ) {
75 const QMap<int, QVariant> &dataMap = map[ section ];
76 if ( dataMap.contains( role ) ) {
77 return dataMap[ role ];
78 }
79 }
80
81 // Default values if nothing else matches
82 switch ( role ) {
83 case Qt::DisplayRole:
84 return QLatin1String( orientation == Qt::Vertical ? "Series " : "Item " ) + QString::number( sec
85
86 case KDChart::DatasetBrushRole: {
87 if ( paletteType() == PaletteTypeSubdued )
88 return Palette::subduedPalette().getBrush( section );
89 else if ( paletteType() == PaletteTypeRainbow )
90 return Palette::rainbowPalette().getBrush( section );
91 else if ( paletteType() == PaletteTypeDefault )
92 return Palette::defaultPalette().getBrush( section );
93 else
94 qWarning("Unknown type of fallback palette!");
95 }
96 case KDChart::DatasetPenRole: {
97 // default to the color set for the brush (or it’s defaults)
98 // but only if no per model override was set
99 if ( !modelData( role ).isValid() ) {
100 QBrush brush = qVariantValue<QBrush>( headerData( section, orientation, DatasetBrushRole ) )
101 return QPen( brush.color() );
102 }
103 }
104 default:
105 break;
106 }
107
108 return QVariant();
109 }

6.13.3.6 QModelIndex KDChart::AbstractProxyModel::index (int row, int col, const


QModelIndex & index) const [inherited]

Definition at line 53 of file KDChartAbstractProxyModel.cpp.


References KDChart::AbstractProxyModel::mapFromSource(), and KDChart::AbstractProxyModel::map-
ToSource().
Referenced by setHeaderData(), and setModelData().

54 {
55 Q_ASSERT(sourceModel());
56 return mapFromSource(sourceModel()->index( row, col, mapToSource(index) ));
57 }

6.13.3.7 void AttributesModel::initFrom (const AttributesModel ∗ other)

Definition at line 54 of file KDChartAttributesModel.cpp.


References mDataMap, mHorizontalHeaderDataMap, mModelDataMap, mVerticalHeaderDataMap,
paletteType(), and setPaletteType().

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


214 KD Chart 2 Class Documentation

Referenced by KDChart::AbstractDiagram::setModel().

55 {
56 if( other == this || ! other ) return;
57
58 mDataMap = other->mDataMap;
59 mHorizontalHeaderDataMap = other->mHorizontalHeaderDataMap;
60 mVerticalHeaderDataMap = other->mVerticalHeaderDataMap;
61 mModelDataMap = other->mModelDataMap;
62
63 setPaletteType( other->paletteType() );
64 }

6.13.3.8 bool AttributesModel::isKnownAttributesRole (int role) const

Returns whether the given role corresponds to one of the known internally used ones.
Definition at line 176 of file KDChartAttributesModel.cpp.
References KDChart::BarAttributesRole, KDChart::DatasetBrushRole, KDChart::DatasetPenRole,
KDChart::DataValueLabelAttributesRole, KDChart::LineAttributesRole, KDChart::PieAttributesRole,
KDChart::ThreeDAttributesRole, KDChart::ThreeDBarAttributesRole, KDChart::ThreeDLineAttributes-
Role, and KDChart::ThreeDPieAttributesRole.
Referenced by data(), setData(), and setHeaderData().

177 {
178 bool oneOfOurs = false;
179 switch( role ) {
180 // fallthrough intended
181 case DataValueLabelAttributesRole:
182 case DatasetBrushRole:
183 case DatasetPenRole:
184 case ThreeDAttributesRole:
185 case LineAttributesRole:
186 case ThreeDLineAttributesRole:
187 case BarAttributesRole:
188 case ThreeDBarAttributesRole:
189 case PieAttributesRole:
190 case ThreeDPieAttributesRole:
191 oneOfOurs = true;
192 default:
193 break;
194 }
195 return oneOfOurs;
196 }

6.13.3.9 QModelIndex KDChart::AbstractProxyModel::mapFromSource (const QModelIndex &


sourceIndex) const [inherited]

Definition at line 23 of file KDChartAbstractProxyModel.cpp.


Referenced by KDChart::AbstractProxyModel::index(), and KDChart::AbstractProxyModel::parent().

24 {
25 if ( !sourceIndex.isValid() )
26 return QModelIndex();
27 //qDebug() << "sourceIndex.model()="<<sourceIndex.model();
28 //qDebug() << "model()="<<sourceModel();

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.13 KDChart::AttributesModel Class Reference 215

29 Q_ASSERT( sourceIndex.model() == sourceModel() );


30
31 // Create an index that preserves the internal pointer from the source;
32 // this way AbstractProxyModel preserves the structure of the source model
33 return createIndex( sourceIndex.row(), sourceIndex.column(), sourceIndex.internalPointer() );
34 }

6.13.3.10 QModelIndex KDChart::AbstractProxyModel::mapToSource (const QModelIndex &


proxyIndex) const [inherited]

Definition at line 36 of file KDChartAbstractProxyModel.cpp.


Referenced by columnCount(), data(), KDChart::AbstractProxyModel::index(), KDChart::AbstractProxy-
Model::parent(), rowCount(), and setData().

37 {
38 if ( !proxyIndex.isValid() )
39 return QModelIndex();
40 Q_ASSERT( proxyIndex.model() == this );
41 // So here we need to create a source index which holds that internal pointer.
42 // No way to pass it to sourceModel()->index... so we have to do the ugly way:
43 QModelIndex sourceIndex;
44 KDPrivateModelIndex* hack = reinterpret_cast<KDPrivateModelIndex*>(&sourceIndex);
45 hack->r = proxyIndex.row();
46 hack->c = proxyIndex.column();
47 hack->p = proxyIndex.internalPointer();
48 hack->m = sourceModel();
49 Q_ASSERT( sourceIndex.isValid() );
50 return sourceIndex;
51 }

6.13.3.11 QVariant KDChart::AttributesModel::modelData (int role) const

Definition at line 261 of file KDChartAttributesModel.cpp.


Referenced by data(), and headerData().

262 {
263 return mModelDataMap.value( role, QVariant() );
264 }

6.13.3.12 AttributesModel::PaletteType AttributesModel::paletteType () const

Definition at line 247 of file KDChartAttributesModel.cpp.


Referenced by headerData(), and initFrom().

248 {
249 return mPaletteType;
250 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


216 KD Chart 2 Class Documentation

6.13.3.13 QModelIndex KDChart::AbstractProxyModel::parent (const QModelIndex & index)


const [inherited]

Definition at line 59 of file KDChartAbstractProxyModel.cpp.


References KDChart::AbstractProxyModel::mapFromSource(), and KDChart::AbstractProxyModel::map-
ToSource().

60 {
61 Q_ASSERT(sourceModel());
62 return mapFromSource(sourceModel()->parent( mapToSource(index) ));
63 }

6.13.3.14 int AttributesModel::rowCount (const QModelIndex &) const

[reimplemented]
Definition at line 266 of file KDChartAttributesModel.cpp.
References KDChart::AbstractProxyModel::mapToSource().
Referenced by setHeaderData(), and setModelData().

267 {
268 Q_ASSERT(sourceModel());
269 return sourceModel()->rowCount( mapToSource(index) );
270 }

6.13.3.15 bool AttributesModel::setData (const QModelIndex & index, const QVariant & value,
int role = Qt::DisplayRole)

[reimplemented]
Definition at line 212 of file KDChartAttributesModel.cpp.
References isKnownAttributesRole(), and KDChart::AbstractProxyModel::mapToSource().
Referenced by KDChart::BarDiagram::setBarAttributes().

213 {
214 if ( !isKnownAttributesRole( role ) ) {
215 return sourceModel()->setData( mapToSource(index), value, role );
216 } else {
217 QMap< int, QMap< int, QVariant> > &colDataMap = mDataMap[ index.column() ];
218 QMap<int, QVariant> &dataMap = colDataMap[ index.row() ];
219 //qDebug() << "AttributesModel::setData" <<"role" << role << "value" << value;
220 dataMap.insert( role, value );
221 emit attributesChanged( index, index );
222 return true;
223 }
224 }

6.13.3.16 bool AttributesModel::setHeaderData (int section, Qt::Orientation orientation, const


QVariant & value, int role = Qt::DisplayRole)

[reimplemented]

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.13 KDChart::AttributesModel Class Reference 217

Definition at line 226 of file KDChartAttributesModel.cpp.


References KDChart::AbstractProxyModel::index(), isKnownAttributesRole(), and rowCount().

228 {
229 if ( !isKnownAttributesRole( role ) ) {
230 return sourceModel()->setHeaderData( section, orientation, value, role );
231 } else {
232 QMap<int, QMap<int, QVariant> > &sectionDataMap
233 = orientation == Qt::Horizontal ? mHorizontalHeaderDataMap : mVerticalHeaderDataMap;
234 QMap<int, QVariant> &dataMap = sectionDataMap[ section ];
235 dataMap.insert( role, value );
236 emit attributesChanged( index( 0, section, QModelIndex() ),
237 index( rowCount( QModelIndex() ), section, QModelIndex() ) );
238 return true;
239 }
240 }

6.13.3.17 bool KDChart::AttributesModel::setModelData (const QVariant value, int role)

Definition at line 252 of file KDChartAttributesModel.cpp.


References columnCount(), KDChart::AbstractProxyModel::index(), and rowCount().

253 {
254 mModelDataMap.insert( role, value );
255 emit attributesChanged( index( 0, 0, QModelIndex() ),
256 index( rowCount( QModelIndex() ),
257 columnCount( QModelIndex() ), QModelIndex() ) );
258 return true;
259 }

6.13.3.18 void AttributesModel::setPaletteType (PaletteType type)

Sets the palettetype used by this attributesmodel.


Definition at line 242 of file KDChartAttributesModel.cpp.
Referenced by initFrom().

243 {
244 mPaletteType = type;
245 }

6.13.3.19 void AttributesModel::setSourceModel (QAbstractItemModel ∗ sourceModel)

[reimplemented]
Definition at line 278 of file KDChartAttributesModel.cpp.
Referenced by AttributesModel().

279 {
280 if( this->sourceModel() != 0 )
281 disconnect( this->sourceModel(), SIGNAL( dataChanged( const QModelIndex&, const QModelIndex&))
282 this, SIGNAL( dataChanged( const QModelIndex&, const QModelIndex&)))
283 QAbstractProxyModel::setSourceModel( sourceModel );

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


218 KD Chart 2 Class Documentation

284 if( this->sourceModel() != NULL )


285 connect( this->sourceModel(), SIGNAL( dataChanged( const QModelIndex&, const QModelIndex&)),
286 this, SIGNAL( dataChanged( const QModelIndex&, const QModelIndex&)));
287 }

6.13.4 Member Data Documentation

6.13.4.1 Q_SIGNALS KDChart::AttributesModel::__pad0__

Definition at line 111 of file KDChartAttributesModel.h.


The documentation for this class was generated from the following files:

• KDChartAttributesModel.h
• KDChartAttributesModel.cpp

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.14 KDChart::BackgroundAttributes Class Reference 219

6.14 KDChart::BackgroundAttributes Class Reference


#include <KDChartBackgroundAttributes.h>

Public Types

• enum BackgroundPixmapMode {
BackgroundPixmapModeNone,
BackgroundPixmapModeCentered,
BackgroundPixmapModeScaled,
BackgroundPixmapModeStretched }

Public Member Functions

• BackgroundAttributes (const BackgroundAttributes &)


• BackgroundAttributes ()
• QBrush brush () const
• bool isVisible () const
• bool operator!= (const BackgroundAttributes &other) const
• BackgroundAttributes & operator= (const BackgroundAttributes &)
• bool operator== (const BackgroundAttributes &) const
• QPixmap pixmap () const
• BackgroundPixmapMode pixmapMode () const
• void setBrush (const QBrush &brush)
• void setPixmap (const QPixmap &backPixmap)
• void setPixmapMode (BackgroundPixmapMode mode)
• void setVisible (bool visible)
• ∼BackgroundAttributes ()

6.14.1 Member Enumeration Documentation

6.14.1.1 enum KDChart::BackgroundAttributes::BackgroundPixmapMode

Enumeration values:
BackgroundPixmapModeNone
BackgroundPixmapModeCentered
BackgroundPixmapModeScaled
BackgroundPixmapModeStretched

Definition at line 49 of file KDChartBackgroundAttributes.h.

49 { BackgroundPixmapModeNone,
50 BackgroundPixmapModeCentered,
51 BackgroundPixmapModeScaled,
52 BackgroundPixmapModeStretched };

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


220 KD Chart 2 Class Documentation

6.14.2 Constructor & Destructor Documentation

6.14.2.1 KDChart::BackgroundAttributes::BackgroundAttributes ()

6.14.2.2 KDChart::BackgroundAttributes::BackgroundAttributes (const BackgroundAttributes


&)

6.14.2.3 KDChart::BackgroundAttributes::∼BackgroundAttributes ()

6.14.3 Member Function Documentation

6.14.3.1 QBrush KDChart::BackgroundAttributes::brush () const

Referenced by operator<<().

6.14.3.2 bool KDChart::BackgroundAttributes::isVisible () const

Referenced by operator<<().

6.14.3.3 bool KDChart::BackgroundAttributes::operator!= (const BackgroundAttributes & other)


const

Definition at line 67 of file KDChartBackgroundAttributes.h.

67 { return !operator==(other); }

6.14.3.4 BackgroundAttributes& KDChart::BackgroundAttributes::operator= (const


BackgroundAttributes &)

6.14.3.5 bool KDChart::BackgroundAttributes::operator== (const BackgroundAttributes &)


const

6.14.3.6 QPixmap KDChart::BackgroundAttributes::pixmap () const

Referenced by operator<<().

6.14.3.7 BackgroundPixmapMode KDChart::BackgroundAttributes::pixmapMode () const

Referenced by operator<<().

6.14.3.8 void KDChart::BackgroundAttributes::setBrush (const QBrush & brush)

6.14.3.9 void KDChart::BackgroundAttributes::setPixmap (const QPixmap & backPixmap)

6.14.3.10 void KDChart::BackgroundAttributes::setPixmapMode (BackgroundPixmapMode


mode)

6.14.3.11 void KDChart::BackgroundAttributes::setVisible (bool visible)

The documentation for this class was generated from the following file:

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.14 KDChart::BackgroundAttributes Class Reference 221

• KDChartBackgroundAttributes.h

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


222 KD Chart 2 Class Documentation

6.15 KDChart::BarAttributes Class Reference


#include <KDChartBarAttributes.h>
Collaboration diagram for KDChart::BarAttributes:

Public Member Functions


• BarAttributes (const BarAttributes &)
• BarAttributes ()
• qreal barGapFactor () const
• bool drawSolidExcessArrows () const
• qreal fixedBarWidth () const
• qreal fixedDataValueGap () const
• qreal fixedValueBlockGap () const
• qreal groupGapFactor () const
• bool operator!= (const BarAttributes &other) const
• BarAttributes & operator= (const BarAttributes &)
• bool operator== (const BarAttributes &) const
• void setBarGapFactor (qreal gapFactor)
• void setDrawSolidExcessArrows (bool solidArrows)
• void setFixedBarWidth (qreal width)
• void setFixedDataValueGap (qreal gap)
• void setFixedValueBlockGap (qreal gap)
• void setGroupGapFactor (qreal gapFactor)
• void setUseFixedBarWidth (bool useFixedBarWidth)
• void setUseFixedDataValueGap (bool gapIsFixed)
• void setUseFixedValueBlockGap (bool gapIsFixed)
• bool useFixedBarWidth () const
• bool useFixedDataValueGap () const
• bool useFixedValueBlockGap () const
• ∼BarAttributes ()

6.15.1 Constructor & Destructor Documentation

6.15.1.1 KDChart::BarAttributes::BarAttributes ()

6.15.1.2 KDChart::BarAttributes::BarAttributes (const BarAttributes &)

6.15.1.3 KDChart::BarAttributes::∼BarAttributes ()

6.15.2 Member Function Documentation

6.15.2.1 qreal KDChart::BarAttributes::barGapFactor () const

6.15.2.2 bool KDChart::BarAttributes::drawSolidExcessArrows () const

6.15.2.3 qreal KDChart::BarAttributes::fixedBarWidth () const

Referenced by KDChart::BarDiagram::paint().

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.15 KDChart::BarAttributes Class Reference 223

6.15.2.4 qreal KDChart::BarAttributes::fixedDataValueGap () const

Referenced by KDChart::BarDiagram::paint().

6.15.2.5 qreal KDChart::BarAttributes::fixedValueBlockGap () const

Referenced by KDChart::BarDiagram::paint().

6.15.2.6 qreal KDChart::BarAttributes::groupGapFactor () const

6.15.2.7 bool KDChart::BarAttributes::operator!= (const BarAttributes & other) const

Definition at line 71 of file KDChartBarAttributes.h.

71 { return !operator==(other); }

6.15.2.8 BarAttributes& KDChart::BarAttributes::operator= (const BarAttributes &)

6.15.2.9 bool KDChart::BarAttributes::operator== (const BarAttributes &) const

6.15.2.10 void KDChart::BarAttributes::setBarGapFactor (qreal gapFactor)

6.15.2.11 void KDChart::BarAttributes::setDrawSolidExcessArrows (bool solidArrows)

6.15.2.12 void KDChart::BarAttributes::setFixedBarWidth (qreal width)

6.15.2.13 void KDChart::BarAttributes::setFixedDataValueGap (qreal gap)

6.15.2.14 void KDChart::BarAttributes::setFixedValueBlockGap (qreal gap)

6.15.2.15 void KDChart::BarAttributes::setGroupGapFactor (qreal gapFactor)

6.15.2.16 void KDChart::BarAttributes::setUseFixedBarWidth (bool useFixedBarWidth)

6.15.2.17 void KDChart::BarAttributes::setUseFixedDataValueGap (bool gapIsFixed)

6.15.2.18 void KDChart::BarAttributes::setUseFixedValueBlockGap (bool gapIsFixed)

6.15.2.19 bool KDChart::BarAttributes::useFixedBarWidth () const

Referenced by KDChart::BarDiagram::paint().

6.15.2.20 bool KDChart::BarAttributes::useFixedDataValueGap () const

Referenced by KDChart::BarDiagram::paint().

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


224 KD Chart 2 Class Documentation

6.15.2.21 bool KDChart::BarAttributes::useFixedValueBlockGap () const

Referenced by KDChart::BarDiagram::paint().
The documentation for this class was generated from the following file:

• KDChartBarAttributes.h

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.16 KDChart::BarDiagram Class Reference 225

6.16 KDChart::BarDiagram Class Reference


#include <KDChartBarDiagram.h>
Inheritance diagram for KDChart::BarDiagram:Collaboration diagram for KDChart::BarDiagram:

Public Types
• enum BarType {
Normal,
Stacked,
Percent,
Rows }

Public Member Functions


• virtual void addAxis (CartesianAxis ∗axis)
Add the axis to the diagram.

• bool allowOverlappingDataValueTexts () const


• bool antiAliasing () const
• virtual AttributesModel ∗ attributesModel () const
Returns the AttributesModel, that is used by this diagram.

• virtual KDChart::CartesianAxisList axes () const


• BarAttributes barAttributes (const QModelIndex &index) const
• BarAttributes barAttributes (int column) const
• BarAttributes barAttributes () const
• BarDiagram (QWidget ∗parent=0, CartesianCoordinatePlane ∗plane=0)
• QBrush brush (const QModelIndex &index) const
Retrieve the brush to be used, for painting the datapoint at the given index in the model.

• QBrush brush (int dataset) const


Retrieve the brush to be used for the given dataset.

• QBrush brush () const


Retrieve the brush to be used for painting datapoints globally.

• virtual BarDiagram ∗ clone () const


• AbstractCoordinatePlane ∗ coordinatePlane () const
The coordinate plane associated with the diagram.

• const QPair< QPointF, QPointF > dataBoundaries () const


Return the bottom left and top right data point, that the diagram will display (unless the grid adjusts these
values).

• virtual void dataChanged (const QModelIndex &topLeft, const QModelIndex &bottomRight)


[reimplemented]

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


226 KD Chart 2 Class Documentation

• QList< QBrush > datasetBrushes () const


The set of dataset brushes currently used, for use in legends, etc.

• int datasetDimension () const


The dataset dimension of a diagram determines, how many value dimensions it expects each datapoint to
have.

• QStringList datasetLabels () const


The set of dataset labels currently displayed, for use in legends, etc.

• QList< MarkerAttributes > datasetMarkers () const


The set of dataset markers currently used, for use in legends, etc.

• QList< QPen > datasetPens () const


The set of dataset pens currently used, for use in legends, etc.

• DataValueAttributes dataValueAttributes (const QModelIndex &index) const


Retrieve the DataValueAttributes for the given index.

• DataValueAttributes dataValueAttributes (int column) const


Retrieve the DataValueAttributes for the given dataset.

• DataValueAttributes dataValueAttributes () const


Retrieve the DataValueAttributes speficied globally.

• virtual void doItemsLayout ()


[reimplemented]

• virtual int horizontalOffset () const


[reimplemented]

• virtual QModelIndex indexAt (const QPoint &point) const


[reimplemented]

• virtual bool isIndexHidden (const QModelIndex &index) const


[reimplemented]

• QStringList itemRowLabels () const


The set of item row labels currently displayed, for use in Abscissa axes, etc.

• virtual void layoutPlanes ()


• virtual QModelIndex moveCursor (CursorAction cursorAction, Qt::KeyboardModifiers modifiers)
[reimplemented]

• const int numberOfAbscissaSegments () const


[reimplemented]

• const int numberOfOrdinateSegments () const


[reimplemented]

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.16 KDChart::BarDiagram Class Reference 227

• virtual void paintMarker (QPainter ∗painter, const MarkerAttributes &markerAttributes, const


QBrush &brush, const QPen &, const QPointF &point, const QSizeF &size)
• QPen pen (const QModelIndex &index) const
Retrieve the pen to be used, for painting the datapoint at the given index in the model.

• QPen pen (int dataset) const


Retrieve the pen to be used for the given dataset.

• QPen pen () const


Retrieve the pen to be used for painting datapoints globally.

• bool percentMode () const


• virtual AbstractCartesianDiagram ∗ referenceDiagram () const
• virtual QPointF referenceDiagramOffset () const
• void resize (const QSizeF &area)
Called by the widget’s sizeEvent.

• virtual void scrollTo (const QModelIndex &index, ScrollHint hint=EnsureVisible)


[reimplemented]

• void setAllowOverlappingDataValueTexts (bool allow)


Set whether data value labels are allowed to overlap.

• void setAntiAliasing (bool enabled)


Set whether anti-aliasing is to be used while rendering this diagram.

• virtual void setAttributesModel (AttributesModel ∗model)


Associate an AttributesModel with this diagram.

• void setBarAttributes (const QModelIndex &index, const BarAttributes &a)


• void setBarAttributes (int column, const BarAttributes &a)
• void setBarAttributes (const BarAttributes &a)
• void setBrush (const QBrush &brush)
Set the brush to be used, for painting all datasets in the model.

• void setBrush (int dataset, const QBrush &brush)


Set the brush to be used, for painting the given dataset.

• void setBrush (const QModelIndex &index, const QBrush &brush)


Set the brush to be used, for painting the datapoint at the given index.

• virtual void setCoordinatePlane (AbstractCoordinatePlane ∗plane)


Set the coordinate plane associated with the diagram.

• void setDatasetDimension (int dimension)


Sets the dataset dimension of the diagram.

• void setDataValueAttributes (const DataValueAttributes &a)


Set the DataValueAttributes for all datapoints in the model.

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


228 KD Chart 2 Class Documentation

• void setDataValueAttributes (int dataset, const DataValueAttributes &a)


Set the DataValueAttributes for the given dataset.

• void setDataValueAttributes (const QModelIndex &index, const DataValueAttributes &a)


Set the DataValueAttributes for the given index.

• virtual void setModel (QAbstractItemModel ∗model)


Associate a model with the diagram.

• void setPen (const QPen &pen)


Set the pen to be used, for painting all datasets in the model.

• void setPen (int dataset, const QPen &pen)


Set the pen to be used, for painting the given dataset.

• void setPen (const QModelIndex &index, const QPen &pen)


Set the pen to be used, for painting the datapoint at the given index.

• void setPercentMode (bool percent)


• virtual void setReferenceDiagram (AbstractCartesianDiagram ∗diagram, const QPointF
&offset=QPointF())
• virtual void setRootIndex (const QModelIndex &idx)
Set the root index in the model, where the diagram starts referencing data for display.

• virtual void setSelection (const QRect &rect, QItemSelectionModel::SelectionFlags command)


[reimplemented]

• void setThreeDBarAttributes (const QModelIndex &index, const ThreeDBarAttributes &a)


• void setThreeDBarAttributes (int column, const ThreeDBarAttributes &a)
• void setThreeDBarAttributes (const ThreeDBarAttributes &a)
• void setType (BarType type)
• virtual void takeAxis (CartesianAxis ∗axis)
Removes the axis from the diagram, without deleting it.

• ThreeDBarAttributes threeDBarAttributes (const QModelIndex &index) const


• ThreeDBarAttributes threeDBarAttributes (int column) const
• ThreeDBarAttributes threeDBarAttributes () const
• BarType type () const
• void update () const
• void useDefaultColors ()
Set the palette to be used, for painting datasets to the default palette.

• void useRainbowColors ()
Set the palette to be used, for painting datasets to the rainbow palette.

• void useSubduedColors ()
Set the palette to be used, for painting datasets to the subdued palette.

• virtual int verticalOffset () const


[reimplemented]

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.16 KDChart::BarDiagram Class Reference 229

• virtual QRect visualRect (const QModelIndex &index) const


[reimplemented]

• virtual QRegion visualRegionForSelection (const QItemSelection &selection) const


[reimplemented]

• virtual ∼BarDiagram ()

Protected Member Functions

• QModelIndex attributesModelRootIndex () const


• const QPair< QPointF, QPointF > calculateDataBoundaries () const
[reimplemented]

• virtual bool checkInvariants (bool justReturnTheStatus=false) const


• QModelIndex columnToIndex (int column) const
• void modelsChanged ()
This signal is emitted, when either the model or the AttributesModel is replaced.

• void paint (PaintContext ∗paintContext)


Draw the diagram contents to the rectangle and painter, that are passed in as part of the paint context.

• void paintDataValueText (QPainter ∗painter, const QModelIndex &index, const QPointF &pos, dou-
ble value)
• virtual void paintDataValueTexts (QPainter ∗painter)
• void paintMarker (QPainter ∗painter, const QModelIndex &index, const QPointF &pos)
• virtual void paintMarkers (QPainter ∗painter)
• void propertiesChanged ()
Emitted upon change of a property of the Diagram.

• void resizeEvent (QResizeEvent ∗)


• void setAttributesModelRootIndex (const QModelIndex &)
• void setDataBoundariesDirty () const
• virtual double threeDItemDepth (int column) const
• virtual double threeDItemDepth (const QModelIndex &index) const
• double valueForCell (int row, int column) const
Helper method, retrieving the data value (DisplayRole) for a given row and column.

Protected Attributes

• Q_SIGNALS __pad0__: void layoutChanged( AbstractDiagram∗ )

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


230 KD Chart 2 Class Documentation

6.16.1 Member Enumeration Documentation

6.16.1.1 enum KDChart::BarDiagram::BarType

Enumeration values:
Normal
Stacked
Percent
Rows

Definition at line 55 of file KDChartBarDiagram.h.

55 { Normal,
56 Stacked,
57 Percent,
58 Rows };

6.16.2 Constructor & Destructor Documentation

6.16.2.1 BarDiagram::BarDiagram (QWidget ∗ parent = 0, CartesianCoordinatePlane ∗ plane = 0)


[explicit]

Definition at line 53 of file KDChartBarDiagram.cpp.


Referenced by clone().

53 :
54 AbstractCartesianDiagram( new Private(), parent, plane )
55 {
56 init();
57 }

6.16.2.2 BarDiagram::∼BarDiagram () [virtual]

Definition at line 63 of file KDChartBarDiagram.cpp.

64 {
65 }

6.16.3 Member Function Documentation

6.16.3.1 void AbstractCartesianDiagram::addAxis (CartesianAxis ∗ axis) [virtual,


inherited]

Add the axis to the diagram.


The diagram takes ownership of the axis and will delete it.
To gain back ownership (e.g. for assigning the axis to another diagram) use the takeAxis method, before
calling addAxis on the other diagram.

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.16 KDChart::BarDiagram Class Reference 231

See also:
takeAxis

Definition at line 66 of file KDChartAbstractCartesianDiagram.cpp.


References KDChart::AbstractAxis::createObserver(), d, and KDChart::AbstractCartesian-
Diagram::layoutPlanes().

67 {
68 if ( !d->axesList.contains( axis ) ) {
69 d->axesList.append( axis );
70 axis->createObserver( this );
71 layoutPlanes();
72 }
73 }

6.16.3.2 bool AbstractDiagram::allowOverlappingDataValueTexts () const [inherited]

Returns:
Whether data value labels are allowed to overlap.

Definition at line 291 of file KDChartAbstractDiagram.cpp.


References d.

295 {

6.16.3.3 bool AbstractDiagram::antiAliasing () const [inherited]

Returns:
Whether anti-aliasing is to be used for rendering this diagram.

Definition at line 302 of file KDChartAbstractDiagram.cpp.


References d.
Referenced by KDChart::LineDiagram::paint().

306 {

6.16.3.4 AttributesModel ∗ AbstractDiagram::attributesModel () const [virtual,


inherited]

Returns the AttributesModel, that is used by this diagram.


By default each diagram owns its own AttributesModel, which should never be deleted. Only if a user-
supplied AttributesModel has been set does the pointer returned here not belong to the diagram.

Returns:
The AttributesModel associated with the diagram.

See also:
setAttributesModel

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


232 KD Chart 2 Class Documentation

Definition at line 180 of file KDChartAbstractDiagram.cpp.


References d.
Referenced by KDChart::RingDiagram::paint(), KDChart::PolarDiagram::paint(), and setBarAttributes().

181 {
182 return d->attributesModel;
183 }

6.16.3.5 QModelIndex AbstractDiagram::attributesModelRootIndex () const [protected,


inherited]

returns a QModelIndex pointing into the AttributesModel that corresponds to the root index of the diagram.
Definition at line 204 of file KDChartAbstractDiagram.cpp.
References d.
Referenced by KDChart::LineDiagram::calculateDataBoundaries(), calculateDataBoundaries(),
KDChart::LineDiagram::numberOfAbscissaSegments(), numberOfAbscissaSegments(), KDChart::Line-
Diagram::numberOfOrdinateSegments(), numberOfOrdinateSegments(), KDChart::LineDiagram::paint(),
paint(), and KDChart::AbstractDiagram::valueForCell().

210 {

6.16.3.6 KDChart::CartesianAxisList AbstractCartesianDiagram::axes () const [virtual,


inherited]

Definition at line 85 of file KDChartAbstractCartesianDiagram.cpp.


References KDChart::CartesianAxisList, and d.

86 {
87 return d->axesList;
88 }

6.16.3.7 BarAttributes BarDiagram::barAttributes (const QModelIndex & index) const

Definition at line 123 of file KDChartBarDiagram.cpp.


References d.

124 {
125 return qVariantValue<BarAttributes>(
126 d->attributesModel->data(
127 d->attributesModel->mapFromSource( index ),
128 KDChart::BarAttributesRole ) );
129 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.16 KDChart::BarDiagram Class Reference 233

6.16.3.8 BarAttributes BarDiagram::barAttributes (int column) const

Definition at line 115 of file KDChartBarDiagram.cpp.


References d.

116 {
117 return qVariantValue<BarAttributes>(
118 d->attributesModel->data(
119 d->attributesModel->mapFromSource( columnToIndex( column ) ),
120 KDChart::BarAttributesRole ) );
121 }

6.16.3.9 BarAttributes BarDiagram::barAttributes () const

Definition at line 109 of file KDChartBarDiagram.cpp.


References d.
Referenced by paint().

110 {
111 return qVariantValue<BarAttributes>(
112 d->attributesModel->data( KDChart::BarAttributesRole ) );
113 }

6.16.3.10 QBrush AbstractDiagram::brush (const QModelIndex & index) const [inherited]

Retrieve the brush to be used, for painting the datapoint at the given index in the model.

Parameters:
index The index of the datapoint in the model.

Returns:
The brush to use for painting.

Definition at line 632 of file KDChartAbstractDiagram.cpp.

638 :
QRect AbstractDiagram::visualRect(const QModelIndex &) const

6.16.3.11 QBrush AbstractDiagram::brush (int dataset) const [inherited]

Retrieve the brush to be used for the given dataset.


This will fall back automatically to what was set at model level, if there are no dataset specific settings.

Parameters:
dataset The dataset to retrieve the brush for.
Returns:
The brush to use for painting.

Definition at line 624 of file KDChartAbstractDiagram.cpp.

631 {

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


234 KD Chart 2 Class Documentation

6.16.3.12 QBrush AbstractDiagram::brush () const [inherited]

Retrieve the brush to be used for painting datapoints globally.


This will fall back automatically to the default settings, if there are no specific settings.

Returns:
The brush to use for painting.

Definition at line 618 of file KDChartAbstractDiagram.cpp.


Referenced by KDChart::PieDiagram::paint(), and KDChart::AbstractDiagram::paintMarker().

623 {

6.16.3.13 const QPair< QPointF, QPointF > BarDiagram::calculateDataBoundaries () const


[protected, virtual]

[reimplemented]
Implements KDChart::AbstractDiagram.
Definition at line 199 of file KDChartBarDiagram.cpp.
References KDChart::AbstractDiagram::attributesModelRootIndex(), KDChart::AbstractDiagram::check-
Invariants(), KDChart::AbstractDiagram::coordinatePlane(), d, threeDItemDepth(), KDChart::Abstract-
CoordinatePlane::translate(), and type().

200 {
201 if ( !checkInvariants() ) return QPair<QPointF, QPointF>( QPointF( 0, 0 ), QPointF( 0, 0 ) );
202 const int rowCount = d->attributesModel->rowCount(attributesModelRootIndex());
203 const int colCount = d->attributesModel->columnCount(attributesModelRootIndex());
204
205 double xMin = 0;
206 double xMax = rowCount;
207 double yMin = 0, yMax = 0;
208 double maxThreeDDepth = 0.0;
209 double firstThreeDDepth = 0.0;
210 double lastThreeDDepth = 0.0;
211
212 bool bStarting = true;
213 // calculate boundaries for different line types Normal - Stacked - Percent - Default Normal
214 switch ( type() ){
215 case BarDiagram::Normal:
216 {
217 for ( int i=0; i<colCount; ++i ) {
218 for ( int j=0; j< rowCount; ++j ) {
219 const double value = d->attributesModel->data( d->attributesModel->index( j, i, at
220 // this is always true yMin can be 0 in case all values
221 // are the same
222 // same for yMax it can be zero if all values are negative
223 yMin = qMin( yMin, value );
224 yMax = qMax( yMax, value );
225
226 const double depth = threeDItemDepth( model()->index( j, i, rootIndex() ) );
227 if( depth > 0.0 ){
228 maxThreeDDepth = qMax( maxThreeDDepth, depth );
229 if( bStarting )
230 firstThreeDDepth = depth;
231 lastThreeDDepth = depth;
232 }
233 bStarting = false;

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.16 KDChart::BarDiagram Class Reference 235

234 }
235 }
236 }
237 break;
238 case BarDiagram::Stacked:
239 {
240 for ( int j=0; j< rowCount; ++j ) {
241 // calculate sum of values per column - Find out stacked Min/Max
242 double stackedValues = 0;
243 for ( int i=0; i<colCount ; ++i ) {
244 QModelIndex idx = model()->index( j, i, rootIndex() );
245 stackedValues += model()->data( idx ).toDouble();
246 // this is always true yMin can be 0 in case all values
247 // are the same
248 // same for yMax it can be zero if all values are negative
249 yMin = qMin( yMin, stackedValues );
250 yMax = qMax( yMax, stackedValues );
251
252 const double depth = threeDItemDepth( idx );
253 if( depth > 0.0 ){
254 maxThreeDDepth = qMax( maxThreeDDepth, depth );
255 if( bStarting )
256 firstThreeDDepth = depth;
257 lastThreeDDepth = depth;
258 }
259 bStarting = false;
260 }
261 }
262 }
263 break;
264 case BarDiagram::Percent:
265 {
266 for ( int i=0; i<colCount; ++i ) {
267 for ( int j=0; j< rowCount; ++j ) {
268 // Ordinate should begin at 0 the max value being the 100% pos
269 QModelIndex idx = model()->index( j, i, rootIndex() );
270 // only positive values are handled
271 double value = model()->data( idx ).toDouble();
272 yMax = qMax( yMax, value );
273 const double depth = threeDItemDepth( idx );
274 if( depth > 0.0 ){
275 maxThreeDDepth = qMax( maxThreeDDepth, depth );
276 if( bStarting )
277 firstThreeDDepth = depth;
278 lastThreeDDepth = depth;
279 }
280 bStarting = false;
281 }
282 }
283 break;
284 }
285 default:
286 Q_ASSERT_X ( false, "calculateDataBoundaries()",
287 "Type item does not match a defined bar chart Type." );
288 }
289
290 // special cases
291 if ( yMax == yMin ) {
292 if ( yMin == 0.0 )
293 yMax = 0.1; //we need at list a range
294 else
295 yMax = 0.0; // they are the same but negative
296 }
297 QPointF bottomLeft ( QPointF( xMin, yMin ) );
298 QPointF topRight ( QPointF( xMax, yMax ) );
299
300 //FIXME(khz): Verify, if this code is right: We are taking

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


236 KD Chart 2 Class Documentation

301 // ’any’ ThreeDBarAttributes, no matter for which cell it is specified


302 // as long, as it is enabled(),
303 // but we are ignoring all ThreeDBarAttributes that might have been set
304 // at a header (using the setter that takes a column as parameter).
305 // see: LineDiagram::calculateDataBoundaries ()
306 if ( maxThreeDDepth > 0.0 ) {
307 double percentx, percenty;
308 //threeDBoundaries calculate a depth percent value and add it
309 QPointF pTRTranslated = coordinatePlane()->translate( topRight );
310 QPointF pBLTranslated = coordinatePlane()->translate( bottomLeft );
311 //reserve some plane space for the top of the threeD bars
312 //Pending Michel: fixme 4 - 8?
313 if ( d->maxDepth )
314 maxThreeDDepth = d->maxDepth;
315 if ( type() == BarDiagram::Normal ) {
316 percentx = (maxThreeDDepth / pTRTranslated.x());
317 percenty = (maxThreeDDepth / pBLTranslated.y());
318 } else if ( type() == BarDiagram::Stacked ){
319 percentx = ( maxThreeDDepth / pTRTranslated.x());
320 percenty = ((maxThreeDDepth*8) / pBLTranslated.y());
321 } else {
322 percentx = ( maxThreeDDepth / pTRTranslated.x());
323 percenty = ((maxThreeDDepth*4) / pBLTranslated.y());
324 }
325 topRight.setX( topRight.x() + percentx);
326 topRight.setY( topRight.y() + percenty);
327 }
328
329 //qDebug() << "BarDiagram::calculateDataBoundaries () returns ( " << bottomLeft << topRight <<")";
330
331 return QPair<QPointF, QPointF> ( bottomLeft, topRight );
332 }

6.16.3.14 bool AbstractDiagram::checkInvariants (bool justReturnTheStatus = false) const


[protected, virtual, inherited]

Definition at line 746 of file KDChartAbstractDiagram.cpp.


References KDChart::AbstractDiagram::coordinatePlane().
Referenced by KDChart::RingDiagram::calculateDataBoundaries(), KDChart::PolarDiagram::calculate-
DataBoundaries(), KDChart::PieDiagram::calculateDataBoundaries(), KDChart::LineDiagram::calculate-
DataBoundaries(), calculateDataBoundaries(), KDChart::RingDiagram::paint(), KDChart::Polar-
Diagram::paint(), KDChart::PieDiagram::paint(), KDChart::LineDiagram::paint(), paint(), and
KDChart::AbstractDiagram::paintMarker().

746 {
747 Q_ASSERT_X ( model(), "AbstractDiagram::checkInvariants()",
748 "There is no usable model set, for the diagram." );
749
750 Q_ASSERT_X ( coordinatePlane(), "AbstractDiagram::checkInvariants()",
751 "There is no usable coordinate plane set, for the diagram." );
752 }
753 return model() && coordinatePlane();
754 }
755
756 int AbstractDiagram::datasetDimension( ) const

6.16.3.15 BarDiagram ∗ BarDiagram::clone () const [virtual]

Definition at line 67 of file KDChartBarDiagram.cpp.

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.16 KDChart::BarDiagram Class Reference 237

References BarDiagram(), and d.

68 {
69 return new BarDiagram( new Private( *d ) );
70 }

6.16.3.16 QModelIndex AbstractDiagram::columnToIndex (int column) const [protected,


inherited]

Definition at line 211 of file KDChartAbstractDiagram.cpp.

217 {

6.16.3.17 AbstractCoordinatePlane ∗ AbstractDiagram::coordinatePlane () const


[inherited]

The coordinate plane associated with the diagram.


This determines how coordinates in value space are mapped into pixel space. By default this is a Cartesian-
CoordinatePlane.
Returns:
The coordinate plane associated with the diagram.

Definition at line 125 of file KDChartAbstractDiagram.cpp.


References d.
Referenced by calculateDataBoundaries(), KDChart::AbstractDiagram::checkInvariants(),
KDChart::AbstractCartesianDiagram::layoutPlanes(), KDChart::PolarDiagram::paint(), KDChart::Line-
Diagram::paint(), paint(), KDChart::AbstractPolarDiagram::polarCoordinatePlane(), and
KDChart::AbstractCartesianDiagram::setCoordinatePlane().

126 {
127 return d->plane;
128 }

6.16.3.18 const QPair< QPointF, QPointF > AbstractDiagram::dataBoundaries () const


[inherited]

Return the bottom left and top right data point, that the diagram will display (unless the grid adjusts these
values).
This method returns a chached result of calculations done by calculateDataBoundaries. Classes derived
from AbstractDiagram must implement the calculateDataBoundaries function, to specify their own way of
calculating the data boundaries. If derived classes want to force recalculation of the data boundaries, they
can call setDataBoundariesDirty()
Returned value is in diagram coordinates.
Definition at line 130 of file KDChartAbstractDiagram.cpp.
References KDChart::AbstractDiagram::calculateDataBoundaries(), and d.
Referenced by KDChart::CartesianCoordinatePlane::calculateRawDataBoundingRect(), KDChart::Polar-
CoordinatePlane::layoutDiagrams(), KDChart::LineDiagram::paint(), and paint().

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


238 KD Chart 2 Class Documentation

131 {
132 if( d->databoundariesDirty ){
133 d->databoundaries = calculateDataBoundaries ();
134 d->databoundariesDirty = false;
135 }
136 return d->databoundaries;
137 }

6.16.3.19 void AbstractDiagram::dataChanged (const QModelIndex & topLeft, const


QModelIndex & bottomRight) [virtual, inherited]

[reimplemented]
Definition at line 232 of file KDChartAbstractDiagram.cpp.
References d.

232 {
233 // We are still too dumb to do intelligent updates...
234 d->databoundariesDirty = true;
235 scheduleDelayedItemsLayout();
236 }
237
238 void AbstractDiagram::setDataValueAttributes( const QModelIndex & index,

6.16.3.20 QList< QBrush > AbstractDiagram::datasetBrushes () const [inherited]

The set of dataset brushes currently used, for use in legends, etc.

Note:
Cell-level override brushes, if set, take precedence over the dataset values, so you might need to check
these too, in order to find the brush, that is used for a single cell.

Returns:
The current set of dataset brushes.

Definition at line 710 of file KDChartAbstractDiagram.cpp.


Referenced by KDChart::Legend::buildLegend(), KDChart::Legend::datasetCount(), and
KDChart::Legend::setBrushesFromDiagram().

712 {
713 QBrush brush = qVariantValue<QBrush>( attributesModel()->headerData( i, Qt::Vertical, DatasetB
714 ret << brush;
715 }
716
717 return ret;
718 }
719
720 QList<QPen> AbstractDiagram::datasetPens() const

6.16.3.21 int AbstractDiagram::datasetDimension () const [inherited]

The dataset dimension of a diagram determines, how many value dimensions it expects each datapoint to
have.

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.16 KDChart::BarDiagram Class Reference 239

For each dimension it will expect one column of values in the model. If the dimensionality is 1, automatic
values will be used for the abscissa.
For example a diagram with the default dimension of 1, will have one column per datapoint (the y values)
and will use automatic values for the x axis (1, 2, 3, ... n). If the dimension is 2, the diagram will use the
first, (and the third, fifth, etc) columns as X values, and the second, (and the fourth, sixth, etc) column as Y
values.

Returns:
The dataset dimension of the diagram.

Definition at line 758 of file KDChartAbstractDiagram.cpp.


References d.
Referenced by KDChart::LineDiagram::calculateDataBoundaries(), KDChart::LineDiagram::get-
CellValues(), KDChart::CartesianCoordinatePlane::getDataDimensionsList(), KDChart::Line-
Diagram::paint(), and KDChart::LineDiagram::setType().

762 {

6.16.3.22 QStringList AbstractDiagram::datasetLabels () const [inherited]

The set of dataset labels currently displayed, for use in legends, etc.

Returns:
The set of dataset labels currently displayed.

Definition at line 698 of file KDChartAbstractDiagram.cpp.


Referenced by KDChart::Legend::buildLegend(), and KDChart::Legend::datasetCount().

699 : " << attributesModel()->columnCount(attributesModel


700 const int columnCount = attributesModel()->columnCount(attributesModelRootIndex());
701 for( int i = datasetDimension()-1; i < columnCount; i += datasetDimension() ){
702 //qDebug() << "label: " << attributesModel()->headerData( i, Qt::Horizontal, Qt::DisplayRole )
703 ret << attributesModel()->headerData( i, Qt::Horizontal, Qt::DisplayRole ).toString();
704 }
705 return ret;
706 }
707
708 QList<QBrush> AbstractDiagram::datasetBrushes() const

6.16.3.23 QList< MarkerAttributes > AbstractDiagram::datasetMarkers () const


[inherited]

The set of dataset markers currently used, for use in legends, etc.

Note:
Cell-level override markers, if set, take precedence over the dataset values, so you might need to check
these too, in order to find the marker, that is shown for a single cell.

Returns:
The current set of dataset brushes.

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


240 KD Chart 2 Class Documentation

Definition at line 733 of file KDChartAbstractDiagram.cpp.


Referenced by KDChart::Legend::buildLegend().

735 {
736 DataValueAttributes a =
737 qVariantValue<DataValueAttributes>( attributesModel()->headerData( i, Qt::Vertical, DataVa
738 const MarkerAttributes &ma = a.markerAttributes();
739 ret << ma;
740 }
741 return ret;
742 }
743
744 bool AbstractDiagram::checkInvariants( bool justReturnTheStatus ) const

6.16.3.24 QList< QPen > AbstractDiagram::datasetPens () const [inherited]

The set of dataset pens currently used, for use in legends, etc.

Note:
Cell-level override pens, if set, take precedence over the dataset values, so you might need to check
these too, in order to find the pens, that is used for a single cell.

Returns:
The current set of dataset pens.

Definition at line 722 of file KDChartAbstractDiagram.cpp.


Referenced by KDChart::Legend::buildLegend().

724 {
725 QPen pen = qVariantValue<QPen>( attributesModel()->headerData( i, Qt::Vertical, DatasetPenRole
726 ret << pen;
727 }
728 return ret;
729 }
730
731 QList<MarkerAttributes> AbstractDiagram::datasetMarkers() const

6.16.3.25 DataValueAttributes AbstractDiagram::dataValueAttributes (const QModelIndex &


index) const [inherited]

Retrieve the DataValueAttributes for the given index.


This will fall back automatically to what was set at dataset or model level, if there are no datapoint specific
settings.

Parameters:
index The datapoint to retrieve the attributes for.

Returns:
The DataValueAttributes for the given index.

Definition at line 272 of file KDChartAbstractDiagram.cpp.

278 {

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.16 KDChart::BarDiagram Class Reference 241

6.16.3.26 DataValueAttributes AbstractDiagram::dataValueAttributes (int column) const


[inherited]

Retrieve the DataValueAttributes for the given dataset.


This will fall back automatically to what was set at model level, if there are no dataset specific settings.

Parameters:
dataset The dataset to retrieve the attributes for.
Returns:
The DataValueAttributes for the given dataset.

Definition at line 265 of file KDChartAbstractDiagram.cpp.

271 {

6.16.3.27 DataValueAttributes AbstractDiagram::dataValueAttributes () const [inherited]

Retrieve the DataValueAttributes speficied globally.


This will fall back automatically to the default settings, if there are no specific settings.

Returns:
The global DataValueAttributes.

Definition at line 260 of file KDChartAbstractDiagram.cpp.


Referenced by KDChart::AbstractDiagram::paintDataValueText(), and KDChart::AbstractDiagram::paint-
Marker().

264 {

6.16.3.28 void AbstractDiagram::doItemsLayout () [virtual, inherited]

[reimplemented]
Definition at line 223 of file KDChartAbstractDiagram.cpp.
References d, and KDChart::AbstractDiagram::update().

223 {
224 d->plane->layoutDiagrams();
225 update();
226 }
227 QAbstractItemView::doItemsLayout();
228 }
229
230 void AbstractDiagram::dataChanged( const QModelIndex &topLeft,

6.16.3.29 int AbstractDiagram::horizontalOffset () const [virtual, inherited]

[reimplemented]
Definition at line 655 of file KDChartAbstractDiagram.cpp.

657 { return 0; }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


242 KD Chart 2 Class Documentation

6.16.3.30 QModelIndex AbstractDiagram::indexAt (const QPoint & point) const [virtual,


inherited]

[reimplemented]
Definition at line 649 of file KDChartAbstractDiagram.cpp.

651 { return QModelIndex(); }

6.16.3.31 bool AbstractDiagram::isIndexHidden (const QModelIndex & index) const


[virtual, inherited]

[reimplemented]
Definition at line 661 of file KDChartAbstractDiagram.cpp.

663 {}

6.16.3.32 QStringList AbstractDiagram::itemRowLabels () const [inherited]

The set of item row labels currently displayed, for use in Abscissa axes, etc.

Returns:
The set of item row labels currently displayed.

Definition at line 686 of file KDChartAbstractDiagram.cpp.

687 : " << attributesModel()->rowCount(attributesModelRoo


688 const int rowCount = attributesModel()->rowCount(attributesModelRootIndex());
689 for( int i = 0; i < rowCount; ++i ){
690 //qDebug() << "label: " << attributesModel()->headerData( i, Qt::Vertical, Qt::DisplayRole ).t
691 ret << attributesModel()->headerData( i, Qt::Vertical, Qt::DisplayRole ).toString();
692 }
693 return ret;
694 }
695
696 QStringList AbstractDiagram::datasetLabels() const

6.16.3.33 void KDChart::AbstractCartesianDiagram::layoutPlanes () [virtual,


inherited]

Definition at line 90 of file KDChartAbstractCartesianDiagram.cpp.


References KDChart::AbstractDiagram::coordinatePlane(), and KDChart::AbstractCoordinate-
Plane::layoutPlanes().
Referenced by KDChart::AbstractCartesianDiagram::addAxis(), and KDChart::AbstractCartesian-
Diagram::takeAxis().

91 {
92 //qDebug() << "KDChart::AbstractCartesianDiagram::layoutPlanes()";
93 AbstractCoordinatePlane* plane = coordinatePlane();
94 if( plane ){
95 plane->layoutPlanes();
96 //qDebug() << "KDChart::AbstractCartesianDiagram::layoutPlanes() OK";
97 }
98 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.16 KDChart::BarDiagram Class Reference 243

6.16.3.34 void KDChart::AbstractDiagram::modelsChanged () [protected, inherited]

This signal is emitted, when either the model or the AttributesModel is replaced.
Referenced by KDChart::AbstractDiagram::setAttributesModel(), and KDChart::AbstractDiagram::set-
Model().

6.16.3.35 QModelIndex AbstractDiagram::moveCursor (CursorAction cursorAction,


Qt::KeyboardModifiers modifiers) [virtual, inherited]

[reimplemented]
Definition at line 652 of file KDChartAbstractDiagram.cpp.

654 { return 0; }

6.16.3.36 const int BarDiagram::numberOfAbscissaSegments () const [virtual]

[reimplemented]
Implements KDChart::AbstractCartesianDiagram.
Definition at line 667 of file KDChartBarDiagram.cpp.
References KDChart::AbstractDiagram::attributesModelRootIndex(), and d.

668 {
669 return d->attributesModel->rowCount(attributesModelRootIndex());
670 }

6.16.3.37 const int BarDiagram::numberOfOrdinateSegments () const [virtual]

[reimplemented]
Implements KDChart::AbstractCartesianDiagram.
Definition at line 672 of file KDChartBarDiagram.cpp.
References KDChart::AbstractDiagram::attributesModelRootIndex(), and d.

673 {
674 return d->attributesModel->columnCount(attributesModelRootIndex());
675 }

6.16.3.38 void BarDiagram::paint (PaintContext ∗ paintContext) [protected, virtual]

Draw the diagram contents to the rectangle and painter, that are passed in as part of the paint context.

Parameters:
paintContext All information needed for painting.

Implements KDChart::AbstractDiagram.
Definition at line 376 of file KDChartBarDiagram.cpp.

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


244 KD Chart 2 Class Documentation

References KDChart::AbstractDiagram::attributesModelRootIndex(), barAttributes(), KDChart::Abstract-


Diagram::checkInvariants(), KDChart::AbstractDiagram::coordinatePlane(), d, KDChart::Abstract-
Diagram::dataBoundaries(), KDChart::AbstractThreeDAttributes::depth(), KDChart::BarAttributes::fixed-
BarWidth(), KDChart::BarAttributes::fixedDataValueGap(), KDChart::BarAttributes::fixedValueBlock-
Gap(), KDChart::AbstractThreeDAttributes::isEnabled(), KDChart::AbstractDiagram::paintDataValue-
Text(), KDChart::PaintContext::painter(), KDChart::PaintContext::rectangle(), threeDBarAttributes(),
KDChart::AbstractCoordinatePlane::translate(), type(), KDChart::BarAttributes::useFixedBarWidth(),
KDChart::BarAttributes::useFixedDataValueGap(), and KDChart::BarAttributes::useFixedValueBlock-
Gap().

377 {
378 if ( !checkInvariants() )
379 return;
380 // Calculate width
381 QPointF boundLeft, boundRight;
382 QPair<QPointF,QPointF> boundaries = dataBoundaries();
383 if( !AbstractGrid::isBoundariesValid(boundaries) ) return;
384 boundLeft = coordinatePlane()->translate( boundaries.first );
385 boundRight = coordinatePlane()->translate( boundaries.second );
386 double width = boundRight.x() - boundLeft.x();
387 //calculates and stores the values
388 const int rowCount = d->attributesModel->rowCount(attributesModelRootIndex());
389 const int colCount = d->attributesModel->columnCount(attributesModelRootIndex());
390 DataValueTextInfoList list;
391 BarAttributes ba = barAttributes( model()->index( 0, 0, rootIndex() ) );
392 double barWidth = 0;
393 double maxDepth = 0;
394 double spaceBetweenBars = 0;
395 double spaceBetweenGroups = 0;
396 double groupWidth = /*ctx->rectangle().width() / ( rowCount + 2 )*/ width/ (rowCount + 2);
397
398
399 if ( ba.useFixedBarWidth() ) {
400 barWidth = ba.fixedBarWidth();
401 groupWidth += barWidth;
402
403 // Pending Michel set a min and max value for the groupWidth related to the area.width
404 // FixMe
405 if ( groupWidth < 0 )
406 groupWidth = 0;
407
408 if ( groupWidth * rowCount > ctx->rectangle().width() )
409 groupWidth = ctx->rectangle().width() / rowCount;
410 }
411
412 // maxLimit: allow the space between bars to be larger until area.width() is covered by the groups
413 double maxLimit = rowCount * (groupWidth + ((colCount-1) * ba.fixedDataValueGap()) );
414
415 //Pending Michel: FixMe
416 if ( ba.useFixedDataValueGap() ) {
417 if ( ctx->rectangle().width() > maxLimit )
418 spaceBetweenBars += ba.fixedDataValueGap();
419 else
420 spaceBetweenBars = ((ctx->rectangle().width()/rowCount) - groupWidth)/(colCount-1);
421 }
422
423 //Pending Michel: FixMe
424 if ( ba.useFixedValueBlockGap() )
425 spaceBetweenGroups += ba.fixedValueBlockGap();
426
427 calculateValueAndGapWidths( rowCount, colCount,groupWidth,
428 barWidth, spaceBetweenBars, spaceBetweenGroups );
429
430 // paint different bar types: Normal - Stacked - Percent
431 switch ( type() )

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.16 KDChart::BarDiagram Class Reference 245

432 {
433 case BarDiagram::Normal:
434 {
435 // we paint the bars for all series next to each other, then move to the next value
436 for ( int i=0; i<rowCount; ++i ) {
437 double offset = -groupWidth/2 + spaceBetweenGroups/2;
438 // case fixed data value gap - handles max and min limits as well
439 if ( ba.useFixedDataValueGap() ) {
440 if ( spaceBetweenBars > 0 ) {
441 if ( ctx->rectangle().width() > maxLimit )
442 offset -= ba.fixedDataValueGap();
443 else
444 offset -= ((ctx->rectangle().width()/rowCount) - groupWidth)/(colCount-1);
445
446 } else {
447 //allow reducing the gap until the bars are displayed next to each other - nul
448 offset += barWidth/2;
449 }
450 }
451
452 for ( int j=0; j< colCount; ++j ) {
453 // paint one group
454 const double value = d->attributesModel->data( d->attributesModel->index( i, j, at
455 QPointF topPoint = coordinatePlane()->translate( QPointF( i + 0.5, value ) );
456 QPointF bottomPoint = coordinatePlane()->translate( QPointF( i, 0 ) );
457 const double barHeight = bottomPoint.y() - topPoint.y();
458 topPoint.setX( topPoint.x() + offset );
459 //PENDING Michel: FIXME barWidth
460 QModelIndex index = model()->index( i, j, rootIndex() );
461 list.append( DataValueTextInfo( index, topPoint, value ) );
462 paintBars( ctx, index, QRectF( topPoint, QSizeF( barWidth, barHeight ) ), maxDepth
463
464 offset += barWidth + spaceBetweenBars;
465 }
466 }
467 }
468 break;
469 case BarDiagram::Stacked:
470 {
471 for ( int i = 0; i<colCount; ++i ) {
472 double offset = spaceBetweenGroups;
473 for ( int j = 0; j< rowCount; ++j ) {
474 QModelIndex index = model()->index( j, i, rootIndex() );
475 ThreeDBarAttributes tda = threeDBarAttributes( index );
476 double value = 0, stackedValues = 0;
477 QPointF point, previousPoint;
478
479 if ( tda.isEnabled() ) {
480 if ( barWidth > 0 )
481 barWidth = (width - ((offset+(tda.depth()))*rowCount))/ rowCount;
482 if ( barWidth <= 0 ) {
483 barWidth = 0;
484 maxDepth = offset - (width/rowCount);
485 }
486 } else
487 barWidth = (ctx->rectangle().width() - (offset*rowCount))/ rowCount ;
488
489 value = model()->data( index ).toDouble();
490 for ( int k = i; k >= 0 ; --k )
491 stackedValues += model()->data( model()->index( j, k, rootIndex() ) ).toDouble(
492 point = coordinatePlane()->translate( QPointF( j, stackedValues ) );
493 point.setX( point.x() + offset/2 );
494 previousPoint = coordinatePlane()->translate( QPointF( j, stackedValues - value ) )
495 const double barHeight = previousPoint.y() - point.y();
496 list.append( DataValueTextInfo( index, point, value ) );
497 paintBars( ctx, index, QRectF( point, QSizeF( barWidth , barHeight ) ), maxDepth );
498 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


246 KD Chart 2 Class Documentation

499
500 }
501 }
502 break;
503 case BarDiagram::Percent:
504 {
505 double maxValue = 100; // always 100 %
506 double sumValues = 0;
507 QVector <double > sumValuesVector;
508
509 //calculate sum of values for each column and store
510 for ( int j=0; j<rowCount; ++j ) {
511 for ( int i=0; i<colCount; ++i ) {
512 double tmpValue = model()->data( model()->index( j, i, rootIndex() ) ).toDouble();
513 if ( tmpValue > 0 )
514 sumValues += tmpValue;
515 if ( i == colCount-1 ) {
516 sumValuesVector << sumValues ;
517 sumValues = 0;
518 }
519 }
520 }
521
522 // calculate stacked percent value
523 for ( int i = 0; i<colCount; ++i ) {
524 double offset = spaceBetweenGroups;
525 for ( int j=0; j<rowCount ; ++j ) {
526 double value = 0, stackedValues = 0;
527 QPointF point, previousPoint;
528 QModelIndex index = model()->index( j, i, rootIndex() );
529 ThreeDBarAttributes tda = threeDBarAttributes( index );
530
531 if ( tda.isEnabled() ) {
532 if ( barWidth > 0 )
533 barWidth = (width - ((offset+(tda.depth()))*rowCount))/ rowCount;
534 if ( barWidth <= 0 ) {
535 barWidth = 0;
536 maxDepth = offset - ( width/rowCount);
537 }
538 }
539 else
540 barWidth = (ctx->rectangle().width() - (offset*rowCount))/ rowCount;
541
542 value = model()->data( index ).toDouble();
543
544 // calculate stacked percent value
545 // we only take in account positives values for now.
546 for ( int k = i; k >= 0 ; --k ) {
547 double val = model()->data( model()->index( j, k, rootIndex() ) ).toDouble();
548 if ( val > 0)
549 stackedValues += val;
550 }
551
552 if ( sumValuesVector.at( j ) != 0 && value > 0 ) {
553 point = coordinatePlane()->translate( QPointF( j, stackedValues/sumValuesVect
554
555 point.setX( point.x() + offset/2 );
556
557 previousPoint = coordinatePlane()->translate( QPointF( j, (stackedValues - val
558 }
559 const double barHeight = previousPoint.y() - point.y();
560
561 list.append( DataValueTextInfo( index, point, value ) );
562 paintBars( ctx, index, QRectF( point, QSizeF( barWidth, barHeight ) ), maxDepth );
563
564 }
565 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.16 KDChart::BarDiagram Class Reference 247

566 }
567 break;
568 default:
569 Q_ASSERT_X ( false, "paint()",
570 "Type item does not match a defined bar chart Type." );
571 }
572
573 DataValueTextInfoListIterator it( list );
574 while ( it.hasNext() ) {
575 const DataValueTextInfo& info = it.next();
576 paintDataValueText( ctx->painter(), info.index, info.pos, info.value );
577 }
578 }

6.16.3.39 void AbstractDiagram::paintDataValueText (QPainter ∗ painter, const QModelIndex &


index, const QPointF & pos, double value) [protected, inherited]

Definition at line 318 of file KDChartAbstractDiagram.cpp.


References KDChart::DataValueAttributes::dataLabel(), KDChart::AbstractDiagram::dataValue-
Attributes(), KDChart::DataValueAttributes::decimalDigits(), KDChart::TextAttributes::font(),
KDChart::TextAttributes::isVisible(), KDChart::DataValueAttributes::isVisible(), KDChart::Text-
Attributes::pen(), KDChart::DataValueAttributes::prefix(), KDChart::TextAttributes::rotation(),
KDChart::DataValueAttributes::suffix(), and KDChart::DataValueAttributes::textAttributes().
Referenced by KDChart::RingDiagram::paint(), KDChart::PolarDiagram::paint(), KDChart::Line-
Diagram::paint(), and paint().

320 {
321 // paint one data series
322 DataValueAttributes a = dataValueAttributes(index);
323 if ( !a.isVisible() ) return;
324
325 // handle decimal digits
326 int decimalDigits = a.decimalDigits();
327 int decimalPos = QString::number( value ).indexOf( QLatin1Char( ’.’ ) );
328 QString roundedValue;
329 if ( a.dataLabel().isNull() ) {
330 if ( decimalPos > 0 && value != 0 )
331 roundedValue = roundValues ( value, decimalPos, decimalDigits );
332 else
333 roundedValue = QString::number( value );
334 } else
335 roundedValue = a.dataLabel();
336 // handle prefix and suffix
337 if ( !a.prefix().isNull() )
338 roundedValue.prepend( a.prefix() );
339
340 if ( !a.suffix().isNull() )
341 roundedValue.append( a.suffix() );
342
343 PainterSaver painterSaver( painter );
344 // FIXME draw the non-text bits, background, etc
345 const TextAttributes &ta = a.textAttributes();
346 if ( ta.isVisible() ) {
347 painter->setPen( ta.pen() );
348 painter->setFont( ta.font() );
349 painter->translate( pos );
350 painter->rotate( ta.rotation() );
351 painter->drawText( QPointF(0, 0), roundedValue );
352 }
353 }
354

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


248 KD Chart 2 Class Documentation

355 QString AbstractDiagram::roundValues( double value,

6.16.3.40 void AbstractDiagram::paintDataValueTexts (QPainter ∗ painter) [protected,


virtual, inherited]

Definition at line 382 of file KDChartAbstractDiagram.cpp.

385 {
386 for ( int j=0; j< rowCount; ++j ) {
387 const QModelIndex index = model()->index( j, i, rootIndex() );
388 double value = model()->data( index ).toDouble();
389 const QPointF pos = coordinatePlane()->translate( QPointF( j, value ) );
390 paintDataValueText( painter, index, pos, value );
391 }
392 }
393 }
394
395

6.16.3.41 void AbstractDiagram::paintMarker (QPainter ∗ painter, const QModelIndex & index,


const QPointF & pos) [protected, inherited]

Definition at line 398 of file KDChartAbstractDiagram.cpp.


References KDChart::AbstractDiagram::brush(), KDChart::AbstractDiagram::checkInvariants(),
KDChart::AbstractDiagram::dataValueAttributes(), KDChart::MarkerAttributes::isVisible(),
KDChart::DataValueAttributes::isVisible(), KDChart::DataValueAttributes::markerAttributes(),
KDChart::MarkerAttributes::markerColor(), KDChart::MarkerAttributes::markerSize(),
KDChart::AbstractDiagram::paintMarker(), and KDChart::MarkerAttributes::pen().

399 {
400
401 if ( !checkInvariants() ) return;
402 DataValueAttributes a = dataValueAttributes(index);
403 if ( !a.isVisible() ) return;
404 const MarkerAttributes &ma = a.markerAttributes();
405 if ( !ma.isVisible() ) return;
406
407 PainterSaver painterSaver( painter );
408 QSizeF maSize( ma.markerSize() );
409 QBrush indexBrush( brush( index ) );
410 QPen indexPen( ma.pen() );
411 if ( ma.markerColor().isValid() )
412 indexBrush.setColor( ma.markerColor() );
413
414 paintMarker( painter, ma, indexBrush, indexPen, pos, maSize );
415 }
416
417

6.16.3.42 void AbstractDiagram::paintMarker (QPainter ∗ painter, const MarkerAttributes &


markerAttributes, const QBrush & brush, const QPen &, const QPointF & point, const
QSizeF & size) [virtual, inherited]

Definition at line 420 of file KDChartAbstractDiagram.cpp.

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.16 KDChart::BarDiagram Class Reference 249

References KDChart::MarkerAttributes::markerStyle().
Referenced by KDChart::LineDiagram::paint(), KDChart::MarkerLayoutItem::paint(), and
KDChart::AbstractDiagram::paintMarker().

424 {
425 PainterSaver painterSaver( painter );
426 painter->setBrush( brush );
427 painter->setPen( pen );
428 painter->setRenderHint ( QPainter::Antialiasing );
429 painter->translate( pos );
430 switch ( markerAttributes.markerStyle() ) {
431 case MarkerAttributes::MarkerCircle:
432 painter->drawEllipse( QRectF( 0 - maSize.height()/2, 0 - maSize.width()/2,
433 maSize.height(), maSize.width()) );
434 break;
435 case MarkerAttributes::MarkerSquare:
436 {
437 QRectF rect( 0 - maSize.height()/2, 0 - maSize.width()/2,
438 maSize.height(), maSize.width() );
439 painter->drawRect( rect );
440 painter->fillRect( rect, painter->brush() );
441 break;
442 }
443 case MarkerAttributes::MarkerDiamond:
444 {
445 QVector <QPointF > diamondPoints;
446 QPointF top, left, bottom, right;
447 top = QPointF( 0, 0 - maSize.height()/2 );
448 left = QPointF( 0 - maSize.width()/2, 0 );
449 bottom = QPointF( 0, maSize.height()/2 );
450 right = QPointF( maSize.width()/2, 0 );
451 diamondPoints << top << left << bottom << right;
452 painter->drawPolygon( diamondPoints );
453 break;
454 }
455 //Pending Michel: do we need that? Ask: What is the idea about
456 // Marker1Pixel and Marker4Pixels.
457 case MarkerAttributes::Marker1Pixel:
458 {
459 QSizeF pSize(4,4);
460 QPen pen1Pixel;
461 pen1Pixel.setColor( painter->background().color() );
462 QRectF centerRect( -pSize.height()/2, -pSize.width()/2,
463 pSize.height(), pSize.width() );
464 painter->setPen( pen1Pixel );
465 painter->drawEllipse( centerRect );
466 break;
467 }
468 case MarkerAttributes::Marker4Pixels:
469 {
470 QSizeF pSize(8, 8);
471 QPen pen4Pixel;
472 pen4Pixel.setColor( painter->background().color() );
473 QRectF centerRect( -pSize.height()/2, -pSize.width()/2,
474 pSize.height(), pSize.width() );
475 painter->setPen( pen4Pixel );
476 painter->drawEllipse( centerRect );
477 break;
478 }
479 case MarkerAttributes::MarkerRing:
480 {
481 painter->setBrush( Qt::NoBrush );
482 painter->drawEllipse( QRectF( 0 - maSize.height()/2, 0 - maSize.width()/2,
483 maSize.height(), maSize.width()) );
484 break;
485 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


250 KD Chart 2 Class Documentation

486 case MarkerAttributes::MarkerCross:


487 {
488 QVector <QPointF > crossPoints;
489 QPointF leftTop, leftBottom, centerBottomLeft, bottomLeft, bottomRight,
490 centerBottomRight,rightBottom, rightTop, centerTopRight, topRight, topLeft,
491 centerTopLeft;
492 leftTop = QPointF( -maSize.width()/2, -maSize.height()/4 );
493 leftBottom = QPointF( -maSize.width()/2, maSize.height()/4 );
494 centerBottomLeft = QPointF( -maSize.width()/4, maSize.height()/4 );
495 bottomLeft = QPointF( -maSize.width()/4, maSize.height()/2 );
496 bottomRight = QPointF( maSize.width()/4, maSize.height()/2 );
497 centerBottomRight = QPointF( maSize.width()/4, maSize.height()/4 );
498 rightBottom = QPointF( maSize.width()/2, maSize.height()/4 );
499 rightTop = QPointF( maSize.width()/2, -maSize.height()/4 );
500 centerTopRight = QPointF( maSize.width()/4, -maSize.height()/4 );
501 topRight = QPointF( maSize.width()/4, -maSize.height()/2 );
502 topLeft = QPointF( -maSize.width()/4, -maSize.height()/2 );
503 centerTopLeft = QPointF( -maSize.width()/4, -maSize.height()/4 );
504
505 crossPoints << leftTop << leftBottom << centerBottomLeft
506 << bottomLeft << bottomRight << centerBottomRight
507 << rightBottom << rightTop << centerTopRight
508 << topRight << topLeft << centerTopLeft;
509
510 painter->drawPolygon( crossPoints );
511 break;
512 }
513 case MarkerAttributes::MarkerFastCross:
514 {
515 QPointF left, right, top, bottom;
516 left = QPointF( -maSize.width()/2, 0 );
517 right = QPointF( maSize.width()/2, 0 );
518 top = QPointF( 0, -maSize.height()/2 );
519 bottom= QPointF( 0, maSize.height()/2 );
520 painter->drawLine( left, right );
521 painter->drawLine( top, bottom );
522 break;
523 }
524 default:
525 Q_ASSERT_X ( false, "paintMarkers()",
526 "Type item does not match a defined Marker Type." );
527 }
528 }
529
530 void AbstractDiagram::paintMarkers( QPainter* painter )

6.16.3.43 void AbstractDiagram::paintMarkers (QPainter ∗ painter) [protected,


virtual, inherited]

Definition at line 532 of file KDChartAbstractDiagram.cpp.

535 {
536 for ( int j=0; j< rowCount; ++j ) {
537 const QModelIndex index = model()->index( j, i, rootIndex() );
538 double value = model()->data( index ).toDouble();
539 const QPointF pos = coordinatePlane()->translate( QPointF( j, value ) );
540 paintMarker( painter, index, pos );
541 }
542 }
543 }
544
545

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.16 KDChart::BarDiagram Class Reference 251

6.16.3.44 QPen AbstractDiagram::pen (const QModelIndex & index) const [inherited]

Retrieve the pen to be used, for painting the datapoint at the given index in the model.

Parameters:
index The index of the datapoint in the model.

Returns:
The pen to use for painting.

Definition at line 586 of file KDChartAbstractDiagram.cpp.

593 {

6.16.3.45 QPen AbstractDiagram::pen (int dataset) const [inherited]

Retrieve the pen to be used for the given dataset.


This will fall back automatically to what was set at model level, if there are no dataset specific settings.

Parameters:
dataset The dataset to retrieve the pen for.

Returns:
The pen to use for painting.

Definition at line 578 of file KDChartAbstractDiagram.cpp.

585 {

6.16.3.46 QPen AbstractDiagram::pen () const [inherited]

Retrieve the pen to be used for painting datapoints globally.


This will fall back automatically to the default settings, if there are no specific settings.

Returns:
The pen to use for painting.

Definition at line 572 of file KDChartAbstractDiagram.cpp.


Referenced by KDChart::PieDiagram::paint().

577 {

6.16.3.47 bool AbstractDiagram::percentMode () const [inherited]

Definition at line 313 of file KDChartAbstractDiagram.cpp.


References d.
Referenced by KDChart::CartesianCoordinatePlane::getDataDimensionsList().

320 {

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


252 KD Chart 2 Class Documentation

6.16.3.48 void KDChart::AbstractDiagram::propertiesChanged () [protected,


inherited]

Emitted upon change of a property of the Diagram.


Referenced by KDChart::AbstractDiagram::setDataValueAttributes(), KDChart::LineDiagram::setLine-
Attributes(), KDChart::LineDiagram::setThreeDLineAttributes(), and KDChart::LineDiagram::setType().

6.16.3.49 AbstractCartesianDiagram ∗ AbstractCartesianDiagram::referenceDiagram () const


[virtual, inherited]

Definition at line 123 of file KDChartAbstractCartesianDiagram.cpp.


References d.

124 {
125 return d->referenceDiagram;
126 }

6.16.3.50 QPointF AbstractCartesianDiagram::referenceDiagramOffset () const [virtual,


inherited]

Definition at line 128 of file KDChartAbstractCartesianDiagram.cpp.


References d.

129 {
130 return d->referenceDiagramOffset;
131 }

6.16.3.51 void BarDiagram::resize (const QSizeF & area) [virtual]

Called by the widget’s sizeEvent.


Adjust all internal structures, that are calculated, dependending on the size of the widget.

Parameters:
area

Implements KDChart::AbstractDiagram.
Definition at line 663 of file KDChartBarDiagram.cpp.

664 {
665 }

6.16.3.52 void BarDiagram::resizeEvent (QResizeEvent ∗) [protected]

Definition at line 194 of file KDChartBarDiagram.cpp.

195 {
196
197 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.16 KDChart::BarDiagram Class Reference 253

6.16.3.53 void AbstractDiagram::scrollTo (const QModelIndex & index, ScrollHint hint =


EnsureVisible) [virtual, inherited]

[reimplemented]
Definition at line 646 of file KDChartAbstractDiagram.cpp.

648 { return QModelIndex(); }

6.16.3.54 void AbstractDiagram::setAllowOverlappingDataValueTexts (bool allow)


[inherited]

Set whether data value labels are allowed to overlap.

Parameters:
allow True means that overlapping labels are allowed.

Definition at line 285 of file KDChartAbstractDiagram.cpp.


References d.

290 {

6.16.3.55 void AbstractDiagram::setAntiAliasing (bool enabled) [inherited]

Set whether anti-aliasing is to be used while rendering this diagram.

Parameters:
enabled True means that AA is enabled.

Definition at line 296 of file KDChartAbstractDiagram.cpp.


References d.

301 {

6.16.3.56 void AbstractDiagram::setAttributesModel (AttributesModel ∗ model) [virtual,


inherited]

Associate an AttributesModel with this diagram.


Note that the diagram does _not_ take ownership of the AttributesModel. This should thus only be used
with AttributesModels that have been explicitely created by the user, and are owned by her. Setting an
AttributesModel that is internal to another diagram is an error.
Correct:

AttributesModel *am = new AttributesModel( model, 0 );


diagram1->setAttributesModel( am );
diagram2->setAttributesModel( am );

Wrong:

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


254 KD Chart 2 Class Documentation

diagram1->setAttributesModel( diagram2->attributesModel() );

Parameters:
model The AttributesModel to use for this diagram.

See also:
AttributesModel

Definition at line 160 of file KDChartAbstractDiagram.cpp.


References d, and KDChart::AbstractDiagram::modelsChanged().

161 {
162 if( amodel->sourceModel() != model() ) {
163 qWarning("KDChart::AbstractDiagram::setAttributesModel() failed: "
164 "Trying to set an attributesmodel which works on a different "
165 "model than the diagram.");
166 return;
167 }
168 if( qobject_cast<PrivateAttributesModel*>(amodel) ) {
169 qWarning("KDChart::AbstractDiagram::setAttributesModel() failed: "
170 "Trying to set an attributesmodel that is private to another diagram.");
171 return;
172 }
173 d->setAttributesModel(amodel);
174 scheduleDelayedItemsLayout();
175 d->databoundariesDirty = true;
176 emit modelsChanged();
177 }

6.16.3.57 void AbstractDiagram::setAttributesModelRootIndex (const QModelIndex & idx)


[protected, inherited]

Definition at line 195 of file KDChartAbstractDiagram.cpp.


References d.

6.16.3.58 void BarDiagram::setBarAttributes (const QModelIndex & index, const BarAttributes


& a)

Definition at line 101 of file KDChartBarDiagram.cpp.


References KDChart::AbstractDiagram::attributesModel(), KDChart::BarAttributesRole, d, and
KDChart::AttributesModel::setData().

102 {
103 attributesModel()->setData(
104 d->attributesModel->mapFromSource( index ),
105 qVariantFromValue( ta ),
106 BarAttributesRole );
107 }

6.16.3.59 void BarDiagram::setBarAttributes (int column, const BarAttributes & a)

Definition at line 93 of file KDChartBarDiagram.cpp.


References KDChart::BarAttributesRole, and d.

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.16 KDChart::BarDiagram Class Reference 255

94 {
95 d->attributesModel->setHeaderData(
96 column, Qt::Vertical,
97 qVariantFromValue( ta ),
98 BarAttributesRole );
99 }

6.16.3.60 void BarDiagram::setBarAttributes (const BarAttributes & a)

Definition at line 88 of file KDChartBarDiagram.cpp.


References KDChart::BarAttributesRole, and d.

89 {
90 d->attributesModel->setModelData( qVariantFromValue( ta ), BarAttributesRole );
91 }

6.16.3.61 void AbstractDiagram::setBrush (const QBrush & brush) [inherited]

Set the brush to be used, for painting all datasets in the model.

Parameters:
brush The brush to use.

Definition at line 602 of file KDChartAbstractDiagram.cpp.

608 {

6.16.3.62 void AbstractDiagram::setBrush (int dataset, const QBrush & brush) [inherited]

Set the brush to be used, for painting the given dataset.

Parameters:
dataset The dataset’s column in the model.
pen The brush to use.

Definition at line 609 of file KDChartAbstractDiagram.cpp.

617 {

6.16.3.63 void AbstractDiagram::setBrush (const QModelIndex & index, const QBrush & brush)
[inherited]

Set the brush to be used, for painting the datapoint at the given index.

Parameters:
index The datapoint’s index in the model.
brush The brush to use.

Definition at line 594 of file KDChartAbstractDiagram.cpp.

601 {

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


256 KD Chart 2 Class Documentation

6.16.3.64 void KDChart::AbstractCartesianDiagram::setCoordinatePlane


(AbstractCoordinatePlane ∗ plane) [virtual, inherited]

Set the coordinate plane associated with the diagram.


This determines how coordinates in value space are mapped into pixel space. The chart takes ownership.

Returns:
The coordinate plane associated with the diagram.

Reimplemented from KDChart::AbstractDiagram.


Definition at line 100 of file KDChartAbstractCartesianDiagram.cpp.
References KDChart::AbstractDiagram::coordinatePlane(), and KDChart::AbstractDiagram::set-
CoordinatePlane().

101 {
102 if( coordinatePlane() ) disconnect( coordinatePlane() );
103 AbstractDiagram::setCoordinatePlane(plane);
104
105 // show the axes, after all have been adjusted
106 // (because they might be dependend on each other)
107 /*
108 if( plane )
109 Q_FOREACH( CartesianAxis* axis, d->axesList )
110 axis->show();
111 else
112 Q_FOREACH( CartesianAxis* axis, d->axesList )
113 axis->hide();
114 */
115 }

6.16.3.65 void AbstractDiagram::setDataBoundariesDirty () const [protected,


inherited]

Definition at line 139 of file KDChartAbstractDiagram.cpp.


References d.
Referenced by setThreeDBarAttributes(), KDChart::LineDiagram::setThreeDLineAttributes(),
KDChart::LineDiagram::setType(), and setType().

140 {
141 d->databoundariesDirty = true;
142 }

6.16.3.66 void AbstractDiagram::setDatasetDimension (int dimension) [inherited]

Sets the dataset dimension of the diagram.

See also:
datasetDimension.

Parameters:
dimension

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.16 KDChart::BarDiagram Class Reference 257

Definition at line 763 of file KDChartAbstractDiagram.cpp.


References d.

770 {

6.16.3.67 void AbstractDiagram::setDataValueAttributes (const DataValueAttributes & a)


[inherited]

Set the DataValueAttributes for all datapoints in the model.

Parameters:
a The attributes to set.

Definition at line 279 of file KDChartAbstractDiagram.cpp.


References d.

284 {

6.16.3.68 void AbstractDiagram::setDataValueAttributes (int dataset, const DataValueAttributes


& a) [inherited]

Set the DataValueAttributes for the given dataset.

Parameters:
dataset The dataset to set the attributes for.
a The attributes to set.

Definition at line 251 of file KDChartAbstractDiagram.cpp.


References d.

259 {

6.16.3.69 void AbstractDiagram::setDataValueAttributes (const QModelIndex & index, const


DataValueAttributes & a) [inherited]

Set the DataValueAttributes for the given index.

Parameters:
index The datapoint to set the attributes for.
a The attributes to set.

Definition at line 240 of file KDChartAbstractDiagram.cpp.


References d, KDChart::DataValueLabelAttributesRole, and KDChart::AbstractDiagram::properties-
Changed().

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


258 KD Chart 2 Class Documentation

240 {
241 d->attributesModel->setData(
242 d->attributesModel->mapFromSource( index ),
243 qVariantFromValue( a ),
244 DataValueLabelAttributesRole );
245 emit propertiesChanged();
246 }
247
248

6.16.3.70 void AbstractDiagram::setModel (QAbstractItemModel ∗ model) [virtual,


inherited]

Associate a model with the diagram.


Definition at line 144 of file KDChartAbstractDiagram.cpp.
References d, KDChart::AttributesModel::initFrom(), and KDChart::AbstractDiagram::modelsChanged().

145 {
146 QAbstractItemView::setModel( newModel );
147 AttributesModel* amodel = new PrivateAttributesModel( newModel, this );
148 amodel->initFrom( d->attributesModel );
149 d->setAttributesModel(amodel);
150 scheduleDelayedItemsLayout();
151 d->databoundariesDirty = true;
152 emit modelsChanged();
153 }

6.16.3.71 void AbstractDiagram::setPen (const QPen & pen) [inherited]

Set the pen to be used, for painting all datasets in the model.

Parameters:
pen The pen to use.

Definition at line 556 of file KDChartAbstractDiagram.cpp.

562 {

6.16.3.72 void AbstractDiagram::setPen (int dataset, const QPen & pen) [inherited]

Set the pen to be used, for painting the given dataset.

Parameters:
dataset The dataset’s row in the model.
pen The pen to use.

Definition at line 563 of file KDChartAbstractDiagram.cpp.

571 {

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.16 KDChart::BarDiagram Class Reference 259

6.16.3.73 void AbstractDiagram::setPen (const QModelIndex & index, const QPen & pen)
[inherited]

Set the pen to be used, for painting the datapoint at the given index.

Parameters:
index The datapoint’s index in the model.
pen The pen to use.

Definition at line 548 of file KDChartAbstractDiagram.cpp.

555 {

6.16.3.74 void AbstractDiagram::setPercentMode (bool percent) [inherited]

Definition at line 307 of file KDChartAbstractDiagram.cpp.


References d.
Referenced by KDChart::LineDiagram::setType(), and setType().

312 {

6.16.3.75 void AbstractCartesianDiagram::setReferenceDiagram (AbstractCartesianDiagram ∗


diagram, const QPointF & offset = QPointF()) [virtual, inherited]

Definition at line 117 of file KDChartAbstractCartesianDiagram.cpp.


References d.

118 {
119 d->referenceDiagram = diagram;
120 d->referenceDiagramOffset = offset;
121 }

6.16.3.76 void AbstractDiagram::setRootIndex (const QModelIndex & idx) [virtual,


inherited]

Set the root index in the model, where the diagram starts referencing data for display.
[reimplemented]
Definition at line 188 of file KDChartAbstractDiagram.cpp.
References d.

6.16.3.77 void AbstractDiagram::setSelection (const QRect & rect,


QItemSelectionModel::SelectionFlags command) [virtual, inherited]

[reimplemented]
Definition at line 664 of file KDChartAbstractDiagram.cpp.

666 { return QRegion(); }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


260 KD Chart 2 Class Documentation

6.16.3.78 void BarDiagram::setThreeDBarAttributes (const QModelIndex & index, const


ThreeDBarAttributes & a)

Definition at line 148 of file KDChartBarDiagram.cpp.


References d, KDChart::AbstractDiagram::setDataBoundariesDirty(), and KDChart::ThreeDBar-
AttributesRole.

149 {
150 setDataBoundariesDirty();
151 d->attributesModel->setData(
152 d->attributesModel->mapFromSource(index),
153 qVariantFromValue( tda ),
154 ThreeDBarAttributesRole );
155 emit layoutChanged( this );
156 }

6.16.3.79 void BarDiagram::setThreeDBarAttributes (int column, const ThreeDBarAttributes &


a)

Definition at line 138 of file KDChartBarDiagram.cpp.


References d, KDChart::AbstractDiagram::setDataBoundariesDirty(), and KDChart::ThreeDBar-
AttributesRole.

139 {
140 setDataBoundariesDirty();
141 d->attributesModel->setHeaderData(
142 column, Qt::Vertical,
143 qVariantFromValue( tda ),
144 ThreeDBarAttributesRole );
145 emit layoutChanged( this );
146 }

6.16.3.80 void BarDiagram::setThreeDBarAttributes (const ThreeDBarAttributes & a)

Definition at line 131 of file KDChartBarDiagram.cpp.


References d, KDChart::AbstractDiagram::setDataBoundariesDirty(), and KDChart::ThreeDBar-
AttributesRole.

132 {
133 setDataBoundariesDirty();
134 d->attributesModel->setModelData( qVariantFromValue( tda ), ThreeDBarAttributesRole );
135 emit layoutChanged( this );
136 }

6.16.3.81 void BarDiagram::setType (BarType type)

Definition at line 72 of file KDChartBarDiagram.cpp.


References d, KDChart::AbstractDiagram::setDataBoundariesDirty(), and KDChart::Abstract-
Diagram::setPercentMode().

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.16 KDChart::BarDiagram Class Reference 261

73 {
74 if ( type == d->barType ) return;
75
76 d->barType = type;
77 // AbstractAxis settings - see AbstractDiagram and CartesianAxis
78 setPercentMode( type == BarDiagram::Percent );
79 setDataBoundariesDirty();
80 emit layoutChanged( this );
81 }

6.16.3.82 void AbstractCartesianDiagram::takeAxis (CartesianAxis ∗ axis) [virtual,


inherited]

Removes the axis from the diagram, without deleting it.


The diagram no longer owns the axis, so it is the caller’s responsibility to delete the axis.

See also:
addAxis

Definition at line 75 of file KDChartAbstractCartesianDiagram.cpp.


References d, KDChart::AbstractAxis::deleteObserver(), KDChart::AbstractCartesianDiagram::layout-
Planes(), and KDChart::AbstractLayoutItem::setParentWidget().
Referenced by KDChart::CartesianAxis::∼CartesianAxis().

76 {
77 const int idx = d->axesList.indexOf( axis );
78 if( idx != -1 )
79 d->axesList.takeAt( idx );
80 axis->deleteObserver( this );
81 axis->setParentWidget( 0 );
82 layoutPlanes();
83 }

6.16.3.83 ThreeDBarAttributes BarDiagram::threeDBarAttributes (const QModelIndex & index)


const

Definition at line 172 of file KDChartBarDiagram.cpp.


References d.

173 {
174 return qVariantValue<ThreeDBarAttributes>(
175 d->attributesModel->data(
176 d->attributesModel->mapFromSource(index),
177 KDChart::ThreeDBarAttributesRole ) );
178 }

6.16.3.84 ThreeDBarAttributes BarDiagram::threeDBarAttributes (int column) const

Definition at line 164 of file KDChartBarDiagram.cpp.


References d.

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


262 KD Chart 2 Class Documentation

165 {
166 return qVariantValue<ThreeDBarAttributes>(
167 d->attributesModel->data(
168 d->attributesModel->mapFromSource( columnToIndex( column ) ),
169 KDChart::ThreeDBarAttributesRole ) );
170 }

6.16.3.85 ThreeDBarAttributes BarDiagram::threeDBarAttributes () const

Definition at line 158 of file KDChartBarDiagram.cpp.


References d.
Referenced by paint(), and threeDItemDepth().

159 {
160 return qVariantValue<ThreeDBarAttributes>(
161 d->attributesModel->data( KDChart::ThreeDBarAttributesRole ) );
162 }

6.16.3.86 double BarDiagram::threeDItemDepth (int column) const [protected, virtual]

Implements KDChart::AbstractCartesianDiagram.
Definition at line 185 of file KDChartBarDiagram.cpp.
References d.

186 {
187 return qVariantValue<ThreeDBarAttributes>(
188 d->attributesModel->headerData (
189 column,
190 Qt::Vertical,
191 KDChart::ThreeDBarAttributesRole ) ).validDepth();
192 }

6.16.3.87 double BarDiagram::threeDItemDepth (const QModelIndex & index) const


[protected, virtual]

Implements KDChart::AbstractCartesianDiagram.
Definition at line 180 of file KDChartBarDiagram.cpp.
References threeDBarAttributes(), and KDChart::AbstractThreeDAttributes::validDepth().
Referenced by calculateDataBoundaries().

181 {
182 return threeDBarAttributes( index ).validDepth();
183 }

6.16.3.88 BarDiagram::BarType BarDiagram::type () const

Definition at line 83 of file KDChartBarDiagram.cpp.


References d.
Referenced by calculateDataBoundaries(), and paint().

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.16 KDChart::BarDiagram Class Reference 263

84 {
85 return d->barType;
86 }

6.16.3.89 void AbstractDiagram::update () const [inherited]

Definition at line 777 of file KDChartAbstractDiagram.cpp.


References d.
Referenced by KDChart::AbstractDiagram::doItemsLayout().

6.16.3.90 void KDChart::AbstractDiagram::useDefaultColors () [inherited]

Set the palette to be used, for painting datasets to the default palette.

See also:
KDChart::Palette. FIXME: fold into one usePalette (KDChart::Palette&) method

Definition at line 671 of file KDChartAbstractDiagram.cpp.


References d.

675 {

6.16.3.91 void KDChart::AbstractDiagram::useRainbowColors () [inherited]

Set the palette to be used, for painting datasets to the rainbow palette.

See also:
KDChart::Palette.

Definition at line 681 of file KDChartAbstractDiagram.cpp.


References d.

685 {

6.16.3.92 void KDChart::AbstractDiagram::useSubduedColors () [inherited]

Set the palette to be used, for painting datasets to the subdued palette.

See also:
KDChart::Palette.

Definition at line 676 of file KDChartAbstractDiagram.cpp.


References d.

680 {

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


264 KD Chart 2 Class Documentation

6.16.3.93 double AbstractDiagram::valueForCell (int row, int column) const [protected,


inherited]

Helper method, retrieving the data value (DisplayRole) for a given row and column.

Parameters:
row The row to query.
column The column to query.

Returns:
The value of the display role at the given row and column as a double.

Definition at line 771 of file KDChartAbstractDiagram.cpp.


References KDChart::AbstractDiagram::attributesModelRootIndex(), and d.
Referenced by KDChart::LineDiagram::paint().

776 {

6.16.3.94 int AbstractDiagram::verticalOffset () const [virtual, inherited]

[reimplemented]
Definition at line 658 of file KDChartAbstractDiagram.cpp.

660 { return true; }

6.16.3.95 QRect AbstractDiagram::visualRect (const QModelIndex & index) const [virtual,


inherited]

[reimplemented]
Definition at line 641 of file KDChartAbstractDiagram.cpp.

645 {}

6.16.3.96 QRegion AbstractDiagram::visualRegionForSelection (const QItemSelection &


selection) const [virtual, inherited]

[reimplemented]
Definition at line 667 of file KDChartAbstractDiagram.cpp.

6.16.4 Member Data Documentation

6.16.4.1 Q_SIGNALS KDChart::AbstractDiagram::__pad0__ [protected, inherited]

Definition at line 506 of file KDChartAbstractDiagram.h.


The documentation for this class was generated from the following files:

• KDChartBarDiagram.h
• KDChartBarDiagram.cpp

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.17 KDChart::CartesianAxis Class Reference 265

6.17 KDChart::CartesianAxis Class Reference


#include <KDChartCartesianAxis.h>
Inheritance diagram for KDChart::CartesianAxis:Collaboration diagram for KDChart::CartesianAxis:

6.17.1 Detailed Description

The class for cartesian axes.


For being useful, axes need to be assigned to a diagram, see AbstractCartesianDiagram::addAxis and
AbstractCartesianDiagram::takeAxis.

See also:
PolarAxis, AbstractCartesianDiagram

Definition at line 48 of file KDChartCartesianAxis.h.

Public Types
• enum Position {
Bottom,
Top,
Right,
Left }

Public Member Functions


• void alignToReferencePoint (const RelativePosition &position)
• BackgroundAttributes backgroundAttributes () const
• CartesianAxis (AbstractCartesianDiagram ∗diagram=0)
C’tor of the class for cartesian axes.

• virtual void connectSignals ()


Wireing the signal/slot connections.

• const AbstractCoordinatePlane ∗ coordinatePlane () const


Convenience function, returns the coordinate plane, in which this axis is used.

• void createObserver (AbstractDiagram ∗diagram)


• void deleteObserver (AbstractDiagram ∗diagram)
• const AbstractDiagram ∗ diagram () const
• virtual Qt::Orientations expandingDirections () const
pure virtual in QLayoutItem

• FrameAttributes frameAttributes () const


• virtual QRect geometry () const
pure virtual in QLayoutItem

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


266 KD Chart 2 Class Documentation

• bool hasDefaultTitleTextAttributes () const


• virtual bool isAbscissa () const
• virtual bool isEmpty () const
pure virtual in QLayoutItem

• virtual bool isOrdinate () const


• QStringList labels () const
Returns a list of strings, that are used as axis labels, as set via setLabels.

• virtual void layoutPlanes ()


• virtual QSize maximumSize () const
pure virtual in QLayoutItem

• virtual QSize minimumSize () const


pure virtual in QLayoutItem

• bool observedBy (AbstractDiagram ∗diagram) const


• virtual void paint (QPainter ∗)
reimpl

• void paintAll (QPainter &painter)


Call paintAll, if you want the background and the frame to be drawn before the normal paint() is invoked
automatically.

• virtual void paintBackground (QPainter &painter, const QRect &rectangle)


• virtual void paintCtx (PaintContext ∗)
reimpl

• virtual void paintFrame (QPainter &painter, const QRect &rectangle)


• virtual void paintIntoRect (QPainter &painter, const QRect &rect)
Draws the background and frame, then calls paint().

• virtual const Position position () const


• void removeFromParentLayout ()
• void resetTitleTextAttributes ()
Reset the title text attributes to the built-in default:.

• void setBackgroundAttributes (const BackgroundAttributes &a)


• void setFrameAttributes (const FrameAttributes &a)
• virtual void setGeometry (const QRect &r)
pure virtual in QLayoutItem

• void setLabels (const QStringList &list)


Use this to specify your own set of strings, to be used as axis labels.

• void setParentLayout (QLayout ∗lay)


• virtual void setParentWidget (QWidget ∗widget)
Inform the item about its widget: This enables the item, to trigger that widget’s update, whenever the size
of the item’s contents has changed.

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.17 KDChart::CartesianAxis Class Reference 267

• virtual void setPosition (Position p)


• void setShortLabels (const QStringList &list)
Use this to specify your own set of strings, to be used as axis labels, in case the normal labels are too long.

• void setTextAttributes (const TextAttributes &a)


Use this to specify the text attributes to be used for axis labels.

• void setTitleText (const QString &text)


• void setTitleTextAttributes (const TextAttributes &a)
• QStringList shortLabels () const
Returns a list of strings, that are used as axis labels, as set via setShortLabels.

• virtual QSize sizeHint () const


pure virtual in QLayoutItem

• virtual void sizeHintChanged () const


Report changed size hint: ask the parent widget to recalculate the layout.

• TextAttributes textAttributes () const


Returns the text attributes to be used for axis labels.

• int tickLength (bool subUnitTicks=false) const


• QString titleText () const
• TextAttributes titleTextAttributes () const
Returns the text attributes that will be used for displaying the title text.

• ∼CartesianAxis ()

Public Attributes

• public Q_SLOTS: void update()


• protected Q_SLOTS: virtual void delayedInit()

Protected Member Functions

• virtual QRect areaGeometry () const


• QRect innerRect () const
• virtual void positionHasChanged ()

Protected Attributes

• Q_SIGNALS __pad0__: void positionChanged( AbstractArea ∗ )


• QWidget ∗ mParent
• QLayout ∗ mParentLayout

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


268 KD Chart 2 Class Documentation

6.17.2 Member Enumeration Documentation

6.17.2.1 enum KDChart::CartesianAxis::Position

Enumeration values:
Bottom
Top
Right
Left

Definition at line 56 of file KDChartCartesianAxis.h.

56 {
57 Bottom,
58 Top,
59 Right,
60 Left
61 };

6.17.3 Constructor & Destructor Documentation

6.17.3.1 CartesianAxis::CartesianAxis (AbstractCartesianDiagram ∗ diagram = 0) [explicit]

C’tor of the class for cartesian axes.


Note:
If using a zero parent for the constructor, you need to call your diagram’s addAxis function to add
your axis to the diagram. Otherwise, there is no need to call addAxis, since the constructor does that
automatically for you, if you pass a diagram as parameter.

See also:
AbstractCartesianDiagram::addAxis

Definition at line 49 of file KDChartCartesianAxis.cpp.

50 : AbstractAxis ( new Private( diagram, this ), diagram )


51 {
52 init();
53 }

6.17.3.2 CartesianAxis::∼CartesianAxis ()

Definition at line 55 of file KDChartCartesianAxis.cpp.


References d, and KDChart::AbstractCartesianDiagram::takeAxis().

56 {
57 // when we remove the first axis it will unregister itself and
58 // propagate the next one to the primary, thus the while loop
59 while ( d->mDiagram ) {
60 AbstractCartesianDiagram *cd = qobject_cast<AbstractCartesianDiagram*>( d->mDiagram );
61 cd->takeAxis( this );
62 }
63 Q_FOREACH( AbstractDiagram *diagram, d->secondaryDiagrams ) {
64 AbstractCartesianDiagram *cd = qobject_cast<AbstractCartesianDiagram*>( diagram );
65 cd->takeAxis( this );
66 }
67 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.17 KDChart::CartesianAxis Class Reference 269

6.17.4 Member Function Documentation

6.17.4.1 void AbstractAreaBase::alignToReferencePoint (const RelativePosition & position)


[inherited]

Definition at line 75 of file KDChartAbstractAreaBase.cpp.

76 {
77 Q_UNUSED( position );
78 // PENDING(kalle) FIXME
79 qWarning( "Sorry, not implemented: void AbstractAreaBase::alignToReferencePoint( const RelativePosi
80 }

6.17.4.2 QRect AbstractArea::areaGeometry () const [protected, virtual,


inherited]

Implements KDChart::AbstractAreaBase.
Definition at line 105 of file KDChartAbstractArea.cpp.
Referenced by KDChart::CartesianCoordinatePlane::drawingArea(), KDChart::PolarCoordinate-
Plane::layoutDiagrams(), paint(), KDChart::AbstractArea::paintAll(), and paintCtx().

106 {
107 return geometry();
108 }

6.17.4.3 BackgroundAttributes AbstractAreaBase::backgroundAttributes () const


[inherited]

Definition at line 97 of file KDChartAbstractAreaBase.cpp.


References d.

98 {
99 return d->backgroundAttributes;
100 }

6.17.4.4 void AbstractAxis::connectSignals () [virtual, inherited]

Wireing the signal/slot connections.


This method gets called automatically, each time, when you assign the axis to a diagram, either by passing
a diagram∗ to the c’tor, or by calling the diagram’s setAxis method, resp.
If overwriting this method in derived classes, make sure to call this base method AbstractAxis::connect-
Signals(), so your axis gets connected to the diagram’s built-in signals.

See also:
AbstractCartesianDiagram::addAxis()

Definition at line 192 of file KDChartAbstractAxis.cpp.


References d.
Referenced by KDChart::AbstractAxis::createObserver().

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


270 KD Chart 2 Class Documentation

193 {
194 if( d->observer ){
195 connect( d->observer, SIGNAL( diagramDataChanged( AbstractDiagram *) ),
196 this, SLOT( update() ) );
197 }
198 }

6.17.4.5 const AbstractCoordinatePlane ∗ AbstractAxis::coordinatePlane () const


[inherited]

Convenience function, returns the coordinate plane, in which this axis is used.
If the axis is not used in a coordinate plane, the return value is Zero.
Definition at line 293 of file KDChartAbstractAxis.cpp.
References d.

294 {
295 if( d->diagram() )
296 return d->diagram()->coordinatePlane();
297 return 0;
298 }

6.17.4.6 void AbstractAxis::createObserver (AbstractDiagram ∗ diagram) [inherited]

Definition at line 158 of file KDChartAbstractAxis.cpp.


References KDChart::AbstractAxis::connectSignals(), and d.
Referenced by KDChart::AbstractCartesianDiagram::addAxis().

159 {
160 if( d->setDiagram( diagram, this ) )
161 connectSignals();
162 }

6.17.4.7 void AbstractAxis::deleteObserver (AbstractDiagram ∗ diagram) [inherited]

Definition at line 174 of file KDChartAbstractAxis.cpp.


References d.
Referenced by KDChart::AbstractCartesianDiagram::takeAxis(), and KDChart::AbstractCartesian-
Diagram::∼AbstractCartesianDiagram().

175 {
176 d->unsetDiagram( diagram, this );
177 }

6.17.4.8 const AbstractDiagram ∗ KDChart::AbstractAxis::diagram () const [inherited]

Definition at line 300 of file KDChartAbstractAxis.cpp.


References d.

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.17 KDChart::CartesianAxis Class Reference 271

301 {
302 return d->diagram();
303 }

6.17.4.9 Qt::Orientations CartesianAxis::expandingDirections () const [virtual]

pure virtual in QLayoutItem


Definition at line 689 of file KDChartCartesianAxis.cpp.
References Bottom, Left, position(), Right, and Top.

690 {
691 Qt::Orientations ret;
692 switch ( position() )
693 {
694 case Bottom:
695 case Top:
696 ret = Qt::Horizontal;
697 break;
698 case Left:
699 case Right:
700 ret = Qt::Vertical;
701 break;
702 default:
703 Q_ASSERT( false ); // all positions need to be handeld
704 break;
705 };
706 return ret;
707 }

6.17.4.10 FrameAttributes AbstractAreaBase::frameAttributes () const [inherited]

Definition at line 87 of file KDChartAbstractAreaBase.cpp.


References d.
Referenced by KDChart::Legend::clone().

88 {
89 return d->frameAttributes;
90 }

6.17.4.11 QRect CartesianAxis::geometry () const [virtual]

pure virtual in QLayoutItem


Implements KDChart::AbstractAxis.
Definition at line 827 of file KDChartCartesianAxis.cpp.
References d.

828 {
829 return d->geometry;
830 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


272 KD Chart 2 Class Documentation

6.17.4.12 bool CartesianAxis::hasDefaultTitleTextAttributes () const

Definition at line 111 of file KDChartCartesianAxis.cpp.


References d.
Referenced by titleTextAttributes().

112 {
113 return d->useDefaultTextAttributes;
114 }

6.17.4.13 QRect AbstractAreaBase::innerRect () const [protected, inherited]

Definition at line 175 of file KDChartAbstractAreaBase.cpp.


References KDChart::AbstractAreaBase::areaGeometry(), and d.
Referenced by KDChart::TextArea::paintAll(), KDChart::AbstractAreaWidget::paintAll(), and
KDChart::AbstractArea::paintAll().

176 {
177 Q_ASSERT_X ( d != 0, "AbstractAreaBase::innerRect()",
178 "Private class was not initialized!" );
179
180 const int padding
181 = d->frameAttributes.isVisible()
182 ? qMax( d->frameAttributes.padding(), 0 ) : 0;
183 return
184 QRect( QPoint(0,0), areaGeometry().size() )
185 .adjusted( padding, padding, -padding, -padding );
186 }

6.17.4.14 bool CartesianAxis::isAbscissa () const [virtual]

Definition at line 139 of file KDChartCartesianAxis.cpp.


References Bottom, position(), and Top.
Referenced by paintCtx(), and tickLength().

140 {
141 return position() == Bottom || position() == Top;
142 }

6.17.4.15 bool CartesianAxis::isEmpty () const [virtual]

pure virtual in QLayoutItem


Definition at line 684 of file KDChartCartesianAxis.cpp.

685 {
686 return false; // if the axis exists, it has some (perhaps default) content
687 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.17 KDChart::CartesianAxis Class Reference 273

6.17.4.16 bool CartesianAxis::isOrdinate () const [virtual]

Definition at line 144 of file KDChartCartesianAxis.cpp.


References Left, position(), and Right.
Referenced by paintCtx().

145 {
146 return position() == Left || position() == Right;
147 }

6.17.4.17 QStringList AbstractAxis::labels () const [inherited]

Returns a list of strings, that are used as axis labels, as set via setLabels.

See also:
setLabels

Definition at line 254 of file KDChartAbstractAxis.cpp.


References d.
Referenced by maximumSize(), and paintCtx().

255 {
256 return d->hardLabels;
257 }

6.17.4.18 void CartesianAxis::layoutPlanes () [virtual]

Definition at line 127 of file KDChartCartesianAxis.cpp.


References d, and KDChart::AbstractCoordinatePlane::layoutPlanes().
Referenced by resetTitleTextAttributes(), setPosition(), setTitleText(), and setTitleTextAttributes().

128 {
129 //qDebug() << "CartesianAxis::layoutPlanes()";
130 if( ! d->diagram() || ! d->diagram()->coordinatePlane() ) return;
131 //qDebug() << "CartesianAxis::layoutPlanes(): Sorry, found no plane.";
132 AbstractCoordinatePlane* plane = d->diagram()->coordinatePlane();
133 if( plane ){
134 plane->layoutPlanes();
135 //qDebug() << "CartesianAxis::layoutPlanes() OK";
136 }
137 }

6.17.4.19 QSize CartesianAxis::maximumSize () const [virtual]

pure virtual in QLayoutItem


Definition at line 709 of file KDChartCartesianAxis.cpp.

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


274 KD Chart 2 Class Documentation

References Bottom, d, KDChart::AbstractCoordinatePlane::gridDimensionsList(), KDChart::Text-


Attributes::isVisible(), KDChart::AbstractAxis::labels(), Left, KDChart::AbstractCoordinate-
Plane::parent(), position(), KDChart::TextLayoutItem::realFont(), Right, KDChart::TextLayoutItem::set-
Text(), KDChart::TextLayoutItem::sizeHint(), KDChart::AbstractAxis::textAttributes(), tickLength(),
titleText(), titleTextAttributes(), and Top.
Referenced by minimumSize(), and sizeHint().

710 {
711 QSize result;
712 if ( !d->diagram() )
713 return result;
714
715 const TextAttributes labelTA = textAttributes();
716 const bool drawLabels = labelTA.isVisible();
717
718 const TextAttributes titleTA( titleTextAttributes() );
719 const bool drawTitle = titleTA.isVisible() && ! titleText().isEmpty();
720
721 AbstractCoordinatePlane* plane = d->diagram()->coordinatePlane();
722 QObject* refArea = plane->parent();
723 TextLayoutItem labelItem( QString::null, labelTA, refArea,
724 KDChartEnums::MeasureOrientationMinimum, Qt::AlignLeft );
725 TextLayoutItem titleItem( titleText(), titleTA, refArea,
726 KDChartEnums::MeasureOrientationMinimum, Qt::AlignHCenter | Qt::AlignVCenter );
727 const qreal labelGap =
728 drawLabels
729 ? (QFontMetricsF( labelItem.realFont() ).height() / 3.0)
730 : 0.0;
731 const qreal titleGap =
732 drawTitle
733 ? (QFontMetricsF( titleItem.realFont() ).height() / 3.0)
734 : 0.0;
735
736 switch ( position() )
737 {
738 case Bottom:
739 case Top: {
740 qreal h = 0;
741 if( drawLabels ){
742 // if there’re no label strings, we take the biggest needed number as height
743 if ( ! labels().count() )
744 {
745 labelItem.setText( QString::number( plane->gridDimensionsList().first().end, ’f’,
746 h = labelItem.sizeHint().height();
747 }else{
748 // find the longest label text:
749 for ( int i = 0; i < labels().count(); ++i )
750 {
751 labelItem.setText( labels()[ i ] );
752 qreal lh = labelItem.sizeHint().height();
753 h = qMax( h, lh );
754 }
755 }
756 // we leave a little gap between axis labels and bottom (or top, resp.) side of axis
757 h += labelGap;
758 }
759 // space for a possible title:
760 if ( drawTitle ) {
761 // we add the title height and leave a little gap between axis labels and axis title
762 h += titleItem.sizeHint().height() + titleGap;
763 }
764 // space for the ticks
765 h += qAbs( tickLength() ) * 3.0;
766 result = QSize ( 10, static_cast<int>( h ) );
767 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.17 KDChart::CartesianAxis Class Reference 275

768 break;
769 case Left:
770 case Right: {
771 qreal w = 0;
772 if( drawLabels ){
773 // if there’re no label strings, we take the biggest needed number as width
774 if ( labels().count() == 0 )
775 {
776 labelItem.setText( QString::number( plane->gridDimensionsList().last().end, ’f’, 0
777 w = labelItem.sizeHint().width();
778 }else{
779 // find the longest label text:
780 for ( int i = 0; i < labels().count(); ++i )
781 {
782 labelItem.setText( labels()[ i ] );
783 qreal lw = labelItem.sizeHint().width();
784 w = qMax( w, lw );
785 }
786 }
787 // we leave a little gap between axis labels and left (or right, resp.) side of axis
788 w += labelGap;
789 }
790 // space for a possible title:
791 if ( drawTitle ) {
792 // we add the title height and leave a little gap between axis labels and axis title
793 w += titleItem.sizeHint().height() + titleGap;
794 }
795 // space for the ticks
796 w += qAbs( tickLength() ) * 3.0;
797
798 result = QSize ( static_cast<int>( w ), 10 );
799 // qDebug() << "left/right axis width:" << result << " w:" << w;
800 }
801 break;
802 default:
803 Q_ASSERT( false ); // all positions need to be handled
804 break;
805 };
806 //qDebug() << "*******************" << result;
807 return result;
808 }

6.17.4.20 QSize CartesianAxis::minimumSize () const [virtual]

pure virtual in QLayoutItem


Definition at line 810 of file KDChartCartesianAxis.cpp.
References maximumSize().

811 {
812 return maximumSize();
813 }

6.17.4.21 bool KDChart::AbstractAxis::observedBy (AbstractDiagram ∗ diagram) const


[inherited]

Definition at line 305 of file KDChartAbstractAxis.cpp.


References d.

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


276 KD Chart 2 Class Documentation

306 {
307 return d->hasDiagram( diagram );
308 }

6.17.4.22 void CartesianAxis::paint (QPainter ∗) [virtual]

reimpl
Implements KDChart::AbstractLayoutItem.
Definition at line 168 of file KDChartCartesianAxis.cpp.
References KDChart::AbstractArea::areaGeometry(), d, paintCtx(), KDChart::PaintContext::set-
CoordinatePlane(), KDChart::PaintContext::setPainter(), and KDChart::PaintContext::setRectangle().

169 {
170 //qDebug() << "KDChart::CartesianAxis::paint() called";
171 if( ! d->diagram() || ! d->diagram()->coordinatePlane() ) return;
172 PaintContext ctx;
173 ctx.setPainter ( painter );
174 ctx.setCoordinatePlane( d->diagram()->coordinatePlane() );
175 const QRect rect( areaGeometry() );
176
177 //qDebug() << "CartesianAxis::paint( QPainter* painter ) " << " areaGeometry()():" << rect << " s
178
179 ctx.setRectangle(
180 QRectF (
181 //QPointF(0, 0),
182 QPointF(rect.left(), rect.top()),
183 QSizeF(rect.width(), rect.height() ) ) );
184 // enabling clipping so that we’re not drawing outside
185 QRegion clipRegion( rect.adjusted( -1, -1, 1, 1 ) );
186 painter->setClipRegion( clipRegion );
187 paintCtx( &ctx );
188 painter->setClipping( false );
189 //qDebug() << "KDChart::CartesianAxis::paint() done.";
190 }

6.17.4.23 void AbstractArea::paintAll (QPainter & painter) [inherited]

Call paintAll, if you want the background and the frame to be drawn before the normal paint() is invoked
automatically.
Definition at line 83 of file KDChartAbstractArea.cpp.
References KDChart::AbstractArea::areaGeometry(), KDChart::AbstractAreaBase::innerRect(),
KDChart::AbstractLayoutItem::paint(), KDChart::AbstractAreaBase::paintBackground(), and
KDChart::AbstractAreaBase::paintFrame().
Referenced by KDChart::Chart::paint(), and KDChart::AbstractArea::paintIntoRect().

84 {
85 // Paint the background and frame
86 paintBackground( painter, geometry() );
87 paintFrame( painter, geometry() );
88
89 // temporarily adjust the widget size, to be sure all content gets calculated
90 // to fit into the inner rectangle
91 const QRect oldGeometry( areaGeometry() );
92 QRect inner( innerRect() );

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.17 KDChart::CartesianAxis Class Reference 277

93 inner.moveTo(
94 oldGeometry.left() + inner.left(),
95 oldGeometry.top() + inner.top() );
96 const bool needAdjustGeometry = oldGeometry != inner;
97 if( needAdjustGeometry )
98 setGeometry( inner );
99 paint( &painter );
100 if( needAdjustGeometry )
101 setGeometry( oldGeometry );
102 //qDebug() << "AbstractAreaWidget::paintAll() done.";
103 }

6.17.4.24 void AbstractAreaBase::paintBackground (QPainter & painter, const QRect &


rectangle) [virtual, inherited]

Definition at line 103 of file KDChartAbstractAreaBase.cpp.


References attributes, and d.
Referenced by KDChart::TextArea::paintAll(), KDChart::AbstractAreaWidget::paintAll(), and
KDChart::AbstractArea::paintAll().

104 {
105 Q_ASSERT_X ( d != 0, "AbstractAreaBase::paintBackground()",
106 "Private class was not initialized!" );
107
108 #define attributes d->backgroundAttributes
109
110 if( !attributes.isVisible() ) return;
111
112 /* first draw the brush (may contain a pixmap)*/
113 if( Qt::NoBrush != attributes.brush().style() ) {
114 KDChart::PainterSaver painterSaver( &painter );
115 painter.setPen( Qt::NoPen );
116 const QPointF newTopLeft( painter.deviceMatrix().map( rect.topLeft() ) );
117 painter.setBrushOrigin( newTopLeft );
118 painter.setBrush( attributes.brush() );
119 painter.drawRect( rect );
120 }
121 /* next draw the backPixmap over the brush */
122 if( !attributes.pixmap().isNull() &&
123 attributes.pixmapMode() != BackgroundAttributes::BackgroundPixmapModeNone ) {
124 QPointF ol = rect.topLeft();
125 if( BackgroundAttributes::BackgroundPixmapModeCentered == attributes.pixmapMode() )
126 {
127 ol.setX( rect.center().x() - attributes.pixmap().width() / 2 );
128 ol.setY( rect.center().y() - attributes.pixmap().height()/ 2 );
129 painter.drawPixmap( ol, attributes.pixmap() );
130 } else {
131 QMatrix m;
132 double zW = (double)rect.width() / (double)attributes.pixmap().width();
133 double zH = (double)rect.height() / (double)attributes.pixmap().height();
134 switch( attributes.pixmapMode() ) {
135 case BackgroundAttributes::BackgroundPixmapModeScaled:
136 {
137 double z;
138 z = qMin( zW, zH );
139 m.scale( z, z );
140 }
141 break;
142 case BackgroundAttributes::BackgroundPixmapModeStretched:
143 m.scale( zW, zH );
144 break;
145 default:

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


278 KD Chart 2 Class Documentation

146 ; // Cannot happen, previously checked


147 }
148 QPixmap pm = attributes.pixmap().transformed( m );
149 ol.setX( rect.center().x() - pm.width() / 2 );
150 ol.setY( rect.center().y() - pm.height()/ 2 );
151 painter.drawPixmap( ol, pm );
152 }
153 }
154 #undef attributes
155 }

6.17.4.25 void CartesianAxis::paintCtx (PaintContext ∗) [virtual]

reimpl
Reimplemented from KDChart::AbstractLayoutItem.
Definition at line 193 of file KDChartCartesianAxis.cpp.
References KDChart::AbstractArea::areaGeometry(), Bottom, KDChart::DataDimension::calcMode,
KDChart::PaintContext::coordinatePlane(), d, KDChart::DataDimensionsList, KDChart::Data-
Dimension::distance(), KDChart::DataDimension::end, KDChart::TextLayoutItem::geometry(),
KDChart::AbstractCoordinatePlane::gridDimensionsList(), KDChart::TextLayoutItem::intersects(),
isAbscissa(), KDChart::DataDimension::isCalculated, isOrdinate(), KDChart::TextAttributes::isVisible(),
KDChart::AbstractAxis::labels(), Left, KDChart::TextLayoutItem::paint(), KDChart::AbstractCoordinate-
Plane::parent(), position(), ptr, KDChart::TextLayoutItem::realFont(), Right, KDChart::TextLayout-
Item::setGeometry(), KDChart::TextLayoutItem::setText(), KDChart::AbstractAxis::shortLabels(),
KDChart::TextLayoutItem::sizeHint(), KDChart::DataDimension::start, KDChart::DataDimension::step-
Width, KDChart::DataDimension::subStepWidth, KDChart::TextLayoutItem::text(), KDChart::Abstract-
Axis::textAttributes(), tickLength(), titleText(), titleTextAttributes(), Top, and KDChart::Cartesian-
CoordinatePlane::translate().
Referenced by paint().

194 {
195 //qDebug() << "KDChart::CartesianAxis::paintCtx() called";
196
197 Q_ASSERT_X ( d->diagram(), "CartesianAxis::paint",
198 "Function call not allowed: The axis is not assigned to any diagram." );
199
200 CartesianCoordinatePlane* plane = dynamic_cast<CartesianCoordinatePlane*>(context->coordinatePlane
201 Q_ASSERT_X ( plane, "CartesianAxis::paint",
202 "Bad function call: PaintContext::coodinatePlane() NOT a cartesian plane." );
203
204 const int MinimumPixelsBetweenRulers = 5;
205 DataDimensionsList dimensions( plane->gridDimensionsList() );
206 // test for programming errors: critical
207 Q_ASSERT_X ( dimensions.count() == 2, "CartesianAxis::paint",
208 "Error: plane->gridDimensionsList() did not return exactly two dimensions." );
209 DataDimension& dimX = dimensions.first();
210 const DataDimension& dimY = dimensions.last();
211 const DataDimension& dim = (isAbscissa() ? dimensions.first() : dimensions.last());
212 // if(isAbscissa())
213 // qDebug() << " " << "Abscissa:" << dimX.start <<".."<<dimX.end;
214 // else
215 // qDebug() << " " << "Ordinate:" << dimY.start <<".."<<dimY.end;
216
217 // preparations:
218 // - calculate the range that will be displayed:
219 const qreal absRange = qAbs( dim.distance() );
220
221 // Fixme Michel: Need to find the type of chart here - Line or Bar

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.17 KDChart::CartesianAxis Class Reference 279

222 // if Bars calculate the number of groups


223
224 qreal numberOfUnitRulers;
225 if ( isAbscissa() )
226 numberOfUnitRulers = d->diagram()->model()->rowCount() - 1.0;
227 else {
228 numberOfUnitRulers = absRange / qAbs( dimY.stepWidth ) + 1.0;
229 //qDebug() << "absRange" << absRange << "dimY.stepWidth:" << dimY.stepWidth << "numberOfUnitRu
230 }
231 qreal numberOfSubUnitRulers;
232 if ( isAbscissa() )
233 numberOfSubUnitRulers = 0.0;
234 else {
235 numberOfSubUnitRulers = absRange / qAbs( dimY.subStepWidth ) + 1.0;
236 //qDebug() << "dimY.subStepWidth:" << dimY.stepWidth << "numberOfSubUnitRulers:" << numberOfSu
237 }
238
239 // - calculate the absolute range in screen pixels:
240 const QPointF p1 = plane->translate( QPointF(dimX.start, dimY.start) );
241 const QPointF p2 = plane->translate( QPointF(dimX.end, dimY.end) );
242
243 double screenRange;
244 if ( isAbscissa() )
245 {
246 screenRange = qAbs ( p1.x() - p2.x() );
247 } else {
248 screenRange = qAbs ( p1.y() - p2.y() );
249 }
250
251 const bool useItemCountLabels = isAbscissa() && d->diagram()->datasetDimension() == 1;
252
253
254
255
256 //FIXME(khz): Remove this code, and do the calculation in the grid calc function
257 if( isAbscissa() && ! dimX.isCalculated ){
258 dimX.stepWidth = 1.0;
259 while( screenRange / numberOfUnitRulers <= MinimumPixelsBetweenRulers ){
260 dimX.stepWidth *= 10.0;
261 //qDebug() << "adjusting dimX.stepWidth to" << dimX.stepWidth;
262 numberOfUnitRulers = qAbs( dimX.distance() / dimX.stepWidth );
263 }
264 }
265
266 const bool drawUnitRulers = screenRange / numberOfUnitRulers > MinimumPixelsBetweenRulers;
267 const bool drawSubUnitRulers =
268 (numberOfSubUnitRulers != 0.0) &&
269 (screenRange / numberOfSubUnitRulers > MinimumPixelsBetweenRulers);
270
271 const TextAttributes labelTA = textAttributes();
272 const bool drawLabels = labelTA.isVisible();
273
274 // - find the reference point at which to start drawing and the increment (line distance);
275 QPointF rulerRef;
276 QRect geoRect( areaGeometry() );
277 QRectF rulerRect;
278 double rulerWidth;
279 double rulerHeight;
280
281 //for debugging: if( isAbscissa() )ptr->drawRect(geoRect.adjusted(0,0,-1,-1));
282 //qDebug() << " " << (isAbscissa() ? "Abscissa":"Ordinate") << "axis painting with geometr
283
284 // FIXME references are of course different for all locations:
285 rulerWidth = geoRect.width();
286 rulerHeight = geoRect.height();
287 switch( position() )
288 {

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


280 KD Chart 2 Class Documentation

289 case Top:


290 rulerRef.setX( geoRect.topLeft().x() );
291 rulerRef.setY( geoRect.topLeft().y() + rulerHeight );
292 break;
293 case Bottom:
294 rulerRef.setX( geoRect.bottomLeft().x() );
295 rulerRef.setY( geoRect.bottomLeft().y() - rulerHeight );
296 break;
297 case Right:
298 rulerRef.setX( geoRect.bottomRight().x() - rulerWidth );
299 rulerRef.setY( geoRect.bottomRight().y() );
300 break;
301 case Left:
302 rulerRef.setX( geoRect.bottomLeft().x() + rulerWidth );
303 rulerRef.setY( geoRect.bottomLeft().y() );
304 break;
305 }
306
307 // set up the lines to paint:
308
309 // set up a map of integer positions,
310
311 // - starting with the fourth
312 // - the the halfs
313 // - then the tens
314 // this will override all halfs and fourth that hit a higher-order ruler
315 // MAKE SURE TO START AT (0, 0)!
316
317 // set up a reference point, a step vector and a unit vector for the drawing:
318
319 const qreal minValueY = dimY.start;
320 const qreal maxValueY = dimY.end;
321 const qreal minValueX = dimX.start;
322 const qreal maxValueX = dimX.end;
323 const bool isLogarithmicX = (dimX.calcMode == AbstractCoordinatePlane::Logarithmic );
324 const bool isLogarithmicY = (dimY.calcMode == AbstractCoordinatePlane::Logarithmic );
325 //#define AXES_PAINTING_DEBUG 1
326 #ifdef AXES_PAINTING_DEBUG
327 qDebug() << "CartesianAxis::paint: reference values:" << endl
328 << "-- range x/y: " << dimX.distance() << "/" << dimY.distance() << endl
329 << "-- absRange: " << absRange << endl
330 << "-- numberOfUnitRulers: " << numberOfUnitRulers << endl
331 << "-- screenRange: " << screenRange << endl
332 << "-- drawUnitRulers: " << drawUnitRulers << endl
333 << "-- drawLabels: " << drawLabels << endl
334 << "-- ruler reference point:: " << rulerRef << endl
335 << "-- minValueX: " << minValueX << " maxValueX: " << maxValueX << endl
336 << "-- minValueY: " << minValueY << " maxValueY: " << maxValueY << endl
337 ;
338 #endif
339
340 ptr->setPen ( Qt::black );
341 // Commenting this it causes the frame backround to be painted in red
342 // for some reason and does not look to make sense.
343 //ptr->setBrush ( Qt::red ); // PENDING(michel) What is this for?
344 QPointF fourthRulerRef ( rulerRef );
345
346 const QObject* referenceArea = plane->parent();
347
348 // that QVector contains all drawn x-ticks (so no subticks are drawn there also)
349 QVector< int > drawnXTicks;
350 // and that does the same for the y-ticks
351 QVector< int > drawnYTicks;
352
353 // this draws the unit rulers
354 if ( drawUnitRulers ) {
355 const int hardLabelsCount = labels().count();

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.17 KDChart::CartesianAxis Class Reference 281

356 const int shortLabelsCount = shortLabels().count();


357 bool useShortLabels = false;
358
359 QStringList headerLabels;
360 if( useItemCountLabels ){
361 headerLabels =
362 isOrdinate()
363 ? d->diagram()->datasetLabels()
364 : d->diagram()->itemRowLabels();
365 }
366 const int headerLabelsCount = headerLabels.count();
367
368 TextLayoutItem* labelItem =
369 drawLabels
370 ? new TextLayoutItem( QString::number( minValueY ),
371 labelTA,
372 referenceArea,
373 KDChartEnums::MeasureOrientationMinimum,
374 Qt::AlignLeft )
375 : 0;
376 TextLayoutItem* labelItem2 =
377 drawLabels
378 ? new TextLayoutItem( QString::number( minValueY ),
379 labelTA,
380 referenceArea,
381 KDChartEnums::MeasureOrientationMinimum,
382 Qt::AlignLeft )
383 : 0;
384 const QFontMetricsF met(
385 drawLabels
386 ? labelItem->realFont()
387 : QFontMetricsF( QApplication::font() ) );
388 const qreal halfFontHeight = met.height() * 0.5;
389
390 if ( isAbscissa() ) {
391 // If we have a labels list AND a short labels list, we first find out,
392 // if there is enough space for the labels: if not, use the short labels.
393 if( drawLabels && hardLabelsCount > 0 && shortLabelsCount > 0 ){
394 bool labelsAreOverlapping = false;
395 int iLabel = 0;
396 qreal i = minValueX;
397 while ( i < maxValueX && !labelsAreOverlapping )
398 {
399 if ( dimX.stepWidth != 1.0 && ! dim.isCalculated )
400 {
401 labelItem->setText( QString::number( i, ’f’, 0 ) );
402 labelItem2->setText( QString::number( i + dimX.stepWidth, ’f’, 0 ) );
403 } else {
404 labelItem->setText( labels()[ iLabel ] );
405 labelItem->setText( labels()[ iLabel + 1 >= hardLabelsCount ? 0 : iLabel + 1 ]
406 }
407 QPointF firstPos( i, 0.0 );
408 firstPos = plane->translate( firstPos );
409
410 QPointF secondPos( i + dimX.stepWidth, 0.0 );
411 secondPos = plane->translate( secondPos );
412
413 labelsAreOverlapping = labelItem->intersects( *labelItem2, firstPos, secondPos );
414
415 if ( iLabel++ > hardLabelsCount - 1 )
416 iLabel = 0;
417 if ( isLogarithmicX )
418 i *= 10.0;
419 else
420 i += dimX.stepWidth;
421 }
422

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


282 KD Chart 2 Class Documentation

423 useShortLabels = labelsAreOverlapping;


424 }
425
426 labelItem2->setText( QString::null );
427 QPoint oldItemPos;
428 int idxLabel = 0;
429 qreal iLabelF = minValueX;
430 qreal i = minValueX;
431 while ( i < maxValueX ) {
432 QPointF topPoint ( i + ( useItemCountLabels ? 0.5 : 0.0 ), 0.0 );
433 QPointF bottomPoint ( topPoint );
434 topPoint = plane->translate( topPoint );
435 bottomPoint = plane->translate( bottomPoint );
436 topPoint.setY( fourthRulerRef.y() + tickLength() );
437 bottomPoint.setY( fourthRulerRef.y() );
438 ptr->drawLine( topPoint, bottomPoint );
439 drawnXTicks.append( static_cast<int>( topPoint.x() ) );
440 if ( drawLabels ) {
441 if ( isLogarithmicX )
442 labelItem->setText( QString::number(i, ’f’, 0) );
443 else if( (dimX.stepWidth != 1.0) && ! dimX.isCalculated )
444 labelItem->setText( QString::number(i, ’f’, 0) );
445 else
446 labelItem->setText( hardLabelsCount
447 ? ( useShortLabels ? shortLabels()[ idxLabel ] : labels()[ idxLabel ] )
448 : ( headerLabelsCount ? headerLabels[ idxLabel ] : QString::number( iLabe
449 // No need to call labelItem->setParentWidget(), since we are using
450 // the layout item temporarily only.
451 const QSize size( labelItem->sizeHint() );
452 labelItem->setGeometry(
453 QRect(
454 QPoint(
455 static_cast<int>( topPoint.x() - size.width() / 2 ),
456 static_cast<int>( topPoint.y() +
457 ( position() == Bottom
458 ? halfFontHeight
459 : ((halfFontHeight + size.height()) * -1.0) ) ) ),
460 size ) );
461
462 if ( ! labelItem2->intersects( *labelItem, oldItemPos, labelItem->geometry().topLe
463 {
464 labelItem->paint( ptr );
465
466 labelItem2->setText( labelItem->text() );
467 oldItemPos = labelItem->geometry().topLeft();
468 }
469
470 if( hardLabelsCount ){
471 if( idxLabel >= hardLabelsCount -1 )
472 idxLabel = 0;
473 else
474 ++idxLabel;
475 }else if( headerLabelsCount ){
476 if( idxLabel >= headerLabelsCount-1 )
477 idxLabel = 0;
478 else
479 ++idxLabel;
480 }else{
481 iLabelF += dimX.stepWidth;
482 }
483 }
484 if ( isLogarithmicX )
485 i *= 10.0;
486 else
487 i += dimX.stepWidth;
488 }
489 } else {

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.17 KDChart::CartesianAxis Class Reference 283

490 const double maxLimit = maxValueY;


491 const double steg = dimY.stepWidth;
492 int maxLabelsWidth = 0;
493 qreal labelValue;
494 if( drawLabels && position() == Right ){
495 // Find the wides label, so we to know how much we need to right-shift
496 // our labels, to get them drawn right aligned:
497 labelValue = minValueY;
498 qreal f = minValueY;
499 while ( f <= maxLimit ) {
500 labelItem->setText( QString::number( labelValue ) );
501 maxLabelsWidth = qMax( maxLabelsWidth, labelItem->sizeHint().width() );
502 if ( isLogarithmicY )
503 labelValue *= 10.0;
504 else
505 labelValue += dimY.stepWidth;
506 if ( isLogarithmicY )
507 f *= 10.0;
508 else
509 f += steg;
510 }
511 }
512 labelValue = minValueY;
513 //qDebug("minValueY: %f maxLimit: %f steg: %f", minValueY, maxLimit, steg);
514 qreal f = minValueY;
515 while ( f <= maxLimit ) {
516 //qDebug("f: %f",f);
517 QPointF leftPoint ( 0.0, f );
518 QPointF rightPoint ( 0.0, f );
519 leftPoint = plane->translate( leftPoint );
520 rightPoint = plane->translate( rightPoint );
521 leftPoint.setX( fourthRulerRef.x() + tickLength() );
522 rightPoint.setX( fourthRulerRef.x() );
523 ptr->drawLine( leftPoint, rightPoint );
524 drawnYTicks.append( static_cast<int>( leftPoint.y() ) );
525 if ( drawLabels ) {
526 labelItem->setText( QString::number( labelValue ) );
527 // No need to call labelItem->setParentWidget(), since we are using
528 // the layout item temporarily only.
529 const QSize labelSize( labelItem->sizeHint() );
530 leftPoint.setX( leftPoint.x()
531 );
532 const int x =
533 static_cast<int>( leftPoint.x() + met.height() * ( position() == Left ? -0.5 :
534 - ( position() == Left ? labelSize.width() : (labelSize.width() - maxLabelsWid
535 int y;
536 if( f == minValueY ){
537 // first label of the ordinate?
538 // shift it up a bit, to prevent it from being clipped away
539 y = static_cast<int>( leftPoint.y() - met.ascent() * 0.7 );
540 } else if( f + steg > maxLimit ){
541 // last label of the ordinate?
542 // shift it down a bit, to prevent it from being clipped away
543 y = static_cast<int>( leftPoint.y() - met.ascent() * 0.1 );
544 } else{
545 y = static_cast<int>( leftPoint.y() - met.ascent() * 0.5 );
546 }
547 --y;
548
549 labelItem->setGeometry( QRect( QPoint(x, y), labelSize ) );
550 //ptr->drawRect(labelItem->geometry().adjusted(0,0,-1,-1));
551 labelItem->paint( ptr );
552
553 if ( isLogarithmicY )
554 labelValue *= 10.0;
555 else
556 labelValue += dimY.stepWidth;

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


284 KD Chart 2 Class Documentation

557 }
558 if ( isLogarithmicY )
559 f *= 10.0;
560 else
561 f += steg;
562 }
563 }
564 if( labelItem )
565 delete labelItem;
566 if( labelItem2 )
567 delete labelItem2;
568 }
569
570 // this draws the subunit rulers
571 if ( drawSubUnitRulers ) {
572 // for the x-axis
573 if ( isAbscissa() ) {
574 int nextMayBeTick = 0;
575 int mayBeTick = 0;
576 float f = minValueX;
577 qreal fLogSubstep = minValueX;
578 int logSubstep = 0;
579 while ( f <= maxValueX ) {
580 QPointF topPoint ( f, 0 );
581 QPointF bottomPoint ( f, 0 );
582 // we don’t draw the sub ticks, if we are at the same position as a normal tick
583 topPoint = plane->translate( topPoint );
584 bottomPoint = plane->translate( bottomPoint );
585 topPoint.setY( fourthRulerRef.y() + tickLength( true ) );
586 bottomPoint.setY( fourthRulerRef.y() );
587 if( drawnXTicks.count() > nextMayBeTick )
588 mayBeTick = drawnXTicks[ nextMayBeTick ];
589 if( qAbs( mayBeTick - topPoint.x() ) > 1 )
590 ptr->drawLine( topPoint, bottomPoint );
591 else
592 ++nextMayBeTick;
593 if ( isLogarithmicX ){
594 if( logSubstep == 9 ){
595 fLogSubstep *= 10.0;
596 logSubstep = 0;
597 }
598 f += fLogSubstep;
599 ++logSubstep;
600 }else{
601 f += dimX.subStepWidth;
602 }
603 }
604 // for the y-axis
605 } else {
606 int nextMayBeTick = 0;
607 int mayBeTick = 0;
608 float f = minValueY;
609 qreal fLogSubstep = minValueY;
610 int logSubstep = 0;
611 while ( f <= maxValueY ) {
612 QPointF leftPoint ( 0, f );
613 QPointF rightPoint ( 0, f );
614 // we don’t draw the sub ticks, if we are at the same position as a normal tick
615 leftPoint = plane->translate( leftPoint );
616 rightPoint = plane->translate( rightPoint );
617 leftPoint.setX( fourthRulerRef.x() + tickLength( true ) );
618 rightPoint.setX( fourthRulerRef.x() );
619 if( drawnYTicks.count() > nextMayBeTick )
620 mayBeTick = drawnYTicks[ nextMayBeTick ];
621 if( qAbs( mayBeTick - leftPoint.y() ) > 1 )
622 ptr->drawLine( leftPoint, rightPoint );
623 else

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.17 KDChart::CartesianAxis Class Reference 285

624 ++nextMayBeTick;
625 if ( isLogarithmicY ){
626 if( logSubstep == 9 ){
627 fLogSubstep *= 10.0;
628 logSubstep = 0;
629 }
630 f += fLogSubstep;
631 ++logSubstep;
632 }else{
633 f += dimY.subStepWidth;
634 }
635 }
636 }
637 }
638
639
640 if( ! titleText().isEmpty() ){
641 const TextAttributes titleTA( titleTextAttributes() );
642 if( titleTA.isVisible() ){
643 TextLayoutItem titleItem( titleText(),
644 titleTA,
645 referenceArea,
646 KDChartEnums::MeasureOrientationMinimum,
647 Qt::AlignHCenter|Qt::AlignVCenter );
648 QPointF point;
649 const QSize size( titleItem.sizeHint() );
650 switch( position() )
651 {
652 case Top:
653 point.setX( geoRect.left() + geoRect.width() / 2.0);
654 point.setY( geoRect.top() );
655 break;
656 case Bottom:
657 point.setX( geoRect.left() + geoRect.width() / 2.0);
658 point.setY( geoRect.bottom() - size.height() );
659 break;
660 case Left:
661 point.setX( geoRect.left() );
662 point.setY( geoRect.top() + geoRect.height() / 2.0);
663 break;
664 case Right:
665 point.setX( geoRect.right() - size.height() );
666 point.setY( geoRect.top() + geoRect.height() / 2.0);
667 break;
668 }
669 PainterSaver painterSaver( ptr );
670 ptr->translate( point );
671 if( isOrdinate() )
672 ptr->rotate( 270.0 );
673 titleItem.setGeometry( QRect( QPoint(-size.width() / 2, 0), size ) );
674 //ptr->drawRect(titleItem.geometry().adjusted(0,0,-1,-1));
675 titleItem.paint( ptr );
676 }
677 }
678
679 //qDebug() << "KDChart::CartesianAxis::paintCtx() done.";
680 }

6.17.4.26 void AbstractAreaBase::paintFrame (QPainter & painter, const QRect & rectangle)
[virtual, inherited]

Definition at line 158 of file KDChartAbstractAreaBase.cpp.


References attributes, and d.

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


286 KD Chart 2 Class Documentation

Referenced by KDChart::TextArea::paintAll(), KDChart::AbstractAreaWidget::paintAll(), and


KDChart::AbstractArea::paintAll().

159 {
160 Q_ASSERT_X ( d != 0, "AbstractAreaBase::paintFrame()",
161 "Private class was not initialized!" );
162
163 #define attributes d->frameAttributes
164
165 if( !attributes.isVisible() ) return;
166
167 const QPen oldPen( painter.pen() );
168 painter.setPen( attributes.pen() );
169 painter.drawRect( rect );
170 painter.setPen( oldPen );
171 #undef attributes
172 }

6.17.4.27 void AbstractArea::paintIntoRect (QPainter & painter, const QRect & rect)
[virtual, inherited]

Draws the background and frame, then calls paint().


In most cases there is no need to overwrite this method in a derived class, but you would overwrite Abstract-
LayoutItem::paint() instead.
Definition at line 71 of file KDChartAbstractArea.cpp.
References KDChart::AbstractArea::paintAll().

72 {
73 const QRect oldGeometry( geometry() );
74 if( oldGeometry != rect )
75 setGeometry( rect );
76 painter.translate( rect.left(), rect.top() );
77 paintAll( painter );
78 painter.translate( -rect.left(), -rect.top() );
79 if( oldGeometry != rect )
80 setGeometry( oldGeometry );
81 }

6.17.4.28 const CartesianAxis::Position CartesianAxis::position () const [virtual]

Definition at line 122 of file KDChartCartesianAxis.cpp.


References d.
Referenced by expandingDirections(), isAbscissa(), isOrdinate(), maximumSize(), paintCtx(), and tick-
Length().

123 {
124 return d->position;
125 }

6.17.4.29 void AbstractArea::positionHasChanged () [protected, virtual,


inherited]

Reimplemented from KDChart::AbstractAreaBase.

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.17 KDChart::CartesianAxis Class Reference 287

Definition at line 110 of file KDChartAbstractArea.cpp.

111 {
112 emit positionChanged( this );
113 }

6.17.4.30 void KDChart::AbstractLayoutItem::removeFromParentLayout () [inherited]

Definition at line 66 of file KDChartLayoutItems.h.


Referenced by KDChart::Chart::takeCoordinatePlane().

67 {
68 if( mParentLayout ){
69 if( widget() )
70 mParentLayout->removeWidget( widget() );
71 else
72 mParentLayout->removeItem( this );
73 }
74 }

6.17.4.31 void CartesianAxis::resetTitleTextAttributes ()

Reset the title text attributes to the built-in default:.


Same font and pen as AbstractAxis::textAttributes() and 1.5 times their size.
Definition at line 105 of file KDChartCartesianAxis.cpp.
References d, and layoutPlanes().

106 {
107 d->useDefaultTextAttributes = true;
108 layoutPlanes();
109 }

6.17.4.32 void AbstractAreaBase::setBackgroundAttributes (const BackgroundAttributes & a)


[inherited]

Definition at line 92 of file KDChartAbstractAreaBase.cpp.


References d.

93 {
94 d->backgroundAttributes = a;
95 }

6.17.4.33 void AbstractAreaBase::setFrameAttributes (const FrameAttributes & a)


[inherited]

Definition at line 82 of file KDChartAbstractAreaBase.cpp.


References d.
Referenced by KDChart::Legend::clone().

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


288 KD Chart 2 Class Documentation

83 {
84 d->frameAttributes = a;
85 }

6.17.4.34 void CartesianAxis::setGeometry (const QRect & r) [virtual]

pure virtual in QLayoutItem


Implements KDChart::AbstractAxis.
Definition at line 820 of file KDChartCartesianAxis.cpp.
References d.

821 {
822 // qDebug() << "KDChart::CartesianAxis::setGeometry(" << r << ") called"
823 // << (isAbscissa() ? "for Abscissa":"for Ordinate") << "axis";
824 d->geometry = r;
825 }

6.17.4.35 void AbstractAxis::setLabels (const QStringList & list) [inherited]

Use this to specify your own set of strings, to be used as axis labels.
Labels specified via setLabels take precedence: If a non-empty list is passed, KD Chart will use these
strings as axis labels, instead of calculating them.
If you a smaller number of strings than the number od labels drawn at this axis, KD Chart will iterate over
the list, repeating the strings, until all labels are drawn. As an example you could specify the seven days of
the week as abscissa labels, which would be repeatedly used then.
By passing an empty QStringList you can reset the default behaviour.

See also:
labels, setShortLabels

Definition at line 244 of file KDChartAbstractAxis.cpp.


References d.

245 {
246 d->hardLabels = list;
247 }

6.17.4.36 void KDChart::AbstractLayoutItem::setParentLayout (QLayout ∗ lay) [inherited]

Definition at line 62 of file KDChartLayoutItems.h.

63 {
64 mParentLayout = lay;
65 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.17 KDChart::CartesianAxis Class Reference 289

6.17.4.37 void KDChart::AbstractLayoutItem::setParentWidget (QWidget ∗ widget)


[virtual, inherited]

Inform the item about its widget: This enables the item, to trigger that widget’s update, whenever the size
of the item’s contents has changed.
Thus, you need to call setParentWidget on every item, that has a non-fixed size.
Definition at line 56 of file KDChartLayoutItems.cpp.
References KDChart::AbstractLayoutItem::mParent.
Referenced by KDChart::Legend::buildLegend(), and KDChart::AbstractCartesianDiagram::takeAxis().

57 {
58 mParent = widget;
59 }

6.17.4.38 void CartesianAxis::setPosition (Position p) [virtual]

Definition at line 116 of file KDChartCartesianAxis.cpp.


References d, and layoutPlanes().

117 {
118 d->position = p;
119 layoutPlanes();
120 }

6.17.4.39 void AbstractAxis::setShortLabels (const QStringList & list) [inherited]

Use this to specify your own set of strings, to be used as axis labels, in case the normal labels are too long.

Note:
Setting done via setShortLabels will be ignored, if you did not pass a non-empty string list via set-
Labels too!

By passing an empty QStringList you can reset the default behaviour.

See also:
shortLabels, setLabels

Definition at line 270 of file KDChartAbstractAxis.cpp.


References d.

271 {
272 d->hardShortLabels = list;
273 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


290 KD Chart 2 Class Documentation

6.17.4.40 void AbstractAxis::setTextAttributes (const TextAttributes & a) [inherited]

Use this to specify the text attributes to be used for axis labels.
By default, the reference area will be set at painting time. It will be the then-valid coordinate plane’s
parent widget, so normally, it will be the KDChart::Chart. Thus the labels of all of your axes in all of your
diagrams within that Chart will be drawn in same font size, by default.

See also:
textAttributes, setLabels

Definition at line 212 of file KDChartAbstractAxis.cpp.


References d.

213 {
214 d->textAttributes = a;
215 }

6.17.4.41 void CartesianAxis::setTitleText (const QString & text)

Definition at line 74 of file KDChartCartesianAxis.cpp.


References d, and layoutPlanes().

75 {
76 //FIXME(khz): Call update al all places where axis internals are changed!
77 d->titleText = text;
78 layoutPlanes();
79 }

6.17.4.42 void CartesianAxis::setTitleTextAttributes (const TextAttributes & a)

Definition at line 86 of file KDChartCartesianAxis.cpp.


References d, and layoutPlanes().

87 {
88 d->titleTextAttributes = a;
89 d->useDefaultTextAttributes = false;
90 layoutPlanes();
91 }

6.17.4.43 QStringList AbstractAxis::shortLabels () const [inherited]

Returns a list of strings, that are used as axis labels, as set via setShortLabels.

Note:
Setting done via setShortLabels will be ignored, if you did not pass a non-empty string list via set-
Labels too!

See also:
setShortLabels

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.17 KDChart::CartesianAxis Class Reference 291

Definition at line 283 of file KDChartAbstractAxis.cpp.


References d.
Referenced by paintCtx().

284 {
285 return d->hardShortLabels;
286 }

6.17.4.44 QSize CartesianAxis::sizeHint () const [virtual]

pure virtual in QLayoutItem


Definition at line 815 of file KDChartCartesianAxis.cpp.
References maximumSize().

816 {
817 return maximumSize();
818 }

6.17.4.45 void KDChart::AbstractLayoutItem::sizeHintChanged () const [virtual,


inherited]

Report changed size hint: ask the parent widget to recalculate the layout.
Definition at line 73 of file KDChartLayoutItems.cpp.
Referenced by KDChart::TextLayoutItem::sizeHint().

74 {
75 // This is exactly like what QWidget::updateGeometry does.
76 // qDebug("KDChart::AbstractLayoutItem::sizeHintChanged() called");
77 if( mParent ) {
78 if ( mParent->layout() )
79 mParent->layout()->invalidate();
80 else
81 QApplication::postEvent( mParent, new QEvent( QEvent::LayoutRequest ) );
82 }
83 }

6.17.4.46 TextAttributes AbstractAxis::textAttributes () const [inherited]

Returns the text attributes to be used for axis labels.

See also:
setTextAttributes

Definition at line 222 of file KDChartAbstractAxis.cpp.


References d.
Referenced by maximumSize(), paintCtx(), and titleTextAttributes().

223 {
224 return d->textAttributes;
225 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


292 KD Chart 2 Class Documentation

6.17.4.47 int CartesianAxis::tickLength (bool subUnitTicks = false) const

Definition at line 832 of file KDChartCartesianAxis.cpp.


References isAbscissa(), Left, position(), and Top.
Referenced by maximumSize(), and paintCtx().

833 {
834 int result = 0;
835
836 if ( isAbscissa() ) {
837 result = position() == Top ? -4 : 3;
838 } else {
839 result = position() == Left ? -4 : 3;
840 }
841
842 if ( subUnitTicks )
843 result = result < 0 ? result + 1 : result - 1;
844
845 return result;
846 }

6.17.4.48 QString CartesianAxis::titleText () const

Definition at line 81 of file KDChartCartesianAxis.cpp.


References d.
Referenced by maximumSize(), and paintCtx().

82 {
83 return d->titleText;
84 }

6.17.4.49 TextAttributes CartesianAxis::titleTextAttributes () const

Returns the text attributes that will be used for displaying the title text.
This is either the text attributes as specified by setTitleTextAttributes, or (if setTitleTextAttributes() was
not called) the default text attributes.

See also:
resetTitleTextAttributes, hasDefaultTitleTextAttributes

Definition at line 93 of file KDChartCartesianAxis.cpp.


References d, KDChart::TextAttributes::fontSize(), hasDefaultTitleTextAttributes(), KDChart::Text-
Attributes::setFontSize(), KDChart::Measure::setValue(), KDChart::AbstractAxis::textAttributes(), and
KDChart::Measure::value().
Referenced by maximumSize(), and paintCtx().

94 {
95 if( hasDefaultTitleTextAttributes() ){
96 TextAttributes ta( textAttributes() );
97 Measure me( ta.fontSize() );
98 me.setValue( me.value() * 1.5 );

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.17 KDChart::CartesianAxis Class Reference 293

99 ta.setFontSize( me );
100 return ta;
101 }
102 return d->titleTextAttributes;
103 }

6.17.5 Member Data Documentation

6.17.5.1 Q_SIGNALS KDChart::AbstractArea::__pad0__ [protected, inherited]

Reimplemented in KDChart::AbstractCoordinatePlane.
Definition at line 86 of file KDChartAbstractArea.h.

6.17.5.2 QWidget∗ KDChart::AbstractLayoutItem::mParent [protected, inherited]

Definition at line 76 of file KDChartLayoutItems.h.


Referenced by KDChart::AbstractLayoutItem::setParentWidget().

6.17.5.3 QLayout∗ KDChart::AbstractLayoutItem::mParentLayout [protected,


inherited]

Definition at line 77 of file KDChartLayoutItems.h.

6.17.5.4 public KDChart::AbstractAxis::Q_SLOTS [inherited]

Definition at line 108 of file KDChartAbstractAxis.h.

6.17.5.5 protected KDChart::AbstractAxis::Q_SLOTS [inherited]

Definition at line 105 of file KDChartAbstractAxis.h.


The documentation for this class was generated from the following files:

• KDChartCartesianAxis.h
• KDChartCartesianAxis.cpp

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


294 KD Chart 2 Class Documentation

6.18 KDChart::CartesianCoordinatePlane Class Reference


#include <KDChartCartesianCoordinatePlane.h>
Inheritance diagram for KDChart::CartesianCoordinatePlane:Collaboration diagram for
KDChart::CartesianCoordinatePlane:

Public Types
• enum AxesCalcMode {
Linear,
Logarithmic }

Public Member Functions


• void addDiagram (AbstractDiagram ∗diagram)
Adds a diagram to this coordinate plane.

• void alignToReferencePoint (const RelativePosition &position)


• AxesCalcMode axesCalcModeX () const
• AxesCalcMode axesCalcModeY () const
• BackgroundAttributes backgroundAttributes () const
• CartesianCoordinatePlane (Chart ∗parent=0)
• AbstractDiagram ∗ diagram ()
• ConstAbstractDiagramList diagrams () const
• AbstractDiagramList diagrams ()
• bool doesIsometricScaling ()
• virtual Qt::Orientations expandingDirections () const
pure virtual in QLayoutItem

• FrameAttributes frameAttributes () const


• virtual QRect geometry () const
pure virtual in QLayoutItem

• GridAttributes globalGridAttributes () const


• GridAttributes gridAttributes (Qt::Orientation orientation) const
• DataDimensionsList gridDimensionsList ()
Returns the dimensions used for drawing the grid lines.

• bool hasOwnGridAttributes (Qt::Orientation orientation) const


• QPair< qreal, qreal > horizontalRange () const
• virtual bool isEmpty () const
pure virtual in QLayoutItem

• void layoutPlanes ()
Calling layoutPlanes() on the plane triggers the global KDChart::Chart::slotLayoutPlanes().

• virtual QSize maximumSize () const


pure virtual in QLayoutItem

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.18 KDChart::CartesianCoordinatePlane Class Reference 295

• virtual QSize minimumSize () const


pure virtual in QLayoutItem

• virtual QSize minimumSizeHint () const


[reimplemented]

• void needLayoutPlanes ()
Emitted when plane needs to trigger the Chart’s layouting of the coord.

• void needRelayout ()
Emitted when plane needs to trigger the Chart’s layouting.

• void needUpdate ()
Emitted when plane needs to update its drawings.

• virtual void paint (QPainter ∗)


reimpl

• void paintAll (QPainter &painter)


Call paintAll, if you want the background and the frame to be drawn before the normal paint() is invoked
automatically.

• virtual void paintBackground (QPainter &painter, const QRect &rectangle)


• virtual void paintCtx (PaintContext ∗context)
Default impl: Paint the complete item using its layouted position and size.

• virtual void paintFrame (QPainter &painter, const QRect &rectangle)


• virtual void paintIntoRect (QPainter &painter, const QRect &rect)
Draws the background and frame, then calls paint().

• const Chart ∗ parent () const


• Chart ∗ parent ()
• void propertiesChanged ()
Emitted upon change of a property of the Coordinate Plane or any of its components.

• AbstractCoordinatePlane ∗ referenceCoordinatePlane () const


There are two ways, in which planes can be caused to interact, in where they are put layouting wise: The
first is the reference plane.

• void relayout ()
Calling relayout() on the plane triggers the global KDChart::Chart::slotRelayout().

• void removeFromParentLayout ()
• virtual void replaceDiagram (AbstractDiagram ∗diagram, AbstractDiagram ∗oldDiagram=0)
Replaces the old diagram, or appends the diagram, it there is none yet.

• void resetGridAttributes (Qt::Orientation orientation)


Reset the attributes to be used for grid lines drawn in horizontal direction (or in vertical direction, resp.).

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


296 KD Chart 2 Class Documentation

• void setAxesCalcModes (AxesCalcMode mode)


Specifies the calculation modes for all axes.

• void setAxesCalcModeX (AxesCalcMode mode)


Specifies the calculation mode for all Abscissa axes.

• void setAxesCalcModeY (AxesCalcMode mode)


Specifies the calculation mode for all Ordinate axes.

• void setBackgroundAttributes (const BackgroundAttributes &a)


• void setFrameAttributes (const FrameAttributes &a)
• virtual void setGeometry (const QRect &r)
pure virtual in QLayoutItem

• void setGlobalGridAttributes (const GridAttributes &)


Set the grid attributes to be used by this coordinate plane.

• void setGridAttributes (Qt::Orientation orientation, const GridAttributes &)


Set the attributes to be used for grid lines drawn in horizontal direction (or in vertical direction, resp.).

• void setHorizontalRange (const QPair< qreal, qreal > &)


Allows setting the boundaries of the visible value space area that the plane displays in horizontal direction.

• void setIsometricScaling (bool onOff)


• void setParent (Chart ∗parent)
Called internally by KDChart::Chart.

• void setParentLayout (QLayout ∗lay)


• virtual void setParentWidget (QWidget ∗widget)
Inform the item about its widget: This enables the item, to trigger that widget’s update, whenever the size
of the item’s contents has changed.

• void setReferenceCoordinatePlane (AbstractCoordinatePlane ∗plane)


Set another coordinate plane to be used as the reference plane for this one.

• void setVerticalRange (const QPair< qreal, qreal > &)


Allows setting the boundaries of the visible value space area that the plane displays in vertical direction.

• virtual void setZoomCenter (QPointF center)


Set the point (in value coordinates) to be used as the center point in zoom operations.

• virtual void setZoomFactorX (double factor)


Sets the zoom factor in horizontal direction, that is applied to all coordinate transformations.

• virtual void setZoomFactorY (double factor)


Sets the zoom factor in vertical direction, that is applied to all coordinate transformations.

• virtual QSize sizeHint () const


pure virtual in QLayoutItem

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.18 KDChart::CartesianCoordinatePlane Class Reference 297

• virtual void sizeHintChanged () const


Report changed size hint: ask the parent widget to recalculate the layout.

• virtual QSizePolicy sizePolicy () const


[reimplemented]

• virtual void takeDiagram (AbstractDiagram ∗diagram)


Removes the diagram from the plane, without deleting it.

• const QPointF translate (const QPointF &diagramPoint) const


Translate the given point in value space coordinates to a position in pixel space.

• QPair< qreal, qreal > verticalRange () const


• virtual QPointF zoomCenter () const
• virtual double zoomFactorX () const
• virtual double zoomFactorY () const
• ∼CartesianCoordinatePlane ()

Public Attributes
• Q_SIGNALS __pad0__: void destroyedCoordinatePlane( AbstractCoordinatePlane∗ )

Protected Member Functions


• virtual QRect areaGeometry () const
• virtual QRectF calculateRawDataBoundingRect () const
• virtual QRectF drawingArea () const
• virtual DataDimensionsList getDataDimensionsList () const
• QRect innerRect () const
• void layoutDiagrams ()
Distribute the available space among the diagrams and axes.

• void paintEvent (QPaintEvent ∗)


• virtual void positionHasChanged ()

Protected Attributes
• QWidget ∗ mParent
• QLayout ∗ mParentLayout
• protected Q_SLOTS: void slotLayoutChanged( AbstractDiagram∗ )

6.18.1 Member Enumeration Documentation

6.18.1.1 enum KDChart::AbstractCoordinatePlane::AxesCalcMode [inherited]

Enumeration values:
Linear
Logarithmic

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


298 KD Chart 2 Class Documentation

Definition at line 55 of file KDChartAbstractCoordinatePlane.h.

55 { Linear, Logarithmic };

6.18.2 Constructor & Destructor Documentation

6.18.2.1 CartesianCoordinatePlane::CartesianCoordinatePlane (Chart ∗ parent = 0)


[explicit]

Definition at line 65 of file KDChartCartesianCoordinatePlane.cpp.

66 : AbstractCoordinatePlane ( new Private(), parent )


67 {
68 // this bloc left empty intentionally
69 }

6.18.2.2 CartesianCoordinatePlane::∼CartesianCoordinatePlane ()

Definition at line 71 of file KDChartCartesianCoordinatePlane.cpp.

72 {
73 // this bloc left empty intentionally
74 }

6.18.3 Member Function Documentation

6.18.3.1 void CartesianCoordinatePlane::addDiagram (AbstractDiagram ∗ diagram)


[virtual]

Adds a diagram to this coordinate plane.

Parameters:
diagram The diagram to add.

See also:
replaceDiagram, takeDiagram

Reimplemented from KDChart::AbstractCoordinatePlane.


Definition at line 82 of file KDChartCartesianCoordinatePlane.cpp.
References KDChart::AbstractCoordinatePlane::addDiagram(), and KDChart::AbstractCoordinate-
Plane::propertiesChanged().

83 {
84 Q_ASSERT_X ( dynamic_cast<AbstractCartesianDiagram*> ( diagram ),
85 "CartesianCoordinatePlane::addDiagram", "Only cartesian "
86 "diagrams can be added to a cartesian coordinate plane!" );
87 AbstractCoordinatePlane::addDiagram ( diagram );
88 connect ( diagram, SIGNAL ( layoutChanged ( AbstractDiagram* ) ),
89 SLOT ( slotLayoutChanged ( AbstractDiagram* ) ) );
90
91 connect( diagram, SIGNAL( propertiesChanged() ),this, SIGNAL( propertiesChanged() ) );
92 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.18 KDChart::CartesianCoordinatePlane Class Reference 299

6.18.3.2 void AbstractAreaBase::alignToReferencePoint (const RelativePosition & position)


[inherited]

Definition at line 75 of file KDChartAbstractAreaBase.cpp.

76 {
77 Q_UNUSED( position );
78 // PENDING(kalle) FIXME
79 qWarning( "Sorry, not implemented: void AbstractAreaBase::alignToReferencePoint( const RelativePosi
80 }

6.18.3.3 QRect AbstractArea::areaGeometry () const [protected, virtual,


inherited]

Implements KDChart::AbstractAreaBase.
Definition at line 105 of file KDChartAbstractArea.cpp.
Referenced by drawingArea(), KDChart::PolarCoordinatePlane::layoutDiagrams(), KDChart::Cartesian-
Axis::paint(), KDChart::AbstractArea::paintAll(), and KDChart::CartesianAxis::paintCtx().

106 {
107 return geometry();
108 }

6.18.3.4 CartesianCoordinatePlane::AxesCalcMode CartesianCoordinatePlane::axesCalcModeX


() const

Definition at line 408 of file KDChartCartesianCoordinatePlane.cpp.


References d.
Referenced by getDataDimensionsList().

409 {
410 return d->coordinateTransformation.axesCalcModeX;
411 }

6.18.3.5 CartesianCoordinatePlane::AxesCalcMode CartesianCoordinatePlane::axesCalcModeY


() const

Definition at line 403 of file KDChartCartesianCoordinatePlane.cpp.


References d.
Referenced by getDataDimensionsList().

404 {
405 return d->coordinateTransformation.axesCalcModeY;
406 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


300 KD Chart 2 Class Documentation

6.18.3.6 BackgroundAttributes AbstractAreaBase::backgroundAttributes () const


[inherited]

Definition at line 97 of file KDChartAbstractAreaBase.cpp.


References d.

98 {
99 return d->backgroundAttributes;
100 }

6.18.3.7 QRectF CartesianCoordinatePlane::calculateRawDataBoundingRect () const


[protected, virtual]

Definition at line 163 of file KDChartCartesianCoordinatePlane.cpp.


References d, KDChart::AbstractDiagram::dataBoundaries(), and KDChart::AbstractCoordinate-
Plane::diagrams().
Referenced by getDataDimensionsList().

164 {
165 // determine unit of the rectangles of all involved diagrams:
166 QPointF smallestPoint;
167 QPointF largestPoint;
168 bool bStarting = true;
169 Q_FOREACH( const AbstractDiagram* diagram, diagrams() )
170 {
171 QPair<QPointF, QPointF> dataBoundariesPair = diagram->dataBoundaries();
172 //qDebug() << "CartesianCoordinatePlane::calculateRawDataBoundingRect() gets diagram->dataBoun
173 if ( bStarting || dataBoundariesPair.first.x() < smallestPoint.x() )
174 smallestPoint.setX( dataBoundariesPair.first.x() );
175 if ( bStarting || dataBoundariesPair.first.y() < smallestPoint.y() )
176 smallestPoint.setY( dataBoundariesPair.first.y() );
177 if ( bStarting || dataBoundariesPair.second.x() > largestPoint.x() )
178 largestPoint.setX( dataBoundariesPair.second.x() );
179 if ( bStarting || dataBoundariesPair.second.y() > largestPoint.y() )
180 largestPoint.setY( dataBoundariesPair.second.y() );
181 bStarting = false;
182 }
183
184 // if custom boundaries are set on the plane, use them
185 if ( d->horizontalMin != d->horizontalMax ) {
186 smallestPoint.setX( d->horizontalMin );
187 largestPoint.setX( d->horizontalMax );
188 }
189 if ( d->verticalMin != d->verticalMax ) {
190 smallestPoint.setY( d->verticalMin );
191 largestPoint.setY( d->verticalMax );
192 }
193
194 QRectF dataBoundingRect;
195 dataBoundingRect.setBottomLeft ( smallestPoint );
196 dataBoundingRect.setTopRight ( largestPoint );
197 //qDebug() << "CartesianCoordinatePlane::calculateRawDataBoundingRect() returns" << dataBoundingRe
198 return dataBoundingRect;
199 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.18 KDChart::CartesianCoordinatePlane Class Reference 301

6.18.3.8 AbstractDiagram ∗ AbstractCoordinatePlane::diagram () [inherited]

Returns:
The first diagram associated with this coordinate plane.

Definition at line 113 of file KDChartAbstractCoordinatePlane.cpp.


References d.
Referenced by KDChart::Widget::diagram().

114 {
115 if ( d->diagrams.isEmpty() )
116 {
117 return 0;
118 } else {
119 return d->diagrams.first();
120 }
121 }

6.18.3.9 ConstAbstractDiagramList AbstractCoordinatePlane::diagrams () const


[inherited]

Returns:
The list of diagrams associated with this coordinate plane.

Definition at line 128 of file KDChartAbstractCoordinatePlane.cpp.


References KDChart::ConstAbstractDiagramList, and d.

129 {
130 ConstAbstractDiagramList list;
131 #ifndef QT_NO_STL
132 qCopy( d->diagrams.begin(), d->diagrams.end(), std::back_inserter( list ) );
133 #else
134 Q_FOREACH( AbstractDiagram * a, d->diagrams )
135 list.push_back( a );
136 #endif
137 return list;
138 }

6.18.3.10 AbstractDiagramList AbstractCoordinatePlane::diagrams () [inherited]

Returns:
The list of diagrams associated with this coordinate plane.

Definition at line 123 of file KDChartAbstractCoordinatePlane.cpp.


References KDChart::AbstractDiagramList, and d.
Referenced by calculateRawDataBoundingRect(), getDataDimensionsList(), KDChart::PolarCoordinate-
Plane::layoutDiagrams(), layoutDiagrams(), KDChart::PolarCoordinatePlane::paint(), and paint().

124 {
125 return d->diagrams;
126 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


302 KD Chart 2 Class Documentation

6.18.3.11 bool CartesianCoordinatePlane::doesIsometricScaling ()

Definition at line 356 of file KDChartCartesianCoordinatePlane.cpp.


References d.

357 {
358 return d->isometricScaling;
359 }

6.18.3.12 QRectF CartesianCoordinatePlane::drawingArea () const [protected, virtual]

Definition at line 250 of file KDChartCartesianCoordinatePlane.cpp.


References KDChart::AbstractArea::areaGeometry().
Referenced by layoutDiagrams(), and paint().

251 {
252 const QRect rect( areaGeometry() );
253 return QRectF ( rect.left()+1, rect.top()+1, rect.width() - 3, rect.height() - 3 );
254 }

6.18.3.13 Qt::Orientations KDChart::AbstractCoordinatePlane::expandingDirections () const


[virtual, inherited]

pure virtual in QLayoutItem


Definition at line 200 of file KDChartAbstractCoordinatePlane.cpp.

201 {
202 return Qt::Vertical | Qt::Horizontal;
203 }

6.18.3.14 FrameAttributes AbstractAreaBase::frameAttributes () const [inherited]

Definition at line 87 of file KDChartAbstractAreaBase.cpp.


References d.
Referenced by KDChart::Legend::clone().

88 {
89 return d->frameAttributes;
90 }

6.18.3.15 QRect KDChart::AbstractCoordinatePlane::geometry () const [virtual,


inherited]

pure virtual in QLayoutItem


Definition at line 237 of file KDChartAbstractCoordinatePlane.cpp.
References d.
Referenced by KDChart::PolarCoordinatePlane::paint().

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.18 KDChart::CartesianCoordinatePlane Class Reference 303

238 {
239 return d->geometry;
240 }

6.18.3.16 DataDimensionsList CartesianCoordinatePlane::getDataDimensionsList () const


[protected, virtual]

Implements KDChart::AbstractCoordinatePlane.
Definition at line 201 of file KDChartCartesianCoordinatePlane.cpp.
References axesCalcModeX(), axesCalcModeY(), calculateRawDataBoundingRect(), KDChart::Data-
DimensionsList, KDChart::AbstractDiagram::datasetDimension(), KDChart::AbstractCoordinate-
Plane::diagrams(), gridAttributes(), KDChart::GridAttributes::gridGranularitySequence(), KDChart::Grid-
Attributes::gridStepWidth(), KDChart::GridAttributes::gridSubStepWidth(), and KDChart::Abstract-
Diagram::percentMode().

202 {
203
204 DataDimensionsList l;
205 const AbstractCartesianDiagram* dgr
206 = diagrams().isEmpty() ? 0 : dynamic_cast<const AbstractCartesianDiagram*> (diagrams().first()
207
208 if( dgr ){
209 const QRectF r( calculateRawDataBoundingRect() );
210 // note:
211 // We do *not* access d->gridAttributesHorizontal here, but
212 // we use the getter function, to get the global attrs, if no
213 // special ones have been set for the respective orientation.
214 const GridAttributes gaH( gridAttributes( Qt::Horizontal ) );
215 const GridAttributes gaV( gridAttributes( Qt::Vertical ) );
216 // append the first dimension: for Abscissa axes
217 l.append(
218 DataDimension(
219 r.left(), r.right(),
220 dgr->datasetDimension() > 1,
221 axesCalcModeX(),
222 gaH.gridGranularitySequence(),
223 gaH.gridStepWidth() ) );
224 // append the second dimension: for Ordinate axes
225 if( dgr->percentMode() )
226 l.append(
227 DataDimension(
228 // always return 0-100 when in percentMode
229 0.0, 100.0,
230 true,
231 axesCalcModeY(),
232 KDChartEnums::GranularitySequence_10_20,
233 10.0 ) );
234 else
235 l.append(
236 DataDimension(
237 r.bottom(), r.top(),
238 true,
239 axesCalcModeY(),
240 gaV.gridGranularitySequence(),
241 gaV.gridStepWidth(),
242 gaV.gridSubStepWidth() ) );
243 }else{
244 l.append( DataDimension() ); // This gets us the default 1..0 / 1..0 grid
245 l.append( DataDimension() ); // shown, if there is no diagram on this plane.
246 }
247 return l;
248 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


304 KD Chart 2 Class Documentation

6.18.3.17 GridAttributes KDChart::AbstractCoordinatePlane::globalGridAttributes () const


[inherited]

Returns:
The grid attributes used by this coordinate plane.

See also:
setGlobalGridAttributes
CartesianCoordinatePlane::gridAttributes

Definition at line 157 of file KDChartAbstractCoordinatePlane.cpp.


References d.
Referenced by KDChart::PolarCoordinatePlane::gridAttributes(), and gridAttributes().

158 {
159 return d->gridAttributes;
160 }

6.18.3.18 GridAttributes KDChart::CartesianCoordinatePlane::gridAttributes (Qt::Orientation


orientation) const

Returns:
The attributes used for grid lines drawn in horizontal direction (or in vertical direction, resp.).

Note:
This function always returns a valid set of grid attributes: If no special grid attributes were set foe
this orientation the global attributes are returned, as returned by AbstractCoordinatePlane::globalGrid-
Attributes.

See also:
setGridAttributes
resetGridAttributes
AbstractCoordinatePlane::globalGridAttributes
hasOwnGridAttributes

Definition at line 489 of file KDChartCartesianCoordinatePlane.cpp.


References d, KDChart::AbstractCoordinatePlane::globalGridAttributes(), and hasOwnGridAttributes().
Referenced by getDataDimensionsList().

491 {
492 if( hasOwnGridAttributes( orientation ) ){
493 if( orientation == Qt::Horizontal )
494 return d->gridAttributesHorizontal;
495 else
496 return d->gridAttributesVertical;
497 }else{
498 return globalGridAttributes();
499 }
500 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.18 KDChart::CartesianCoordinatePlane Class Reference 305

6.18.3.19 KDChart::DataDimensionsList KDChart::AbstractCoordinatePlane::gridDimensions-


List () [inherited]

Returns the dimensions used for drawing the grid lines.


Returned data is the result of (cached) grid calculations, so - if you need that information for your own
tasks - make sure to call again this function after every data modification that has changed the data range,
since grid calculation is based upon the data range, thus the grid start/end might have changed if the data
was changed.

Note:
Returned list will contain different numbers of DataDimension, depending on the kind of coordinate
plane used. For CartesianCoordinatePlane two DataDimension are returned: the first representing
grid lines in X direction (matching the Abscissa axes) and the second indicating vertical grid lines (or
Ordinate axes, resp.).

Returns:
The dimensions used for drawing the grid lines.

See also:
DataDimension

Definition at line 162 of file KDChartAbstractCoordinatePlane.cpp.


References d, and KDChart::DataDimensionsList.
Referenced by layoutDiagrams(), KDChart::CartesianAxis::maximumSize(), and KDChart::Cartesian-
Axis::paintCtx().

163 {
164 return d->grid->updateData( this );
165 }

6.18.3.20 bool KDChart::CartesianCoordinatePlane::hasOwnGridAttributes (Qt::Orientation


orientation) const

Returns:
Returns whether the grid attributes have been set for the respective direction via setGridAttributes(
orientation ).

If false, the grid will use the global attributes set by AbstractCoordinatePlane::globalGridAttributes (or the
default attributes, resp.)

See also:
setGridAttributes
resetGridAttributes
AbstractCoordinatePlane::globalGridAttributes

Definition at line 512 of file KDChartCartesianCoordinatePlane.cpp.


References d.
Referenced by gridAttributes().

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


306 KD Chart 2 Class Documentation

514 {
515 return
516 ( orientation == Qt::Horizontal )
517 ? d->hasOwnGridAttributesHorizontal
518 : d->hasOwnGridAttributesVertical;
519 }

6.18.3.21 QPair< qreal, qreal > KDChart::CartesianCoordinatePlane::horizontalRange () const

Returns:
The largest and smallest visible horizontal value space value. If this is not explicitely set,or if both
values are the same, the plane will use the union of the dataBoundaries of all associated diagrams.

See also:
KDChart::AbstractDiagram::dataBoundaries

Definition at line 459 of file KDChartCartesianCoordinatePlane.cpp.


References d.

460 {
461 return QPair<qreal, qreal>( d->horizontalMin, d->horizontalMax );
462 }

6.18.3.22 QRect AbstractAreaBase::innerRect () const [protected, inherited]

Definition at line 175 of file KDChartAbstractAreaBase.cpp.


References KDChart::AbstractAreaBase::areaGeometry(), and d.
Referenced by KDChart::TextArea::paintAll(), KDChart::AbstractAreaWidget::paintAll(), and
KDChart::AbstractArea::paintAll().

176 {
177 Q_ASSERT_X ( d != 0, "AbstractAreaBase::innerRect()",
178 "Private class was not initialized!" );
179
180 const int padding
181 = d->frameAttributes.isVisible()
182 ? qMax( d->frameAttributes.padding(), 0 ) : 0;
183 return
184 QRect( QPoint(0,0), areaGeometry().size() )
185 .adjusted( padding, padding, -padding, -padding );
186 }

6.18.3.23 bool KDChart::AbstractCoordinatePlane::isEmpty () const [virtual,


inherited]

pure virtual in QLayoutItem


Definition at line 193 of file KDChartAbstractCoordinatePlane.cpp.

194 {
195 return false; // never empty!
196 // coordinate planes with no associated diagrams
197 // are showing a default grid of ()1..10, 1..10) stepWidth 1
198 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.18 KDChart::CartesianCoordinatePlane Class Reference 307

6.18.3.24 void CartesianCoordinatePlane::layoutDiagrams () [protected, virtual]

Distribute the available space among the diagrams and axes.


Implements KDChart::AbstractCoordinatePlane.
Definition at line 256 of file KDChartCartesianCoordinatePlane.cpp.
References d, KDChart::DataDimensionsList, KDChart::AbstractCoordinatePlane::diagrams(),
KDChart::DataDimension::distance(), drawingArea(), KDChart::DataDimension::end,
KDChart::AbstractCoordinatePlane::gridDimensionsList(), and KDChart::DataDimension::start.
Referenced by setHorizontalRange(), setIsometricScaling(), and setVerticalRange().

257 {
258 //qDebug("KDChart::CartesianCoordinatePlane::layoutDiagrams() called");
259 if ( diagrams().isEmpty() )
260 { // FIXME evaluate what can still be prepared
261 // FIXME decide default dimension if no diagrams are present (to make empty planes useable)
262 }
263 // the rectangle the diagrams cover in the *plane*:
264 // (Why -3? We save 1px on each side for the antialiased drawing, and
265 // respect the way QPainter calculates the width of a painted rect (the
266 // size is the rectangle size plus the pen width). This way, most clipping
267 // for regular pens should be avoided. When pens with a penWidth or larger
268 // than 1 are used, this may not be sufficient.
269 const QRectF drawArea( drawingArea() );
270 //qDebug() << "drawingArea() returns" << drawArea;
271
272 const DataDimensionsList dimensions( gridDimensionsList() );
273 // test for programming errors: critical
274 Q_ASSERT_X ( dimensions.count() == 2, "CartesianCoordinatePlane::layoutDiagrams",
275 "Error: gridDimensionsList() did not return exactly two dimensions." );
276 const DataDimension dimX = dimensions.first();
277 const DataDimension dimY = dimensions.last();
278 const qreal distX = dimX.distance();
279 const qreal distY = dimY.distance();
280 const QPointF pt(qMin(dimX.start, dimX.end), qMax(dimY.start, dimY.end));
281 const QSizeF siz( qAbs(distX), -qAbs(distY) );
282 const QRectF dataBoundingRect( pt, siz );
283
284 // calculate the remaining rectangle, and use it as the diagram area:
285 QRectF diagramArea = drawArea;
286 diagramArea.setTopLeft ( QPointF ( drawArea.left(), drawArea.top() ) );
287 diagramArea.setBottomRight ( QPointF ( drawArea.right(), drawArea.bottom() ) );
288
289 // determine coordinate transformation:
290 QPointF diagramTopLeft = dataBoundingRect.topLeft();
291 double diagramWidth = dataBoundingRect.width();
292 double diagramHeight = dataBoundingRect.height();
293 double planeWidth = diagramArea.width();
294 double planeHeight = diagramArea.height();
295 double scaleX;
296 double scaleY;
297
298 double diagramXUnitInCoordinatePlane;
299 double diagramYUnitInCoordinatePlane;
300
301 diagramXUnitInCoordinatePlane = diagramWidth != 0 ? planeWidth / diagramWidth : 1;
302 diagramYUnitInCoordinatePlane = diagramHeight != 0 ? planeHeight / diagramHeight : 1;
303 // calculate diagram origin in plane coordinates:
304 QPointF coordinateOrigin = QPointF (
305 diagramTopLeft.x() * -diagramXUnitInCoordinatePlane,
306 diagramTopLeft.y() * -diagramYUnitInCoordinatePlane );
307 coordinateOrigin += diagramArea.topLeft();
308 // calculate isometric scaling factor to maxscale the diagram into
309 // the coordinate system:

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


308 KD Chart 2 Class Documentation

310 if ( d->isometricScaling )
311 {
312 double scale = qMin ( qAbs ( diagramXUnitInCoordinatePlane ),
313 qAbs ( diagramYUnitInCoordinatePlane ) );
314
315 scaleX = qAbs( scale / diagramXUnitInCoordinatePlane );
316 scaleY = qAbs( scale / diagramYUnitInCoordinatePlane );
317 } else {
318 scaleX = 1.0;
319 scaleY = 1.0;
320 }
321 d->coordinateTransformation.diagramRect = dataBoundingRect;
322 d->coordinateTransformation.originTranslation = coordinateOrigin;
323 d->coordinateTransformation.unitVectorX = diagramXUnitInCoordinatePlane;
324 d->coordinateTransformation.unitVectorY = diagramYUnitInCoordinatePlane;
325 d->coordinateTransformation.isoScaleX = scaleX;
326 d->coordinateTransformation.isoScaleY = scaleY;
327 // adapt diagram area to effect of isometric scaling:
328 diagramArea.setTopLeft( translate ( dataBoundingRect.topLeft() ) );
329 diagramArea.setBottomRight ( translate ( dataBoundingRect.bottomRight() ) );
330 //qDebug("KDChart::CartesianCoordinatePlane::layoutDiagrams() done,\ncalling update() now:");
331 update();
332 }

6.18.3.25 void KDChart::AbstractCoordinatePlane::layoutPlanes () [inherited]

Calling layoutPlanes() on the plane triggers the global KDChart::Chart::slotLayoutPlanes().


Definition at line 254 of file KDChartAbstractCoordinatePlane.cpp.
References KDChart::AbstractCoordinatePlane::needLayoutPlanes().
Referenced by KDChart::AbstractCoordinatePlane::addDiagram(), KDChart::CartesianAxis::layout-
Planes(), KDChart::AbstractCartesianDiagram::layoutPlanes(), and KDChart::AbstractCoordinate-
Plane::replaceDiagram().

255 {
256 //qDebug("KDChart::AbstractCoordinatePlane::relayout() called");
257 emit needLayoutPlanes();
258 }

6.18.3.26 QSize KDChart::AbstractCoordinatePlane::maximumSize () const [virtual,


inherited]

pure virtual in QLayoutItem


Definition at line 205 of file KDChartAbstractCoordinatePlane.cpp.
References d.
Referenced by KDChart::AbstractCoordinatePlane::sizeHint().

206 {
207 if( d->parent )
208 return d->parent->size();
209 // Note: At external layut calculation time the coord.plane *will*
210 // have a parent widget, so returning a default size here
211 // will not affect its real drawing size.
212 return QSize(1000, 1000);
213 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.18 KDChart::CartesianCoordinatePlane Class Reference 309

6.18.3.27 QSize KDChart::AbstractCoordinatePlane::minimumSize () const [virtual,


inherited]

pure virtual in QLayoutItem


Definition at line 215 of file KDChartAbstractCoordinatePlane.cpp.

216 {
217 return QSize(60, 60); // this default can be overwritten by derived classes
218 }

6.18.3.28 QSize KDChart::AbstractCoordinatePlane::minimumSizeHint () const [virtual,


inherited]

[reimplemented]
Definition at line 140 of file KDChartAbstractCoordinatePlane.cpp.

141 {
142 return QSize( 200, 200 );
143 }

6.18.3.29 void KDChart::AbstractCoordinatePlane::needLayoutPlanes () [inherited]

Emitted when plane needs to trigger the Chart’s layouting of the coord.
planes.
Referenced by KDChart::AbstractCoordinatePlane::layoutPlanes().

6.18.3.30 void KDChart::AbstractCoordinatePlane::needRelayout () [inherited]

Emitted when plane needs to trigger the Chart’s layouting.


Referenced by KDChart::AbstractCoordinatePlane::relayout().

6.18.3.31 void KDChart::AbstractCoordinatePlane::needUpdate () [inherited]

Emitted when plane needs to update its drawings.

6.18.3.32 void CartesianCoordinatePlane::paint (QPainter ∗) [virtual]

reimpl
Implements KDChart::AbstractLayoutItem.
Definition at line 95 of file KDChartCartesianCoordinatePlane.cpp.
References KDChart::AbstractDiagramList, d, KDChart::AbstractCoordinatePlane::diagrams(),
drawingArea(), KDChart::PaintContext::setCoordinatePlane(), KDChart::PaintContext::setPainter(),
and KDChart::PaintContext::setRectangle().

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


310 KD Chart 2 Class Documentation

96 {
97 // prevent recursive call:
98 //qDebug("attempt plane::paint()");
99 if( d->bPaintIsRunning ){
100 d->bNextPaintPending = true;
101 return;
102 }
103 d->bNextPaintPending = false;
104 d->bPaintIsRunning = true;
105
106 //qDebug("start plane::paint()");
107
108 AbstractDiagramList diags = diagrams();
109 //FIXME(khz): make this also work in no diagrams are there
110 // (commenting out the following line should do it)
111 if ( !diags.isEmpty() )
112 {
113 PaintContext ctx;
114 ctx.setPainter ( painter );
115 ctx.setCoordinatePlane ( this );
116 const QRectF drawArea( drawingArea() );
117 ctx.setRectangle ( drawArea );
118
119 // enabling clipping so that we’re not drawing outside
120 QRect clipRect = drawArea.toRect().adjusted( -1, -1, 1, 1 );
121 QRegion clipRegion( clipRect );
122 painter->setClipRegion( clipRegion );
123
124 // paint the coordinate system rulers:
125 d->grid->drawGrid( &ctx );
126
127 // paint the diagrams:
128 for ( int i = 0; i < diags.size(); i++ )
129 {
130 //qDebug(" attempt diags[i]->paint ( &ctx );");
131
132 //if ( qApp->hasPendingEvents () )
133 // continue;
134
135 //if( ! d->bNextPaintPending )
136 // qApp->processEvents( QEventLoop::ExcludeSocketNotifiers );
137 //if( ! d->bNextPaintPending ){
138 //qDebug(" start diags[i]->paint ( &ctx );");
139 PainterSaver painterSaver( painter );
140 diags[i]->paint ( &ctx );
141 //}
142 //qDebug(" done: diags[i]->paint ( &ctx );");
143 }
144
145 // and disable clipping afterwards
146 painter->setClipping( false );
147
148 //for debugging:
149 // painter->drawRect( drawArea.adjusted(4,4,4,4) );
150 // painter->drawRect( drawArea.adjusted(2,2,2,2) );
151 // painter->drawRect( drawArea );
152 }
153 d->bPaintIsRunning = false;
154 //qDebug("done: plane::paint()");
155 }

6.18.3.33 void AbstractArea::paintAll (QPainter & painter) [inherited]

Call paintAll, if you want the background and the frame to be drawn before the normal paint() is invoked
automatically.

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.18 KDChart::CartesianCoordinatePlane Class Reference 311

Definition at line 83 of file KDChartAbstractArea.cpp.


References KDChart::AbstractArea::areaGeometry(), KDChart::AbstractAreaBase::innerRect(),
KDChart::AbstractLayoutItem::paint(), KDChart::AbstractAreaBase::paintBackground(), and
KDChart::AbstractAreaBase::paintFrame().
Referenced by KDChart::Chart::paint(), and KDChart::AbstractArea::paintIntoRect().

84 {
85 // Paint the background and frame
86 paintBackground( painter, geometry() );
87 paintFrame( painter, geometry() );
88
89 // temporarily adjust the widget size, to be sure all content gets calculated
90 // to fit into the inner rectangle
91 const QRect oldGeometry( areaGeometry() );
92 QRect inner( innerRect() );
93 inner.moveTo(
94 oldGeometry.left() + inner.left(),
95 oldGeometry.top() + inner.top() );
96 const bool needAdjustGeometry = oldGeometry != inner;
97 if( needAdjustGeometry )
98 setGeometry( inner );
99 paint( &painter );
100 if( needAdjustGeometry )
101 setGeometry( oldGeometry );
102 //qDebug() << "AbstractAreaWidget::paintAll() done.";
103 }

6.18.3.34 void AbstractAreaBase::paintBackground (QPainter & painter, const QRect &


rectangle) [virtual, inherited]

Definition at line 103 of file KDChartAbstractAreaBase.cpp.


References attributes, and d.
Referenced by KDChart::TextArea::paintAll(), KDChart::AbstractAreaWidget::paintAll(), and
KDChart::AbstractArea::paintAll().

104 {
105 Q_ASSERT_X ( d != 0, "AbstractAreaBase::paintBackground()",
106 "Private class was not initialized!" );
107
108 #define attributes d->backgroundAttributes
109
110 if( !attributes.isVisible() ) return;
111
112 /* first draw the brush (may contain a pixmap)*/
113 if( Qt::NoBrush != attributes.brush().style() ) {
114 KDChart::PainterSaver painterSaver( &painter );
115 painter.setPen( Qt::NoPen );
116 const QPointF newTopLeft( painter.deviceMatrix().map( rect.topLeft() ) );
117 painter.setBrushOrigin( newTopLeft );
118 painter.setBrush( attributes.brush() );
119 painter.drawRect( rect );
120 }
121 /* next draw the backPixmap over the brush */
122 if( !attributes.pixmap().isNull() &&
123 attributes.pixmapMode() != BackgroundAttributes::BackgroundPixmapModeNone ) {
124 QPointF ol = rect.topLeft();
125 if( BackgroundAttributes::BackgroundPixmapModeCentered == attributes.pixmapMode() )
126 {
127 ol.setX( rect.center().x() - attributes.pixmap().width() / 2 );

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


312 KD Chart 2 Class Documentation

128 ol.setY( rect.center().y() - attributes.pixmap().height()/ 2 );


129 painter.drawPixmap( ol, attributes.pixmap() );
130 } else {
131 QMatrix m;
132 double zW = (double)rect.width() / (double)attributes.pixmap().width();
133 double zH = (double)rect.height() / (double)attributes.pixmap().height();
134 switch( attributes.pixmapMode() ) {
135 case BackgroundAttributes::BackgroundPixmapModeScaled:
136 {
137 double z;
138 z = qMin( zW, zH );
139 m.scale( z, z );
140 }
141 break;
142 case BackgroundAttributes::BackgroundPixmapModeStretched:
143 m.scale( zW, zH );
144 break;
145 default:
146 ; // Cannot happen, previously checked
147 }
148 QPixmap pm = attributes.pixmap().transformed( m );
149 ol.setX( rect.center().x() - pm.width() / 2 );
150 ol.setY( rect.center().y() - pm.height()/ 2 );
151 painter.drawPixmap( ol, pm );
152 }
153 }
154 #undef attributes
155 }

6.18.3.35 void KDChart::AbstractLayoutItem::paintCtx (PaintContext ∗ context) [virtual,


inherited]

Default impl: Paint the complete item using its layouted position and size.
Reimplemented in KDChart::CartesianAxis.
Definition at line 64 of file KDChartLayoutItems.cpp.
References KDChart::AbstractLayoutItem::paint(), and KDChart::PaintContext::painter().

65 {
66 if( context )
67 paint( context->painter() );
68 }

6.18.3.36 void KDChart::CartesianCoordinatePlane::paintEvent (QPaintEvent ∗)


[protected]

6.18.3.37 void AbstractAreaBase::paintFrame (QPainter & painter, const QRect & rectangle)
[virtual, inherited]

Definition at line 158 of file KDChartAbstractAreaBase.cpp.


References attributes, and d.
Referenced by KDChart::TextArea::paintAll(), KDChart::AbstractAreaWidget::paintAll(), and
KDChart::AbstractArea::paintAll().

159 {
160 Q_ASSERT_X ( d != 0, "AbstractAreaBase::paintFrame()",

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.18 KDChart::CartesianCoordinatePlane Class Reference 313

161 "Private class was not initialized!" );


162
163 #define attributes d->frameAttributes
164
165 if( !attributes.isVisible() ) return;
166
167 const QPen oldPen( painter.pen() );
168 painter.setPen( attributes.pen() );
169 painter.drawRect( rect );
170 painter.setPen( oldPen );
171 #undef attributes
172 }

6.18.3.38 void AbstractArea::paintIntoRect (QPainter & painter, const QRect & rect)
[virtual, inherited]

Draws the background and frame, then calls paint().


In most cases there is no need to overwrite this method in a derived class, but you would overwrite Abstract-
LayoutItem::paint() instead.
Definition at line 71 of file KDChartAbstractArea.cpp.
References KDChart::AbstractArea::paintAll().

72 {
73 const QRect oldGeometry( geometry() );
74 if( oldGeometry != rect )
75 setGeometry( rect );
76 painter.translate( rect.left(), rect.top() );
77 paintAll( painter );
78 painter.translate( -rect.left(), -rect.top() );
79 if( oldGeometry != rect )
80 setGeometry( oldGeometry );
81 }

6.18.3.39 const KDChart::Chart ∗ KDChart::AbstractCoordinatePlane::parent () const


[inherited]

Definition at line 182 of file KDChartAbstractCoordinatePlane.cpp.


References d.

183 {
184 return d->parent;
185 }

6.18.3.40 KDChart::Chart ∗ KDChart::AbstractCoordinatePlane::parent () [inherited]

Definition at line 187 of file KDChartAbstractCoordinatePlane.cpp.


References d.
Referenced by KDChart::CartesianAxis::maximumSize(), and KDChart::CartesianAxis::paintCtx().

188 {
189 return d->parent;
190 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


314 KD Chart 2 Class Documentation

6.18.3.41 void AbstractArea::positionHasChanged () [protected, virtual,


inherited]

Reimplemented from KDChart::AbstractAreaBase.


Definition at line 110 of file KDChartAbstractArea.cpp.

111 {
112 emit positionChanged( this );
113 }

6.18.3.42 void KDChart::AbstractCoordinatePlane::propertiesChanged () [inherited]

Emitted upon change of a property of the Coordinate Plane or any of its components.
Referenced by addDiagram(), setAxesCalcModes(), setAxesCalcModeX(), setAxesCalcModeY(),
KDChart::PolarCoordinatePlane::setGridAttributes(), setGridAttributes(), setHorizontalRange(), set-
IsometricScaling(), setVerticalRange(), setZoomCenter(), setZoomFactorX(), and setZoomFactorY().

6.18.3.43 AbstractCoordinatePlane ∗ KDChart::AbstractCoordinatePlane::referenceCoordinate-


Plane () const [inherited]

There are two ways, in which planes can be caused to interact, in where they are put layouting wise: The
first is the reference plane.
If such a reference plane is set, on a plane, it will use the same cell in the layout as that one. In addition
to this, planes can share an axis. In that case they will be layed out in relation to each other as suggested
by the position of the axis. If, for example Plane1 and Plane2 share an axis at position Left, that will result
in the layout: Axis Plane1 Plane 2, vertically. If Plane1 also happens to be Plane2’s reference plane, both
planes are drawn over each other. The reference plane concept allows two planes to share the same space
even if neither has any axis, and in case there are shared axis, it is used to decided, whether the planes
should be painted on top of each other or layed out vertically or horizontally next to each other.

Returns:
The reference coordinate plane associated with this one.

Definition at line 172 of file KDChartAbstractCoordinatePlane.cpp.


References d.

173 {
174 return d->referenceCoordinatePlane;
175 }

6.18.3.44 void KDChart::AbstractCoordinatePlane::relayout () [inherited]

Calling relayout() on the plane triggers the global KDChart::Chart::slotRelayout().


Definition at line 248 of file KDChartAbstractCoordinatePlane.cpp.
References KDChart::AbstractCoordinatePlane::needRelayout().

249 {
250 //qDebug("KDChart::AbstractCoordinatePlane::relayout() called");
251 emit needRelayout();
252 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.18 KDChart::CartesianCoordinatePlane Class Reference 315

6.18.3.45 void KDChart::AbstractLayoutItem::removeFromParentLayout () [inherited]

Definition at line 66 of file KDChartLayoutItems.h.


Referenced by KDChart::Chart::takeCoordinatePlane().

67 {
68 if( mParentLayout ){
69 if( widget() )
70 mParentLayout->removeWidget( widget() );
71 else
72 mParentLayout->removeItem( this );
73 }
74 }

6.18.3.46 void AbstractCoordinatePlane::replaceDiagram (AbstractDiagram ∗ diagram,


AbstractDiagram ∗ oldDiagram = 0) [virtual, inherited]

Replaces the old diagram, or appends the diagram, it there is none yet.

Parameters:
diagram The diagram to be used instead of the old diagram. This parameter must not be zero, or the
method will do nothing.
oldDiagram The diagram to be removed by the new diagram. This diagram will be deleted automat-
ically. If the parameter is omitted, the very first diagram will be replaced. In case, there was no
diagram yet, the new diagram will just be added.

Note:
If you want to re-use the old diagram, call takeDiagram and addDiagram, instead of using replace-
Diagram.

See also:
addDiagram, takeDiagram

Definition at line 82 of file KDChartAbstractCoordinatePlane.cpp.


References KDChart::AbstractCoordinatePlane::addDiagram(), d, KDChart::AbstractCoordinate-
Plane::layoutDiagrams(), KDChart::AbstractCoordinatePlane::layoutPlanes(), and KDChart::Abstract-
CoordinatePlane::takeDiagram().

83 {
84 if( diagram && oldDiagram_ != diagram ){
85 AbstractDiagram* oldDiagram = oldDiagram_;
86 if( d->diagrams.count() ){
87 if( ! oldDiagram )
88 oldDiagram = d->diagrams.first();
89 takeDiagram( oldDiagram );
90 }
91 delete oldDiagram;
92 addDiagram( diagram );
93 layoutDiagrams();
94 layoutPlanes(); // there might be new axes, etc
95 update();
96 }
97 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


316 KD Chart 2 Class Documentation

6.18.3.47 void KDChart::CartesianCoordinatePlane::resetGridAttributes (Qt::Orientation


orientation)

Reset the attributes to be used for grid lines drawn in horizontal direction (or in vertical direction, resp.).
By calling this method you specify that the global attributes set by AbstractCoordinatePlane::setGlobal-
GridAttributes be used.

See also:
setGridAttributes, gridAttributes
AbstractCoordinatePlane::globalGridAttributes
hasOwnGridAttributes

Definition at line 482 of file KDChartCartesianCoordinatePlane.cpp.

484 {
485 setHasOwnGridAttributes( orientation, false );
486 update();
487 }

6.18.3.48 void CartesianCoordinatePlane::setAxesCalcModes (AxesCalcMode mode)

Specifies the calculation modes for all axes.


Definition at line 413 of file KDChartCartesianCoordinatePlane.cpp.
References d, and KDChart::AbstractCoordinatePlane::propertiesChanged().

414 {
415 if( d->coordinateTransformation.axesCalcModeY != mode ||
416 d->coordinateTransformation.axesCalcModeX != mode ){
417 d->coordinateTransformation.axesCalcModeY = mode;
418 d->coordinateTransformation.axesCalcModeX = mode;
419 emit propertiesChanged();
420 }
421 }

6.18.3.49 void CartesianCoordinatePlane::setAxesCalcModeX (AxesCalcMode mode)

Specifies the calculation mode for all Abscissa axes.


Definition at line 431 of file KDChartCartesianCoordinatePlane.cpp.
References d, and KDChart::AbstractCoordinatePlane::propertiesChanged().

432 {
433 if( d->coordinateTransformation.axesCalcModeX != mode ){
434 d->coordinateTransformation.axesCalcModeX = mode;
435 emit propertiesChanged();
436 }
437 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.18 KDChart::CartesianCoordinatePlane Class Reference 317

6.18.3.50 void CartesianCoordinatePlane::setAxesCalcModeY (AxesCalcMode mode)

Specifies the calculation mode for all Ordinate axes.


Definition at line 423 of file KDChartCartesianCoordinatePlane.cpp.
References d, and KDChart::AbstractCoordinatePlane::propertiesChanged().

424 {
425 if( d->coordinateTransformation.axesCalcModeY != mode ){
426 d->coordinateTransformation.axesCalcModeY = mode;
427 emit propertiesChanged();
428 }
429 }

6.18.3.51 void AbstractAreaBase::setBackgroundAttributes (const BackgroundAttributes & a)


[inherited]

Definition at line 92 of file KDChartAbstractAreaBase.cpp.


References d.

93 {
94 d->backgroundAttributes = a;
95 }

6.18.3.52 void AbstractAreaBase::setFrameAttributes (const FrameAttributes & a)


[inherited]

Definition at line 82 of file KDChartAbstractAreaBase.cpp.


References d.
Referenced by KDChart::Legend::clone().

83 {
84 d->frameAttributes = a;
85 }

6.18.3.53 void KDChart::AbstractCoordinatePlane::setGeometry (const QRect & r)


[virtual, inherited]

pure virtual in QLayoutItem

Note:
Do not call this function directly, unless you know exactly what you are doing. Geometry management
is done by KD Chart’s internal layouting measures.

Definition at line 227 of file KDChartAbstractCoordinatePlane.cpp.


References d.

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


318 KD Chart 2 Class Documentation

228 {
229 // qDebug() << "KDChart::AbstractCoordinatePlane::setGeometry(" << r << ") called";
230 if( d->geometry != r ){
231 d->geometry = r;
232 // Note: We do *not* call update() here
233 // because it would invoke KDChart::update() recursively.
234 }
235 }

6.18.3.54 void KDChart::AbstractCoordinatePlane::setGlobalGridAttributes (const


GridAttributes &) [inherited]

Set the grid attributes to be used by this coordinate plane.


To disable grid painting, for example, your code should like this:

GridAttributes ga = plane->globalGridAttributes();
ga.setGlobalGridVisible( false );
plane->setGlobalGridAttributes( ga );

See also:
globalGridAttributes
CartesianCoordinatePlane::setGridAttributes

Definition at line 151 of file KDChartAbstractCoordinatePlane.cpp.


References d.

152 {
153 d->gridAttributes = a;
154 update();
155 }

6.18.3.55 void KDChart::CartesianCoordinatePlane::setGridAttributes (Qt::Orientation


orientation, const GridAttributes &)

Set the attributes to be used for grid lines drawn in horizontal direction (or in vertical direction, resp.).
To disable horizontal grid painting, for example, your code should like this:

GridAttributes ga = plane->gridAttributes( Qt::Horizontal );


ga.setGridVisible( false );
plane-setGridAttributes( Qt::Horizontal, ga );

Note:
setGridAttributes overwrites the global attributes that were set by AbstractCoordinatePlane::setGlobal-
GridAttributes. To re-activate these global attributes you can call resetGridAttributes.

See also:
resetGridAttributes, gridAttributes
AbstractCoordinatePlane::setGlobalGridAttributes
hasOwnGridAttributes

Definition at line 469 of file KDChartCartesianCoordinatePlane.cpp.


References d, and KDChart::AbstractCoordinatePlane::propertiesChanged().

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.18 KDChart::CartesianCoordinatePlane Class Reference 319

472 {
473 if( orientation == Qt::Horizontal )
474 d->gridAttributesHorizontal = a;
475 else
476 d->gridAttributesVertical = a;
477 setHasOwnGridAttributes( orientation, true );
478 update();
479 emit propertiesChanged();
480 }

6.18.3.56 void KDChart::CartesianCoordinatePlane::setHorizontalRange (const QPair< qreal,


qreal > &)

Allows setting the boundaries of the visible value space area that the plane displays in horizontal direction.
The horizontal viewport. To disable use of this range, set both values to the same thing, which constiutes a
null range.

Parameters:
A pair of values representing the smalles and the largest horizontal value space coordinate that are still
visible.

Definition at line 439 of file KDChartCartesianCoordinatePlane.cpp.


References d, layoutDiagrams(), and KDChart::AbstractCoordinatePlane::propertiesChanged().

440 {
441 if ( d->horizontalMin != range.first || d->horizontalMax != range.second ) {
442 d->horizontalMin = range.first;
443 d->horizontalMax = range.second;
444 layoutDiagrams();
445 emit propertiesChanged();
446 }
447 }

6.18.3.57 void CartesianCoordinatePlane::setIsometricScaling (bool onOff)

Definition at line 346 of file KDChartCartesianCoordinatePlane.cpp.


References d, layoutDiagrams(), and KDChart::AbstractCoordinatePlane::propertiesChanged().

347 {
348 if ( d->isometricScaling != onOff )
349 {
350 d->isometricScaling = onOff;
351 layoutDiagrams();
352 emit propertiesChanged();
353 }
354 }

6.18.3.58 void KDChart::AbstractCoordinatePlane::setParent (Chart ∗ parent) [inherited]

Called internally by KDChart::Chart.


Definition at line 177 of file KDChartAbstractCoordinatePlane.cpp.
References d.
Referenced by KDChart::Chart::addCoordinatePlane(), and KDChart::Chart::takeCoordinatePlane().

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


320 KD Chart 2 Class Documentation

178 {
179 d->parent = parent;
180 }

6.18.3.59 void KDChart::AbstractLayoutItem::setParentLayout (QLayout ∗ lay) [inherited]

Definition at line 62 of file KDChartLayoutItems.h.

63 {
64 mParentLayout = lay;
65 }

6.18.3.60 void KDChart::AbstractLayoutItem::setParentWidget (QWidget ∗ widget)


[virtual, inherited]

Inform the item about its widget: This enables the item, to trigger that widget’s update, whenever the size
of the item’s contents has changed.
Thus, you need to call setParentWidget on every item, that has a non-fixed size.
Definition at line 56 of file KDChartLayoutItems.cpp.
References KDChart::AbstractLayoutItem::mParent.
Referenced by KDChart::Legend::buildLegend(), and KDChart::AbstractCartesianDiagram::takeAxis().

57 {
58 mParent = widget;
59 }

6.18.3.61 void KDChart::AbstractCoordinatePlane::setReferenceCoordinatePlane


(AbstractCoordinatePlane ∗ plane) [inherited]

Set another coordinate plane to be used as the reference plane for this one.

Parameters:
plane The coordinate plane to be used the reference plane for this one.

See also:
referenceCoordinatePlane

Definition at line 167 of file KDChartAbstractCoordinatePlane.cpp.


References d.

168 {
169 d->referenceCoordinatePlane = plane;
170 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.18 KDChart::CartesianCoordinatePlane Class Reference 321

6.18.3.62 void KDChart::CartesianCoordinatePlane::setVerticalRange (const QPair< qreal, qreal


> &)

Allows setting the boundaries of the visible value space area that the plane displays in vertical direction.
The vertical viewport. To disable use of this range, set both values to the same thing, which constiutes a
null range.

Parameters:
A pair of values representing the smalles and the largest vertical value space coordinate that are still
visible.

Definition at line 449 of file KDChartCartesianCoordinatePlane.cpp.


References d, layoutDiagrams(), and KDChart::AbstractCoordinatePlane::propertiesChanged().

450 {
451 if ( d->verticalMin != range.first || d->verticalMax != range.second ) {
452 d->verticalMin = range.first;
453 d->verticalMax = range.second;
454 layoutDiagrams();
455 emit propertiesChanged();
456 }
457 }

6.18.3.63 void CartesianCoordinatePlane::setZoomCenter (QPointF center) [virtual]

Set the point (in value coordinates) to be used as the center point in zoom operations.

Parameters:
center The point to use.

Reimplemented from KDChart::AbstractCoordinatePlane.


Definition at line 377 of file KDChartCartesianCoordinatePlane.cpp.
References d, and KDChart::AbstractCoordinatePlane::propertiesChanged().

378 {
379 if( d->coordinateTransformation.zoom.xCenter != center.x() ||
380 d->coordinateTransformation.zoom.yCenter != center.y() ){
381 d->coordinateTransformation.zoom.xCenter = center.x();
382 d->coordinateTransformation.zoom.yCenter = center.y();
383 emit propertiesChanged();
384 }
385 }

6.18.3.64 void CartesianCoordinatePlane::setZoomFactorX (double factor) [virtual]

Sets the zoom factor in horizontal direction, that is applied to all coordinate transformations.
Reimplemented from KDChart::AbstractCoordinatePlane.
Definition at line 361 of file KDChartCartesianCoordinatePlane.cpp.
References d, and KDChart::AbstractCoordinatePlane::propertiesChanged().

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


322 KD Chart 2 Class Documentation

362 {
363 if( d->coordinateTransformation.zoom.xFactor != factor ){
364 d->coordinateTransformation.zoom.xFactor = factor;
365 emit propertiesChanged();
366 }
367 }

6.18.3.65 void CartesianCoordinatePlane::setZoomFactorY (double factor) [virtual]

Sets the zoom factor in vertical direction, that is applied to all coordinate transformations.
Reimplemented from KDChart::AbstractCoordinatePlane.
Definition at line 369 of file KDChartCartesianCoordinatePlane.cpp.
References d, and KDChart::AbstractCoordinatePlane::propertiesChanged().

370 {
371 if( d->coordinateTransformation.zoom.yFactor != factor ){
372 d->coordinateTransformation.zoom.yFactor = factor;
373 emit propertiesChanged();
374 }
375 }

6.18.3.66 QSize KDChart::AbstractCoordinatePlane::sizeHint () const [virtual,


inherited]

pure virtual in QLayoutItem


Definition at line 220 of file KDChartAbstractCoordinatePlane.cpp.
References KDChart::AbstractCoordinatePlane::maximumSize().

221 {
222 // we return our maxiumu (which is the full size of the Chart)
223 // even if we know the plane will be smaller
224 return maximumSize();
225 }

6.18.3.67 void KDChart::AbstractLayoutItem::sizeHintChanged () const [virtual,


inherited]

Report changed size hint: ask the parent widget to recalculate the layout.
Definition at line 73 of file KDChartLayoutItems.cpp.
Referenced by KDChart::TextLayoutItem::sizeHint().

74 {
75 // This is exactly like what QWidget::updateGeometry does.
76 // qDebug("KDChart::AbstractLayoutItem::sizeHintChanged() called");
77 if( mParent ) {
78 if ( mParent->layout() )
79 mParent->layout()->invalidate();
80 else
81 QApplication::postEvent( mParent, new QEvent( QEvent::LayoutRequest ) );
82 }
83 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.18 KDChart::CartesianCoordinatePlane Class Reference 323

6.18.3.68 QSizePolicy KDChart::AbstractCoordinatePlane::sizePolicy () const [virtual,


inherited]

[reimplemented]
Definition at line 146 of file KDChartAbstractCoordinatePlane.cpp.

147 {
148 return QSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding );
149 }

6.18.3.69 void AbstractCoordinatePlane::takeDiagram (AbstractDiagram ∗ diagram)


[virtual, inherited]

Removes the diagram from the plane, without deleting it.


The plane no longer owns the diagram, so it is the caller’s responsibility to delete the diagram.

See also:
addDiagram, replaceDiagram

Definition at line 100 of file KDChartAbstractCoordinatePlane.cpp.


References d, KDChart::AbstractCoordinatePlane::layoutDiagrams(), and KDChart::Abstract-
Diagram::setCoordinatePlane().
Referenced by KDChart::AbstractCoordinatePlane::replaceDiagram().

101 {
102 const int idx = d->diagrams.indexOf( diagram );
103 if( idx != -1 ){
104 d->diagrams.removeAt( idx );
105 diagram->setParent( 0 );
106 diagram->setCoordinatePlane( 0 );
107 layoutDiagrams();
108 update();
109 }
110 }

6.18.3.70 const QPointF CartesianCoordinatePlane::translate (const QPointF & diagramPoint)


const [virtual]

Translate the given point in value space coordinates to a position in pixel space.

Parameters:
diagramPoint The point in value coordinates.

Returns:
The translated point.

Implements KDChart::AbstractCoordinatePlane.
Definition at line 334 of file KDChartCartesianCoordinatePlane.cpp.
References d.
Referenced by KDChart::CartesianAxis::paintCtx().

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


324 KD Chart 2 Class Documentation

335 {
336 // i had to disable the assertion, because it fails for diagramPoint’s
337 // directly on the edge of the diagramRect. i guess it can be replaced by
338 // manually comparing he coordinates, but be aware of the fact that the
339 // user coordinate system may be directed in any way the user choses!
340 // Q_ASSERT_X ( d->coordinateTransformation.diagramRect.contains ( diagramPoint ),
341 // "CartesianCoordinatePlane::translate", "Diagram point has to be inside "
342 // "user-supplied diagram rectangle." );
343 return d->coordinateTransformation.translate ( diagramPoint );
344 }

6.18.3.71 QPair< qreal, qreal > KDChart::CartesianCoordinatePlane::verticalRange () const

Returns:
The largest and smallest visible horizontal value space value. If this is not explicitely set, or if both
values are the same, the plane will use the union of the dataBoundaries of all associated diagrams.

See also:
KDChart::AbstractDiagram::dataBoundaries

Definition at line 464 of file KDChartCartesianCoordinatePlane.cpp.


References d.

465 {
466 return QPair<qreal, qreal>( d->verticalMin, d->verticalMax );
467 }

6.18.3.72 QPointF CartesianCoordinatePlane::zoomCenter () const [virtual]

Returns:
The center point (in value coordinates) of the coordinate plane, that is used for zoom operations.

Reimplemented from KDChart::AbstractCoordinatePlane.


Definition at line 387 of file KDChartCartesianCoordinatePlane.cpp.
References d.

388 {
389 return QPointF( d->coordinateTransformation.zoom.xCenter,
390 d->coordinateTransformation.zoom.yCenter );
391 }

6.18.3.73 double CartesianCoordinatePlane::zoomFactorX () const [virtual]

Returns:
The zoom factor in horizontal direction, that is applied to all coordinate transformations.

Reimplemented from KDChart::AbstractCoordinatePlane.


Definition at line 393 of file KDChartCartesianCoordinatePlane.cpp.
References d.

394 {
395 return d->coordinateTransformation.zoom.xFactor;
396 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.18 KDChart::CartesianCoordinatePlane Class Reference 325

6.18.3.74 double CartesianCoordinatePlane::zoomFactorY () const [virtual]

Returns:
The zoom factor in vertical direction, that is applied to all coordinate transformations.

Reimplemented from KDChart::AbstractCoordinatePlane.


Definition at line 398 of file KDChartCartesianCoordinatePlane.cpp.
References d.

399 {
400 return d->coordinateTransformation.zoom.yFactor;
401 }

6.18.4 Member Data Documentation

6.18.4.1 Q_SIGNALS KDChart::AbstractCoordinatePlane::__pad0__ [inherited]

Reimplemented from KDChart::AbstractArea.


Definition at line 284 of file KDChartAbstractCoordinatePlane.h.

6.18.4.2 QWidget∗ KDChart::AbstractLayoutItem::mParent [protected, inherited]

Definition at line 76 of file KDChartLayoutItems.h.


Referenced by KDChart::AbstractLayoutItem::setParentWidget().

6.18.4.3 QLayout∗ KDChart::AbstractLayoutItem::mParentLayout [protected,


inherited]

Definition at line 77 of file KDChartLayoutItems.h.

6.18.4.4 protected KDChart::CartesianCoordinatePlane::Q_SLOTS [protected]

Reimplemented from KDChart::AbstractCoordinatePlane.


Definition at line 197 of file KDChartCartesianCoordinatePlane.h.
The documentation for this class was generated from the following files:

• KDChartCartesianCoordinatePlane.h
• KDChartCartesianCoordinatePlane.cpp

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


326 KD Chart 2 Class Documentation

6.19 KDChart::Chart Class Reference


#include <KDChartChart.h>
Inheritance diagram for KDChart::Chart:Collaboration diagram for KDChart::Chart:

6.19.1 Detailed Description

A chart with one or more diagrams.


The Chart class represents a drawing consisting of one or more diagrams and various optional elements
such as legends, axes, text boxes, headers or footers. It takes ownership of all these elements when they are
assigned to it. Each diagram is associated with a coordinate plane, of which the chart can have more than
one. The coordinate planes (and thus the associated diagrams) can be layed out in various ways.
The Chart class makes heavy use of the Qt Interview framework for model/view programming, and thus
requires data to be presented to it in a QAbstractItemModel compatible way. For many simple charts,
especially if the visualized data is static, KDChart::Widget provides an abstracted interface, that hides the
complexity of Interview to a large extent.
Definition at line 61 of file KDChartChart.h.

Public Member Functions


• void addCoordinatePlane (AbstractCoordinatePlane ∗plane)
Adds a coordinate plane to the chart.

• void addHeaderFooter (HeaderFooter ∗headerFooter)


Adds a header or a footer to the chart.

• void addLegend (Legend ∗legend)


Add the given legend to the chart.

• Chart (QWidget ∗parent=0)


• AbstractCoordinatePlane ∗ coordinatePlane ()
Each chart must have at least one coordinate plane.

• CoordinatePlaneList coordinatePlanes ()
The list of coordinate planes.

• int globalLeadingBottom () const


The padding between the start of the widget and the start of the area that is used for drawing at the bottom.

• int globalLeadingLeft () const


The padding between the start of the widget and the start of the area that is used for drawing on the left.

• int globalLeadingRight () const


The padding between the start of the widget and the start of the area that is used for drawing on the right.

• int globalLeadingTop () const


The padding between the start of the widget and the start of the area that is used for drawing at the top.

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.19 KDChart::Chart Class Reference 327

• HeaderFooter ∗ headerFooter ()
The first header or footer of the chart.

• HeaderFooterList headerFooters ()
The list of headers and footers associated with the chart.

• Legend ∗ legend ()
The first legend of the chart or 0 if there was none added to the chart.

• LegendList legends ()
The list of all legends associated with the chart.

• void paint (QPainter ∗painter, const QRect &target)


Paints all the contents of the chart.

• void replaceCoordinatePlane (AbstractCoordinatePlane ∗plane, AbstractCoordinatePlane ∗old-


Plane=0)
Replaces the old coordinate plane, or appends the plane, it there is none yet.

• void replaceHeaderFooter (HeaderFooter ∗headerFooter, HeaderFooter ∗oldHeaderFooter=0)


Replaces the old header (or footer, resp.), or appends the new header or footer, it there is none yet.

• void replaceLegend (Legend ∗legend, Legend ∗oldLegend=0)


Replaces the old legend, or appends the new legend, it there is none yet.

• void setCoordinatePlaneLayout (QLayout ∗layout)


• void setGlobalLeading (int left, int top, int right, int bottom)
Set the padding between the margin of the widget and the area that the contents are drawn into.

• void setGlobalLeadingBottom (int leading)


Set the padding between the start of the widget and the start of the area that is used for drawing on the
bottom.

• void setGlobalLeadingLeft (int leading)


Set the padding between the start of the widget and the start of the area that is used for drawing on the left.

• void setGlobalLeadingRight (int leading)


Set the padding between the start of the widget and the start of the area that is used for drawing on the right.

• void setGlobalLeadingTop (int leading)


Set the padding between the start of the widget and the start of the area that is used for drawing at the top.

• void takeCoordinatePlane (AbstractCoordinatePlane ∗plane)


Removes the coordinate plane from the chart, without deleting it.

• void takeHeaderFooter (HeaderFooter ∗headerFooter)


Removes the header (or footer, resp.) from the chart, without deleting it.

• void takeLegend (Legend ∗legend)


Removes the legend from the chart, without deleting it.

• ∼Chart ()

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


328 KD Chart 2 Class Documentation

Public Attributes
• Q_SIGNALS __pad0__: void propertiesChanged()

Protected Member Functions


• void paintEvent (QPaintEvent ∗event)
Draws the background and frame, then calls paint().

• void resizeEvent (QResizeEvent ∗event)


Adjusts the internal layout when the chart is resized.

6.19.2 Constructor & Destructor Documentation

6.19.2.1 Chart::Chart (QWidget ∗ parent = 0) [explicit]

Definition at line 550 of file KDChartChart.cpp.


References addCoordinatePlane().

551 : QWidget ( parent )


552 , _d( new Private( this ) )
553 {
554 #if defined KDAB_EVAL
555 EvalDialog::checkEvalLicense( "KD Chart" );
556 #endif
557
558 addCoordinatePlane( new CartesianCoordinatePlane ( this ) );
559 }

6.19.2.2 Chart::∼Chart ()

Definition at line 561 of file KDChartChart.cpp.

562 {
563 delete _d;
564 }

6.19.3 Member Function Documentation

6.19.3.1 void Chart::addCoordinatePlane (AbstractCoordinatePlane ∗ plane)

Adds a coordinate plane to the chart.


The chart takes ownership.

Parameters:
plane The coordinate plane to add.

See also:
replaceCoordinatePlane, takeCoordinatePlane

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.19 KDChart::Chart Class Reference 329

Definition at line 584 of file KDChartChart.cpp.


References d, and KDChart::AbstractCoordinatePlane::setParent().
Referenced by Chart(), and replaceCoordinatePlane().

585 {
586 connect( plane, SIGNAL( destroyedCoordinatePlane( AbstractCoordinatePlane* ) ),
587 d, SLOT( slotUnregisterDestroyedPlane( AbstractCoordinatePlane* ) ) );
588 connect( plane, SIGNAL( needUpdate() ), this, SLOT( update() ) );
589 connect( plane, SIGNAL( needRelayout() ), d, SLOT( slotRelayout() ) ) ;
590 connect( plane, SIGNAL( needLayoutPlanes() ), d, SLOT( slotLayoutPlanes() ) ) ;
591 connect( plane, SIGNAL( propertiesChanged() ),this, SIGNAL( propertiesChanged() ) );
592 d->coordinatePlanes.append( plane );
593 plane->setParent( this );
594 d->slotLayoutPlanes();
595 }

6.19.3.2 void Chart::addHeaderFooter (HeaderFooter ∗ headerFooter)

Adds a header or a footer to the chart.


The chart takes ownership.

Parameters:
headerFooter The header (or footer, resp.) to add.

See also:
replaceHeaderFooter, takeHeaderFooter

Definition at line 761 of file KDChartChart.cpp.


References d, and KDChart::HeaderFooter::setParent().
Referenced by replaceHeaderFooter().

762 {
763 d->headerFooters.append( headerFooter );
764 headerFooter->setParent( this );
765 connect( headerFooter, SIGNAL( destroyedHeaderFooter( HeaderFooter* ) ),
766 d, SLOT( slotUnregisterDestroyedHeaderFooter( HeaderFooter* ) ) );
767 connect( headerFooter, SIGNAL( positionChanged( HeaderFooter* ) ),
768 d, SLOT( slotRelayout() ) );
769 d->slotRelayout();
770 }

6.19.3.3 void Chart::addLegend (Legend ∗ legend)

Add the given legend to the chart.


The chart takes ownership.

Parameters:
legend The legend to add.

See also:
replaceLegend, takeLegend

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


330 KD Chart 2 Class Documentation

Definition at line 813 of file KDChartChart.cpp.


References d.
Referenced by replaceLegend().

814 {
815 d->legends.append( legend );
816 legend->setParent( this );
817 connect( legend, SIGNAL( destroyedLegend( Legend* ) ),
818 d, SLOT( slotUnregisterDestroyedLegend( Legend* ) ) );
819 connect( legend, SIGNAL( positionChanged( AbstractAreaWidget* ) ),
820 d, SLOT( slotLayoutPlanes() ) ); //slotRelayout() ) );
821 connect( legend, SIGNAL( propertiesChanged() ),this, SIGNAL( propertiesChanged() ) );
822 d->slotRelayout();
823 }

6.19.3.4 AbstractCoordinatePlane ∗ Chart::coordinatePlane ()

Each chart must have at least one coordinate plane.


Initially a default CartesianCoordinatePlane is created. Use replaceCoordinatePlane() to replace it with a
different one, such as a PolarCoordinatePlane.

Returns:
The first coordinate plane of the chart.

Definition at line 568 of file KDChartChart.cpp.


References d.

569 {
570 if ( d->coordinatePlanes.isEmpty() )
571 {
572 qWarning() << "Chart::coordinatePlane: warning: no coordinate plane defined.";
573 return 0;
574 } else {
575 return d->coordinatePlanes.first();
576 }
577 }

6.19.3.5 CoordinatePlaneList Chart::coordinatePlanes ()

The list of coordinate planes.

Returns:
The list of coordinate planes.

Definition at line 579 of file KDChartChart.cpp.


References KDChart::CoordinatePlaneList, and d.

580 {
581 return d->coordinatePlanes;
582 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.19 KDChart::Chart Class Reference 331

6.19.3.6 int Chart::globalLeadingBottom () const

The padding between the start of the widget and the start of the area that is used for drawing at the bottom.

Returns:
The padding between the start of the widget and the start of the area that is used for drawing at the
bottom.
See also:
setGlobalLeading

Definition at line 673 of file KDChartChart.cpp.


References d.

674 {
675 return d->globalLeadingBottom;
676 }

6.19.3.7 int Chart::globalLeadingLeft () const

The padding between the start of the widget and the start of the area that is used for drawing on the left.

Returns:
The padding between the start of the widget and the start of the area that is used for drawing on the
left.
See also:
setGlobalLeading

Definition at line 640 of file KDChartChart.cpp.


References d.

641 {
642 return d->globalLeadingLeft;
643 }

6.19.3.8 int Chart::globalLeadingRight () const

The padding between the start of the widget and the start of the area that is used for drawing on the right.

Returns:
The padding between the start of the widget and the start of the area that is used for drawing on the
right.

See also:
setGlobalLeading

Definition at line 662 of file KDChartChart.cpp.


References d.

663 {
664 return d->globalLeadingRight;
665 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


332 KD Chart 2 Class Documentation

6.19.3.9 int Chart::globalLeadingTop () const

The padding between the start of the widget and the start of the area that is used for drawing at the top.

Returns:
The padding between the start of the widget and the start of the area that is used for drawing at the top.

See also:
setGlobalLeading

Definition at line 651 of file KDChartChart.cpp.


References d.

652 {
653 return d->globalLeadingTop;
654 }

6.19.3.10 HeaderFooter ∗ Chart::headerFooter ()

The first header or footer of the chart.


By default there is none.

Returns:
The first header or footer of the chart or 0 if there was none added to the chart.

Definition at line 799 of file KDChartChart.cpp.


References d.

800 {
801 if( d->headerFooters.isEmpty() ) {
802 return 0;
803 } else {
804 return d->headerFooters.first();
805 }
806 }

6.19.3.11 HeaderFooterList Chart::headerFooters ()

The list of headers and footers associated with the chart.

Returns:
The list of headers and footers associated with the chart.

Definition at line 808 of file KDChartChart.cpp.


References d, and KDChart::HeaderFooterList.

809 {
810 return d->headerFooters;
811 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.19 KDChart::Chart Class Reference 333

6.19.3.12 Legend ∗ Chart::legend ()

The first legend of the chart or 0 if there was none added to the chart.

Returns:
The first legend of the chart or 0 if none exists.

Definition at line 851 of file KDChartChart.cpp.


References d.
Referenced by paint().

852 {
853 if ( d->legends.isEmpty() )
854 {
855 return 0;
856 } else {
857 return d->legends.first();
858 }
859 }

6.19.3.13 LegendList Chart::legends ()

The list of all legends associated with the chart.

Returns:
The list of all legends associated with the chart.

Definition at line 861 of file KDChartChart.cpp.


References d, and KDChart::LegendList.

862 {
863 return d->legends;
864 }

6.19.3.14 void Chart::paint (QPainter ∗ painter, const QRect & target)

Paints all the contents of the chart.


Use this method, to make KD Chart draw into your QPainter.

Note:
Any global leading settings will be used by the paint method too, so make sure to set them to zero, if
you want the drawing to have the exact size of the target rectangle.

Parameters:
painter The painter to be drawn into.
target The rectangle to be filled by the Chart’s drawing.

See also:
setGlobalLeading

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


334 KD Chart 2 Class Documentation

Definition at line 683 of file KDChartChart.cpp.


References d, legend(), KDChart::TextArea::paintAll(), KDChart::AbstractArea::paintAll(), and
KDChart::AbstractAreaWidget::paintIntoRect().
Referenced by paintEvent().

684 {
685 //qDebug() << "KDChart::Chart::paint() called, inPaint: " << d->inPaint;
686 #ifdef debug_recursive_paint
687 ++nPaint;
688 if( 100<nPaint)
689 qFatal("nPaint > 100");
690 #endif
691 if( d->inPaint || target_.isEmpty() || !painter ) return;
692
693 d->inPaint = true;
694
695 const QRect oldGeometry( geometry() );
696 //painter->drawRect( oldGeometry );
697 QRect target( target_ );
698 QPoint translation(0,0);
699
700 if( target != oldGeometry ){
701 //qDebug() << "KDChart::Chart::paint() calling new setGeometry(" << target << ")";
702 setGeometry( target );
703 painter->drawRect( target );
704 d->slotLayoutPlanes();
705 translation.setX( target_.left() );
706 translation.setY( target_.left() );
707 painter->translate( translation );
708 }
709
710 KDAB_FOREACH( KDChart::AbstractArea* layoutItem, d->layoutItems ) {
711 layoutItem->paintAll( *painter );
712 }
713 KDAB_FOREACH( KDChart::AbstractArea* planeLayoutItem, d->planeLayoutItems ) {
714 planeLayoutItem->paintAll( *painter );
715 }
716 KDAB_FOREACH( KDChart::TextArea* textLayoutItem, d->textLayoutItems ) {
717 textLayoutItem->paintAll( *painter );
718 }
719 //int i=0;
720 KDAB_FOREACH( Legend *legend, d->legends ) {
721 //qDebug("legend # %i",++i);
722 if( ! legend->isHidden() ){
723 //legend->forceRebuild();
724 /*
725 const QPoint translation( legend->geometry().topLeft() );
726 painter->translate( translation );
727 legend->paintAll( *painter );
728 if( ! translation.isNull() )
729 painter->translate( -translation.x(), -translation.y() );
730 */
731 legend->paintIntoRect( *painter, legend->geometry() );
732 }
733 }
734
735 if( target_ != oldGeometry ){
736 //qDebug() << "KDChart::Chart::paint() calling new setGeometry(" << oldGeometry << ")";
737 setGeometry( oldGeometry );
738 if( ! translation.isNull() )
739 painter->translate( -translation.x(), -translation.y() );
740 }
741
742 d->inPaint = false;
743 //qDebug() << "KDChart::Chart::paint() done.\n";

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.19 KDChart::Chart Class Reference 335

744 }

6.19.3.15 void Chart::paintEvent (QPaintEvent ∗ event) [protected]

Draws the background and frame, then calls paint().


In most cases there is no need to override this method in a derived class, but if you do, do not forget to call
paint().

See also:
paint

Definition at line 751 of file KDChartChart.cpp.


References paint().

752 {
753 event->accept();
754
755 QPainter painter( this );
756 //FIXME(khz): Paint the background/frame too!
757 // (can we derive Chart from AreaWidget ??)
758 paint( &painter, geometry() );
759 }

6.19.3.16 void Chart::replaceCoordinatePlane (AbstractCoordinatePlane ∗ plane,


AbstractCoordinatePlane ∗ oldPlane = 0)

Replaces the old coordinate plane, or appends the plane, it there is none yet.

Parameters:
plane The coordinate plane to be used instead of the old plane. This parameter must not be zero, or
the method will do nothing.
oldPlane The coordinate plane to be removed by the new plane. This plane will be deleted automati-
cally. If the parameter is omitted, the very first coordinate plane will be replaced. In case, there
was no plane yet, the new plane will just be added.

Note:
If you want to re-use the old coordinate plane, call takeCoordinatePlane and addCoordinatePlane,
instead of using replaceCoordinatePlane.

See also:
addCoordinatePlane, takeCoordinatePlane

Definition at line 597 of file KDChartChart.cpp.


References addCoordinatePlane(), d, and takeCoordinatePlane().

599 {
600 if( plane && oldPlane_ != plane ){
601 AbstractCoordinatePlane* oldPlane = oldPlane_;
602 if( d->coordinatePlanes.count() ){
603 if( ! oldPlane )
604 oldPlane = d->coordinatePlanes.first();

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


336 KD Chart 2 Class Documentation

605 takeCoordinatePlane( oldPlane );


606 }
607 delete oldPlane;
608 addCoordinatePlane( plane );
609 }
610 }

6.19.3.17 void Chart::replaceHeaderFooter (HeaderFooter ∗ headerFooter, HeaderFooter ∗


oldHeaderFooter = 0)

Replaces the old header (or footer, resp.), or appends the new header or footer, it there is none yet.

Parameters:
headerFooter The header or footer to be used instead of the old one. This parameter must not be zero,
or the method will do nothing.
oldHeaderFooter The header or footer to be removed by the new one. This header or footer will be
deleted automatically. If the parameter is omitted, the very first header or footer will be replaced.
In case, there was no header and no footer yet, the new header or footer will just be added.

Note:
If you want to re-use the old header or footer, call takeHeaderFooter and addHeaderFooter, instead of
using replaceHeaderFooter.

See also:
addHeaderFooter, takeHeaderFooter

Definition at line 772 of file KDChartChart.cpp.


References addHeaderFooter(), d, and takeHeaderFooter().

774 {
775 if( headerFooter && oldHeaderFooter_ != headerFooter ){
776 HeaderFooter* oldHeaderFooter = oldHeaderFooter_;
777 if( d->headerFooters.count() ){
778 if( ! oldHeaderFooter )
779 oldHeaderFooter = d->headerFooters.first();
780 takeHeaderFooter( oldHeaderFooter );
781 }
782 delete oldHeaderFooter;
783 addHeaderFooter( headerFooter );
784 }
785 }

6.19.3.18 void Chart::replaceLegend (Legend ∗ legend, Legend ∗ oldLegend = 0)

Replaces the old legend, or appends the new legend, it there is none yet.

Parameters:
legend The legend to be used instead of the old one. This parameter must not be zero, or the method
will do nothing.
oldLegend The legend to be removed by the new one. This legend will be deleted automatically. If
the parameter is omitted, the very first legend will be replaced. In case, there was no legend yet,
the new legend will just be added.

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.19 KDChart::Chart Class Reference 337

Note:
If you want to re-use the old legend, call takeLegend and addLegend, instead of using replaceLegend.

See also:
addLegend, takeLegend

Definition at line 825 of file KDChartChart.cpp.


References addLegend(), d, and takeLegend().

826 {
827 if( legend && oldLegend_ != legend ){
828 Legend* oldLegend = oldLegend_;
829 if( d->legends.count() ){
830 if( ! oldLegend )
831 oldLegend = d->legends.first();
832 takeLegend( oldLegend );
833 }
834 delete oldLegend;
835 addLegend( legend );
836 }
837 }

6.19.3.19 void Chart::resizeEvent (QResizeEvent ∗ event) [protected]

Adjusts the internal layout when the chart is resized.


Definition at line 746 of file KDChartChart.cpp.
References d.

747 {
748 d->slotLayoutPlanes();
749 }

6.19.3.20 void KDChart::Chart::setCoordinatePlaneLayout (QLayout ∗ layout)

6.19.3.21 void Chart::setGlobalLeading (int left, int top, int right, int bottom)

Set the padding between the margin of the widget and the area that the contents are drawn into.

Parameters:
left The padding on the left side.
top The padding at the top.
right The padding on the left hand side.
bottom The padding on the bottom.

See also:
setGlobalLeadingTop, setGlobalLeadingBottom, setGlobalLeadingLeft, setGlobalLeadingRight
globalLeadingTop, globalLeadingBottom, globalLeadingLeft, globalLeadingRight

Definition at line 625 of file KDChartChart.cpp.


References d, setGlobalLeadingBottom(), setGlobalLeadingLeft(), setGlobalLeadingRight(), and set-
GlobalLeadingTop().

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


338 KD Chart 2 Class Documentation

626 {
627 setGlobalLeadingLeft( left );
628 setGlobalLeadingTop( top );
629 setGlobalLeadingRight( right );
630 setGlobalLeadingBottom( bottom );
631 d->slotRelayout();
632 }

6.19.3.22 void Chart::setGlobalLeadingBottom (int leading)

Set the padding between the start of the widget and the start of the area that is used for drawing on the
bottom.

Parameters:
leading The padding value.

See also:
setGlobalLeading

Definition at line 667 of file KDChartChart.cpp.


References d.
Referenced by setGlobalLeading().

668 {
669 d->globalLeadingBottom = leading;
670 d->slotRelayout();
671 }

6.19.3.23 void Chart::setGlobalLeadingLeft (int leading)

Set the padding between the start of the widget and the start of the area that is used for drawing on the left.

Parameters:
leading The padding value.

See also:
setGlobalLeading

Definition at line 634 of file KDChartChart.cpp.


References d.
Referenced by setGlobalLeading().

635 {
636 d->globalLeadingLeft = leading;
637 d->slotRelayout();
638 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.19 KDChart::Chart Class Reference 339

6.19.3.24 void Chart::setGlobalLeadingRight (int leading)

Set the padding between the start of the widget and the start of the area that is used for drawing on the right.

Parameters:
leading The padding value.

See also:
setGlobalLeading

Definition at line 656 of file KDChartChart.cpp.


References d.
Referenced by setGlobalLeading().

657 {
658 d->globalLeadingRight = leading;
659 d->slotRelayout();
660 }

6.19.3.25 void Chart::setGlobalLeadingTop (int leading)

Set the padding between the start of the widget and the start of the area that is used for drawing at the top.

Parameters:
leading The padding value.

See also:
setGlobalLeading

Definition at line 645 of file KDChartChart.cpp.


References d.
Referenced by setGlobalLeading().

646 {
647 d->globalLeadingTop = leading;
648 d->slotRelayout();
649 }

6.19.3.26 void Chart::takeCoordinatePlane (AbstractCoordinatePlane ∗ plane)

Removes the coordinate plane from the chart, without deleting it.
The chart no longer owns the plane, so it is the caller’s responsibility to delete the plane.

See also:
addCoordinatePlane, takeCoordinatePlane

Definition at line 612 of file KDChartChart.cpp.


References d, KDChart::AbstractLayoutItem::removeFromParentLayout(), and KDChart::Abstract-
CoordinatePlane::setParent().
Referenced by replaceCoordinatePlane().

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


340 KD Chart 2 Class Documentation

613 {
614 const int idx = d->coordinatePlanes.indexOf( plane );
615 if( idx != -1 ){
616 d->coordinatePlanes.takeAt( idx );
617 disconnect( plane, SIGNAL( destroyedCoordinatePlane( AbstractCoordinatePlane* ) ),
618 d, SLOT( slotUnregisterDestroyedPlane( AbstractCoordinatePlane* ) ) );
619 plane->removeFromParentLayout();
620 plane->setParent( 0 );
621 }
622 d->slotLayoutPlanes();
623 }

6.19.3.27 void Chart::takeHeaderFooter (HeaderFooter ∗ headerFooter)

Removes the header (or footer, resp.) from the chart, without deleting it.
The chart no longer owns the header or footer, so it is the caller’s responsibility to delete the header or
footer.

See also:
addHeaderFooter, replaceHeaderFooter

Definition at line 787 of file KDChartChart.cpp.


References d, and KDChart::HeaderFooter::setParent().
Referenced by replaceHeaderFooter().

788 {
789 const int idx = d->headerFooters.indexOf( headerFooter );
790 if( idx != -1 ){
791 d->headerFooters.takeAt( idx );
792 disconnect( headerFooter, SIGNAL( destroyedHeaderFooter( HeaderFooter* ) ),
793 d, SLOT( slotUnregisterDestroyedHeaderFooter( HeaderFooter* ) ) );
794 headerFooter->setParent( 0 );
795 }
796 d->slotRelayout();
797 }

6.19.3.28 void Chart::takeLegend (Legend ∗ legend)

Removes the legend from the chart, without deleting it.


The chart no longer owns the legend, so it is the caller’s responsibility to delete the legend.

See also:
addLegend, takeLegend

Definition at line 839 of file KDChartChart.cpp.


References d.
Referenced by replaceLegend().

840 {
841 const int idx = d->legends.indexOf( legend );
842 if( idx != -1 ){
843 d->legends.takeAt( idx );

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.19 KDChart::Chart Class Reference 341

844 disconnect( legend, SIGNAL( destroyedLegend( Legend* ) ),


845 d, SLOT( slotUnregisterDestroyedLegend( Legend* ) ) );
846 legend->setParent( 0 );
847 }
848 d->slotRelayout();
849 }

6.19.4 Member Data Documentation

6.19.4.1 Q_SIGNALS KDChart::Chart::__pad0__

Definition at line 337 of file KDChartChart.h.


The documentation for this class was generated from the following files:

• KDChartChart.h
• KDChartChart.cpp

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


342 KD Chart 2 Class Documentation

6.20 KDChart::DataDimension Class Reference


#include <KDChartAbstractCoordinatePlane.h>
Collaboration diagram for KDChart::DataDimension:

6.20.1 Detailed Description

Helper class for one dimension of data, e.g. for the rows in a data model, or for the labels of an axis, or for
the vertical lines in a grid.
isCalculated specifies whether this dimension’s values are calculated or counted. (counted == "Item 1",
"Item 2", "Item 3" ...)
sequence is the GranularitySequence, as specified at for the respective coordinate plane.
Step width is an optional parameter, to be omitted (or set to Zero, resp.) if the step width is unknown.
The default c’tor just gets you counted values from 1..10, using step width 1, used by the CartesianGrid,
when showing an empty plane without any diagrams.
Definition at line 320 of file KDChartAbstractCoordinatePlane.h.

Public Member Functions


• DataDimension (qreal start_, qreal end_, bool isCalculated_, AbstractCoordinatePlane::AxesCalc-
Mode calcMode_, KDChartEnums::GranularitySequence sequence_, qreal stepWidth_=0.0, qreal
subStepWidth_=0.0)
• DataDimension ()
• qreal distance () const
Returns the size of the distance, equivalent to the width() (or height(), resp.) of a QRectF.

• bool operator!= (const DataDimension &other) const


• bool operator== (const DataDimension &r) const

Public Attributes
• AbstractCoordinatePlane::AxesCalcMode calcMode
• qreal end
• bool isCalculated
• KDChartEnums::GranularitySequence sequence
• qreal start
• qreal stepWidth
• qreal subStepWidth

6.20.2 Constructor & Destructor Documentation

6.20.2.1 KDChart::DataDimension::DataDimension ()

Definition at line 322 of file KDChartAbstractCoordinatePlane.h.


References calcMode, sequence, stepWidth, and subStepWidth.

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.20 KDChart::DataDimension Class Reference 343

326 {}
327 DataDimension( qreal start_,
328 qreal end_,
329 bool isCalculated_,
330 AbstractCoordinatePlane::AxesCalcMode calcMode_,

6.20.2.2 KDChart::DataDimension::DataDimension (qreal start_, qreal end_,


bool isCalculated_, AbstractCoordinatePlane::AxesCalcMode calcMode_,
KDChartEnums::GranularitySequence sequence_, qreal stepWidth_ = 0.0, qreal
subStepWidth_ = 0.0)

Definition at line 331 of file KDChartAbstractCoordinatePlane.h.


References calcMode, end, isCalculated, sequence, start, stepWidth, and subStepWidth.

334 : start( start_ )


335 , end( end_ )
336 , isCalculated( isCalculated_ )
337 , calcMode( calcMode_ )
338 , sequence( sequence_ )
339 , stepWidth( stepWidth_ )
340 , subStepWidth( subStepWidth_ )
341 {}

6.20.3 Member Function Documentation

6.20.3.1 qreal KDChart::DataDimension::distance () const

Returns the size of the distance, equivalent to the width() (or height(), resp.) of a QRectF.
Note that this value can be negative, e.g. indicating axis labels going in reversed direction.
Definition at line 353 of file KDChartAbstractCoordinatePlane.h.
References start.
Referenced by KDChart::CartesianCoordinatePlane::layoutDiagrams(), and KDChart::Cartesian-
Axis::paintCtx().

355 {
356 return

6.20.3.2 bool KDChart::DataDimension::operator!= (const DataDimension & other) const

Definition at line 370 of file KDChartAbstractCoordinatePlane.h.


References calcMode, end, and isCalculated.

6.20.3.3 bool KDChart::DataDimension::operator== (const DataDimension & r) const

Definition at line 358 of file KDChartAbstractCoordinatePlane.h.


References calcMode, end, isCalculated, sequence, stepWidth, and subStepWidth.

367 { return !operator==( other ); }


368

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


344 KD Chart 2 Class Documentation

6.20.4 Member Data Documentation

6.20.4.1 AbstractCoordinatePlane::AxesCalcMode KDChart::DataDimension::calcMode

Definition at line 376 of file KDChartAbstractCoordinatePlane.h.


Referenced by DataDimension(), operator!=(), operator==(), and KDChart::CartesianAxis::paintCtx().

6.20.4.2 qreal KDChart::DataDimension::end

Definition at line 374 of file KDChartAbstractCoordinatePlane.h.


Referenced by DataDimension(), KDChart::CartesianCoordinatePlane::layoutDiagrams(), operator!=(),
operator==(), and KDChart::CartesianAxis::paintCtx().

6.20.4.3 bool KDChart::DataDimension::isCalculated

Definition at line 375 of file KDChartAbstractCoordinatePlane.h.


Referenced by DataDimension(), operator!=(), operator==(), and KDChart::CartesianAxis::paintCtx().

6.20.4.4 KDChartEnums::GranularitySequence KDChart::DataDimension::sequence

Definition at line 377 of file KDChartAbstractCoordinatePlane.h.


Referenced by DataDimension(), and operator==().

6.20.4.5 qreal KDChart::DataDimension::start

Definition at line 373 of file KDChartAbstractCoordinatePlane.h.


Referenced by DataDimension(), distance(), KDChart::CartesianCoordinatePlane::layoutDiagrams(), and
KDChart::CartesianAxis::paintCtx().

6.20.4.6 qreal KDChart::DataDimension::stepWidth

Definition at line 378 of file KDChartAbstractCoordinatePlane.h.


Referenced by DataDimension(), operator==(), and KDChart::CartesianAxis::paintCtx().

6.20.4.7 qreal KDChart::DataDimension::subStepWidth

Definition at line 379 of file KDChartAbstractCoordinatePlane.h.


Referenced by DataDimension(), operator==(), and KDChart::CartesianAxis::paintCtx().
The documentation for this class was generated from the following file:

• KDChartAbstractCoordinatePlane.h

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.21 KDChart::DatasetProxyModel Class Reference 345

6.21 KDChart::DatasetProxyModel Class Reference


#include <KDChartDatasetProxyModel.h>
Inheritance diagram for KDChart::DatasetProxyModel:Collaboration diagram for KDChart::Dataset-
ProxyModel:

6.21.1 Detailed Description

DatasetProxyModel takes a KDChart dataset configuration and translates it into a filtering proxy model.
The resulting model will only contain the part of the model that is selected by the dataset, and the according
row and column header data.
Currently, this model is implemented for table models only. The way it would work with models represent-
ing a tree is to be decided.
The column selection is configured by passing a dataset description vector to the model. This vector (of
integers) is supposed to have one value for each column of the original model. If the value at position x is
-1, column x of the original model is not included in the dataset. If it is between 0 and (columnCount() -1),
it is the column the source column is mapped to in the resulting model. Any other value is an error.
Definition at line 58 of file KDChartDatasetProxyModel.h.

Public Member Functions


• QVariant data (const QModelIndex &index, int role) const
Overloaded from base class.

• DatasetProxyModel (QObject ∗parent=0)


Create a DatasetProxyModel.

• QVariant headerData (int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const


Overloaded from base class.

• QModelIndex index (int row, int column, const QModelIndex &parent=QModelIndex()) const
• QModelIndex mapFromSource (const QModelIndex &sourceIndex) const
Implements the mapping from the source to the proxy indexes.

• QModelIndex mapToSource (const QModelIndex &proxyIndex) const


Implements the mapping from the proxy to the source indexes.

• QModelIndex parent (const QModelIndex &child) const


• void setDatasetColumnDescriptionVector (const DatasetDescriptionVector &columnConfig)
Configure the dataset selection for the columns.

• void setDatasetDescriptionVectors (const DatasetDescriptionVector &rowConfig, const Dataset-


DescriptionVector &columnConfig)
Convenience method to configure rows and columns in one step.

• void setDatasetRowDescriptionVector (const DatasetDescriptionVector &rowConfig)


Configure the dataset selection for the rows.

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


346 KD Chart 2 Class Documentation

• void setSourceModel (QAbstractItemModel ∗sourceModel)


Overloaded from base class.

• void setSourceRootIndex (const QModelIndex &rootIdx)


Set the root index of the table in the source model.

Public Attributes
• public Q_SLOTS: void resetDatasetDescriptions()

Protected Member Functions


• bool filterAcceptsColumn (int sourceColumn, const QModelIndex &) const
Decide whether the column is accepted.

• bool filterAcceptsRow (int source_row, const QModelIndex &source_parent) const


Decide whether the row is accepted.

6.21.2 Constructor & Destructor Documentation

6.21.2.1 DatasetProxyModel::DatasetProxyModel (QObject ∗ parent = 0) [explicit]

Create a DatasetProxyModel.
Without further configuration, this model is invalid.

See also:
setDatasetDescriptionVector

Definition at line 35 of file KDChartDatasetProxyModel.cpp.

36 : QSortFilterProxyModel ( parent )
37 {
38 }

6.21.3 Member Function Documentation

6.21.3.1 QVariant DatasetProxyModel::data (const QModelIndex & index, int role) const

Overloaded from base class.


Definition at line 209 of file KDChartDatasetProxyModel.cpp.

210 {
211 return sourceModel()->data( mapToSource ( index ), role );
212 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.21 KDChart::DatasetProxyModel Class Reference 347

6.21.3.2 bool DatasetProxyModel::filterAcceptsColumn (int sourceColumn, const QModelIndex


&) const [protected]

Decide whether the column is accepted.


Definition at line 136 of file KDChartDatasetProxyModel.cpp.

138 {
139 if ( mColSrcToProxyMap.isEmpty() )
140 { // no column mapping set up yet, all columns are passed down:
141 return true;
142 } else {
143 Q_ASSERT ( sourceModel() );
144 Q_ASSERT ( mColSrcToProxyMap.size() == sourceModel()->columnCount(mRootIndex) );
145 if ( mColSrcToProxyMap[sourceColumn] == -1 )
146 { // this column is explicitly not accepted:
147 return false;
148 } else {
149 Q_ASSERT ( mColSrcToProxyMap[sourceColumn] >= 0
150 && mColSrcToProxyMap[sourceColumn] < mColSrcToProxyMap.size() );
151 return true;
152 }
153 }
154 }

6.21.3.3 bool DatasetProxyModel::filterAcceptsRow (int source_row, const QModelIndex &


source_parent) const [protected]

Decide whether the row is accepted.


Definition at line 116 of file KDChartDatasetProxyModel.cpp.

118 {
119 if ( mRowSrcToProxyMap.isEmpty() )
120 { // no row mapping set, all rows are passed down:
121 return true;
122 } else {
123 Q_ASSERT ( sourceModel() );
124 Q_ASSERT ( mRowSrcToProxyMap.size() == sourceModel()->rowCount(mRootIndex) );
125 if ( mRowSrcToProxyMap[sourceRow] == -1 )
126 { // this row is explicitly not accepted:
127 return false;
128 } else {
129 Q_ASSERT ( mRowSrcToProxyMap[sourceRow] >= 0
130 && mRowSrcToProxyMap[sourceRow] < mRowSrcToProxyMap.size() );
131 return true;
132 }
133 }
134 }

6.21.3.4 QVariant DatasetProxyModel::headerData (int section, Qt::Orientation orientation, int


role = Qt::DisplayRole) const

Overloaded from base class.


Definition at line 214 of file KDChartDatasetProxyModel.cpp.

215 {
216 if ( orientation == Qt::Horizontal )

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


348 KD Chart 2 Class Documentation

217 {
218 if ( mapProxyColumnToSource ( section ) == -1 )
219 {
220 return QVariant();
221 } else {
222 return sourceModel()->headerData ( mapProxyColumnToSource ( section ),
223 orientation, role );
224 }
225 } else {
226 if ( mapProxyRowToSource ( section ) == -1 )
227 {
228 return QVariant();
229 } else {
230 return sourceModel()->headerData ( mapProxyRowToSource ( section ),
231 orientation, role );
232 }
233 }
234 }

6.21.3.5 QModelIndex DatasetProxyModel::index (int row, int column, const QModelIndex &
parent = QModelIndex()) const

Definition at line 68 of file KDChartDatasetProxyModel.cpp.


References mapFromSource().

70 {
71 return mapFromSource( sourceModel()->index( mapProxyRowToSource(row),
72 mapProxyColumnToSource(column),
73 parent ) );
74 }

6.21.3.6 QModelIndex DatasetProxyModel::mapFromSource (const QModelIndex & sourceIndex)


const

Implements the mapping from the source to the proxy indexes.


Definition at line 81 of file KDChartDatasetProxyModel.cpp.
Referenced by index(), and parent().

82 {
83 Q_ASSERT_X ( sourceModel(), "DatasetProxyModel::mapFromSource", "A source "
84 "model must be set before the selection can be configured." );
85
86 if ( !sourceIndex.isValid() ) return sourceIndex;
87
88 if ( mRowSrcToProxyMap.isEmpty() && mColSrcToProxyMap.isEmpty() )
89 {
90 return createIndex ( sourceIndex.row(), sourceIndex.column(),
91 sourceIndex.internalPointer() );
92 } else {
93 int row = mapSourceRowToProxy ( sourceIndex.row() );
94 int column = mapSourceColumnToProxy ( sourceIndex.column() );
95 return createIndex ( row, column, sourceIndex.internalPointer() );
96 }
97 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.21 KDChart::DatasetProxyModel Class Reference 349

6.21.3.7 QModelIndex DatasetProxyModel::mapToSource (const QModelIndex & proxyIndex)


const

Implements the mapping from the proxy to the source indexes.


Definition at line 99 of file KDChartDatasetProxyModel.cpp.

100 {
101 Q_ASSERT_X ( sourceModel(), "DatasetProxyModel::mapToSource", "A source "
102 "model must be set before the selection can be configured." );
103
104 if ( !proxyIndex.isValid() ) return proxyIndex;
105 if ( mRowSrcToProxyMap.isEmpty() && mColSrcToProxyMap.isEmpty() )
106 {
107 return createIndex ( proxyIndex.row(), proxyIndex.column(),
108 proxyIndex.internalPointer() );
109 } else {
110 int row = mapProxyRowToSource ( proxyIndex.row() );
111 int column = mapProxyColumnToSource ( proxyIndex.column() );
112 return createIndex ( row, column, proxyIndex.internalPointer() );
113 }
114 }

6.21.3.8 QModelIndex DatasetProxyModel::parent (const QModelIndex & child) const

Definition at line 76 of file KDChartDatasetProxyModel.cpp.


References mapFromSource().

77 {
78 return mapFromSource( sourceModel()->parent( child ) );
79 }

6.21.3.9 void DatasetProxyModel::setDatasetColumnDescriptionVector (const


DatasetDescriptionVector & columnConfig)

Configure the dataset selection for the columns.


Every call to this method resets the previous dataset description.
Definition at line 50 of file KDChartDatasetProxyModel.cpp.
References KDChart::DatasetDescriptionVector.
Referenced by setDatasetDescriptionVectors().

52 {
53 Q_ASSERT_X ( sourceModel(), "DatasetProxyModel::setDatasetColumnDescriptionVector",
54 "A source model must be set before the selection can be configured." );
55 initializeDatasetDecriptors ( configuration, sourceModel()->columnCount(mRootIndex),
56 mColSrcToProxyMap, mColProxyToSrcMap );
57 clear(); // clear emits layoutChanged()
58 }

6.21.3.10 void DatasetProxyModel::setDatasetDescriptionVectors (const DatasetDescriptionVector


& rowConfig, const DatasetDescriptionVector & columnConfig)

Convenience method to configure rows and columns in one step.

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


350 KD Chart 2 Class Documentation

Definition at line 60 of file KDChartDatasetProxyModel.cpp.


References KDChart::DatasetDescriptionVector, setDatasetColumnDescriptionVector(), and setDataset-
RowDescriptionVector().

63 {
64 setDatasetRowDescriptionVector( rowConfig );
65 setDatasetColumnDescriptionVector ( columnConfig );
66 }

6.21.3.11 void DatasetProxyModel::setDatasetRowDescriptionVector (const


DatasetDescriptionVector & rowConfig)

Configure the dataset selection for the rows.


Every call to this method resets the previous dataset description.
Definition at line 40 of file KDChartDatasetProxyModel.cpp.
References KDChart::DatasetDescriptionVector.
Referenced by setDatasetDescriptionVectors().

42 {
43 Q_ASSERT_X ( sourceModel(), "DatasetProxyModel::setDatasetRowDescriptionVector",
44 "A source model must be set before the selection can be configured." );
45 initializeDatasetDecriptors ( configuration, sourceModel()->rowCount(mRootIndex),
46 mRowSrcToProxyMap, mRowProxyToSrcMap );
47 clear(); // clear emits layoutChanged()
48 }

6.21.3.12 void DatasetProxyModel::setSourceModel (QAbstractItemModel ∗ sourceModel)

Overloaded from base class.


Definition at line 261 of file KDChartDatasetProxyModel.cpp.

262 {
263 QSortFilterProxyModel::setSourceModel ( sourceModel );
264 mRootIndex = QModelIndex();
265 connect ( sourceModel, SIGNAL ( layoutChanged() ),
266 SLOT( resetDatasetDescriptions() ) );
267
268 resetDatasetDescriptions();
269 }

6.21.3.13 void DatasetProxyModel::setSourceRootIndex (const QModelIndex & rootIdx)

Set the root index of the table in the source model.


Definition at line 271 of file KDChartDatasetProxyModel.cpp.

272 {
273 mRootIndex = rootIdx;
274 resetDatasetDescriptions();
275 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.21 KDChart::DatasetProxyModel Class Reference 351

6.21.4 Member Data Documentation

6.21.4.1 public KDChart::DatasetProxyModel::Q_SLOTS

Definition at line 97 of file KDChartDatasetProxyModel.h.


The documentation for this class was generated from the following files:

• KDChartDatasetProxyModel.h
• KDChartDatasetProxyModel.cpp

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


352 KD Chart 2 Class Documentation

6.22 KDChart::DatasetSelectorWidget Class Reference


#include <KDChartDatasetSelector.h>
Inheritance diagram for KDChart::DatasetSelectorWidget:Collaboration diagram for KDChart::Dataset-
SelectorWidget:

Public Member Functions

• DatasetSelectorWidget (QWidget ∗parent=0)


• void mappingDisabled ()
• void on_cbReverseColumns_stateChanged (int)
• void on_cbReverseRows_stateChanged (int)
• void on_groupBox_toggled (bool)
• void on_sbColumnCount_valueChanged (int)
• void on_sbRowCount_valueChanged (int)
• void on_sbStartRow_valueChanged (int)
• void setSourceColumnCount (const int &columnCount)

Public Attributes

• Q_SIGNALS __pad0__: void configureDatasetProxyModel ( const DatasetDescriptionVector& row-


Config
• Q_SIGNALS const DatasetDescriptionVector & columnConfig
• private Q_SLOTS: void on_sbStartColumn_valueChanged ( int )
• public Q_SLOTS: void setSourceRowCount ( const int& rowCount )

6.22.1 Constructor & Destructor Documentation

6.22.1.1 DatasetSelectorWidget::DatasetSelectorWidget (QWidget ∗ parent = 0) [explicit]

Definition at line 36 of file KDChartDatasetSelector.cpp.

37 : QFrame ( parent )
38 , mUi ( new Ui::DatasetSelector () )
39 , mSourceRowCount ( 0 )
40 , mSourceColumnCount ( 0 )
41 {
42 qWarning("For DatasetSelectorWidget to become useful, it has to be connected to the proxy model it
43
44 mUi->setupUi ( this );
45 setMinimumSize ( minimumSizeHint() );
46 }

6.22.2 Member Function Documentation

6.22.2.1 void KDChart::DatasetSelectorWidget::mappingDisabled ()

Referenced by on_groupBox_toggled().

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.22 KDChart::DatasetSelectorWidget Class Reference 353

6.22.2.2 void DatasetSelectorWidget::on_cbReverseColumns_stateChanged (int)

Definition at line 73 of file KDChartDatasetSelector.cpp.

74 {
75 calculateMapping();
76 }

6.22.2.3 void DatasetSelectorWidget::on_cbReverseRows_stateChanged (int)

Definition at line 68 of file KDChartDatasetSelector.cpp.

69 {
70 calculateMapping();
71 }

6.22.2.4 void DatasetSelectorWidget::on_groupBox_toggled (bool)

Definition at line 78 of file KDChartDatasetSelector.cpp.


References mappingDisabled().

79 {
80 if ( state )
81 {
82 calculateMapping();
83 } else {
84 emit mappingDisabled();
85 }
86 }

6.22.2.5 void DatasetSelectorWidget::on_sbColumnCount_valueChanged (int)

Definition at line 58 of file KDChartDatasetSelector.cpp.

59 {
60 calculateMapping();
61 }

6.22.2.6 void DatasetSelectorWidget::on_sbRowCount_valueChanged (int)

Definition at line 63 of file KDChartDatasetSelector.cpp.

64 {
65 calculateMapping();
66 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


354 KD Chart 2 Class Documentation

6.22.2.7 void DatasetSelectorWidget::on_sbStartRow_valueChanged (int)

Definition at line 53 of file KDChartDatasetSelector.cpp.

54 {
55 calculateMapping();
56 }

6.22.2.8 void DatasetSelectorWidget::setSourceColumnCount (const int & columnCount)

Definition at line 98 of file KDChartDatasetSelector.cpp.

99 {
100 if ( columnCount != mSourceColumnCount )
101 {
102 mSourceColumnCount = columnCount;
103 resetDisplayValues();
104 }
105 }

6.22.3 Member Data Documentation

6.22.3.1 Q_SIGNALS KDChart::DatasetSelectorWidget::__pad0__

Definition at line 53 of file KDChartDatasetSelector.h.

6.22.3.2 Q_SIGNALS const DatasetDescriptionVector& KDChart::DatasetSelector-


Widget::columnConfig

Definition at line 53 of file KDChartDatasetSelector.h.

6.22.3.3 private KDChart::DatasetSelectorWidget::Q_SLOTS

Definition at line 59 of file KDChartDatasetSelector.h.

6.22.3.4 public KDChart::DatasetSelectorWidget::Q_SLOTS

Definition at line 48 of file KDChartDatasetSelector.h.


The documentation for this class was generated from the following files:

• KDChartDatasetSelector.h
• KDChartDatasetSelector.cpp

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.23 KDChart::DataValueAttributes Class Reference 355

6.23 KDChart::DataValueAttributes Class Reference


#include <KDChartDataValueAttributes.h>

6.23.1 Detailed Description

Diagram attributes dealing with data value labels.


The DataValueAttributes group all properties that can be set wrt data value labels and if and how they
are displayed. This includes things like the text attributes (font, color), what markers are used, howmany
decimal digits are displayed, etc.
Definition at line 51 of file KDChartDataValueAttributes.h.

Public Member Functions


• BackgroundAttributes backgroundAttributes () const
• QString dataLabel () const
• DataValueAttributes (const DataValueAttributes &)
• DataValueAttributes ()
• int decimalDigits () const
• FrameAttributes frameAttributes () const
• bool isVisible () const
• MarkerAttributes markerAttributes () const
• RelativePosition negativePosition () const
• bool operator!= (const DataValueAttributes &other) const
• DataValueAttributes & operator= (const DataValueAttributes &)
• bool operator== (const DataValueAttributes &) const
• RelativePosition positivePosition () const
• int powerOfTenDivisor () const
• QString prefix () const
• void setBackgroundAttributes (const BackgroundAttributes &a)
Set the background attributes to use for the data value labels area.

• void setDataLabel (const QString label)


a string label instead of the original data value label

• void setDecimalDigits (int digits)


Set how many decimal digits to display when rendering the data value labels.

• void setFrameAttributes (const FrameAttributes &a)


Set the frame attributes to use for the data value labels area.

• void setMarkerAttributes (const MarkerAttributes &a)


Set the marker attributes to use for the data values.

• void setNegativePosition (const RelativePosition &relPosition)


• void setPositivePosition (const RelativePosition &relPosition)
• void setPowerOfTenDivisor (int powerOfTenDivisor)
• void setPrefix (const QString prefix)

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


356 KD Chart 2 Class Documentation

Prepend a prefix to the data value text to be displayed.

• void setShowInfinite (bool infinite)


• void setSuffix (const QString suffix)
Append a suffix to the data value text to be displayed.

• void setTextAttributes (const TextAttributes &a)


Set the text attributes to use for the data value labels.

• void setVisible (bool visible)


Set whether data value labels should be displayed.

• bool showInfinite () const


• QString suffix () const
• TextAttributes textAttributes () const
• ∼DataValueAttributes ()

Static Public Member Functions


• const DataValueAttributes & defaultAttributes ()
• const QVariant & defaultAttributesAsVariant ()

6.23.2 Constructor & Destructor Documentation

6.23.2.1 KDChart::DataValueAttributes::DataValueAttributes ()

6.23.2.2 KDChart::DataValueAttributes::DataValueAttributes (const DataValueAttributes &)

6.23.2.3 KDChart::DataValueAttributes::∼DataValueAttributes ()

6.23.3 Member Function Documentation

6.23.3.1 BackgroundAttributes KDChart::DataValueAttributes::backgroundAttributes () const

Returns:
The background attributes used for painting the data value labels area.

See also:
BackgroundAttributes

Referenced by operator<<().

6.23.3.2 QString KDChart::DataValueAttributes::dataLabel () const

Returns:
The string to be displayed instead of the data value text.

Referenced by KDChart::AbstractDiagram::paintDataValueText().

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.23 KDChart::DataValueAttributes Class Reference 357

6.23.3.3 int KDChart::DataValueAttributes::decimalDigits () const

Returns:
The number of decimal digits displayed.

Referenced by operator<<(), and KDChart::AbstractDiagram::paintDataValueText().

6.23.3.4 const DataValueAttributes& KDChart::DataValueAttributes::defaultAttributes ()


[static]

6.23.3.5 const QVariant& KDChart::DataValueAttributes::defaultAttributesAsVariant ()


[static]

6.23.3.6 FrameAttributes KDChart::DataValueAttributes::frameAttributes () const

Returns:
The frame attributes used for painting the data value labels area.

See also:
FrameAttributes

Referenced by operator<<().

6.23.3.7 bool KDChart::DataValueAttributes::isVisible () const

Returns:
Whether data value labels should be displayed.

Referenced by operator<<(), KDChart::AbstractDiagram::paintDataValueText(), and KDChart::Abstract-


Diagram::paintMarker().

6.23.3.8 MarkerAttributes KDChart::DataValueAttributes::markerAttributes () const

Returns:
The marker attributes used for decorating the data values.

See also:
MarkerAttributes

Referenced by KDChart::AbstractDiagram::paintMarker().

6.23.3.9 RelativePosition KDChart::DataValueAttributes::negativePosition () const

Referenced by operator<<().

6.23.3.10 bool KDChart::DataValueAttributes::operator!= (const DataValueAttributes & other)


const

Definition at line 58 of file KDChartDataValueAttributes.h.

58 { return !operator==(other); }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


358 KD Chart 2 Class Documentation

6.23.3.11 DataValueAttributes& KDChart::DataValueAttributes::operator= (const


DataValueAttributes &)

6.23.3.12 bool KDChart::DataValueAttributes::operator== (const DataValueAttributes &) const

6.23.3.13 RelativePosition KDChart::DataValueAttributes::positivePosition () const

Referenced by operator<<().

6.23.3.14 int KDChart::DataValueAttributes::powerOfTenDivisor () const

Referenced by operator<<().

6.23.3.15 QString KDChart::DataValueAttributes::prefix () const

Returns:
The string used as a prefix to the data value text.

Referenced by KDChart::AbstractDiagram::paintDataValueText().

6.23.3.16 void KDChart::DataValueAttributes::setBackgroundAttributes (const


BackgroundAttributes & a)

Set the background attributes to use for the data value labels area.

Parameters:
a The background attributes to set.

See also:
BackgroundAttributes

6.23.3.17 void KDChart::DataValueAttributes::setDataLabel (const QString label)

a string label instead of the original data value label

Parameters:
label: the string to be displayed.

6.23.3.18 void KDChart::DataValueAttributes::setDecimalDigits (int digits)

Set how many decimal digits to display when rendering the data value labels.
If there are no decimal digits it will not be displayed.

Parameters:
digits The number of decimal digits to use.

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.23 KDChart::DataValueAttributes Class Reference 359

6.23.3.19 void KDChart::DataValueAttributes::setFrameAttributes (const FrameAttributes & a)

Set the frame attributes to use for the data value labels area.

Parameters:
a The frame attributes to set.

See also:
FrameAttributes

6.23.3.20 void KDChart::DataValueAttributes::setMarkerAttributes (const MarkerAttributes &


a)

Set the marker attributes to use for the data values.


This includes the marker type.

Parameters:
a The marker attributes to set.

See also:
MarkerAttributes

6.23.3.21 void KDChart::DataValueAttributes::setNegativePosition (const RelativePosition &


relPosition)

6.23.3.22 void KDChart::DataValueAttributes::setPositivePosition (const RelativePosition &


relPosition)

6.23.3.23 void KDChart::DataValueAttributes::setPowerOfTenDivisor (int powerOfTenDivisor)

6.23.3.24 void KDChart::DataValueAttributes::setPrefix (const QString prefix)

Prepend a prefix to the data value text to be displayed.

Parameters:
prefix The string to prepend.

6.23.3.25 void KDChart::DataValueAttributes::setShowInfinite (bool infinite)

6.23.3.26 void KDChart::DataValueAttributes::setSuffix (const QString suffix)

Append a suffix to the data value text to be displayed.

Parameters:
suffix The string to append.

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


360 KD Chart 2 Class Documentation

6.23.3.27 void KDChart::DataValueAttributes::setTextAttributes (const TextAttributes & a)

Set the text attributes to use for the data value labels.

Parameters:
a The text attributes to set.

See also:
TextAttributes

6.23.3.28 void KDChart::DataValueAttributes::setVisible (bool visible)

Set whether data value labels should be displayed.

Parameters:
visible Whether data value labels should be displayed.

6.23.3.29 bool KDChart::DataValueAttributes::showInfinite () const

Referenced by operator<<().

6.23.3.30 QString KDChart::DataValueAttributes::suffix () const

Returns:
The string used as a suffix to the data value text.

Referenced by KDChart::AbstractDiagram::paintDataValueText().

6.23.3.31 TextAttributes KDChart::DataValueAttributes::textAttributes () const

Returns:
The text attributes used for painting data value labels.

Referenced by operator<<(), and KDChart::AbstractDiagram::paintDataValueText().


The documentation for this class was generated from the following file:

• KDChartDataValueAttributes.h

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.24 KDChart::DiagramObserver Class Reference 361

6.24 KDChart::DiagramObserver Class Reference


#include <KDChartDiagramObserver.h>
Inheritance diagram for KDChart::DiagramObserver:Collaboration diagram for KDChart::Diagram-
Observer:

6.24.1 Detailed Description

A DiagramObserver watches the associated diagram for changes and deletion and emits corresponsing
signals.
Definition at line 43 of file KDChartDiagramObserver.h.

Public Member Functions


• AbstractDiagram ∗ diagram ()
• const AbstractDiagram ∗ diagram () const
• void diagramAttributesChanged (AbstractDiagram ∗diagram)
This signal is emitted whenever the attributes of the diagram change.

• void diagramDataChanged (AbstractDiagram ∗diagram)


This signal is emitted whenever the data of the diagram changes.

• DiagramObserver (AbstractDiagram ∗diagram, QObject ∗parent=0)


Constructs a new observer observing the given diagram.

• void slotAttributesChanged ()
• void slotDataChanged ()
• void slotModelsChanged ()
• ∼DiagramObserver ()

Public Attributes
• Q_SIGNALS __pad0__: void diagramDestroyed( AbstractDiagram∗ diagram )
• private Q_SLOTS: void slotDestroyed()

6.24.2 Constructor & Destructor Documentation

6.24.2.1 DiagramObserver::DiagramObserver (AbstractDiagram ∗ diagram, QObject ∗ parent =


0) [explicit]

Constructs a new observer observing the given diagram.


Definition at line 40 of file KDChartDiagramObserver.cpp.
References slotModelsChanged().

41 : QObject( parent ), m_diagram( diagram )


42 {
43 if ( m_diagram ) {
44 connect( m_diagram, SIGNAL(destroyed(QObject*)), SLOT(slotDestroyed()));

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


362 KD Chart 2 Class Documentation

45 connect( m_diagram, SIGNAL(modelsChanged()), SLOT(slotModelsChanged()));


46 }
47 }

6.24.2.2 DiagramObserver::∼DiagramObserver ()

Definition at line 49 of file KDChartDiagramObserver.cpp.

49 {}

6.24.3 Member Function Documentation

6.24.3.1 AbstractDiagram ∗ DiagramObserver::diagram ()

Definition at line 56 of file KDChartDiagramObserver.cpp.

57 {
58 return m_diagram;
59 }

6.24.3.2 const AbstractDiagram ∗ DiagramObserver::diagram () const

Definition at line 51 of file KDChartDiagramObserver.cpp.


Referenced by KDChart::Legend::datasetCount().

52 {
53 return m_diagram;
54 }

6.24.3.3 void KDChart::DiagramObserver::diagramAttributesChanged (AbstractDiagram ∗


diagram)

This signal is emitted whenever the attributes of the diagram change.


Referenced by slotAttributesChanged().

6.24.3.4 void KDChart::DiagramObserver::diagramDataChanged (AbstractDiagram ∗ diagram)

This signal is emitted whenever the data of the diagram changes.


Referenced by slotDataChanged().

6.24.3.5 void DiagramObserver::slotAttributesChanged ()

Definition at line 99 of file KDChartDiagramObserver.cpp.


References diagramAttributesChanged().
Referenced by slotModelsChanged().

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.24 KDChart::DiagramObserver Class Reference 363

100 {
101 emit diagramAttributesChanged( m_diagram );
102 }

6.24.3.6 void DiagramObserver::slotDataChanged ()

Definition at line 94 of file KDChartDiagramObserver.cpp.


References diagramDataChanged().
Referenced by slotModelsChanged().

95 {
96 emit diagramDataChanged( m_diagram );
97 }

6.24.3.7 void DiagramObserver::slotModelsChanged ()

Definition at line 87 of file KDChartDiagramObserver.cpp.


References slotAttributesChanged(), and slotDataChanged().
Referenced by DiagramObserver().

88 {
89 init();
90 slotDataChanged();
91 slotAttributesChanged();
92 }

6.24.4 Member Data Documentation

6.24.4.1 Q_SIGNALS KDChart::DiagramObserver::__pad0__

Definition at line 59 of file KDChartDiagramObserver.h.

6.24.4.2 private KDChart::DiagramObserver::Q_SLOTS

Definition at line 66 of file KDChartDiagramObserver.h.


The documentation for this class was generated from the following files:

• KDChartDiagramObserver.h
• KDChartDiagramObserver.cpp

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


364 KD Chart 2 Class Documentation

6.25 KDChart::FrameAttributes Class Reference


#include <KDChartFrameAttributes.h>

Public Member Functions

• FrameAttributes (const FrameAttributes &)


• FrameAttributes ()
• bool isVisible () const
• bool operator!= (const FrameAttributes &other) const
• FrameAttributes & operator= (const FrameAttributes &)
• bool operator== (const FrameAttributes &) const
• int padding () const
• QPen pen () const
• void setPadding (int padding)
• void setPen (const QPen &pen)
• void setVisible (bool visible)
• ∼FrameAttributes ()

6.25.1 Constructor & Destructor Documentation

6.25.1.1 KDChart::FrameAttributes::FrameAttributes ()

6.25.1.2 KDChart::FrameAttributes::FrameAttributes (const FrameAttributes &)

6.25.1.3 KDChart::FrameAttributes::∼FrameAttributes ()

6.25.2 Member Function Documentation

6.25.2.1 bool KDChart::FrameAttributes::isVisible () const

Referenced by operator<<().

6.25.2.2 bool KDChart::FrameAttributes::operator!= (const FrameAttributes & other) const

Definition at line 59 of file KDChartFrameAttributes.h.

59 { return !operator==(other); }

6.25.2.3 FrameAttributes& KDChart::FrameAttributes::operator= (const FrameAttributes &)

6.25.2.4 bool KDChart::FrameAttributes::operator== (const FrameAttributes &) const

6.25.2.5 int KDChart::FrameAttributes::padding () const

Referenced by operator<<().

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.25 KDChart::FrameAttributes Class Reference 365

6.25.2.6 QPen KDChart::FrameAttributes::pen () const

Referenced by operator<<().

6.25.2.7 void KDChart::FrameAttributes::setPadding (int padding)

6.25.2.8 void KDChart::FrameAttributes::setPen (const QPen & pen)

6.25.2.9 void KDChart::FrameAttributes::setVisible (bool visible)

The documentation for this class was generated from the following file:

• KDChartFrameAttributes.h

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


366 KD Chart 2 Class Documentation

6.26 KDChart::GridAttributes Class Reference


#include <KDChartGridAttributes.h>

Public Member Functions


• GridAttributes (const GridAttributes &)
• GridAttributes ()
• KDChartEnums::GranularitySequence gridGranularitySequence () const
• QPen gridPen () const
• qreal gridStepWidth () const
• qreal gridSubStepWidth () const
• bool isGridVisible () const
• bool isSubGridVisible () const
• bool operator!= (const GridAttributes &other) const
• GridAttributes & operator= (const GridAttributes &)
• bool operator== (const GridAttributes &) const
• void setGridGranularitySequence (KDChartEnums::GranularitySequence sequence)
• void setGridPen (const QPen &pen)
• void setGridStepWidth (qreal stepWidth=0.0)
• void setGridSubStepWidth (qreal subStepWidth=0.0)
• void setGridVisible (bool visible)
• void setSubGridPen (const QPen &pen)
• void setSubGridVisible (bool visible)
• void setZeroLinePen (const QPen &pen)
• QPen subGridPen () const
• QPen zeroLinePen () const
• ∼GridAttributes ()

6.26.1 Constructor & Destructor Documentation

6.26.1.1 KDChart::GridAttributes::GridAttributes ()

6.26.1.2 KDChart::GridAttributes::GridAttributes (const GridAttributes &)

6.26.1.3 KDChart::GridAttributes::∼GridAttributes ()

6.26.2 Member Function Documentation

6.26.2.1 KDChartEnums::GranularitySequence KDChart::GridAttributes::gridGranularity-


Sequence () const

Referenced by KDChart::CartesianCoordinatePlane::getDataDimensionsList().

6.26.2.2 QPen KDChart::GridAttributes::gridPen () const

Referenced by operator<<().

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.26 KDChart::GridAttributes Class Reference 367

6.26.2.3 qreal KDChart::GridAttributes::gridStepWidth () const

Referenced by KDChart::CartesianCoordinatePlane::getDataDimensionsList(), and operator<<().

6.26.2.4 qreal KDChart::GridAttributes::gridSubStepWidth () const

Referenced by KDChart::CartesianCoordinatePlane::getDataDimensionsList(), and operator<<().

6.26.2.5 bool KDChart::GridAttributes::isGridVisible () const

Referenced by operator<<().

6.26.2.6 bool KDChart::GridAttributes::isSubGridVisible () const

Referenced by operator<<().

6.26.2.7 bool KDChart::GridAttributes::operator!= (const GridAttributes & other) const

Definition at line 79 of file KDChartGridAttributes.h.

79 { return !operator==(other); }

6.26.2.8 GridAttributes& KDChart::GridAttributes::operator= (const GridAttributes &)

6.26.2.9 bool KDChart::GridAttributes::operator== (const GridAttributes &) const

6.26.2.10 void KDChart::GridAttributes::setGridGranularitySequence


(KDChartEnums::GranularitySequence sequence)

6.26.2.11 void KDChart::GridAttributes::setGridPen (const QPen & pen)

6.26.2.12 void KDChart::GridAttributes::setGridStepWidth (qreal stepWidth = 0.0)

6.26.2.13 void KDChart::GridAttributes::setGridSubStepWidth (qreal subStepWidth = 0.0)

6.26.2.14 void KDChart::GridAttributes::setGridVisible (bool visible)

6.26.2.15 void KDChart::GridAttributes::setSubGridPen (const QPen & pen)

6.26.2.16 void KDChart::GridAttributes::setSubGridVisible (bool visible)

6.26.2.17 void KDChart::GridAttributes::setZeroLinePen (const QPen & pen)

6.26.2.18 QPen KDChart::GridAttributes::subGridPen () const

Referenced by operator<<().

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


368 KD Chart 2 Class Documentation

6.26.2.19 QPen KDChart::GridAttributes::zeroLinePen () const

Referenced by operator<<().
The documentation for this class was generated from the following file:

• KDChartGridAttributes.h

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.27 KDChart::HeaderFooter Class Reference 369

6.27 KDChart::HeaderFooter Class Reference


#include <KDChartHeaderFooter.h>
Inheritance diagram for KDChart::HeaderFooter:Collaboration diagram for KDChart::HeaderFooter:

Public Types
• enum HeaderFooterType {
Header,
Footer }

Public Member Functions


• void alignToReferencePoint (const RelativePosition &position)
• const QObject ∗ autoReferenceArea () const
• BackgroundAttributes backgroundAttributes () const
• virtual HeaderFooter ∗ clone () const
• virtual Qt::Orientations expandingDirections () const
pure virtual in QLayoutItem

• FrameAttributes frameAttributes () const


• virtual QRect geometry () const
pure virtual in QLayoutItem

• HeaderFooter (Chart ∗parent=0)


• virtual bool intersects (const TextLayoutItem &other, const QPoint &myPos, const QPoint &other-
Pos) const
• virtual bool intersects (const TextLayoutItem &other, const QPointF &myPos, const QPointF
&otherPos) const
• virtual bool isEmpty () const
pure virtual in QLayoutItem

• virtual QSize maximumSize () const


pure virtual in QLayoutItem

• virtual QSize minimumSize () const


pure virtual in QLayoutItem

• virtual void paint (QPainter ∗)


• void paintAll (QPainter &painter)
Call paintAll, if you want the background and the frame to be drawn before the normal paint() is invoked
automatically.

• virtual void paintBackground (QPainter &painter, const QRect &rectangle)


• virtual void paintCtx (PaintContext ∗context)
Default impl: Paint the complete item using its layouted position and size.

• virtual void paintFrame (QPainter &painter, const QRect &rectangle)

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


370 KD Chart 2 Class Documentation

• virtual void paintIntoRect (QPainter &painter, const QRect &rect)


Draws the background and frame, then calls paint().

• Position position () const


• void positionChanged (HeaderFooter ∗)
• virtual QFont realFont () const
• virtual qreal realFontSize () const
• void removeFromParentLayout ()
• void setAutoReferenceArea (const QObject ∗area)
• void setBackgroundAttributes (const BackgroundAttributes &a)
• void setFrameAttributes (const FrameAttributes &a)
• virtual void setGeometry (const QRect &r)
pure virtual in QLayoutItem

• void setParent (QObject ∗parent)


• void setParentLayout (QLayout ∗lay)
• virtual void setParentWidget (QWidget ∗widget)
Inform the item about its widget: This enables the item, to trigger that widget’s update, whenever the size
of the item’s contents has changed.

• void setPosition (Position position)


• void setText (const QString &text)
• void setTextAttributes (const TextAttributes &a)
Use this to specify the text attributes to be used for this item.

• void setType (HeaderFooterType type)


• virtual QSize sizeHint () const
pure virtual in QLayoutItem

• virtual void sizeHintChanged () const


Report changed size hint: ask the parent widget to recalculate the layout.

• QString text () const


• TextAttributes textAttributes () const
Returns the text attributes to be used for this item.

• HeaderFooterType type () const


• virtual ∼HeaderFooter ()

Public Attributes
• Q_SIGNALS __pad0__: void destroyedHeaderFooter( HeaderFooter∗ )

Protected Member Functions


• virtual QRect areaGeometry () const
• QRect innerRect () const
• virtual void positionHasChanged ()

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.27 KDChart::HeaderFooter Class Reference 371

Protected Attributes

• QWidget ∗ mParent
• QLayout ∗ mParentLayout

6.27.1 Member Enumeration Documentation

6.27.1.1 enum KDChart::HeaderFooter::HeaderFooterType

Enumeration values:
Header
Footer

Definition at line 54 of file KDChartHeaderFooter.h.

54 { Header,
55 Footer };

6.27.2 Constructor & Destructor Documentation

6.27.2.1 HeaderFooter::HeaderFooter (Chart ∗ parent = 0)

Definition at line 55 of file KDChartHeaderFooter.cpp.


References setParent().
Referenced by clone().

55 :
56 TextArea( new Private() )
57 {
58 setParent( parent );
59 init();
60 }

6.27.2.2 HeaderFooter::∼HeaderFooter () [virtual]

Definition at line 62 of file KDChartHeaderFooter.cpp.

63 {
64 emit destroyedHeaderFooter( this );
65 }

6.27.3 Member Function Documentation

6.27.3.1 void AbstractAreaBase::alignToReferencePoint (const RelativePosition & position)


[inherited]

Definition at line 75 of file KDChartAbstractAreaBase.cpp.

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


372 KD Chart 2 Class Documentation

76 {
77 Q_UNUSED( position );
78 // PENDING(kalle) FIXME
79 qWarning( "Sorry, not implemented: void AbstractAreaBase::alignToReferencePoint( const RelativePosi
80 }

6.27.3.2 QRect TextArea::areaGeometry () const [protected, virtual, inherited]

Implements KDChart::AbstractAreaBase.
Definition at line 105 of file KDChartTextArea.cpp.
References KDChart::TextLayoutItem::geometry().
Referenced by KDChart::TextArea::paintAll().

106 {
107 return geometry();
108 }

6.27.3.3 const QObject ∗ KDChart::TextLayoutItem::autoReferenceArea () const


[inherited]

Definition at line 122 of file KDChartLayoutItems.cpp.


Referenced by setParent().

123 {
124 return mAutoReferenceArea;
125 }

6.27.3.4 BackgroundAttributes AbstractAreaBase::backgroundAttributes () const


[inherited]

Definition at line 97 of file KDChartAbstractAreaBase.cpp.


References d.

98 {
99 return d->backgroundAttributes;
100 }

6.27.3.5 HeaderFooter ∗ HeaderFooter::clone () const [virtual]

Definition at line 91 of file KDChartHeaderFooter.cpp.


References d, HeaderFooter(), position(), setPosition(), KDChart::TextLayoutItem::setTextAttributes(),
setType(), KDChart::TextLayoutItem::textAttributes(), and type().

92 {
93 HeaderFooter* headerFooter = new HeaderFooter( new Private( *d ), 0 );
94 headerFooter->setType( type() );
95 headerFooter->setPosition( position() );
96 headerFooter->setTextAttributes( textAttributes() );
97 return headerFooter;
98 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.27 KDChart::HeaderFooter Class Reference 373

6.27.3.6 Qt::Orientations KDChart::TextLayoutItem::expandingDirections () const [virtual,


inherited]

pure virtual in QLayoutItem


Definition at line 162 of file KDChartLayoutItems.cpp.

163 {
164 return 0; // Grow neither vertically nor horizontally
165 }

6.27.3.7 FrameAttributes AbstractAreaBase::frameAttributes () const [inherited]

Definition at line 87 of file KDChartAbstractAreaBase.cpp.


References d.
Referenced by KDChart::Legend::clone().

88 {
89 return d->frameAttributes;
90 }

6.27.3.8 QRect KDChart::TextLayoutItem::geometry () const [virtual, inherited]

pure virtual in QLayoutItem


Definition at line 167 of file KDChartLayoutItems.cpp.
Referenced by KDChart::TextArea::areaGeometry(), KDChart::TextLayoutItem::paint(), KDChart::Text-
Area::paintAll(), KDChart::CartesianAxis::paintCtx(), and KDChart::TextArea::paintIntoRect().

168 {
169 return mRect;
170 }

6.27.3.9 QRect AbstractAreaBase::innerRect () const [protected, inherited]

Definition at line 175 of file KDChartAbstractAreaBase.cpp.


References KDChart::AbstractAreaBase::areaGeometry(), and d.
Referenced by KDChart::TextArea::paintAll(), KDChart::AbstractAreaWidget::paintAll(), and
KDChart::AbstractArea::paintAll().

176 {
177 Q_ASSERT_X ( d != 0, "AbstractAreaBase::innerRect()",
178 "Private class was not initialized!" );
179
180 const int padding
181 = d->frameAttributes.isVisible()
182 ? qMax( d->frameAttributes.padding(), 0 ) : 0;
183 return
184 QRect( QPoint(0,0), areaGeometry().size() )
185 .adjusted( padding, padding, -padding, -padding );
186 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


374 KD Chart 2 Class Documentation

6.27.3.10 bool KDChart::TextLayoutItem::intersects (const TextLayoutItem & other, const


QPoint & myPos, const QPoint & otherPos) const [virtual, inherited]

Definition at line 248 of file KDChartLayoutItems.cpp.


References KDChart::TextLayoutItem::mAttributes, PI, KDChart::TextLayoutItem::rotatedCorners(),
KDChart::TextAttributes::rotation(), and KDChart::TextLayoutItem::unrotatedSizeHint().

249 {
250 if ( mAttributes.rotation() != other.mAttributes.rotation() )
251 {
252 // that’s the code for the common case: the rotation angles don’t need to match here
253 QPolygon myPolygon( rotatedCorners() );
254 QPolygon otherPolygon( other.rotatedCorners() );
255
256 // move the polygons to their positions
257 myPolygon.translate( myPos );
258 otherPolygon.translate( otherPos );
259
260 // create regions out of it
261 QRegion myRegion( myPolygon );
262 QRegion otherRegion( otherPolygon );
263
264 // now the question - do they intersect or not?
265 return ! myRegion.intersect( otherRegion ).isEmpty();
266
267 } else {
268 // and that’s the code for the special case: the rotation angles match, which is less time con
269 const qreal angle = mAttributes.rotation() * PI / 180.0;
270 // both sizes
271 const QSizeF mySize( unrotatedSizeHint() );
272 const QSizeF otherSize( other.unrotatedSizeHint() );
273
274 // that’s myP1 relative to myPos
275 QPointF myP1( mySize.height() * sin( angle ), 0.0 );
276 // that’s otherP1 to myPos
277 QPointF otherP1 = QPointF( otherSize.height() * sin( angle ), 0.0 ) + otherPos - myPos;
278
279 // now rotate both points the negative angle around myPos
280 myP1 = QPointF( myP1.x() * cos( -angle ), myP1.x() * sin( -angle ) );
281 qreal r = sqrt( otherP1.x() * otherP1.x() + otherP1.y() * otherP1.y() );
282 otherP1 = QPointF( r * cos( -angle ), r * sin( -angle ) );
283
284 // finally we look, whether both rectangles intersect or even not
285 return QRectF( myP1, mySize ).intersects( QRectF( otherP1, otherSize ) );
286 }
287 }

6.27.3.11 bool KDChart::TextLayoutItem::intersects (const TextLayoutItem & other, const


QPointF & myPos, const QPointF & otherPos) const [virtual, inherited]

Definition at line 243 of file KDChartLayoutItems.cpp.


Referenced by KDChart::CartesianAxis::paintCtx().

244 {
245 return intersects( other, myPos.toPoint(), otherPos.toPoint() );
246 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.27 KDChart::HeaderFooter Class Reference 375

6.27.3.12 bool KDChart::TextLayoutItem::isEmpty () const [virtual, inherited]

pure virtual in QLayoutItem


Definition at line 172 of file KDChartLayoutItems.cpp.

173 {
174 return false; // never empty, otherwise the layout item would not exist
175 }

6.27.3.13 QSize KDChart::TextLayoutItem::maximumSize () const [virtual, inherited]

pure virtual in QLayoutItem


Definition at line 177 of file KDChartLayoutItems.cpp.
References KDChart::TextLayoutItem::sizeHint().

178 {
179 return sizeHint(); // PENDING(kalle) Review, quite inflexible
180 }

6.27.3.14 QSize KDChart::TextLayoutItem::minimumSize () const [virtual, inherited]

pure virtual in QLayoutItem


Definition at line 182 of file KDChartLayoutItems.cpp.
References KDChart::TextLayoutItem::sizeHint().

183 {
184 return sizeHint(); // PENDING(kalle) Review, quite inflexible
185 }

6.27.3.15 void KDChart::TextLayoutItem::paint (QPainter ∗) [virtual, inherited]

Implements KDChart::AbstractLayoutItem.
Definition at line 325 of file KDChartLayoutItems.cpp.
References KDChart::TextLayoutItem::geometry(), KDChart::TextAttributes::pen(), KDChart::Text-
Attributes::rotation(), and KDChart::TextLayoutItem::sizeHint().
Referenced by KDChart::TextArea::paintAll(), and KDChart::CartesianAxis::paintCtx().

326 {
327 // make sure, cached font is updated, if needed:
328 sizeHint();
329
330 if( !mRect.isValid() )
331 return;
332
333 PainterSaver painterSaver( painter );
334 painter->setFont( cachedFont );
335 painter->setPen( mAttributes.pen() );
336 QRectF rect = geometry();
337

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


376 KD Chart 2 Class Documentation

338 painter->translate( rect.center() );


339 rect.moveTopLeft( QPointF( - rect.width() / 2, - rect.height() / 2 ) );
340 painter->rotate( mAttributes.rotation() );
341 painter->drawText( rect, Qt::AlignHCenter | Qt::AlignVCenter, mText );
342 }

6.27.3.16 void TextArea::paintAll (QPainter & painter) [inherited]

Call paintAll, if you want the background and the frame to be drawn before the normal paint() is invoked
automatically.
Definition at line 83 of file KDChartTextArea.cpp.
References KDChart::TextArea::areaGeometry(), KDChart::TextLayoutItem::geometry(),
KDChart::AbstractAreaBase::innerRect(), KDChart::TextLayoutItem::paint(), KDChart::Abstract-
AreaBase::paintBackground(), KDChart::AbstractAreaBase::paintFrame(), and KDChart::TextLayout-
Item::setGeometry().
Referenced by KDChart::Chart::paint(), and KDChart::TextArea::paintIntoRect().

84 {
85 // Paint the background and frame
86 paintBackground( painter, geometry() );
87 paintFrame( painter, geometry() );
88
89 // temporarily adjust the widget size, to be sure all content gets calculated
90 // to fit into the inner rectangle
91 const QRect oldGeometry( areaGeometry() );
92 QRect inner( innerRect() );
93 inner.moveTo(
94 oldGeometry.left() + inner.left(),
95 oldGeometry.top() + inner.top() );
96 const bool needAdjustGeometry = oldGeometry != inner;
97 if( needAdjustGeometry )
98 setGeometry( inner );
99 paint( &painter );
100 if( needAdjustGeometry )
101 setGeometry( oldGeometry );
102 //qDebug() << "TextAreaWidget::paintAll() done.";
103 }

6.27.3.17 void AbstractAreaBase::paintBackground (QPainter & painter, const QRect &


rectangle) [virtual, inherited]

Definition at line 103 of file KDChartAbstractAreaBase.cpp.


References attributes, and d.
Referenced by KDChart::TextArea::paintAll(), KDChart::AbstractAreaWidget::paintAll(), and
KDChart::AbstractArea::paintAll().

104 {
105 Q_ASSERT_X ( d != 0, "AbstractAreaBase::paintBackground()",
106 "Private class was not initialized!" );
107
108 #define attributes d->backgroundAttributes
109
110 if( !attributes.isVisible() ) return;
111
112 /* first draw the brush (may contain a pixmap)*/

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.27 KDChart::HeaderFooter Class Reference 377

113 if( Qt::NoBrush != attributes.brush().style() ) {


114 KDChart::PainterSaver painterSaver( &painter );
115 painter.setPen( Qt::NoPen );
116 const QPointF newTopLeft( painter.deviceMatrix().map( rect.topLeft() ) );
117 painter.setBrushOrigin( newTopLeft );
118 painter.setBrush( attributes.brush() );
119 painter.drawRect( rect );
120 }
121 /* next draw the backPixmap over the brush */
122 if( !attributes.pixmap().isNull() &&
123 attributes.pixmapMode() != BackgroundAttributes::BackgroundPixmapModeNone ) {
124 QPointF ol = rect.topLeft();
125 if( BackgroundAttributes::BackgroundPixmapModeCentered == attributes.pixmapMode() )
126 {
127 ol.setX( rect.center().x() - attributes.pixmap().width() / 2 );
128 ol.setY( rect.center().y() - attributes.pixmap().height()/ 2 );
129 painter.drawPixmap( ol, attributes.pixmap() );
130 } else {
131 QMatrix m;
132 double zW = (double)rect.width() / (double)attributes.pixmap().width();
133 double zH = (double)rect.height() / (double)attributes.pixmap().height();
134 switch( attributes.pixmapMode() ) {
135 case BackgroundAttributes::BackgroundPixmapModeScaled:
136 {
137 double z;
138 z = qMin( zW, zH );
139 m.scale( z, z );
140 }
141 break;
142 case BackgroundAttributes::BackgroundPixmapModeStretched:
143 m.scale( zW, zH );
144 break;
145 default:
146 ; // Cannot happen, previously checked
147 }
148 QPixmap pm = attributes.pixmap().transformed( m );
149 ol.setX( rect.center().x() - pm.width() / 2 );
150 ol.setY( rect.center().y() - pm.height()/ 2 );
151 painter.drawPixmap( ol, pm );
152 }
153 }
154 #undef attributes
155 }

6.27.3.18 void KDChart::AbstractLayoutItem::paintCtx (PaintContext ∗ context) [virtual,


inherited]

Default impl: Paint the complete item using its layouted position and size.
Reimplemented in KDChart::CartesianAxis.
Definition at line 64 of file KDChartLayoutItems.cpp.
References KDChart::AbstractLayoutItem::paint(), and KDChart::PaintContext::painter().

65 {
66 if( context )
67 paint( context->painter() );
68 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


378 KD Chart 2 Class Documentation

6.27.3.19 void AbstractAreaBase::paintFrame (QPainter & painter, const QRect & rectangle)
[virtual, inherited]

Definition at line 158 of file KDChartAbstractAreaBase.cpp.


References attributes, and d.
Referenced by KDChart::TextArea::paintAll(), KDChart::AbstractAreaWidget::paintAll(), and
KDChart::AbstractArea::paintAll().

159 {
160 Q_ASSERT_X ( d != 0, "AbstractAreaBase::paintFrame()",
161 "Private class was not initialized!" );
162
163 #define attributes d->frameAttributes
164
165 if( !attributes.isVisible() ) return;
166
167 const QPen oldPen( painter.pen() );
168 painter.setPen( attributes.pen() );
169 painter.drawRect( rect );
170 painter.setPen( oldPen );
171 #undef attributes
172 }

6.27.3.20 void TextArea::paintIntoRect (QPainter & painter, const QRect & rect) [virtual,
inherited]

Draws the background and frame, then calls paint().


In most cases there is no need to overwrite this method in a derived class, but you would overwrite Text-
LayoutItem::paint() instead.
Definition at line 71 of file KDChartTextArea.cpp.
References KDChart::TextLayoutItem::geometry(), KDChart::TextArea::paintAll(), and KDChart::Text-
LayoutItem::setGeometry().

72 {
73 const QRect oldGeometry( geometry() );
74 if( oldGeometry != rect )
75 setGeometry( rect );
76 painter.translate( rect.left(), rect.top() );
77 paintAll( painter );
78 painter.translate( -rect.left(), -rect.top() );
79 if( oldGeometry != rect )
80 setGeometry( oldGeometry );
81 }

6.27.3.21 Position HeaderFooter::position () const

Definition at line 117 of file KDChartHeaderFooter.cpp.


References d.
Referenced by clone().

118 {
119 return d->position;
120 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.27 KDChart::HeaderFooter Class Reference 379

6.27.3.22 void KDChart::HeaderFooter::positionChanged (HeaderFooter ∗)

Referenced by setPosition(), and setType().

6.27.3.23 void TextArea::positionHasChanged () [protected, virtual, inherited]

Reimplemented from KDChart::AbstractAreaBase.


Definition at line 110 of file KDChartTextArea.cpp.

111 {
112 emit positionChanged( this );
113 }

6.27.3.24 QFont KDChart::TextLayoutItem::realFont () const [virtual, inherited]

Definition at line 220 of file KDChartLayoutItems.cpp.


Referenced by KDChart::CartesianAxis::maximumSize(), and KDChart::CartesianAxis::paintCtx().

221 {
222 realFontWasRecalculated(); // we can safely ignore the boolean return value
223 return cachedFont;
224 }

6.27.3.25 qreal KDChart::TextLayoutItem::realFontSize () const [virtual, inherited]

Definition at line 193 of file KDChartLayoutItems.cpp.


References KDChart::Measure::calculatedValue(), KDChart::TextAttributes::fontSize(), and
KDChart::TextAttributes::minimalFontSize().

194 {
195 return qMax(
196 mAttributes.fontSize().calculatedValue(
197 mAutoReferenceArea,
198 mAutoReferenceOrientation ),
199 mAttributes.minimalFontSize().calculatedValue(
200 mAutoReferenceArea,
201 mAutoReferenceOrientation ) );
202 }

6.27.3.26 void KDChart::AbstractLayoutItem::removeFromParentLayout () [inherited]

Definition at line 66 of file KDChartLayoutItems.h.


Referenced by KDChart::Chart::takeCoordinatePlane().

67 {
68 if( mParentLayout ){
69 if( widget() )
70 mParentLayout->removeWidget( widget() );
71 else
72 mParentLayout->removeItem( this );
73 }
74 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


380 KD Chart 2 Class Documentation

6.27.3.27 void KDChart::TextLayoutItem::setAutoReferenceArea (const QObject ∗ area)


[inherited]

Definition at line 115 of file KDChartLayoutItems.cpp.


References KDChart::TextLayoutItem::sizeHint().
Referenced by setParent().

116 {
117 mAutoReferenceArea = area;
118 cachedSizeHint = QSize();
119 sizeHint();
120 }

6.27.3.28 void AbstractAreaBase::setBackgroundAttributes (const BackgroundAttributes & a)


[inherited]

Definition at line 92 of file KDChartAbstractAreaBase.cpp.


References d.

93 {
94 d->backgroundAttributes = a;
95 }

6.27.3.29 void AbstractAreaBase::setFrameAttributes (const FrameAttributes & a)


[inherited]

Definition at line 82 of file KDChartAbstractAreaBase.cpp.


References d.
Referenced by KDChart::Legend::clone().

83 {
84 d->frameAttributes = a;
85 }

6.27.3.30 void KDChart::TextLayoutItem::setGeometry (const QRect & r) [virtual,


inherited]

pure virtual in QLayoutItem


Definition at line 187 of file KDChartLayoutItems.cpp.
Referenced by KDChart::TextArea::paintAll(), KDChart::CartesianAxis::paintCtx(), and KDChart::Text-
Area::paintIntoRect().

188 {
189 mRect = r;
190 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.27 KDChart::HeaderFooter Class Reference 381

6.27.3.31 void HeaderFooter::setParent (QObject ∗ parent)

Definition at line 67 of file KDChartHeaderFooter.cpp.


References KDChart::TextLayoutItem::autoReferenceArea(), and KDChart::TextLayoutItem::setAuto-
ReferenceArea().
Referenced by KDChart::Widget::addHeaderFooter(), KDChart::Chart::addHeaderFooter(), Header-
Footer(), KDChart::Widget::replaceHeaderFooter(), and KDChart::Chart::takeHeaderFooter().

68 {
69 QObject::setParent( parent );
70 if( parent && ! autoReferenceArea() )
71 setAutoReferenceArea( parent );
72 }

6.27.3.32 void KDChart::AbstractLayoutItem::setParentLayout (QLayout ∗ lay) [inherited]

Definition at line 62 of file KDChartLayoutItems.h.

63 {
64 mParentLayout = lay;
65 }

6.27.3.33 void KDChart::AbstractLayoutItem::setParentWidget (QWidget ∗ widget)


[virtual, inherited]

Inform the item about its widget: This enables the item, to trigger that widget’s update, whenever the size
of the item’s contents has changed.
Thus, you need to call setParentWidget on every item, that has a non-fixed size.
Definition at line 56 of file KDChartLayoutItems.cpp.
References KDChart::AbstractLayoutItem::mParent.
Referenced by KDChart::Legend::buildLegend(), and KDChart::AbstractCartesianDiagram::takeAxis().

57 {
58 mParent = widget;
59 }

6.27.3.34 void HeaderFooter::setPosition (Position position)

Definition at line 111 of file KDChartHeaderFooter.cpp.


References d, and positionChanged().
Referenced by KDChart::Widget::addHeaderFooter(), and clone().

112 {
113 d->position = position;
114 emit positionChanged( this );
115 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


382 KD Chart 2 Class Documentation

6.27.3.35 void KDChart::TextLayoutItem::setText (const QString & text) [inherited]

Definition at line 127 of file KDChartLayoutItems.cpp.


References KDChart::TextLayoutItem::sizeHint().
Referenced by KDChart::Widget::addHeaderFooter(), KDChart::CartesianAxis::maximumSize(), and
KDChart::CartesianAxis::paintCtx().

128 {
129 mText = text;
130 cachedSizeHint = QSize();
131 sizeHint();
132 }

6.27.3.36 void KDChart::TextLayoutItem::setTextAttributes (const TextAttributes & a)


[inherited]

Use this to specify the text attributes to be used for this item.

See also:
textAttributes

Definition at line 144 of file KDChartLayoutItems.cpp.


References KDChart::TextLayoutItem::sizeHint().
Referenced by clone().

145 {
146 mAttributes = a;
147 cachedSizeHint = QSize(); // invalidate size hint
148 sizeHint();
149 }

6.27.3.37 void HeaderFooter::setType (HeaderFooterType type)

Definition at line 100 of file KDChartHeaderFooter.cpp.


References d, and positionChanged().
Referenced by KDChart::Widget::addHeaderFooter(), and clone().

101 {
102 d->type = type;
103 emit positionChanged( this );
104 }

6.27.3.38 QSize KDChart::TextLayoutItem::sizeHint () const [virtual, inherited]

pure virtual in QLayoutItem


Definition at line 289 of file KDChartLayoutItems.cpp.
References KDChart::AbstractLayoutItem::sizeHintChanged().

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.27 KDChart::HeaderFooter Class Reference 383

Referenced by KDChart::Legend::buildLegend(), KDChart::TextLayoutItem::maximumSize(),


KDChart::CartesianAxis::maximumSize(), KDChart::TextLayoutItem::minimumSize(), KDChart::Text-
LayoutItem::paint(), KDChart::CartesianAxis::paintCtx(), KDChart::TextLayoutItem::setAutoReference-
Area(), KDChart::TextLayoutItem::setText(), and KDChart::TextLayoutItem::setTextAttributes().

290 {
291 if( realFontWasRecalculated() )
292 {
293 cachedSizeHint = calcSizeHint( cachedFont );
294 sizeHintChanged();
295 }
296 //qDebug("cachedSizeHint.width(): %i",cachedSizeHint.width());
297 return cachedSizeHint;
298 }

6.27.3.39 void KDChart::AbstractLayoutItem::sizeHintChanged () const [virtual,


inherited]

Report changed size hint: ask the parent widget to recalculate the layout.
Definition at line 73 of file KDChartLayoutItems.cpp.
Referenced by KDChart::TextLayoutItem::sizeHint().

74 {
75 // This is exactly like what QWidget::updateGeometry does.
76 // qDebug("KDChart::AbstractLayoutItem::sizeHintChanged() called");
77 if( mParent ) {
78 if ( mParent->layout() )
79 mParent->layout()->invalidate();
80 else
81 QApplication::postEvent( mParent, new QEvent( QEvent::LayoutRequest ) );
82 }
83 }

6.27.3.40 QString KDChart::TextLayoutItem::text () const [inherited]

Definition at line 134 of file KDChartLayoutItems.cpp.


Referenced by KDChart::CartesianAxis::paintCtx().

135 {
136 return mText;
137 }

6.27.3.41 KDChart::TextAttributes KDChart::TextLayoutItem::textAttributes () const


[inherited]

Returns the text attributes to be used for this item.

See also:
setTextAttributes

Definition at line 156 of file KDChartLayoutItems.cpp.


Referenced by clone().

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


384 KD Chart 2 Class Documentation

157 {
158 return mAttributes;
159 }

6.27.3.42 HeaderFooter::HeaderFooterType HeaderFooter::type () const

Definition at line 106 of file KDChartHeaderFooter.cpp.


References d.
Referenced by clone().

107 {
108 return d->type;
109 }

6.27.4 Member Data Documentation

6.27.4.1 Q_SIGNALS KDChart::HeaderFooter::__pad0__

Reimplemented from KDChart::TextArea.


Definition at line 66 of file KDChartHeaderFooter.h.

6.27.4.2 QWidget∗ KDChart::AbstractLayoutItem::mParent [protected, inherited]

Definition at line 76 of file KDChartLayoutItems.h.


Referenced by KDChart::AbstractLayoutItem::setParentWidget().

6.27.4.3 QLayout∗ KDChart::AbstractLayoutItem::mParentLayout [protected,


inherited]

Definition at line 77 of file KDChartLayoutItems.h.


The documentation for this class was generated from the following files:

• KDChartHeaderFooter.h
• KDChartHeaderFooter.cpp

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.28 KDChart::HorizontalLineLayoutItem Class Reference 385

6.28 KDChart::HorizontalLineLayoutItem Class Reference

#include <KDChartLayoutItems.h>
Inheritance diagram for KDChart::HorizontalLineLayoutItem:Collaboration diagram for
KDChart::HorizontalLineLayoutItem:

Public Member Functions

• virtual Qt::Orientations expandingDirections () const


• virtual QRect geometry () const
• HorizontalLineLayoutItem ()
• virtual bool isEmpty () const
• virtual QSize maximumSize () const
• virtual QSize minimumSize () const
• virtual void paint (QPainter ∗)
• virtual void paintCtx (PaintContext ∗context)
Default impl: Paint the complete item using its layouted position and size.

• void removeFromParentLayout ()
• virtual void setGeometry (const QRect &r)
• void setParentLayout (QLayout ∗lay)
• virtual void setParentWidget (QWidget ∗widget)
Inform the item about its widget: This enables the item, to trigger that widget’s update, whenever the size
of the item’s contents has changed.

• virtual QSize sizeHint () const


• virtual void sizeHintChanged () const
Report changed size hint: ask the parent widget to recalculate the layout.

Protected Attributes

• QWidget ∗ mParent
• QLayout ∗ mParentLayout

6.28.1 Constructor & Destructor Documentation

6.28.1.1 KDChart::HorizontalLineLayoutItem::HorizontalLineLayoutItem ()

Definition at line 411 of file KDChartLayoutItems.cpp.

412 : AbstractLayoutItem( Qt::AlignCenter )


413 {
414 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


386 KD Chart 2 Class Documentation

6.28.2 Member Function Documentation

6.28.2.1 Qt::Orientations KDChart::HorizontalLineLayoutItem::expandingDirections () const


[virtual]

Definition at line 416 of file KDChartLayoutItems.cpp.

417 {
418 return Qt::Vertical|Qt::Horizontal; // Grow neither vertically nor horizontally
419 }

6.28.2.2 QRect KDChart::HorizontalLineLayoutItem::geometry () const [virtual]

Definition at line 421 of file KDChartLayoutItems.cpp.

422 {
423 return mRect;
424 }

6.28.2.3 bool KDChart::HorizontalLineLayoutItem::isEmpty () const [virtual]

Definition at line 426 of file KDChartLayoutItems.cpp.

427 {
428 return false; // never empty, otherwise the layout item would not exist
429 }

6.28.2.4 QSize KDChart::HorizontalLineLayoutItem::maximumSize () const [virtual]

Definition at line 431 of file KDChartLayoutItems.cpp.

432 {
433 return QSize( QWIDGETSIZE_MAX, QWIDGETSIZE_MAX );
434 }

6.28.2.5 QSize KDChart::HorizontalLineLayoutItem::minimumSize () const [virtual]

Definition at line 436 of file KDChartLayoutItems.cpp.

437 {
438 return QSize( 0, 0 );
439 }

6.28.2.6 void KDChart::HorizontalLineLayoutItem::paint (QPainter ∗) [virtual]

Implements KDChart::AbstractLayoutItem.
Definition at line 452 of file KDChartLayoutItems.cpp.

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.28 KDChart::HorizontalLineLayoutItem Class Reference 387

453 {
454 if( !mRect.isValid() )
455 return;
456
457 painter->drawLine( QPointF( mRect.left(), mRect.center().y() ),
458 QPointF( mRect.right(), mRect.center().y() ) );
459 }

6.28.2.7 void KDChart::AbstractLayoutItem::paintCtx (PaintContext ∗ context) [virtual,


inherited]

Default impl: Paint the complete item using its layouted position and size.
Reimplemented in KDChart::CartesianAxis.
Definition at line 64 of file KDChartLayoutItems.cpp.
References KDChart::AbstractLayoutItem::paint(), and KDChart::PaintContext::painter().

65 {
66 if( context )
67 paint( context->painter() );
68 }

6.28.2.8 void KDChart::AbstractLayoutItem::removeFromParentLayout () [inherited]

Definition at line 66 of file KDChartLayoutItems.h.


Referenced by KDChart::Chart::takeCoordinatePlane().

67 {
68 if( mParentLayout ){
69 if( widget() )
70 mParentLayout->removeWidget( widget() );
71 else
72 mParentLayout->removeItem( this );
73 }
74 }

6.28.2.9 void KDChart::HorizontalLineLayoutItem::setGeometry (const QRect & r)


[virtual]

Definition at line 441 of file KDChartLayoutItems.cpp.

442 {
443 mRect = r;
444 }

6.28.2.10 void KDChart::AbstractLayoutItem::setParentLayout (QLayout ∗ lay) [inherited]

Definition at line 62 of file KDChartLayoutItems.h.

63 {
64 mParentLayout = lay;
65 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


388 KD Chart 2 Class Documentation

6.28.2.11 void KDChart::AbstractLayoutItem::setParentWidget (QWidget ∗ widget)


[virtual, inherited]

Inform the item about its widget: This enables the item, to trigger that widget’s update, whenever the size
of the item’s contents has changed.
Thus, you need to call setParentWidget on every item, that has a non-fixed size.
Definition at line 56 of file KDChartLayoutItems.cpp.
References KDChart::AbstractLayoutItem::mParent.
Referenced by KDChart::Legend::buildLegend(), and KDChart::AbstractCartesianDiagram::takeAxis().

57 {
58 mParent = widget;
59 }

6.28.2.12 QSize KDChart::HorizontalLineLayoutItem::sizeHint () const [virtual]

Definition at line 446 of file KDChartLayoutItems.cpp.

447 {
448 return QSize( -1, 3 ); // see qframe.cpp
449 }

6.28.2.13 void KDChart::AbstractLayoutItem::sizeHintChanged () const [virtual,


inherited]

Report changed size hint: ask the parent widget to recalculate the layout.
Definition at line 73 of file KDChartLayoutItems.cpp.
Referenced by KDChart::TextLayoutItem::sizeHint().

74 {
75 // This is exactly like what QWidget::updateGeometry does.
76 // qDebug("KDChart::AbstractLayoutItem::sizeHintChanged() called");
77 if( mParent ) {
78 if ( mParent->layout() )
79 mParent->layout()->invalidate();
80 else
81 QApplication::postEvent( mParent, new QEvent( QEvent::LayoutRequest ) );
82 }
83 }

6.28.3 Member Data Documentation

6.28.3.1 QWidget∗ KDChart::AbstractLayoutItem::mParent [protected, inherited]

Definition at line 76 of file KDChartLayoutItems.h.


Referenced by KDChart::AbstractLayoutItem::setParentWidget().

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.28 KDChart::HorizontalLineLayoutItem Class Reference 389

6.28.3.2 QLayout∗ KDChart::AbstractLayoutItem::mParentLayout [protected,


inherited]

Definition at line 77 of file KDChartLayoutItems.h.


The documentation for this class was generated from the following files:

• KDChartLayoutItems.h
• KDChartLayoutItems.cpp

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


390 KD Chart 2 Class Documentation

6.29 KDChartEnums Class Reference


#include <KDChartEnums.h>
Inheritance diagram for KDChartEnums:Collaboration diagram for KDChartEnums:

6.29.1 Detailed Description

Project global class providing some enums needed both by KDChartParams and by KDChartCustomBox.
Definition at line 46 of file KDChartEnums.h.

Public Types
• enum GranularitySequence {
GranularitySequence_10_20,
GranularitySequence_10_50,
GranularitySequence_25_50,
GranularitySequenceIrregular }
GranularitySequence specifies the values, that may be applied, to determine a step width within a given
data range.

• enum MeasureCalculationMode {
MeasureCalculationModeAbsolute,
MeasureCalculationModeRelative,
MeasureCalculationModeAuto,
MeasureCalculationModeAutoArea,
MeasureCalculationModeAutoOrientation }
Measure calculation mode: the way how the absolute value of a KDChart::Measure is determined during
KD Chart’s internal geometry calculation time.

• enum MeasureOrientation {
MeasureOrientationAuto,
MeasureOrientationHorizontal,
MeasureOrientationVertical,
MeasureOrientationMinimum,
MeasureOrientationMaximum }
Measure orientation mode: the way how the absolute value of a KDChart::Measure is determined during
KD Chart’s internal geometry calculation time.

• enum PositionValue {
PositionUnknown = 0,
PositionCenter = 1,
PositionNorthWest = 2,
PositionNorth = 3,
PositionNorthEast = 4,

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.29 KDChartEnums Class Reference 391

PositionEast = 5,
PositionSouthEast = 6,
PositionSouth = 7,
PositionSouthWest = 8,
PositionWest = 9 }
Numerical values of the static KDChart::Position instances, for using a Position::value() with a switch()
statement.

• enum TextLayoutPolicy {
LayoutJustOverwrite,
LayoutPolicyRotate,
LayoutPolicyShiftVertically,
LayoutPolicyShiftHorizontally,
LayoutPolicyShrinkFontSize }
Text layout policy: what to do if text that is to be drawn would cover neighboring text or neighboring areas.

Static Public Member Functions

• QString granularitySequenceToString (GranularitySequence sequence)


Converts the specified granularity sequence enum to a string representation.

• QString layoutPolicyToString (TextLayoutPolicy type)


Converts the specified text layout policy enum to a string representation.

• QString measureCalculationModeToString (MeasureCalculationMode mode)


Converts the specified measure calculation mode enum to a string representation.

• QString MeasureOrientationToString (MeasureOrientation mode)


Converts the specified measure orientation enum to a string representation.

• GranularitySequence stringToGranularitySequence (const QString &string)


Converts the specified string to a granularity sequence enum value.

• TextLayoutPolicy stringToLayoutPolicy (const QString &string)


Converts the specified string to a text layout policy enum value.

• MeasureCalculationMode stringToMeasureCalculationMode (const QString &string)


Converts the specified string to a measure calculation mode enum value.

• MeasureOrientation stringToMeasureOrientation (const QString &string)


Converts the specified string to a measure orientation enum value.

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


392 KD Chart 2 Class Documentation

6.29.2 Member Enumeration Documentation

6.29.2.1 enum KDChartEnums::GranularitySequence

GranularitySequence specifies the values, that may be applied, to determine a step width within a given
data range.

Note:
Granularity with can be set for Linear axis calculation mode only, there is no way to specify a step
width for Logarithmic axes.

Value occuring in the GranularitySequence names only are showing their respective relation ship. For real
data they will most times not be used directly, but be multiplied by positive (or negative, resp.) powers of
ten.
A granularity sequence is a sequence of values from the following set: 1, 2, 2.5, 5.
The reason for using one of the following three pre-defined granularity sequences (instead of just using the
best matching step width) is to follow a simple rule: If scaling becomes finer (== smaller step width) no
value, that has been on a grid line before, shall loose its line and be NOT on a grid line anymore!
This means: Smaller step width may not remove any grid lines, but it may add additional lines in between.

• GranularitySequence_10_20 Step widths can be 1, or 2, but they never can be 2.5 nor 5.
• GranularitySequence_10_50 Step widths can be 1, or 5, but they never can be 2, nor 2.5.
• GranularitySequence_25_50 Step widths can be 2.5, or 5, but they never can be 1, nor 2.
• GranularitySequenceIrregular Step widths can be all of these values: 1, or 2, or 2.5, or
5.

Note:
When ever possible, try to avoid using GranularitySequenceIrregular! Allowing all possible step val-
ues, using this granularity sequence involves a serious risk: Your users might be irritated due to ’jump-
ing’ grid lines, when step size is changed from 2.5 to 2 (or vice versa, resp.).

Since you probably like having the value 1 as an allowed step width, the granularity sequence decision
boils down to a boolean question:

• To get ten divided by five you use GranularitySequence_10_20, while


• for having it divided by two GranularitySequence_10_50 is your choice.

Enumeration values:
GranularitySequence_10_20
GranularitySequence_10_50
GranularitySequence_25_50
GranularitySequenceIrregular

Definition at line 94 of file KDChartEnums.h.

94 {
95 GranularitySequence_10_20,
96 GranularitySequence_10_50,
97 GranularitySequence_25_50,
98 GranularitySequenceIrregular };

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.29 KDChartEnums Class Reference 393

6.29.2.2 enum KDChartEnums::MeasureCalculationMode

Measure calculation mode: the way how the absolute value of a KDChart::Measure is determined during
KD Chart’s internal geometry calculation time.
KDChart::Measure values either are relative (calculated in relation to a given AbstractArea), or they are
absolute (used as fixed values).
Values stored in relative measure always are interpreted as per-mille of a reference area’s height (or width,
resp.) depending on the orientation set for the KDChart::Measure.

• MeasureCalculationModeAbsolute Value set by setValue() is absolute, to be used un-


changed.
• MeasureCalculationModeRelative Value is relative, the reference area is specified by set-
ReferenceArea(), and orientation specified by setOrientation().
• MeasureCalculationModeAuto Value is relative, KD Chart will automatically determine
which reference area to use, and it will determine the orientation too.
• MeasureCalculationModeAutoArea Value is relative, Orientation is specified by set-
Orientation(), and KD Chart will automatically determine which reference area to use.
• MeasureCalculationModeAutoOrientation Value is relative, Area is specified by set-
ReferenceArea(), and KD Chart will automatically determine which orientation to use.

See also:
KDChart::Measure::setCalculationMode

Enumeration values:
MeasureCalculationModeAbsolute
MeasureCalculationModeRelative
MeasureCalculationModeAuto
MeasureCalculationModeAutoArea
MeasureCalculationModeAutoOrientation

Definition at line 215 of file KDChartEnums.h.

215 { MeasureCalculationModeAbsolute,
216 MeasureCalculationModeRelative,
217 MeasureCalculationModeAuto,
218 MeasureCalculationModeAutoArea,
219 MeasureCalculationModeAutoOrientation };

6.29.2.3 enum KDChartEnums::MeasureOrientation

Measure orientation mode: the way how the absolute value of a KDChart::Measure is determined during
KD Chart’s internal geometry calculation time.
KDChart::Measure values either are relative (calculated in relation to a given AbstractArea), or they are
absolute (used as fixed values).
Values stored in relative measure take into account the width (and/or the height, resp.) of a so-called
reference area, that is either specified by KDChart::Measure::setReferenceArea, or determined by KD
Chart automatically, respectively.

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


394 KD Chart 2 Class Documentation

• MeasureOrientationAuto Value is calculated, based upon the width (or on the height, resp.)
of the reference area: KD Chart will automatically determie an appropriate way.
• MeasureOrientationHorizontal Value is calculated, based upon the width of the reference
area.
• MeasureOrientationVertical Value is calculated, based upon the height of the reference
area.
• MeasureOrientationMinimum Value is calculated, based upon the width (or on the height,
resp.) of the reference area - which ever is smaller.
• MeasureOrientationMaximum Value is calculated, based upon the width (or on the height,
resp.) of the reference area - which ever is smaller.

See also:
KDChart::Measure::setOrientationMode

Enumeration values:
MeasureOrientationAuto
MeasureOrientationHorizontal
MeasureOrientationVertical
MeasureOrientationMinimum
MeasureOrientationMaximum

Definition at line 284 of file KDChartEnums.h.

284 { MeasureOrientationAuto,
285 MeasureOrientationHorizontal,
286 MeasureOrientationVertical,
287 MeasureOrientationMinimum,
288 MeasureOrientationMaximum };

6.29.2.4 enum KDChartEnums::PositionValue

Numerical values of the static KDChart::Position instances, for using a Position::value() with a switch()
statement.

See also:
Position

Enumeration values:
PositionUnknown
PositionCenter
PositionNorthWest
PositionNorth
PositionNorthEast
PositionEast
PositionSouthEast
PositionSouth
PositionSouthWest

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.29 KDChartEnums Class Reference 395

PositionWest

Definition at line 187 of file KDChartEnums.h.

187 {
188 PositionUnknown = 0,
189 PositionCenter = 1,
190 PositionNorthWest = 2,
191 PositionNorth = 3,
192 PositionNorthEast = 4,
193 PositionEast = 5,
194 PositionSouthEast = 6,
195 PositionSouth = 7,
196 PositionSouthWest = 8,
197 PositionWest = 9 };

6.29.2.5 enum KDChartEnums::TextLayoutPolicy

Text layout policy: what to do if text that is to be drawn would cover neighboring text or neighboring areas.

• LayoutJustOverwrite Just ignore the layout collision and write the text nevertheless.

• LayoutPolicyRotate Try counter-clockwise rotation to make the text fit into the space.

• LayoutPolicyShiftVertically Shift the text baseline upwards (or downwards, resp.) and
draw a connector line between the text and its anchor.

• LayoutPolicyShiftHorizontally Shift the text baseline to the left (or to the right, resp.)
and draw a connector line between the text and its anchor.

• LayoutPolicyShrinkFontSize Reduce the text font size.

See also:
KDChartParams::setPrintDataValues

Enumeration values:
LayoutJustOverwrite
LayoutPolicyRotate
LayoutPolicyShiftVertically
LayoutPolicyShiftHorizontally
LayoutPolicyShrinkFontSize

Definition at line 156 of file KDChartEnums.h.

156 { LayoutJustOverwrite,
157 LayoutPolicyRotate,
158 LayoutPolicyShiftVertically,
159 LayoutPolicyShiftHorizontally,
160 LayoutPolicyShrinkFontSize };

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


396 KD Chart 2 Class Documentation

6.29.3 Member Function Documentation

6.29.3.1 QString KDChartEnums::granularitySequenceToString (GranularitySequence sequence)


[static]

Converts the specified granularity sequence enum to a string representation.

Parameters:
type the granularity sequence enum to convert

Returns:
the string representation of the granularity sequence

Definition at line 107 of file KDChartEnums.h.

107 {
108 switch( sequence ) {
109 case GranularitySequence_10_20:
110 return QString::fromLatin1("GranularitySequence_10_20");
111 case GranularitySequence_10_50:
112 return QString::fromLatin1("GranularitySequence_10_50");
113 case GranularitySequence_25_50:
114 return QString::fromLatin1("GranularitySequence_25_50");
115 case GranularitySequenceIrregular:
116 return QString::fromLatin1("GranularitySequenceIrregular");
117 default: // should not happen
118 qDebug( "Unknown granularity sequence" );
119 return QString::fromLatin1("GranularitySequence_10_20");
120 }
121 }

6.29.3.2 QString KDChartEnums::layoutPolicyToString (TextLayoutPolicy type) [static]

Converts the specified text layout policy enum to a string representation.

Parameters:
type the text layout policy to convert

Returns:
the string representation of the text layout policy enum

6.29.3.3 QString KDChartEnums::measureCalculationModeToString (MeasureCalculationMode


mode) [static]

Converts the specified measure calculation mode enum to a string representation.

Parameters:
type the measure calculation mode to convert

Returns:
the string representation of the Measure calculation mode enum

Definition at line 228 of file KDChartEnums.h.

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.29 KDChartEnums Class Reference 397

228 {
229 switch( mode ) {
230 case MeasureCalculationModeAbsolute:
231 return QString::fromLatin1("MeasureCalculationModeAbsolute");
232 case MeasureCalculationModeAuto:
233 return QString::fromLatin1("MeasureCalculationModeAuto");
234 case MeasureCalculationModeAutoArea:
235 return QString::fromLatin1("MeasureCalculationModeAutoArea");
236 case MeasureCalculationModeAutoOrientation:
237 return QString::fromLatin1("MeasureCalculationModeAutoOrientation");
238 case MeasureCalculationModeRelative:
239 return QString::fromLatin1("MeasureCalculationModeRelative");
240 default: // should not happen
241 qDebug( "Unknown measure calculation mode" );
242 return QString::fromLatin1("MeasureCalculationModeAuto");
243 }
244 }

6.29.3.4 QString KDChartEnums::MeasureOrientationToString (MeasureOrientation mode)


[static]

Converts the specified measure orientation enum to a string representation.

Parameters:
type the measure orientation to convert

Returns:
the string representation of the measure orientation enum

Definition at line 297 of file KDChartEnums.h.

297 {
298 switch( mode ) {
299 case MeasureOrientationAuto:
300 return QString::fromLatin1("MeasureOrientationAuto");
301 case MeasureOrientationHorizontal:
302 return QString::fromLatin1("MeasureOrientationHorizontal");
303 case MeasureOrientationVertical:
304 return QString::fromLatin1("MeasureOrientationVertical");
305 case MeasureOrientationMinimum:
306 return QString::fromLatin1("MeasureOrientationMinimum");
307 case MeasureOrientationMaximum:
308 return QString::fromLatin1("MeasureOrientationMaximum");
309 default: // should not happen
310 qDebug( "Unknown measure orientation mode" );
311 return QString::fromLatin1("MeasureOrientationAuto");
312 }
313 }

6.29.3.5 GranularitySequence KDChartEnums::stringToGranularitySequence (const QString &


string) [static]

Converts the specified string to a granularity sequence enum value.

Parameters:
string the string to convert

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


398 KD Chart 2 Class Documentation

Returns:
the granularity sequence enum value

Definition at line 130 of file KDChartEnums.h.

130 {
131 if( string == QString::fromLatin1("GranularitySequence_10_20") )
132 return GranularitySequence_10_20;
133 if( string == QString::fromLatin1("GranularitySequence_10_50") )
134 return GranularitySequence_10_50;
135 if( string == QString::fromLatin1("GranularitySequence_25_50") )
136 return GranularitySequence_25_50;
137 if( string == QString::fromLatin1("GranularitySequenceIrregular") )
138 return GranularitySequenceIrregular;
139 // default, should not happen
140 return GranularitySequence_10_20;
141 }

6.29.3.6 TextLayoutPolicy KDChartEnums::stringToLayoutPolicy (const QString & string)


[static]

Converts the specified string to a text layout policy enum value.

Parameters:
string the string to convert

Returns:
the text layout policy enum value

6.29.3.7 MeasureCalculationMode KDChartEnums::stringToMeasureCalculationMode (const


QString & string) [static]

Converts the specified string to a measure calculation mode enum value.

Parameters:
string the string to convert

Returns:
the measure calculation mode enum value

Definition at line 253 of file KDChartEnums.h.

253 {
254 if( string == QString::fromLatin1("MeasureCalculationModeAbsolute") )
255 return MeasureCalculationModeAbsolute;
256 if( string == QString::fromLatin1("MeasureCalculationModeAuto") )
257 return MeasureCalculationModeAuto;
258 if( string == QString::fromLatin1("MeasureCalculationModeAutoArea") )
259 return MeasureCalculationModeAutoArea;
260 if( string == QString::fromLatin1("MeasureCalculationModeAutoOrientation") )
261 return MeasureCalculationModeAutoOrientation;
262 if( string == QString::fromLatin1("MeasureCalculationModeRelative") )
263 return MeasureCalculationModeRelative;
264 // default, should not happen
265 return MeasureCalculationModeAuto;
266 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.29 KDChartEnums Class Reference 399

6.29.3.8 MeasureOrientation KDChartEnums::stringToMeasureOrientation (const QString &


string) [static]

Converts the specified string to a measure orientation enum value.

Parameters:
string the string to convert

Returns:
the measure orientation enum value

Definition at line 322 of file KDChartEnums.h.

322 {
323 if( string == QString::fromLatin1("MeasureOrientationAuto") )
324 return MeasureOrientationAuto;
325 if( string == QString::fromLatin1("MeasureOrientationHorizontal") )
326 return MeasureOrientationHorizontal;
327 if( string == QString::fromLatin1("MeasureOrientationVertical") )
328 return MeasureOrientationVertical;
329 if( string == QString::fromLatin1("MeasureOrientationMinimum") )
330 return MeasureOrientationMinimum;
331 if( string == QString::fromLatin1("MeasureOrientationMaximum") )
332 return MeasureOrientationMaximum;
333 // default, should not happen
334 return MeasureOrientationAuto;
335 }

The documentation for this class was generated from the following file:

• KDChartEnums.h

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


400 KD Chart 2 Class Documentation

6.30 KDTextDocument Class Reference

#include <KDTextDocument.h>
Inheritance diagram for KDTextDocument:Collaboration diagram for KDTextDocument:

Public Member Functions

• KDTextDocument (const QString &text, QObject ∗parent=0)


• KDTextDocument (QObject ∗parent=0)
• QSize minimumSizeHint ()
• QSize sizeHint ()
• ∼KDTextDocument ()

6.30.1 Constructor & Destructor Documentation

6.30.1.1 KDTextDocument::KDTextDocument (QObject ∗ parent = 0) [explicit]

Definition at line 38 of file KDTextDocument.cpp.

39 : QTextDocument( p ),
40 mHintValid( false ),
41 mSizeHint(),
42 mMinimumSizeHint()
43 {
44
45 }

6.30.1.2 KDTextDocument::KDTextDocument (const QString & text, QObject ∗ parent = 0)


[explicit]

Definition at line 47 of file KDTextDocument.cpp.

48 : QTextDocument( text, p ),
49 mHintValid( false ),
50 mSizeHint(),
51 mMinimumSizeHint()
52 {
53
54 }

6.30.1.3 KDTextDocument::∼KDTextDocument ()

Definition at line 56 of file KDTextDocument.cpp.

56 {}

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.30 KDTextDocument Class Reference 401

6.30.2 Member Function Documentation

6.30.2.1 QSize KDTextDocument::minimumSizeHint ()

Definition at line 66 of file KDTextDocument.cpp.


Referenced by sizeHint().

67 {
68 /*
69 QTextCursor cursor( this );
70 if( ! cursor.atEnd() )
71 cursor.movePosition( QTextCursor::NextBlock );
72 qDebug() << "KDTextDocument::minimumSizeHint() found:" << cursor.block().text();
73 QSizeF s( documentLayout()->blockBoundingRect( cursor.block() ).size() );
74 qDebug() << "KDTextDocument::minimumSizeHint() found rect" << documentLayout()->blockBoundingRect(
75 return QSize( static_cast<int>(s.width()),
76 static_cast<int>(s.height()) );
77 */
78
79 if( mHintValid )
80 return mMinimumSizeHint;
81
82 mHintValid = true;
83 mSizeHint = sizeForWidth( -1 );
84 QSize sz(-1, -1);
85
86 // PENDING(kalle) Cache
87 sz.rwidth() = sizeForWidth( 0 ).width();
88 sz.rheight() = sizeForWidth( 32000 ).height();
89 if( mSizeHint.height() < sz.height())
90 sz.rheight() = mSizeHint.height();
91
92 mMinimumSizeHint = sz;
93 return sz;
94 }

6.30.2.2 QSize KDTextDocument::sizeHint ()

Definition at line 59 of file KDTextDocument.cpp.


References minimumSizeHint().

60 {
61 if( !mHintValid )
62 (void)minimumSizeHint();
63 return mSizeHint;
64 }

The documentation for this class was generated from the following files:

• KDTextDocument.h
• KDTextDocument.cpp

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


402 KD Chart 2 Class Documentation

6.31 KDChart::Legend Class Reference


#include <KDChartLegend.h>
Inheritance diagram for KDChart::Legend:Collaboration diagram for KDChart::Legend:

6.31.1 Detailed Description

Legend defines the interface for the legend drawing class.


Legend is the class for drawing legends for all kinds of diagrams ("chart types").
Legend is drawn on chart level, not per diagram, but you can have more than one legend per chart, using
KDChart::Chart::addLegend().

Note:
Legend is different from all other classes ofd KD Chart, since it can be displayed outside of the Chart’s
area. If you want to, you can embedd the legend into your own widget, or into another part of a bigger
grid, into which you might have inserted the Chart.

On the other hand, please note that you MUST call Chart::addLegend to get your legend positioned into
the correct place of your chart - if you want to have the legend shown inside of the chart (that’s probably
true for most cases).
Definition at line 61 of file KDChartLegend.h.

Public Member Functions


• void addDiagram (KDChart::AbstractDiagram ∗newDiagram)
Add the given diagram to the legend.

• Qt::Alignment alignment () const


• void alignToReferencePoint (const RelativePosition &position)
• BackgroundAttributes backgroundAttributes () const
• QBrush brush (uint dataset) const
• void buildLegend ()
• virtual Legend ∗ clone () const
• uint datasetCount () const
• KDChart::AbstractDiagram ∗ diagram () const
The first diagram of the legend or 0 if there was none added to the legend.

• DiagramList diagrams () const


The list of all diagrams associated with the legend.

• virtual void forceRebuild ()


• FrameAttributes frameAttributes () const
• Legend (KDChart::AbstractDiagram ∗diagram, QWidget ∗parent)
• Legend (QWidget ∗parent=0)
• MarkerAttributes markerAttributes (uint dataset) const
• Qt::Orientation orientation () const
• virtual void paint (QPainter ∗painter)
Overwrite this to paint the inner contents of your widget.

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.31 KDChart::Legend Class Reference 403

• void paintAll (QPainter &painter)


Call paintAll, if you want the background and the frame to be drawn before the normal paint() is invoked
automatically.

• virtual void paintBackground (QPainter &painter, const QRect &rectangle)


• virtual void paintEvent (QPaintEvent ∗event)
Draws the background and frame, then calls paint().

• virtual void paintFrame (QPainter &painter, const QRect &rectangle)


• virtual void paintIntoRect (QPainter &painter, const QRect &rect)
Draws the background and frame, then calls paint().

• QPen pen (uint dataset) const


• Position position () const
• void propertiesChanged ()
Emitted upon change of a property of the Legend or any of its components.

• const QWidget ∗ referenceArea () const


Returns the reference area, that is used for font size of title text, and for font size of the item texts, IF
automatic area detection is set.

• void removeDiagram (KDChart::AbstractDiagram ∗oldDiagram)


Removes the diagram from the legend’s list of diagrams.

• void removeDiagrams ()
Removes all of the diagram from the legend’s list of diagrams.

• void replaceDiagram (KDChart::AbstractDiagram ∗newDiagram, KDChart::AbstractDiagram ∗old-


Diagram=0)
Replaces the old diagram, or appends the new diagram, it there is none yet.

• void resetDiagram (AbstractDiagram ∗)


• void resetTexts ()
Removes all legend texts that might have been set by setText.

• virtual void resizeEvent (QResizeEvent ∗event)


• void setAlignment (Qt::Alignment)
• void setBackgroundAttributes (const BackgroundAttributes &a)
• void setBrush (uint dataset, const QBrush &brush)
• void setBrushesFromDiagram (KDChart::AbstractDiagram ∗diagram)
• void setColor (uint dataset, const QColor &color)
• void setDefaultColors ()
• void setDiagram (KDChart::AbstractDiagram ∗newDiagram)
A convenience method doing the same as replaceDiagram( newDiagram, 0 );.

• void setFrameAttributes (const FrameAttributes &a)


• void setMarkerAttributes (uint dataset, const MarkerAttributes &)
• void setNeedRebuild ()
• void setOrientation (Qt::Orientation orientation)

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


404 KD Chart 2 Class Documentation

• void setPen (uint dataset, const QPen &pen)


• void setPosition (Position position)
• void setRainbowColors ()
• void setReferenceArea (const QWidget ∗area)
Specifies the reference area for font size of title text, and for font size of the item texts, IF automatic area
detection is set.

• void setShowLines (bool legendShowLines)


• void setSpacing (uint space)
• void setSubduedColors (bool ordered=false)
• void setText (uint dataset, const QString &text)
• void setTextAttributes (const TextAttributes &a)
• void setTitleText (const QString &text)
• void setTitleTextAttributes (const TextAttributes &a)
• virtual void setVisible (bool visible)
• bool showLines () const
• uint spacing () const
• QString text (uint dataset) const
• TextAttributes textAttributes () const
• QString titleText () const
• TextAttributes titleTextAttributes () const
• virtual ∼Legend ()

Public Attributes
• Q_SIGNALS __pad0__: void destroyedLegend( Legend∗ )
• private Q_SLOTS: void emitPositionChanged()

Protected Member Functions


• virtual QRect areaGeometry () const
• QRect innerRect () const
• virtual void positionHasChanged ()

6.31.2 Constructor & Destructor Documentation

6.31.2.1 Legend::Legend (QWidget ∗ parent = 0) [explicit]

Definition at line 75 of file KDChartLegend.cpp.


References d.
Referenced by clone().

75 :
76 AbstractAreaWidget( new Private(), parent )
77 {
78 d->referenceArea = parent;
79 init();
80 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.31 KDChart::Legend Class Reference 405

6.31.2.2 Legend::Legend (KDChart::AbstractDiagram ∗ diagram, QWidget ∗ parent)


[explicit]

Definition at line 82 of file KDChartLegend.cpp.


References d, and setDiagram().

82 :
83 AbstractAreaWidget( new Private(), parent )
84 {
85 d->referenceArea = parent;
86 init();
87 setDiagram( diagram );
88 }

6.31.2.3 Legend::∼Legend () [virtual]

Definition at line 90 of file KDChartLegend.cpp.

91 {
92 emit destroyedLegend( this );
93 }

6.31.3 Member Function Documentation

6.31.3.1 void Legend::addDiagram (KDChart::AbstractDiagram ∗ newDiagram)

Add the given diagram to the legend.

Parameters:
newDiagram The diagram to add.

See also:
diagram, diagrams, removeDiagram, removeDiagrams, replaceDiagram, setDiagram

Definition at line 204 of file KDChartLegend.cpp.


References d, resetDiagram(), and setNeedRebuild().
Referenced by replaceDiagram().

205 {
206 if ( newDiagram )
207 {
208 DiagramObserver* observer = new DiagramObserver( newDiagram, this );
209
210 DiagramObserver* oldObs = d->findObserverForDiagram( newDiagram );
211 if( oldObs ){
212 delete oldObs;
213 d->observers[ d->observers.indexOf( oldObs ) ] = observer;
214 }else{
215 d->observers.append( observer );
216 }
217 connect( observer, SIGNAL( diagramDestroyed(AbstractDiagram*) ),
218 SLOT( resetDiagram(AbstractDiagram*) ));
219 connect( observer, SIGNAL( diagramDataChanged(AbstractDiagram*) ),

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


406 KD Chart 2 Class Documentation

220 SLOT( setNeedRebuild() ));


221 connect( observer, SIGNAL( diagramAttributesChanged(AbstractDiagram*) ),
222 SLOT( setNeedRebuild() ));
223 setNeedRebuild();
224 }
225 }

6.31.3.2 Qt::Alignment Legend::alignment () const

Definition at line 302 of file KDChartLegend.cpp.


References d.
Referenced by clone().

303 {
304 return d->alignment;
305 }

6.31.3.3 void AbstractAreaBase::alignToReferencePoint (const RelativePosition & position)


[inherited]

Definition at line 75 of file KDChartAbstractAreaBase.cpp.

76 {
77 Q_UNUSED( position );
78 // PENDING(kalle) FIXME
79 qWarning( "Sorry, not implemented: void AbstractAreaBase::alignToReferencePoint( const RelativePosi
80 }

6.31.3.4 QRect AbstractAreaWidget::areaGeometry () const [protected, virtual,


inherited]

Implements KDChart::AbstractAreaBase.
Definition at line 116 of file KDChartAbstractAreaWidget.cpp.
Referenced by buildLegend(), paint(), and KDChart::AbstractAreaWidget::paintAll().

117 {
118 return geometry();
119 }

6.31.3.5 BackgroundAttributes AbstractAreaBase::backgroundAttributes () const


[inherited]

Definition at line 97 of file KDChartAbstractAreaBase.cpp.


References d.

98 {
99 return d->backgroundAttributes;
100 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.31 KDChart::Legend Class Reference 407

6.31.3.6 QBrush Legend::brush (uint dataset) const

Definition at line 377 of file KDChartLegend.cpp.


References d.
Referenced by buildLegend(), and setRainbowColors().

378 {
379 if( d->brushes.find( dataset ) != d->brushes.end() )
380 return d->brushes[ dataset ];
381 else
382 return d->modelBrushes[ dataset ];
383 }

6.31.3.7 void Legend::buildLegend ()

Definition at line 582 of file KDChartLegend.cpp.


References KDChart::AbstractAreaWidget::areaGeometry(), brush(), d, KDChart::Abstract-
Diagram::datasetBrushes(), KDChart::AbstractDiagram::datasetLabels(), KDChart::Abstract-
Diagram::datasetMarkers(), KDChart::AbstractDiagram::datasetPens(), diagram(), KDChart::Text-
Attributes::isVisible(), markerAttributes(), orientation(), pen(), propertiesChanged(), referenceArea(),
KDChart::AbstractLayoutItem::setParentWidget(), showLines(), KDChart::TextLayoutItem::sizeHint(),
KDChart::MarkerLayoutItem::sizeHint(), spacing(), text(), textAttributes(), titleText(), and titleText-
Attributes().
Referenced by forceRebuild(), and paint().

583 {
584 #ifdef debug_legend_paint
585 qDebug() << "entering Legend::buildLegend()";
586 #endif
587 if( d->cachedGeometry == areaGeometry() ) {
588 #ifdef debug_legend_paint
589 qDebug() << "leaving Legend::buildLegend() with NO action (was already build)";
590 #endif
591 // Note: We do *not* need to send positionChanged here,
592 // because we send it in the resizeEvent, so layouting
593 // is done at the right time.
594 return;
595 }
596 d->cachedGeometry = areaGeometry();
597
598 #ifdef debug_legend_paint
599 qDebug() << " Legend::buildLegend() areaGeometry: " << areaGeometry();
600 #endif
601
602 Q_FOREACH( QLayoutItem* layoutItem, d->layoutItems ) {
603 d->layout->removeItem( layoutItem );
604 }
605 qDeleteAll( d->layoutItems );
606 d->layoutItems.clear();
607
608 if( orientation() == Qt::Vertical ) {
609 d->layout->setColumnStretch( 4, 1 );
610 } else {
611 d->layout->setColumnStretch( 4, 0 );
612 }
613
614 d->modelLabels.clear();
615 d->modelBrushes.clear();

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


408 KD Chart 2 Class Documentation

616 d->modelPens.clear();
617 d->modelMarkers.clear();
618 for (int i = 0; i < d->observers.size(); ++i){
619 const AbstractDiagram* diagram = d->observers.at(i)->diagram();
620 //qDebug() << "Legend::buildLegend() adding to d->modelLabels :" << diagram->datasetLabels();
621 d->modelLabels += diagram->datasetLabels();
622 d->modelBrushes += diagram->datasetBrushes();
623 d->modelPens += diagram->datasetPens();
624 d->modelMarkers += diagram->datasetMarkers();
625 }
626 Q_ASSERT( d->modelLabels.count() == d->modelBrushes.count() );
627
628 // legend caption
629 if( !titleText().isEmpty() && titleTextAttributes().isVisible() ) {
630 // PENDING(kalle) Other properties!
631 KDChart::TextLayoutItem* titleItem =
632 new KDChart::TextLayoutItem( titleText(),
633 titleTextAttributes(),
634 referenceArea(),
635 (orientation() == Qt::Vertical)
636 ? KDChartEnums::MeasureOrientationMinimum
637 : KDChartEnums::MeasureOrientationHorizontal,
638 Qt::AlignCenter );
639 titleItem->setParentWidget( this );
640
641 d->layoutItems << titleItem;
642 if( orientation() == Qt::Vertical )
643 d->layout->addItem( titleItem, 0, 0, 1, 5, Qt::AlignCenter );
644 else
645 d->layout->addItem( titleItem, 0, 0, 1, d->modelLabels.count()*4, Qt::AlignCenter );
646
647 // The line between the title and the legend items, if any.
648 if( showLines() ) {
649 KDChart::HorizontalLineLayoutItem* lineItem = new KDChart::HorizontalLineLayoutItem();
650 d->layoutItems << lineItem;
651 if( orientation() == Qt::Vertical )
652 d->layout->addItem( lineItem, 1, 0, 1, 5, Qt::AlignCenter );
653 else
654 d->layout->addItem( lineItem, 1, 0, 1, d->modelLabels.count()*4, Qt::AlignCenter );
655 }
656 }
657
658 for ( int dataset = 0; dataset < d->modelLabels.count(); dataset++ ) {
659 // Note: We may use diagram() for all of the MarkerLayoutItem instances,
660 // since all they need the diagram for is to invoke mDiagram->paintMarker()
661 KDChart::MarkerLayoutItem* markerItem = new KDChart::MarkerLayoutItem( diagram(),
662 markerAttributes( datas
663 brush( dataset ),
664 pen( dataset ),
665 Qt::AlignLeft );
666 d->layoutItems << markerItem;
667 if( orientation() == Qt::Vertical )
668 d->layout->addItem( markerItem,
669 dataset*2+2, // first row is title, second is line
670 1,
671 1, 1, Qt::AlignCenter );
672 else
673 d->layout->addItem( markerItem,
674 2, // all in row two
675 dataset*4 );
676
677 // PENDING(kalle) Other properties!
678 KDChart::TextLayoutItem* labelItem =
679 new KDChart::TextLayoutItem( text( dataset ),
680 textAttributes(),
681 referenceArea(),
682 (orientation() == Qt::Vertical)

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.31 KDChart::Legend Class Reference 409

683 ? KDChartEnums::MeasureOrientationMinimum
684 : KDChartEnums::MeasureOrientationHorizontal,
685 Qt::AlignLeft );
686 labelItem->setParentWidget( this );
687
688 d->layoutItems << labelItem;
689 if( orientation() == Qt::Vertical )
690 d->layout->addItem( labelItem,
691 dataset*2+2, // first row is title, second is line
692 3 );
693 else
694 d->layout->addItem( labelItem,
695 2, // all in row two
696 dataset*4+1 );
697
698 // horizontal lines (only in vertical mode, and not after the last item)
699 if( orientation() == Qt::Vertical && showLines() && dataset != ( d->modelLabels.count()-1 ) )
700 KDChart::HorizontalLineLayoutItem* lineItem = new KDChart::HorizontalLineLayoutItem();
701 d->layoutItems << lineItem;
702 d->layout->addItem( lineItem,
703 dataset*2+1+2,
704 0,
705 1, 5, Qt::AlignCenter );
706 }
707
708 // vertical lines (only in horizontal mode, and not after the last item)
709 if( orientation() == Qt::Horizontal && showLines() && dataset != ( d->modelLabels.count()-1 )
710 KDChart::VerticalLineLayoutItem* lineItem = new KDChart::VerticalLineLayoutItem();
711 d->layoutItems << lineItem;
712 d->layout->addItem( lineItem,
713 2, // all in row two
714 dataset*4+2,
715 1, 1, Qt::AlignCenter );
716 }
717
718 if( orientation() != Qt::Vertical ) { // Horizontal needs a spacer
719 d->layout->addItem( new QSpacerItem( spacing(), qMax( markerItem->sizeHint().height(),
720 labelItem->sizeHint().height() ) ),
721 2, // all in row two
722 dataset*4+3 );
723 }
724 }
725
726 // vertical line (only in vertical mode)
727 if( orientation() == Qt::Vertical && showLines() ) {
728 KDChart::VerticalLineLayoutItem* lineItem = new KDChart::VerticalLineLayoutItem();
729 d->layoutItems << lineItem;
730 d->layout->addItem( lineItem, 2, 2, d->modelLabels.count()*2, 1 );
731 }
732
733 // This line is absolutely necessary, otherwise: #2516.
734 d->layout->activate();
735
736 // emit propertiesChanged();
737 d->layout->activate();
738 emit propertiesChanged();
739 //emit positionChanged( this );
740 //emitPositionChanged();
741 #ifdef debug_legend_paint
742 qDebug() << "leaving Legend::buildLegend()";
743 #endif
744 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


410 KD Chart 2 Class Documentation

6.31.3.8 Legend ∗ Legend::clone () const [virtual]

Definition at line 125 of file KDChartLegend.cpp.


References alignment(), d, KDChart::AbstractAreaBase::frameAttributes(), Legend(), position(), set-
Alignment(), KDChart::AbstractAreaBase::setFrameAttributes(), setPosition(), setTextAttributes(), set-
TitleTextAttributes(), textAttributes(), and titleTextAttributes().

126 {
127 Legend* legend = new Legend( new Private( *d ), 0 );
128 legend->setTextAttributes( textAttributes() );
129 legend->setTitleTextAttributes( titleTextAttributes() );
130 legend->setFrameAttributes( frameAttributes() );
131 legend->setPosition( position() );
132 legend->setAlignment( alignment() );
133 return legend;
134 }

6.31.3.9 uint Legend::datasetCount () const

Definition at line 162 of file KDChartLegend.cpp.


References d, KDChart::AbstractDiagram::datasetBrushes(), KDChart::AbstractDiagram::datasetLabels(),
and KDChart::DiagramObserver::diagram().

163 {
164 int modelLabelsCount = 0;
165 int modelBrushesCount = 0;
166 for (int i = 0; i < d->observers.size(); ++i) {
167 DiagramObserver * obs = d->observers.at(i);
168 modelLabelsCount += obs->diagram()->datasetLabels().count();
169 modelBrushesCount += obs->diagram()->datasetBrushes().count();
170 }
171 Q_ASSERT( modelLabelsCount == modelBrushesCount );
172 return modelLabelsCount;
173 }

6.31.3.10 AbstractDiagram ∗ Legend::diagram () const

The first diagram of the legend or 0 if there was none added to the legend.

Returns:
The first diagram of the legend or 0.

See also:
diagrams, addDiagram, removeDiagram, removeDiagrams, replaceDiagram, setDiagram

Definition at line 189 of file KDChartLegend.cpp.


References d.
Referenced by buildLegend(), and paint().

190 {
191 if( d->observers.isEmpty() )
192 return 0;
193 return d->observers.first()->diagram();
194 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.31 KDChart::Legend Class Reference 411

6.31.3.11 DiagramList Legend::diagrams () const

The list of all diagrams associated with the legend.

Returns:
The list of all diagrams associated with the legend.

See also:
diagram, addDiagram, removeDiagram, removeDiagrams, replaceDiagram, setDiagram

Definition at line 196 of file KDChartLegend.cpp.


References d, and KDChart::DiagramList.

197 {
198 DiagramList list;
199 for (int i = 0; i < d->observers.size(); ++i)
200 list << d->observers.at(i)->diagram();
201 return list;
202 }

6.31.3.12 void Legend::forceRebuild () [virtual]

Reimplemented from KDChart::AbstractAreaWidget.


Definition at line 469 of file KDChartLegend.cpp.
References buildLegend(), and setNeedRebuild().
Referenced by resizeEvent().

470 {
471 #ifdef debug_legend_paint
472 qDebug() << "entering Legend::forceRebuild()";
473 #endif
474 //setSpacing(d->layout->spacing());
475 setNeedRebuild();
476 buildLegend();
477 #ifdef debug_legend_paint
478 qDebug() << "leaving Legend::forceRebuild()";
479 #endif
480 }

6.31.3.13 FrameAttributes AbstractAreaBase::frameAttributes () const [inherited]

Definition at line 87 of file KDChartAbstractAreaBase.cpp.


References d.
Referenced by clone().

88 {
89 return d->frameAttributes;
90 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


412 KD Chart 2 Class Documentation

6.31.3.14 QRect AbstractAreaBase::innerRect () const [protected, inherited]

Definition at line 175 of file KDChartAbstractAreaBase.cpp.


References KDChart::AbstractAreaBase::areaGeometry(), and d.
Referenced by KDChart::TextArea::paintAll(), KDChart::AbstractAreaWidget::paintAll(), and
KDChart::AbstractArea::paintAll().

176 {
177 Q_ASSERT_X ( d != 0, "AbstractAreaBase::innerRect()",
178 "Private class was not initialized!" );
179
180 const int padding
181 = d->frameAttributes.isVisible()
182 ? qMax( d->frameAttributes.padding(), 0 ) : 0;
183 return
184 QRect( QPoint(0,0), areaGeometry().size() )
185 .adjusted( padding, padding, -padding, -padding );
186 }

6.31.3.15 MarkerAttributes Legend::markerAttributes (uint dataset) const

Definition at line 424 of file KDChartLegend.cpp.


References d.
Referenced by buildLegend().

425 {
426 if( d->markerAttributes.find( dataset ) != d->markerAttributes.end() )
427 return d->markerAttributes[ dataset ];
428 else if ( static_cast<uint>( d->modelMarkers.count() ) > dataset )
429 return d->modelMarkers[ dataset ];
430 return MarkerAttributes();
431 }

6.31.3.16 Qt::Orientation Legend::orientation () const

Definition at line 315 of file KDChartLegend.cpp.


References d.
Referenced by buildLegend().

316 {
317 return d->orientation;
318 }

6.31.3.17 void Legend::paint (QPainter ∗ painter) [virtual]

Overwrite this to paint the inner contents of your widget.

Note:
When overriding this method, please let your widget draw itself at the top/left corner of the painter.
You should call rect() (or width(), height(), resp.) to find the drawable area’s size: While the paint()
method is being executed the frame of the widget is outside of its rect(), so you can use all of rect() for
your custom drawing!

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.31 KDChart::Legend Class Reference 413

See also:
paint, paintIntoRect

Implements KDChart::AbstractAreaWidget.
Definition at line 137 of file KDChartLegend.cpp.
References KDChart::AbstractAreaWidget::areaGeometry(), buildLegend(), d, diagram(), and
KDChart::AbstractLayoutItem::paint().

138 {
139 #ifdef debug_legend_paint
140 qDebug() << "entering Legend::paint( QPainter* painter )";
141 #endif
142 // rule: We do not show a legend, if there is no diagram.
143 if( ! diagram() ) return;
144 #ifdef debug_legend_paint
145 qDebug() << " Legend::paint() areaGeometry: " << areaGeometry();
146 #endif
147
148 // re-calculate/adjust the Legend’s internal layout and contents, if needed:
149 buildLegend();
150
151 // PENDING(kalle) Support palette
152
153 Q_FOREACH( KDChart::AbstractLayoutItem* layoutItem, d->layoutItems ) {
154 layoutItem->paint( painter );
155 }
156 #ifdef debug_legend_paint
157 qDebug() << "leaving Legend::paint( QPainter* painter )";
158 #endif
159 }

6.31.3.18 void AbstractAreaWidget::paintAll (QPainter & painter) [inherited]

Call paintAll, if you want the background and the frame to be drawn before the normal paint() is invoked
automatically.
Definition at line 89 of file KDChartAbstractAreaWidget.cpp.
References KDChart::AbstractAreaWidget::areaGeometry(), KDChart::AbstractAreaBase::inner-
Rect(), KDChart::AbstractAreaWidget::paint(), KDChart::AbstractAreaBase::paintBackground(), and
KDChart::AbstractAreaBase::paintFrame().
Referenced by KDChart::AbstractAreaWidget::paintEvent(), and KDChart::AbstractAreaWidget::paint-
IntoRect().

90 {
91 //qDebug() << "AbstractAreaWidget::paintAll() called";
92 // Paint the background and frame
93 paintBackground( painter, rect() );
94 paintFrame( painter, rect().adjusted(0,0,-1,-1) );
95
96 // adjust the widget’s content margins,
97 // to be sure all content gets calculated
98 // to fit into the inner rectangle
99 const QRect oldGeometry( areaGeometry() );
100 const QRect inner( innerRect() );
101 //qDebug() << "areaGeometry():" << oldGeometry
102 // << " contentsRect():" << contentsRect() << " inner:" << inner;
103 if( contentsRect() != inner ){
104 //qDebug() << "old contentsRect():" << contentsRect() << " new innerRect:" << inner;

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


414 KD Chart 2 Class Documentation

105 setContentsMargins(
106 inner.left(),
107 inner.top(),
108 oldGeometry.width() -inner.width()-1,
109 oldGeometry.height()-inner.height()-1 );
110 //forceRebuild();
111 }
112 paint( &painter );
113 //qDebug() << "AbstractAreaWidget::paintAll() done.";
114 }

6.31.3.19 void AbstractAreaBase::paintBackground (QPainter & painter, const QRect &


rectangle) [virtual, inherited]

Definition at line 103 of file KDChartAbstractAreaBase.cpp.


References attributes, and d.
Referenced by KDChart::TextArea::paintAll(), KDChart::AbstractAreaWidget::paintAll(), and
KDChart::AbstractArea::paintAll().

104 {
105 Q_ASSERT_X ( d != 0, "AbstractAreaBase::paintBackground()",
106 "Private class was not initialized!" );
107
108 #define attributes d->backgroundAttributes
109
110 if( !attributes.isVisible() ) return;
111
112 /* first draw the brush (may contain a pixmap)*/
113 if( Qt::NoBrush != attributes.brush().style() ) {
114 KDChart::PainterSaver painterSaver( &painter );
115 painter.setPen( Qt::NoPen );
116 const QPointF newTopLeft( painter.deviceMatrix().map( rect.topLeft() ) );
117 painter.setBrushOrigin( newTopLeft );
118 painter.setBrush( attributes.brush() );
119 painter.drawRect( rect );
120 }
121 /* next draw the backPixmap over the brush */
122 if( !attributes.pixmap().isNull() &&
123 attributes.pixmapMode() != BackgroundAttributes::BackgroundPixmapModeNone ) {
124 QPointF ol = rect.topLeft();
125 if( BackgroundAttributes::BackgroundPixmapModeCentered == attributes.pixmapMode() )
126 {
127 ol.setX( rect.center().x() - attributes.pixmap().width() / 2 );
128 ol.setY( rect.center().y() - attributes.pixmap().height()/ 2 );
129 painter.drawPixmap( ol, attributes.pixmap() );
130 } else {
131 QMatrix m;
132 double zW = (double)rect.width() / (double)attributes.pixmap().width();
133 double zH = (double)rect.height() / (double)attributes.pixmap().height();
134 switch( attributes.pixmapMode() ) {
135 case BackgroundAttributes::BackgroundPixmapModeScaled:
136 {
137 double z;
138 z = qMin( zW, zH );
139 m.scale( z, z );
140 }
141 break;
142 case BackgroundAttributes::BackgroundPixmapModeStretched:
143 m.scale( zW, zH );
144 break;
145 default:
146 ; // Cannot happen, previously checked

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.31 KDChart::Legend Class Reference 415

147 }
148 QPixmap pm = attributes.pixmap().transformed( m );
149 ol.setX( rect.center().x() - pm.width() / 2 );
150 ol.setY( rect.center().y() - pm.height()/ 2 );
151 painter.drawPixmap( ol, pm );
152 }
153 }
154 #undef attributes
155 }

6.31.3.20 void AbstractAreaWidget::paintEvent (QPaintEvent ∗ event) [virtual,


inherited]

Draws the background and frame, then calls paint().


In most cases there is no need to overwrite this method in a derived class, but you would overwrite paint()
instead.

See also:
paint

Definition at line 65 of file KDChartAbstractAreaWidget.cpp.


References KDChart::AbstractAreaWidget::paintAll().

66 {
67 Q_UNUSED( event );
68 QPainter painter( this );
69 paintAll( painter );
70 }

6.31.3.21 void AbstractAreaBase::paintFrame (QPainter & painter, const QRect & rectangle)
[virtual, inherited]

Definition at line 158 of file KDChartAbstractAreaBase.cpp.


References attributes, and d.
Referenced by KDChart::TextArea::paintAll(), KDChart::AbstractAreaWidget::paintAll(), and
KDChart::AbstractArea::paintAll().

159 {
160 Q_ASSERT_X ( d != 0, "AbstractAreaBase::paintFrame()",
161 "Private class was not initialized!" );
162
163 #define attributes d->frameAttributes
164
165 if( !attributes.isVisible() ) return;
166
167 const QPen oldPen( painter.pen() );
168 painter.setPen( attributes.pen() );
169 painter.drawRect( rect );
170 painter.setPen( oldPen );
171 #undef attributes
172 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


416 KD Chart 2 Class Documentation

6.31.3.22 void AbstractAreaWidget::paintIntoRect (QPainter & painter, const QRect & rect)
[virtual, inherited]

Draws the background and frame, then calls paint().


In most cases there is no need to overwrite this method in a derived class, but you would overwrite paint()
instead.
Definition at line 72 of file KDChartAbstractAreaWidget.cpp.
References KDChart::AbstractAreaWidget::paintAll().
Referenced by KDChart::Chart::paint().

73 {
74 const QRect oldGeometry( geometry() );
75 if( oldGeometry != rect )
76 setGeometry( rect );
77 painter.translate( rect.left(), rect.top() );
78 paintAll( painter );
79 painter.translate( -rect.left(), -rect.top() );
80 if( oldGeometry != rect )
81 setGeometry( oldGeometry );
82 }

6.31.3.23 QPen Legend::pen (uint dataset) const

Definition at line 408 of file KDChartLegend.cpp.


References d.
Referenced by buildLegend().

409 {
410 if( d->pens.find( dataset ) != d->pens.end() )
411 return d->pens[dataset];
412 else
413 return d->modelPens[ dataset ];
414 }

6.31.3.24 Position Legend::position () const

Definition at line 291 of file KDChartLegend.cpp.


References d.
Referenced by clone().

292 {
293 return d->position;
294 }

6.31.3.25 void AbstractAreaWidget::positionHasChanged () [protected, virtual,


inherited]

Reimplemented from KDChart::AbstractAreaBase.


Definition at line 121 of file KDChartAbstractAreaWidget.cpp.

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.31 KDChart::Legend Class Reference 417

122 {
123 emit positionChanged( this );
124 }

6.31.3.26 void KDChart::Legend::propertiesChanged ()

Emitted upon change of a property of the Legend or any of its components.


Referenced by buildLegend(), and setVisible().

6.31.3.27 const QWidget ∗ Legend::referenceArea () const

Returns the reference area, that is used for font size of title text, and for font size of the item texts, IF
automatic area detection is set.

See also:
setReferenceArea

Definition at line 183 of file KDChartLegend.cpp.


References d.
Referenced by buildLegend().

184 {
185 return (d->referenceArea ? d->referenceArea : static_cast<const QWidget*>(parent()));
186 }

6.31.3.28 void Legend::removeDiagram (KDChart::AbstractDiagram ∗ oldDiagram)

Removes the diagram from the legend’s list of diagrams.

See also:
diagram, diagrams, addDiagram, removeDiagrams, replaceDiagram, setDiagram

Definition at line 227 of file KDChartLegend.cpp.


References d, and setNeedRebuild().
Referenced by removeDiagrams(), replaceDiagram(), and resetDiagram().

228 {
229 if( oldDiagram ){
230 DiagramObserver* oldObs = d->findObserverForDiagram( oldDiagram );
231 if( oldObs ){
232 delete oldObs;
233 d->observers.removeAt( d->observers.indexOf( oldObs ) );
234 }
235 setNeedRebuild();
236 }
237 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


418 KD Chart 2 Class Documentation

6.31.3.29 void Legend::removeDiagrams ()

Removes all of the diagram from the legend’s list of diagrams.

See also:
diagram, diagrams, addDiagram, removeDiagram, replaceDiagram, setDiagram

Definition at line 239 of file KDChartLegend.cpp.


References d, and removeDiagram().

240 {
241 for (int i = 0; i < d->observers.size(); ++i)
242 removeDiagram( d->observers.at(i)->diagram() );
243 }

6.31.3.30 void Legend::replaceDiagram (KDChart::AbstractDiagram ∗ newDiagram,


KDChart::AbstractDiagram ∗ oldDiagram = 0)

Replaces the old diagram, or appends the new diagram, it there is none yet.

Parameters:
newDiagram The diagram to be used instead of the old one. If this parameter is zero, the first diagram
will just be removed.
oldDiagram The diagram to be removed by the new one. This diagram will be deleted automatically.
If the parameter is omitted, the very first diagram will be replaced. In case, there was no diagram
yet, the new diagram will just be added.

See also:
diagram, diagrams, addDiagram, removeDiagram, removeDiagrams, setDiagram

Definition at line 245 of file KDChartLegend.cpp.


References addDiagram(), d, and removeDiagram().
Referenced by setDiagram().

247 {
248 KDChart::AbstractDiagram* old = oldDiagram;
249 if( ! d->observers.isEmpty() && ! old )
250 old = d->observers.first()->diagram();
251 if( old )
252 removeDiagram( old );
253 if( newDiagram )
254 addDiagram( newDiagram );
255 }

6.31.3.31 void Legend::resetDiagram (AbstractDiagram ∗)

Definition at line 262 of file KDChartLegend.cpp.


References removeDiagram().
Referenced by addDiagram().

263 {
264 removeDiagram( oldDiagram );
265 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.31 KDChart::Legend Class Reference 419

6.31.3.32 void Legend::resetTexts ()

Removes all legend texts that might have been set by setText.
This resets the Legend to default behaviour: Texts are created automatically.
Definition at line 338 of file KDChartLegend.cpp.
References d, and setNeedRebuild().

339 {
340 if( ! d->texts.count() ) return;
341 d->texts.clear();
342 setNeedRebuild();
343 }

6.31.3.33 void Legend::resizeEvent (QResizeEvent ∗ event) [virtual]

Definition at line 573 of file KDChartLegend.cpp.


References forceRebuild().

574 {
575 #ifdef debug_legend_paint
576 qDebug() << "Legend::resizeEvent() called";
577 #endif
578 forceRebuild();
579 QTimer::singleShot(0, this, SLOT(emitPositionChanged()));
580 }

6.31.3.34 void Legend::setAlignment (Qt::Alignment)

Definition at line 296 of file KDChartLegend.cpp.


References d.
Referenced by clone().

297 {
298 d->alignment = alignment;
299 emitPositionChanged();
300 }

6.31.3.35 void AbstractAreaBase::setBackgroundAttributes (const BackgroundAttributes & a)


[inherited]

Definition at line 92 of file KDChartAbstractAreaBase.cpp.


References d.

93 {
94 d->backgroundAttributes = a;
95 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


420 KD Chart 2 Class Documentation

6.31.3.36 void Legend::setBrush (uint dataset, const QBrush & brush)

Definition at line 370 of file KDChartLegend.cpp.


References d, and setNeedRebuild().

371 {
372 if( d->brushes[ dataset ] == brush ) return;
373 d->brushes[ dataset ] = brush;
374 setNeedRebuild();
375 }

6.31.3.37 void Legend::setBrushesFromDiagram (KDChart::AbstractDiagram ∗ diagram)

Definition at line 386 of file KDChartLegend.cpp.


References d, KDChart::AbstractDiagram::datasetBrushes(), and setNeedRebuild().

387 {
388 bool bChangesDone = false;
389 QList<QBrush> datasetBrushes = diagram->datasetBrushes();
390 for( int i = 0; i < datasetBrushes.count(); i++ ){
391 if( d->brushes[ i ] != datasetBrushes[ i ] ){
392 d->brushes[ i ] = datasetBrushes[ i ];
393 bChangesDone = true;
394 }
395 }
396 if( bChangesDone )
397 setNeedRebuild();
398 }

6.31.3.38 void Legend::setColor (uint dataset, const QColor & color)

Definition at line 363 of file KDChartLegend.cpp.


References d, and setNeedRebuild().
Referenced by setDefaultColors(), setRainbowColors(), and setSubduedColors().

364 {
365 if( d->brushes[ dataset ] == color ) return;
366 d->brushes[ dataset ] = color;
367 setNeedRebuild();
368 }

6.31.3.39 void Legend::setDefaultColors ()

Definition at line 495 of file KDChartLegend.cpp.


References setColor().

496 {
497 setColor( 0, Qt::red );
498 setColor( 1, Qt::green );
499 setColor( 2, Qt::blue );
500 setColor( 3, Qt::cyan );
501 setColor( 4, Qt::magenta );

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.31 KDChart::Legend Class Reference 421

502 setColor( 5, Qt::yellow );


503 setColor( 6, Qt::darkRed );
504 setColor( 7, Qt::darkGreen );
505 setColor( 8, Qt::darkBlue );
506 setColor( 9, Qt::darkCyan );
507 setColor( 10, Qt::darkMagenta );
508 setColor( 11, Qt::darkYellow );
509 }

6.31.3.40 void Legend::setDiagram (KDChart::AbstractDiagram ∗ newDiagram)

A convenience method doing the same as replaceDiagram( newDiagram, 0 );.


Replaces the first diagram by the given diagram. If the legend’s list of diagram is empty the given diagram
is added to the list.

See also:
diagram, diagrams, addDiagram, removeDiagram, removeDiagrams, replaceDiagram

Definition at line 257 of file KDChartLegend.cpp.


References replaceDiagram().
Referenced by KDChart::Widget::addLegend(), Legend(), and KDChart::Widget::replaceLegend().

258 {
259 replaceDiagram( newDiagram );
260 }

6.31.3.41 void AbstractAreaBase::setFrameAttributes (const FrameAttributes & a)


[inherited]

Definition at line 82 of file KDChartAbstractAreaBase.cpp.


References d.
Referenced by clone().

83 {
84 d->frameAttributes = a;
85 }

6.31.3.42 void Legend::setMarkerAttributes (uint dataset, const MarkerAttributes &)

Definition at line 417 of file KDChartLegend.cpp.


References d, and setNeedRebuild().

418 {
419 if( d->markerAttributes[dataset] == markerAttributes ) return;
420 d->markerAttributes[ dataset ] = markerAttributes;
421 setNeedRebuild();
422 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


422 KD Chart 2 Class Documentation

6.31.3.43 void Legend::setNeedRebuild ()

Definition at line 273 of file KDChartLegend.cpp.


References d.
Referenced by addDiagram(), forceRebuild(), removeDiagram(), resetTexts(), setBrush(), setBrushes-
FromDiagram(), setColor(), setMarkerAttributes(), setOrientation(), setPen(), setReferenceArea(), set-
ShowLines(), setSpacing(), setText(), setTextAttributes(), setTitleText(), and setTitleTextAttributes().

274 {
275 d->cachedGeometry = QRectF();
276 }

6.31.3.44 void Legend::setOrientation (Qt::Orientation orientation)

Definition at line 307 of file KDChartLegend.cpp.


References d, and setNeedRebuild().

308 {
309 if( d->orientation == orientation ) return;
310 d->orientation = orientation;
311 setNeedRebuild();
312 emitPositionChanged();
313 }

6.31.3.45 void Legend::setPen (uint dataset, const QPen & pen)

Definition at line 401 of file KDChartLegend.cpp.


References d, and setNeedRebuild().

402 {
403 if( d->pens[dataset] == pen ) return;
404 d->pens[dataset] = pen;
405 setNeedRebuild();
406 }

6.31.3.46 void Legend::setPosition (Position position)

Definition at line 278 of file KDChartLegend.cpp.


References d.
Referenced by KDChart::Widget::addLegend(), and clone().

279 {
280 d->position = position;
281 emitPositionChanged();
282 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.31 KDChart::Legend Class Reference 423

6.31.3.47 void Legend::setRainbowColors ()

Definition at line 511 of file KDChartLegend.cpp.


References brush(), and setColor().

512 {
513 setColor( 0, QColor(255, 0,196) );
514 setColor( 1, QColor(255, 0, 96) );
515 setColor( 2, QColor(255, 128,64) );
516 setColor( 3, Qt::yellow );
517 setColor( 4, Qt::green );
518 setColor( 5, Qt::cyan );
519 setColor( 6, QColor( 96, 96,255) );
520 setColor( 7, QColor(160, 0,255) );
521 for( int i = 8; i < 16; ++i )
522 setColor( i, brush( i - 8 ).color().light() );
523 }

6.31.3.48 void Legend::setReferenceArea (const QWidget ∗ area)

Specifies the reference area for font size of title text, and for font size of the item texts, IF automatic area
detection is set.

Note:
This parameter is ignored, if the Measure given for setTitleTextAttributes (or setTextAttributes, resp.)
is not specifying automatic area detection.

If no reference area is specified, but automatic area detection is set, then the size of the legend’s parent
widget will be used.

See also:
KDChart::Measure, KDChartEnums::MeasureCalculationMode

Definition at line 176 of file KDChartLegend.cpp.


References d, and setNeedRebuild().

177 {
178 if( area == d->referenceArea ) return;
179 d->referenceArea = area;
180 setNeedRebuild();
181 }

6.31.3.49 void Legend::setShowLines (bool legendShowLines)

Definition at line 320 of file KDChartLegend.cpp.


References d, and setNeedRebuild().

321 {
322 if( d->showLines == legendShowLines ) return;
323 d->showLines = legendShowLines;
324 setNeedRebuild();
325 emitPositionChanged();
326 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


424 KD Chart 2 Class Documentation

6.31.3.50 void Legend::setSpacing (uint space)

Definition at line 482 of file KDChartLegend.cpp.


References d, and setNeedRebuild().

483 {
484 if( d->spacing == space && d->layout->spacing() == static_cast<int>(space) ) return;
485 d->spacing = space;
486 d->layout->setSpacing( space );
487 setNeedRebuild();
488 }

6.31.3.51 void Legend::setSubduedColors (bool ordered = false)

Definition at line 525 of file KDChartLegend.cpp.


References setColor().

526 {
527 static const int NUM_SUBDUEDCOLORS = 18;
528 static const QColor SUBDUEDCOLORS[ NUM_SUBDUEDCOLORS ] = {
529 QColor( 0xe0,0x7f,0x70 ),
530 QColor( 0xe2,0xa5,0x6f ),
531 QColor( 0xe0,0xc9,0x70 ),
532 QColor( 0xd1,0xe0,0x70 ),
533 QColor( 0xac,0xe0,0x70 ),
534 QColor( 0x86,0xe0,0x70 ),
535 QColor( 0x70,0xe0,0x7f ),
536 QColor( 0x70,0xe0,0xa4 ),
537 QColor( 0x70,0xe0,0xc9 ),
538 QColor( 0x70,0xd1,0xe0 ),
539 QColor( 0x70,0xac,0xe0 ),
540 QColor( 0x70,0x86,0xe0 ),
541 QColor( 0x7f,0x70,0xe0 ),
542 QColor( 0xa4,0x70,0xe0 ),
543 QColor( 0xc9,0x70,0xe0 ),
544 QColor( 0xe0,0x70,0xd1 ),
545 QColor( 0xe0,0x70,0xac ),
546 QColor( 0xe0,0x70,0x86 ),
547 };
548 if( ordered )
549 for(int i=0; i<NUM_SUBDUEDCOLORS; ++i)
550 setColor( i, SUBDUEDCOLORS[i] );
551 else{
552 setColor( 0, SUBDUEDCOLORS[ 0] );
553 setColor( 1, SUBDUEDCOLORS[ 5] );
554 setColor( 2, SUBDUEDCOLORS[10] );
555 setColor( 3, SUBDUEDCOLORS[15] );
556 setColor( 4, SUBDUEDCOLORS[ 2] );
557 setColor( 5, SUBDUEDCOLORS[ 7] );
558 setColor( 6, SUBDUEDCOLORS[12] );
559 setColor( 7, SUBDUEDCOLORS[17] );
560 setColor( 8, SUBDUEDCOLORS[ 4] );
561 setColor( 9, SUBDUEDCOLORS[ 9] );
562 setColor(10, SUBDUEDCOLORS[14] );
563 setColor(11, SUBDUEDCOLORS[ 1] );
564 setColor(12, SUBDUEDCOLORS[ 6] );
565 setColor(13, SUBDUEDCOLORS[11] );
566 setColor(14, SUBDUEDCOLORS[16] );
567 setColor(15, SUBDUEDCOLORS[ 3] );
568 setColor(16, SUBDUEDCOLORS[ 8] );
569 setColor(17, SUBDUEDCOLORS[13] );

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.31 KDChart::Legend Class Reference 425

570 }
571 }

6.31.3.52 void Legend::setText (uint dataset, const QString & text)

Definition at line 345 of file KDChartLegend.cpp.


References d, and setNeedRebuild().

346 {
347 if( d->texts[ dataset ] == text ) return;
348 d->texts[ dataset ] = text;
349 setNeedRebuild();
350 }

6.31.3.53 void Legend::setTextAttributes (const TextAttributes & a)

Definition at line 433 of file KDChartLegend.cpp.


References d, and setNeedRebuild().
Referenced by clone().

434 {
435 if( d->textAttributes == a ) return;
436 d->textAttributes = a;
437 setNeedRebuild();
438 }

6.31.3.54 void Legend::setTitleText (const QString & text)

Definition at line 445 of file KDChartLegend.cpp.


References d, and setNeedRebuild().

446 {
447 if( d->titleText == text ) return;
448 d->titleText = text;
449 setNeedRebuild();
450 }

6.31.3.55 void Legend::setTitleTextAttributes (const TextAttributes & a)

Definition at line 457 of file KDChartLegend.cpp.


References d, and setNeedRebuild().
Referenced by clone().

458 {
459 if( d->titleTextAttributes == a ) return;
460 d->titleTextAttributes = a;
461 setNeedRebuild();
462 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


426 KD Chart 2 Class Documentation

6.31.3.56 void Legend::setVisible (bool visible) [virtual]

Definition at line 267 of file KDChartLegend.cpp.


References propertiesChanged().

268 {
269 QWidget::setVisible( visible );
270 emit propertiesChanged();
271 }

6.31.3.57 bool Legend::showLines () const

Definition at line 328 of file KDChartLegend.cpp.


References d.
Referenced by buildLegend().

329 {
330 return d->showLines;
331 }

6.31.3.58 uint Legend::spacing () const

Definition at line 490 of file KDChartLegend.cpp.


References d.
Referenced by buildLegend().

491 {
492 return d->spacing;
493 }

6.31.3.59 QString Legend::text (uint dataset) const

Definition at line 352 of file KDChartLegend.cpp.


References d.
Referenced by buildLegend().

353 {
354 if( d->texts.find( dataset ) != d->texts.end() ){
355 //qDebug() << "Legend::text(" << dataset << ") returning d->texts[" << dataset << "] :" << d->
356 return d->texts[ dataset ];
357 }else{
358 //qDebug() << "Legend::text(" << dataset << ") returning d->modelLabels[" << dataset << "] :"
359 return d->modelLabels[ dataset ];
360 }
361 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.31 KDChart::Legend Class Reference 427

6.31.3.60 TextAttributes Legend::textAttributes () const

Definition at line 440 of file KDChartLegend.cpp.


References d.
Referenced by buildLegend(), and clone().

441 {
442 return d->textAttributes;
443 }

6.31.3.61 QString Legend::titleText () const

Definition at line 452 of file KDChartLegend.cpp.


References d.
Referenced by buildLegend().

453 {
454 return d->titleText;
455 }

6.31.3.62 TextAttributes Legend::titleTextAttributes () const

Definition at line 464 of file KDChartLegend.cpp.


References d.
Referenced by buildLegend(), and clone().

465 {
466 return d->titleTextAttributes;
467 }

6.31.4 Member Data Documentation

6.31.4.1 Q_SIGNALS KDChart::Legend::__pad0__

Reimplemented from KDChart::AbstractAreaWidget.


Definition at line 225 of file KDChartLegend.h.

6.31.4.2 private KDChart::Legend::Q_SLOTS

Definition at line 230 of file KDChartLegend.h.


The documentation for this class was generated from the following files:

• KDChartLegend.h
• KDChartLegend.cpp

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


428 KD Chart 2 Class Documentation

6.32 KDChart::LineAttributes Class Reference


#include <KDChartLineAttributes.h>

Public Types
• enum MissingValuesPolicy {
MissingValuesAreBridged,
MissingValuesHideSegments,
MissingValuesShownAsZero,
MissingValuesPolicyIgnored }
MissingValuesPolicy specifies how a missing value will be shown in a line diagram.

Public Member Functions


• bool displayArea () const
• LineAttributes (const LineAttributes &)
• LineAttributes ()
• MissingValuesPolicy missingValuesPolicy () const
• bool operator!= (const LineAttributes &other) const
• LineAttributes & operator= (const LineAttributes &)
• bool operator== (const LineAttributes &) const
• void setDisplayArea (bool display)
• void setMissingValuesPolicy (MissingValuesPolicy policy)
• void setTransparency (uint alpha)
• uint transparency () const
• ∼LineAttributes ()

6.32.1 Member Enumeration Documentation

6.32.1.1 enum KDChart::LineAttributes::MissingValuesPolicy

MissingValuesPolicy specifies how a missing value will be shown in a line diagram.


Missing value is assumed if the data cell contains a QVariant that can not be interpreted as a double.

• MissingValuesAreBridged the default: No markers will be shown for missing values but the
line will be bridged if there is at least one valid cell before and after the missing value(s), otherwise
the segment will be hidden.

• MissingValuesHideSegments Line segments starting with a missing value will not be shown,
and no markers will be shown for missing values, so this will look like a piece of the line is missing.

• MissingValuesShownAsZero Missing value(s) will be treated like normal zero values, and
markers will shown for them too, so there will be no visible difference between a zero value and a
missing value.

• MissingValuesPolicyIgnored (internal value, do not use)

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.32 KDChart::LineAttributes Class Reference 429

Enumeration values:
MissingValuesAreBridged
MissingValuesHideSegments
MissingValuesShownAsZero
MissingValuesPolicyIgnored

Definition at line 55 of file KDChartLineAttributes.h.

55 {
56 MissingValuesAreBridged,
57 MissingValuesHideSegments,
58 MissingValuesShownAsZero,
59 MissingValuesPolicyIgnored };

6.32.2 Constructor & Destructor Documentation

6.32.2.1 KDChart::LineAttributes::LineAttributes ()

6.32.2.2 KDChart::LineAttributes::LineAttributes (const LineAttributes &)

6.32.2.3 KDChart::LineAttributes::∼LineAttributes ()

6.32.3 Member Function Documentation

6.32.3.1 bool KDChart::LineAttributes::displayArea () const

Referenced by operator<<(), and KDChart::LineDiagram::paint().

6.32.3.2 MissingValuesPolicy KDChart::LineAttributes::missingValuesPolicy () const

Referenced by KDChart::LineDiagram::getCellValues().

6.32.3.3 bool KDChart::LineAttributes::operator!= (const LineAttributes & other) const

Definition at line 79 of file KDChartLineAttributes.h.

79 { return !operator==(other); }

6.32.3.4 LineAttributes& KDChart::LineAttributes::operator= (const LineAttributes &)

6.32.3.5 bool KDChart::LineAttributes::operator== (const LineAttributes &) const

6.32.3.6 void KDChart::LineAttributes::setDisplayArea (bool display)

6.32.3.7 void KDChart::LineAttributes::setMissingValuesPolicy (MissingValuesPolicy policy)

6.32.3.8 void KDChart::LineAttributes::setTransparency (uint alpha)

6.32.3.9 uint KDChart::LineAttributes::transparency () const

Referenced by operator<<(), and KDChart::LineDiagram::paint().

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


430 KD Chart 2 Class Documentation

The documentation for this class was generated from the following file:

• KDChartLineAttributes.h

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.33 KDChart::LineDiagram Class Reference 431

6.33 KDChart::LineDiagram Class Reference


#include <KDChartLineDiagram.h>
Inheritance diagram for KDChart::LineDiagram:Collaboration diagram for KDChart::LineDiagram:

Public Types
• enum LineType {
Normal = 0,
Stacked = 1,
Percent = 2 }

Public Member Functions


• virtual void addAxis (CartesianAxis ∗axis)
Add the axis to the diagram.

• bool allowOverlappingDataValueTexts () const


• bool antiAliasing () const
• virtual AttributesModel ∗ attributesModel () const
Returns the AttributesModel, that is used by this diagram.

• virtual KDChart::CartesianAxisList axes () const


• QBrush brush (const QModelIndex &index) const
Retrieve the brush to be used, for painting the datapoint at the given index in the model.

• QBrush brush (int dataset) const


Retrieve the brush to be used for the given dataset.

• QBrush brush () const


Retrieve the brush to be used for painting datapoints globally.

• virtual LineDiagram ∗ clone () const


• AbstractCoordinatePlane ∗ coordinatePlane () const
The coordinate plane associated with the diagram.

• const QPair< QPointF, QPointF > dataBoundaries () const


Return the bottom left and top right data point, that the diagram will display (unless the grid adjusts these
values).

• virtual void dataChanged (const QModelIndex &topLeft, const QModelIndex &bottomRight)


[reimplemented]

• QList< QBrush > datasetBrushes () const


The set of dataset brushes currently used, for use in legends, etc.

• int datasetDimension () const

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


432 KD Chart 2 Class Documentation

The dataset dimension of a diagram determines, how many value dimensions it expects each datapoint to
have.

• QStringList datasetLabels () const


The set of dataset labels currently displayed, for use in legends, etc.

• QList< MarkerAttributes > datasetMarkers () const


The set of dataset markers currently used, for use in legends, etc.

• QList< QPen > datasetPens () const


The set of dataset pens currently used, for use in legends, etc.

• DataValueAttributes dataValueAttributes (const QModelIndex &index) const


Retrieve the DataValueAttributes for the given index.

• DataValueAttributes dataValueAttributes (int column) const


Retrieve the DataValueAttributes for the given dataset.

• DataValueAttributes dataValueAttributes () const


Retrieve the DataValueAttributes speficied globally.

• virtual void doItemsLayout ()


[reimplemented]

• virtual int horizontalOffset () const


[reimplemented]

• virtual QModelIndex indexAt (const QPoint &point) const


[reimplemented]

• virtual bool isIndexHidden (const QModelIndex &index) const


[reimplemented]

• QStringList itemRowLabels () const


The set of item row labels currently displayed, for use in Abscissa axes, etc.

• virtual void layoutPlanes ()


• LineAttributes lineAttributes (const QModelIndex &index) const
• LineAttributes lineAttributes (int column) const
• LineAttributes lineAttributes () const
• LineDiagram (QWidget ∗parent=0, CartesianCoordinatePlane ∗plane=0)
• virtual QModelIndex moveCursor (CursorAction cursorAction, Qt::KeyboardModifiers modifiers)
[reimplemented]

• const int numberOfAbscissaSegments () const


• const int numberOfOrdinateSegments () const
• virtual void paintMarker (QPainter ∗painter, const MarkerAttributes &markerAttributes, const
QBrush &brush, const QPen &, const QPointF &point, const QSizeF &size)
• QPen pen (const QModelIndex &index) const
Retrieve the pen to be used, for painting the datapoint at the given index in the model.

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.33 KDChart::LineDiagram Class Reference 433

• QPen pen (int dataset) const


Retrieve the pen to be used for the given dataset.

• QPen pen () const


Retrieve the pen to be used for painting datapoints globally.

• bool percentMode () const


• virtual AbstractCartesianDiagram ∗ referenceDiagram () const
• virtual QPointF referenceDiagramOffset () const
• void resize (const QSizeF &area)
Called by the widget’s sizeEvent.

• virtual void scrollTo (const QModelIndex &index, ScrollHint hint=EnsureVisible)


[reimplemented]

• void setAllowOverlappingDataValueTexts (bool allow)


Set whether data value labels are allowed to overlap.

• void setAntiAliasing (bool enabled)


Set whether anti-aliasing is to be used while rendering this diagram.

• virtual void setAttributesModel (AttributesModel ∗model)


Associate an AttributesModel with this diagram.

• void setBrush (const QBrush &brush)


Set the brush to be used, for painting all datasets in the model.

• void setBrush (int dataset, const QBrush &brush)


Set the brush to be used, for painting the given dataset.

• void setBrush (const QModelIndex &index, const QBrush &brush)


Set the brush to be used, for painting the datapoint at the given index.

• virtual void setCoordinatePlane (AbstractCoordinatePlane ∗plane)


Set the coordinate plane associated with the diagram.

• void setDatasetDimension (int dimension)


Sets the dataset dimension of the diagram.

• void setDataValueAttributes (const DataValueAttributes &a)


Set the DataValueAttributes for all datapoints in the model.

• void setDataValueAttributes (int dataset, const DataValueAttributes &a)


Set the DataValueAttributes for the given dataset.

• void setDataValueAttributes (const QModelIndex &index, const DataValueAttributes &a)


Set the DataValueAttributes for the given index.

• void setLineAttributes (const QModelIndex &index, const LineAttributes &a)

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


434 KD Chart 2 Class Documentation

• void setLineAttributes (int column, const LineAttributes &a)


• void setLineAttributes (const LineAttributes &a)
• virtual void setModel (QAbstractItemModel ∗model)
Associate a model with the diagram.

• void setPen (const QPen &pen)


Set the pen to be used, for painting all datasets in the model.

• void setPen (int dataset, const QPen &pen)


Set the pen to be used, for painting the given dataset.

• void setPen (const QModelIndex &index, const QPen &pen)


Set the pen to be used, for painting the datapoint at the given index.

• void setPercentMode (bool percent)


• virtual void setReferenceDiagram (AbstractCartesianDiagram ∗diagram, const QPointF
&offset=QPointF())
• virtual void setRootIndex (const QModelIndex &idx)
Set the root index in the model, where the diagram starts referencing data for display.

• virtual void setSelection (const QRect &rect, QItemSelectionModel::SelectionFlags command)


[reimplemented]

• void setThreeDLineAttributes (const QModelIndex &index, const ThreeDLineAttributes &a)


• void setThreeDLineAttributes (int column, const ThreeDLineAttributes &a)
• void setThreeDLineAttributes (const ThreeDLineAttributes &a)
• void setType (const LineType type)
• virtual void takeAxis (CartesianAxis ∗axis)
Removes the axis from the diagram, without deleting it.

• ThreeDLineAttributes threeDLineAttributes (const QModelIndex &index) const


• ThreeDLineAttributes threeDLineAttributes (int column) const
• ThreeDLineAttributes threeDLineAttributes () const
• LineType type () const
• void update () const
• void useDefaultColors ()
Set the palette to be used, for painting datasets to the default palette.

• void useRainbowColors ()
Set the palette to be used, for painting datasets to the rainbow palette.

• void useSubduedColors ()
Set the palette to be used, for painting datasets to the subdued palette.

• virtual int verticalOffset () const


[reimplemented]

• virtual QRect visualRect (const QModelIndex &index) const


[reimplemented]

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.33 KDChart::LineDiagram Class Reference 435

• virtual QRegion visualRegionForSelection (const QItemSelection &selection) const


[reimplemented]

• virtual ∼LineDiagram ()

Protected Member Functions

• QModelIndex attributesModelRootIndex () const


• virtual const QPair< QPointF, QPointF > calculateDataBoundaries () const
[reimplemented]

• virtual bool checkInvariants (bool justReturnTheStatus=false) const


• QModelIndex columnToIndex (int column) const
• LineAttributes::MissingValuesPolicy getCellValues (int row, int column, double &valueX, double
&valueY) const
• void modelsChanged ()
This signal is emitted, when either the model or the AttributesModel is replaced.

• void paint (PaintContext ∗paintContext)


Draw the diagram contents to the rectangle and painter, that are passed in as part of the paint context.

• void paintDataValueText (QPainter ∗painter, const QModelIndex &index, const QPointF &pos, dou-
ble value)
• virtual void paintDataValueTexts (QPainter ∗painter)
• void paintEvent (QPaintEvent ∗)
• void paintMarker (QPainter ∗painter, const QModelIndex &index, const QPointF &pos)
• virtual void paintMarkers (QPainter ∗painter)
• void propertiesChanged ()
Emitted upon change of a property of the Diagram.

• void resizeEvent (QResizeEvent ∗)


• void setAttributesModelRootIndex (const QModelIndex &)
• void setDataBoundariesDirty () const
• virtual double threeDItemDepth (int column) const
• virtual double threeDItemDepth (const QModelIndex &index) const
• double valueForCell (int row, int column) const
Helper method, retrieving the data value (DisplayRole) for a given row and column.

• double valueForCellTesting (int row, int column, bool &bOK) const

Protected Attributes

• Q_SIGNALS __pad0__: void layoutChanged( AbstractDiagram∗ )

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


436 KD Chart 2 Class Documentation

6.33.1 Member Enumeration Documentation

6.33.1.1 enum KDChart::LineDiagram::LineType

Enumeration values:
Normal
Stacked
Percent

Definition at line 57 of file KDChartLineDiagram.h.

57 {
58 Normal = 0,
59 Stacked = 1,
60 Percent = 2
61 };

6.33.2 Constructor & Destructor Documentation

6.33.2.1 LineDiagram::LineDiagram (QWidget ∗ parent = 0, CartesianCoordinatePlane ∗ plane =


0)

Definition at line 59 of file KDChartLineDiagram.cpp.


Referenced by clone().

59 :
60 AbstractCartesianDiagram( new Private(), parent, plane )
61 {
62 init();
63 }

6.33.2.2 LineDiagram::∼LineDiagram () [virtual]

Definition at line 69 of file KDChartLineDiagram.cpp.

70 {
71 }

6.33.3 Member Function Documentation

6.33.3.1 void AbstractCartesianDiagram::addAxis (CartesianAxis ∗ axis) [virtual,


inherited]

Add the axis to the diagram.


The diagram takes ownership of the axis and will delete it.
To gain back ownership (e.g. for assigning the axis to another diagram) use the takeAxis method, before
calling addAxis on the other diagram.

See also:
takeAxis

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.33 KDChart::LineDiagram Class Reference 437

Definition at line 66 of file KDChartAbstractCartesianDiagram.cpp.


References KDChart::AbstractAxis::createObserver(), d, and KDChart::AbstractCartesian-
Diagram::layoutPlanes().

67 {
68 if ( !d->axesList.contains( axis ) ) {
69 d->axesList.append( axis );
70 axis->createObserver( this );
71 layoutPlanes();
72 }
73 }

6.33.3.2 bool AbstractDiagram::allowOverlappingDataValueTexts () const [inherited]

Returns:
Whether data value labels are allowed to overlap.

Definition at line 291 of file KDChartAbstractDiagram.cpp.


References d.

295 {

6.33.3.3 bool AbstractDiagram::antiAliasing () const [inherited]

Returns:
Whether anti-aliasing is to be used for rendering this diagram.

Definition at line 302 of file KDChartAbstractDiagram.cpp.


References d.
Referenced by paint().

306 {

6.33.3.4 AttributesModel ∗ AbstractDiagram::attributesModel () const [virtual,


inherited]

Returns the AttributesModel, that is used by this diagram.


By default each diagram owns its own AttributesModel, which should never be deleted. Only if a user-
supplied AttributesModel has been set does the pointer returned here not belong to the diagram.

Returns:
The AttributesModel associated with the diagram.

See also:
setAttributesModel

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


438 KD Chart 2 Class Documentation

Definition at line 180 of file KDChartAbstractDiagram.cpp.


References d.
Referenced by KDChart::RingDiagram::paint(), KDChart::PolarDiagram::paint(), and KDChart::Bar-
Diagram::setBarAttributes().

181 {
182 return d->attributesModel;
183 }

6.33.3.5 QModelIndex AbstractDiagram::attributesModelRootIndex () const [protected,


inherited]

returns a QModelIndex pointing into the AttributesModel that corresponds to the root index of the diagram.
Definition at line 204 of file KDChartAbstractDiagram.cpp.
References d.
Referenced by calculateDataBoundaries(), KDChart::BarDiagram::calculateDataBoundaries(),
numberOfAbscissaSegments(), KDChart::BarDiagram::numberOfAbscissaSegments(), numberOf-
OrdinateSegments(), KDChart::BarDiagram::numberOfOrdinateSegments(), paint(), KDChart::Bar-
Diagram::paint(), and KDChart::AbstractDiagram::valueForCell().

210 {

6.33.3.6 KDChart::CartesianAxisList AbstractCartesianDiagram::axes () const [virtual,


inherited]

Definition at line 85 of file KDChartAbstractCartesianDiagram.cpp.


References KDChart::CartesianAxisList, and d.

86 {
87 return d->axesList;
88 }

6.33.3.7 QBrush AbstractDiagram::brush (const QModelIndex & index) const [inherited]

Retrieve the brush to be used, for painting the datapoint at the given index in the model.

Parameters:
index The index of the datapoint in the model.

Returns:
The brush to use for painting.

Definition at line 632 of file KDChartAbstractDiagram.cpp.

638 :
QRect AbstractDiagram::visualRect(const QModelIndex &) const

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.33 KDChart::LineDiagram Class Reference 439

6.33.3.8 QBrush AbstractDiagram::brush (int dataset) const [inherited]

Retrieve the brush to be used for the given dataset.


This will fall back automatically to what was set at model level, if there are no dataset specific settings.

Parameters:
dataset The dataset to retrieve the brush for.

Returns:
The brush to use for painting.

Definition at line 624 of file KDChartAbstractDiagram.cpp.

631 {

6.33.3.9 QBrush AbstractDiagram::brush () const [inherited]

Retrieve the brush to be used for painting datapoints globally.


This will fall back automatically to the default settings, if there are no specific settings.

Returns:
The brush to use for painting.

Definition at line 618 of file KDChartAbstractDiagram.cpp.


Referenced by KDChart::PieDiagram::paint(), and KDChart::AbstractDiagram::paintMarker().

623 {

6.33.3.10 const QPair< QPointF, QPointF > LineDiagram::calculateDataBoundaries () const


[protected, virtual]

[reimplemented]
Implements KDChart::AbstractDiagram.
Definition at line 229 of file KDChartLineDiagram.cpp.
References KDChart::AbstractDiagram::attributesModelRootIndex(), KDChart::AbstractDiagram::check-
Invariants(), d, KDChart::AbstractDiagram::datasetDimension(), type(), and valueForCellTesting().

230 {
231 if ( !checkInvariants( true ) ) return QPair<QPointF, QPointF>( QPointF( 0, 0 ), QPointF( 0, 0 ) )
232
233 const int rowCount = d->attributesModel->rowCount(attributesModelRootIndex());
234 const int colCount = d->attributesModel->columnCount(attributesModelRootIndex());
235 double xMin = 0;
236 double xMax = rowCount -1;
237 double yMin = 0, yMax = 0;
238 bool bStarting = true;
239 bool bOK;
240
241 // calculate boundaries for different line types Normal - Stacked - Percent - Default Normal
242 switch ( type() ){

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


440 KD Chart 2 Class Documentation

243 case LineDiagram::Normal:


244 {
245 for( int i = datasetDimension()-1; i < colCount; i += datasetDimension() ) {
246 for ( int j=0; j< rowCount; ++j ) {
247 const double value = valueForCellTesting( j, i, bOK );
248 double xvalue;
249 if( datasetDimension() > 1 && bOK )
250 xvalue = valueForCellTesting( j, i-1, bOK );
251 if( bOK ){
252 if( bStarting ){
253 yMin = value;
254 yMax = value;
255 }else{
256 yMin = qMin( yMin, value );
257 yMax = qMax( yMax, value );
258 }
259 if ( datasetDimension() > 1 ) {
260 if( bStarting ){
261 xMin = xvalue;
262 xMax = xvalue;
263 }else{
264 xMin = qMin( xMin, xvalue );
265 xMax = qMax( xMax, xvalue );
266 }
267 }
268 bStarting = false;
269 }
270 }
271 }
272
273 if( yMin > 0 && yMax / yMin >= 2.0 )
274 yMin = 0;
275 else if( yMax < 0 && yMax / yMin <= 0.5 )
276 yMax = 0;
277 }
278 break;
279 case LineDiagram::Stacked:
280 {
281 double tmpValue = 0;
282
283 for ( int j=0; j< rowCount; ++j ) {
284 // calculate sum of values per column - Find out stacked Min/Max
285 double stackedValues = 0;
286 for( int i = datasetDimension()-1; i < colCount; i += datasetDimension() ) {
287 const double value = valueForCellTesting( j, i, bOK );
288 if( bOK )
289 stackedValues += value;
290 }
291 if( bStarting ){
292 yMin = stackedValues;
293 yMax = stackedValues;
294 }else{
295 // Pending Michel:
296 // I am taking in account all values negatives or positives
297 // take in account all stacked values
298 yMin = qMin( qMin( yMin, tmpValue ), stackedValues );
299 yMax = qMax( yMax, stackedValues );
300 }
301 bStarting = false;
302 }
303 }
304 break;
305 case LineDiagram::Percent:
306 {
307 for( int i = datasetDimension()-1; i < colCount; i += datasetDimension() ) {
308 for ( int j=0; j< rowCount; ++j ) {
309 // Ordinate should begin at 0 the max value being the 100% pos

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.33 KDChart::LineDiagram Class Reference 441

310 const double value = valueForCellTesting( j, i, bOK );


311 if( bOK ){
312 if( bStarting )
313 yMax = value;
314 else
315 yMax = qMax( yMax, value );
316 bStarting = false;
317 }
318 }
319 }
320 }
321 break;
322 default:
323 Q_ASSERT_X ( false, "calculateDataBoundaries()",
324 "Type item does not match a defined line chart Type." );
325 }
326
327 QPointF bottomLeft ( QPointF( xMin, yMin ) );
328 QPointF topRight ( QPointF( xMax, yMax ) );
329
330 //FIXME(khz): Verify, if this code is right: We are taking
331 // ThreeDBarAttributes that might have been set
332 // at a header (using the setter that takes a column as parameter),
333 // but we are ignoring ’any’ ThreeDBarAttributes, that might have
334 // been specified for an individual cell.
335 // see: BarDiagram::calculateDataBoundaries ()
336 //
337 //Pending Michel: We don’t need that any more with the new Grid Painting
338 //I am commenting the code temporarely - will clean up after testing more
339 //accurately.
340 /*
341 bool threeDBoundaries = false;
342 for ( int i=0; i<colCount; ++i ) {
343 QModelIndex index = model()->index( 0, i, rootIndex() );
344 const ThreeDLineAttributes tda( threeDLineAttributes( index ) );
345 if ( tda.isEnabled() ) {
346 threeDBoundaries = true;
347 QPointF projLeft ( project(QPointF( xMin, 0.0 ), QPointF( xMin, 0.0 ), tda.depth()/10 , index )
348 QPointF projRight( project(QPointF( xMax, yMax ), QPointF( xMax, yMax), tda.depth()/10, index )
349 projRight.x() > topRight.x() ? topRightThreeD.setX( projRight.x() ):
350 topRightThreeD.setX( topRight.x() );
351 projRight.y() > topRight.y() ? topRightThreeD.setY( projRight.y() ):
352 topRightThreeD.setY( topRight.y() );
353 projLeft.x() > bottomLeft.x() ? bottomLeftThreeD.setX( bottomLeft.x() ):
354 bottomLeftThreeD.setX( projLeft.x() );
355 projLeft.y() > bottomLeft.y() ? bottomLeftThreeD.setY( bottomLeft.y() ):
356 bottomLeftThreeD.setY( projLeft.y() );
357 }
358 }
359
360 return threeDBoundaries ? QPair<QPointF, QPointF> ( bottomLeftThreeD , topRightThreeD ):
361 QPair<QPointF, QPointF> ( bottomLeft, topRight );
362 */
363 return QPair<QPointF, QPointF> ( bottomLeft, topRight );
364 }

6.33.3.11 bool AbstractDiagram::checkInvariants (bool justReturnTheStatus = false) const


[protected, virtual, inherited]

Definition at line 746 of file KDChartAbstractDiagram.cpp.


References KDChart::AbstractDiagram::coordinatePlane().
Referenced by KDChart::RingDiagram::calculateDataBoundaries(), KDChart::PolarDiagram::calculate-
DataBoundaries(), KDChart::PieDiagram::calculateDataBoundaries(), calculateDataBoundaries(),

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


442 KD Chart 2 Class Documentation

KDChart::BarDiagram::calculateDataBoundaries(), KDChart::RingDiagram::paint(), KDChart::Polar-


Diagram::paint(), KDChart::PieDiagram::paint(), paint(), KDChart::BarDiagram::paint(), and
KDChart::AbstractDiagram::paintMarker().

746 {
747 Q_ASSERT_X ( model(), "AbstractDiagram::checkInvariants()",
748 "There is no usable model set, for the diagram." );
749
750 Q_ASSERT_X ( coordinatePlane(), "AbstractDiagram::checkInvariants()",
751 "There is no usable coordinate plane set, for the diagram." );
752 }
753 return model() && coordinatePlane();
754 }
755
756 int AbstractDiagram::datasetDimension( ) const

6.33.3.12 LineDiagram ∗ LineDiagram::clone () const [virtual]

Definition at line 73 of file KDChartLineDiagram.cpp.


References d, and LineDiagram().

74 {
75 return new LineDiagram( new Private( *d ) );
76 }

6.33.3.13 QModelIndex AbstractDiagram::columnToIndex (int column) const [protected,


inherited]

Definition at line 211 of file KDChartAbstractDiagram.cpp.

217 {

6.33.3.14 AbstractCoordinatePlane ∗ AbstractDiagram::coordinatePlane () const


[inherited]

The coordinate plane associated with the diagram.


This determines how coordinates in value space are mapped into pixel space. By default this is a Cartesian-
CoordinatePlane.
Returns:
The coordinate plane associated with the diagram.

Definition at line 125 of file KDChartAbstractDiagram.cpp.


References d.
Referenced by KDChart::BarDiagram::calculateDataBoundaries(), KDChart::AbstractDiagram::check-
Invariants(), KDChart::AbstractCartesianDiagram::layoutPlanes(), KDChart::PolarDiagram::paint(),
paint(), KDChart::BarDiagram::paint(), KDChart::AbstractPolarDiagram::polarCoordinatePlane(), and
KDChart::AbstractCartesianDiagram::setCoordinatePlane().

126 {
127 return d->plane;
128 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.33 KDChart::LineDiagram Class Reference 443

6.33.3.15 const QPair< QPointF, QPointF > AbstractDiagram::dataBoundaries () const


[inherited]

Return the bottom left and top right data point, that the diagram will display (unless the grid adjusts these
values).
This method returns a chached result of calculations done by calculateDataBoundaries. Classes derived
from AbstractDiagram must implement the calculateDataBoundaries function, to specify their own way of
calculating the data boundaries. If derived classes want to force recalculation of the data boundaries, they
can call setDataBoundariesDirty()
Returned value is in diagram coordinates.
Definition at line 130 of file KDChartAbstractDiagram.cpp.
References KDChart::AbstractDiagram::calculateDataBoundaries(), and d.
Referenced by KDChart::CartesianCoordinatePlane::calculateRawDataBoundingRect(), KDChart::Polar-
CoordinatePlane::layoutDiagrams(), paint(), and KDChart::BarDiagram::paint().

131 {
132 if( d->databoundariesDirty ){
133 d->databoundaries = calculateDataBoundaries ();
134 d->databoundariesDirty = false;
135 }
136 return d->databoundaries;
137 }

6.33.3.16 void AbstractDiagram::dataChanged (const QModelIndex & topLeft, const


QModelIndex & bottomRight) [virtual, inherited]

[reimplemented]
Definition at line 232 of file KDChartAbstractDiagram.cpp.
References d.

232 {
233 // We are still too dumb to do intelligent updates...
234 d->databoundariesDirty = true;
235 scheduleDelayedItemsLayout();
236 }
237
238 void AbstractDiagram::setDataValueAttributes( const QModelIndex & index,

6.33.3.17 QList< QBrush > AbstractDiagram::datasetBrushes () const [inherited]

The set of dataset brushes currently used, for use in legends, etc.

Note:
Cell-level override brushes, if set, take precedence over the dataset values, so you might need to check
these too, in order to find the brush, that is used for a single cell.

Returns:
The current set of dataset brushes.

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


444 KD Chart 2 Class Documentation

Definition at line 710 of file KDChartAbstractDiagram.cpp.


Referenced by KDChart::Legend::buildLegend(), KDChart::Legend::datasetCount(), and
KDChart::Legend::setBrushesFromDiagram().

712 {
713 QBrush brush = qVariantValue<QBrush>( attributesModel()->headerData( i, Qt::Vertical, DatasetB
714 ret << brush;
715 }
716
717 return ret;
718 }
719
720 QList<QPen> AbstractDiagram::datasetPens() const

6.33.3.18 int AbstractDiagram::datasetDimension () const [inherited]

The dataset dimension of a diagram determines, how many value dimensions it expects each datapoint to
have.
For each dimension it will expect one column of values in the model. If the dimensionality is 1, automatic
values will be used for the abscissa.
For example a diagram with the default dimension of 1, will have one column per datapoint (the y values)
and will use automatic values for the x axis (1, 2, 3, ... n). If the dimension is 2, the diagram will use the
first, (and the third, fifth, etc) columns as X values, and the second, (and the fourth, sixth, etc) column as Y
values.

Returns:
The dataset dimension of the diagram.

Definition at line 758 of file KDChartAbstractDiagram.cpp.


References d.
Referenced by calculateDataBoundaries(), getCellValues(), KDChart::CartesianCoordinatePlane::getData-
DimensionsList(), paint(), and setType().

762 {

6.33.3.19 QStringList AbstractDiagram::datasetLabels () const [inherited]

The set of dataset labels currently displayed, for use in legends, etc.

Returns:
The set of dataset labels currently displayed.

Definition at line 698 of file KDChartAbstractDiagram.cpp.


Referenced by KDChart::Legend::buildLegend(), and KDChart::Legend::datasetCount().

699 : " << attributesModel()->columnCount(attributesModel


700 const int columnCount = attributesModel()->columnCount(attributesModelRootIndex());
701 for( int i = datasetDimension()-1; i < columnCount; i += datasetDimension() ){
702 //qDebug() << "label: " << attributesModel()->headerData( i, Qt::Horizontal, Qt::DisplayRole )
703 ret << attributesModel()->headerData( i, Qt::Horizontal, Qt::DisplayRole ).toString();

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.33 KDChart::LineDiagram Class Reference 445

704 }
705 return ret;
706 }
707
708 QList<QBrush> AbstractDiagram::datasetBrushes() const

6.33.3.20 QList< MarkerAttributes > AbstractDiagram::datasetMarkers () const


[inherited]

The set of dataset markers currently used, for use in legends, etc.

Note:
Cell-level override markers, if set, take precedence over the dataset values, so you might need to check
these too, in order to find the marker, that is shown for a single cell.

Returns:
The current set of dataset brushes.

Definition at line 733 of file KDChartAbstractDiagram.cpp.


Referenced by KDChart::Legend::buildLegend().

735 {
736 DataValueAttributes a =
737 qVariantValue<DataValueAttributes>( attributesModel()->headerData( i, Qt::Vertical, DataVa
738 const MarkerAttributes &ma = a.markerAttributes();
739 ret << ma;
740 }
741 return ret;
742 }
743
744 bool AbstractDiagram::checkInvariants( bool justReturnTheStatus ) const

6.33.3.21 QList< QPen > AbstractDiagram::datasetPens () const [inherited]

The set of dataset pens currently used, for use in legends, etc.

Note:
Cell-level override pens, if set, take precedence over the dataset values, so you might need to check
these too, in order to find the pens, that is used for a single cell.

Returns:
The current set of dataset pens.

Definition at line 722 of file KDChartAbstractDiagram.cpp.


Referenced by KDChart::Legend::buildLegend().

724 {
725 QPen pen = qVariantValue<QPen>( attributesModel()->headerData( i, Qt::Vertical, DatasetPenRole
726 ret << pen;
727 }
728 return ret;
729 }
730
731 QList<MarkerAttributes> AbstractDiagram::datasetMarkers() const

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


446 KD Chart 2 Class Documentation

6.33.3.22 DataValueAttributes AbstractDiagram::dataValueAttributes (const QModelIndex &


index) const [inherited]

Retrieve the DataValueAttributes for the given index.


This will fall back automatically to what was set at dataset or model level, if there are no datapoint specific
settings.

Parameters:
index The datapoint to retrieve the attributes for.

Returns:
The DataValueAttributes for the given index.

Definition at line 272 of file KDChartAbstractDiagram.cpp.

278 {

6.33.3.23 DataValueAttributes AbstractDiagram::dataValueAttributes (int column) const


[inherited]

Retrieve the DataValueAttributes for the given dataset.


This will fall back automatically to what was set at model level, if there are no dataset specific settings.

Parameters:
dataset The dataset to retrieve the attributes for.

Returns:
The DataValueAttributes for the given dataset.

Definition at line 265 of file KDChartAbstractDiagram.cpp.

271 {

6.33.3.24 DataValueAttributes AbstractDiagram::dataValueAttributes () const [inherited]

Retrieve the DataValueAttributes speficied globally.


This will fall back automatically to the default settings, if there are no specific settings.

Returns:
The global DataValueAttributes.

Definition at line 260 of file KDChartAbstractDiagram.cpp.


Referenced by KDChart::AbstractDiagram::paintDataValueText(), and KDChart::AbstractDiagram::paint-
Marker().

264 {

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.33 KDChart::LineDiagram Class Reference 447

6.33.3.25 void AbstractDiagram::doItemsLayout () [virtual, inherited]

[reimplemented]
Definition at line 223 of file KDChartAbstractDiagram.cpp.
References d, and KDChart::AbstractDiagram::update().

223 {
224 d->plane->layoutDiagrams();
225 update();
226 }
227 QAbstractItemView::doItemsLayout();
228 }
229
230 void AbstractDiagram::dataChanged( const QModelIndex &topLeft,

6.33.3.26 LineAttributes::MissingValuesPolicy LineDiagram::getCellValues (int row, int column,


double & valueX, double & valueY) const [protected]

Definition at line 392 of file KDChartLineDiagram.cpp.


References KDChart::AbstractDiagram::datasetDimension(), lineAttributes(), KDChart::Line-
Attributes::missingValuesPolicy(), and valueForCellTesting().
Referenced by paint().

395 {
396 LineAttributes::MissingValuesPolicy policy;
397
398 bool bOK = true;
399 valueX = ( datasetDimension() > 1 && column > 0 )
400 ? valueForCellTesting(row, column-1, bOK)
401 : row;
402 if( bOK )
403 valueY = valueForCellTesting(row, column, bOK);
404 if( bOK ){
405 policy = LineAttributes::MissingValuesPolicyIgnored;
406 }else{
407 // missing value: find out the policy
408 QModelIndex index = model()->index( row, column, rootIndex() );
409 LineAttributes la = lineAttributes( index );
410 policy = la.missingValuesPolicy();
411 }
412 return policy;
413 }

6.33.3.27 int AbstractDiagram::horizontalOffset () const [virtual, inherited]

[reimplemented]
Definition at line 655 of file KDChartAbstractDiagram.cpp.

657 { return 0; }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


448 KD Chart 2 Class Documentation

6.33.3.28 QModelIndex AbstractDiagram::indexAt (const QPoint & point) const [virtual,


inherited]

[reimplemented]
Definition at line 649 of file KDChartAbstractDiagram.cpp.

651 { return QModelIndex(); }

6.33.3.29 bool AbstractDiagram::isIndexHidden (const QModelIndex & index) const


[virtual, inherited]

[reimplemented]
Definition at line 661 of file KDChartAbstractDiagram.cpp.

663 {}

6.33.3.30 QStringList AbstractDiagram::itemRowLabels () const [inherited]

The set of item row labels currently displayed, for use in Abscissa axes, etc.

Returns:
The set of item row labels currently displayed.

Definition at line 686 of file KDChartAbstractDiagram.cpp.

687 : " << attributesModel()->rowCount(attributesModelRoo


688 const int rowCount = attributesModel()->rowCount(attributesModelRootIndex());
689 for( int i = 0; i < rowCount; ++i ){
690 //qDebug() << "label: " << attributesModel()->headerData( i, Qt::Vertical, Qt::DisplayRole ).t
691 ret << attributesModel()->headerData( i, Qt::Vertical, Qt::DisplayRole ).toString();
692 }
693 return ret;
694 }
695
696 QStringList AbstractDiagram::datasetLabels() const

6.33.3.31 void KDChart::AbstractCartesianDiagram::layoutPlanes () [virtual,


inherited]

Definition at line 90 of file KDChartAbstractCartesianDiagram.cpp.


References KDChart::AbstractDiagram::coordinatePlane(), and KDChart::AbstractCoordinate-
Plane::layoutPlanes().
Referenced by KDChart::AbstractCartesianDiagram::addAxis(), and KDChart::AbstractCartesian-
Diagram::takeAxis().

91 {
92 //qDebug() << "KDChart::AbstractCartesianDiagram::layoutPlanes()";
93 AbstractCoordinatePlane* plane = coordinatePlane();
94 if( plane ){
95 plane->layoutPlanes();
96 //qDebug() << "KDChart::AbstractCartesianDiagram::layoutPlanes() OK";
97 }
98 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.33 KDChart::LineDiagram Class Reference 449

6.33.3.32 LineAttributes LineDiagram::lineAttributes (const QModelIndex & index) const

Definition at line 144 of file KDChartLineDiagram.cpp.


References d.

146 {
147 return qVariantValue<LineAttributes>(
148 d->attributesModel->data(
149 d->attributesModel->mapFromSource(index),
150 KDChart::LineAttributesRole ) );
151 }

6.33.3.33 LineAttributes LineDiagram::lineAttributes (int column) const

Definition at line 136 of file KDChartLineDiagram.cpp.


References d.

137 {
138 return qVariantValue<LineAttributes>(
139 d->attributesModel->data(
140 d->attributesModel->mapFromSource( columnToIndex( column ) ),
141 KDChart::LineAttributesRole ) );
142 }

6.33.3.34 LineAttributes LineDiagram::lineAttributes () const

Definition at line 130 of file KDChartLineDiagram.cpp.


References d.
Referenced by getCellValues(), and paint().

131 {
132 return qVariantValue<LineAttributes>(
133 d->attributesModel->data( KDChart::LineAttributesRole ) );
134 }

6.33.3.35 void KDChart::AbstractDiagram::modelsChanged () [protected, inherited]

This signal is emitted, when either the model or the AttributesModel is replaced.
Referenced by KDChart::AbstractDiagram::setAttributesModel(), and KDChart::AbstractDiagram::set-
Model().

6.33.3.36 QModelIndex AbstractDiagram::moveCursor (CursorAction cursorAction,


Qt::KeyboardModifiers modifiers) [virtual, inherited]

[reimplemented]
Definition at line 652 of file KDChartAbstractDiagram.cpp.

654 { return 0; }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


450 KD Chart 2 Class Documentation

6.33.3.37 const int LineDiagram::numberOfAbscissaSegments () const [virtual]

Implements KDChart::AbstractCartesianDiagram.
Definition at line 711 of file KDChartLineDiagram.cpp.
References KDChart::AbstractDiagram::attributesModelRootIndex(), and d.

712 {
713 return d->attributesModel->rowCount(attributesModelRootIndex());
714 }

6.33.3.38 const int LineDiagram::numberOfOrdinateSegments () const [virtual]

Implements KDChart::AbstractCartesianDiagram.
Definition at line 716 of file KDChartLineDiagram.cpp.
References KDChart::AbstractDiagram::attributesModelRootIndex(), and d.

717 {
718 return d->attributesModel->columnCount(attributesModelRootIndex());
719 }

6.33.3.39 void LineDiagram::paint (PaintContext ∗ paintContext) [protected, virtual]

Draw the diagram contents to the rectangle and painter, that are passed in as part of the paint context.

Parameters:
paintContext All information needed for painting.

Implements KDChart::AbstractDiagram.
Definition at line 420 of file KDChartLineDiagram.cpp.
References KDChart::AbstractDiagram::antiAliasing(), KDChart::AbstractDiagram::attributes-
ModelRootIndex(), KDChart::AbstractDiagram::checkInvariants(), KDChart::Abstract-
Diagram::coordinatePlane(), d, KDChart::AbstractDiagram::dataBoundaries(), KDChart::Abstract-
Diagram::datasetDimension(), KDChart::LineAttributes::displayArea(), getCellValues(), line-
Attributes(), KDChart::AbstractDiagram::paintDataValueText(), KDChart::PaintContext::painter(),
KDChart::AbstractDiagram::paintMarker(), KDChart::AbstractCoordinatePlane::translate(),
KDChart::LineAttributes::transparency(), type(), and KDChart::AbstractDiagram::valueForCell().
Referenced by paintEvent().

421 {
422 //qDebug() << " start diag::paint()";
423 if ( !checkInvariants( true ) ) return;
424 if ( !AbstractGrid::isBoundariesValid(dataBoundaries()) ) return;
425
426 //QTime t = QTime::currentTime();
427
428 //calculates and stores the values
429 const int rowCount = d->attributesModel->rowCount(attributesModelRootIndex());
430 const int colCount = d->attributesModel->columnCount(attributesModelRootIndex());
431 DataValueTextInfoList list;
432 LineAttributesInfoList lineList;

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.33 KDChart::LineDiagram Class Reference 451

433 LineAttributes::MissingValuesPolicy policy;


434
435 // paint different line types Normal - Stacked - Percent - Default Normal
436 switch ( type() )
437 {
438 case LineDiagram::Normal:
439 {
440 for( int iColumn = datasetDimension()-1;
441 iColumn < colCount; iColumn += datasetDimension() ) {
442 QPolygonF area;
443 bool bValuesFound = false;
444 double lastValueX, lastValueY;
445 double valueX, valueY;
446 for ( int iRow = 0; iRow < rowCount; ++iRow ) {
447 bool skipThisCell = false;
448 // trying to find a fromPoint
449 policy = getCellValues( iRow, iColumn, valueX, valueY );
450 switch( policy ){
451 case LineAttributes::MissingValuesAreBridged:
452 if( bValuesFound ){
453 valueX = lastValueX;
454 valueY = lastValueY;
455 }else{
456 skipThisCell = true;
457 }
458 break;
459 case LineAttributes::MissingValuesHideSegments:
460 skipThisCell = true;
461 break;
462 case LineAttributes::MissingValuesShownAsZero:
463 // fall through intended
464 case LineAttributes::MissingValuesPolicyIgnored:
465 lastValueX = valueX;
466 lastValueY = valueY;
467 bValuesFound = true;
468 break;
469 }
470 if( ! skipThisCell ){
471 // trying to find a toPoint
472 double nextValueX, nextValueY;
473 bool foundToPoint = false;
474 int iNextRow = iRow+1;
475 while ( ! (foundToPoint || skipThisCell || iNextRow >= rowCount) ) {
476 policy = getCellValues( iNextRow, iColumn, nextValueX, nextValueY );
477 switch( policy ){
478 case LineAttributes::MissingValuesAreBridged:
479 // The cell has no valid value, so we make sure that
480 // this cell will not be processed by the next iteration
481 // of the iRow loop:
482 ++iRow;
483 break;
484 case LineAttributes::MissingValuesHideSegments:
485 // The cell has no valid value, so we make sure that
486 // this cell will not be processed by the next iteration
487 // of the iRow loop:
488 skipThisCell = true;
489 ++iRow;
490 break;
491 case LineAttributes::MissingValuesShownAsZero:
492 // fall through intended
493 case LineAttributes::MissingValuesPolicyIgnored:
494 foundToPoint = true;
495 break;
496 }
497 ++iNextRow;
498 }
499 if( ! skipThisCell ){

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


452 KD Chart 2 Class Documentation

500 QModelIndex index = model()->index( iRow, iColumn, rootIndex() );


501 QPointF fromPoint = coordinatePlane()->translate( QPointF( valueX, valueY
502 area.append( fromPoint );
503 if( foundToPoint ){
504 QPointF toPoint = coordinatePlane()->translate( QPointF( nextValueX, n
505 lineList.append( LineAttributesInfo( index, fromPoint, toPoint ) );
506 }
507 list.append( DataValueTextInfo( index, fromPoint, valueY ) );
508 }
509 }
510 }
511 //area can be set by column
512 QModelIndex index = model()->index( 0, iColumn, rootIndex() );
513 LineAttributes laa = lineAttributes( index );
514 if ( laa.displayArea() )
515 paintAreas( ctx, index, area, laa.transparency() );
516 }
517 }
518 break;
519 case LineDiagram::Stacked:
520 {
521 //FIXME(khz): add LineAttributes::MissingValuesPolicy support for LineDiagram::Stacked
522 for( int i = datasetDimension()-1; i < colCount; i += datasetDimension() ) {
523 QPolygonF area;
524 for ( int j = 0; j< rowCount; ++j ) {
525 QModelIndex index = model()->index( j, i, rootIndex() );
526 double stackedValues = 0, nextValues = 0;
527 for ( int k = i; k >= datasetDimension()-1 ; k -= datasetDimension() ) {
528 stackedValues += valueForCell( j, k );
529 if ( j+1 < rowCount )
530 nextValues += valueForCell( j+1, k );
531 }
532 QPointF nextPoint = coordinatePlane()->translate( QPointF( j, stackedValues ) );
533 area.append( nextPoint );
534 QPointF toPoint = coordinatePlane()->translate( QPointF( j+1, nextValues ) );
535 if ( j+1 < rowCount )
536 lineList.append( LineAttributesInfo( index, nextPoint, toPoint ) );
537 list.append( DataValueTextInfo( index, nextPoint, valueForCell( j, i ) ) );
538 }
539 QModelIndex index = model()->index( 0, i, rootIndex() );
540 LineAttributes laa = lineAttributes( index );
541 if ( laa.displayArea() )
542 paintAreas( ctx, index, area, laa.transparency() );
543 }
544 }
545 break;
546 case LineDiagram::Percent:
547 {
548 //FIXME(khz): add LineAttributes::MissingValuesPolicy support for LineDiagram::Percent
549 double maxValue = 100; // always 100%
550 double sumValues = 0;
551 QVector <double > sumValuesVector;
552
553 //calculate sum of values for each column and store
554 for ( int j=0; j<rowCount ; ++j ) {
555 for( int i = datasetDimension()-1; i < colCount; i += datasetDimension() ) {
556 double tmpValue = valueForCell( j, i );
557 if ( tmpValue > 0 )
558 sumValues += tmpValue;
559 if ( i == colCount-1 ) {
560 sumValuesVector << sumValues ;
561 sumValues = 0;
562 }
563 }
564 }
565 // calculate stacked percent value
566 for( int i = datasetDimension()-1; i < colCount; i += datasetDimension() ) {

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.33 KDChart::LineDiagram Class Reference 453

567 QPolygonF area;


568 for ( int j=0; j<rowCount ; ++j ) {
569 double stackedValues = 0, nextValues = 0;
570 QModelIndex index = model()->index( j, i, rootIndex() );
571 //calculate stacked percent value- we only take in account positives values for no
572 for ( int k = i; k >= 0 ; --k ) {
573 double val = valueForCell( j, k );
574 if ( val > 0)
575 stackedValues += val;
576 if ( j+1 < rowCount ){
577 val = valueForCell( j+1, k);
578 if ( val > 0 )
579 nextValues += val;
580 }
581 }
582 double y = 0;
583 if ( sumValuesVector.at(j) != 0 )
584 y = stackedValues/sumValuesVector.at(j) * maxValue;
585 QPointF nextPoint = coordinatePlane()->translate( QPointF( j, y ) );
586 area.append( nextPoint );
587 if ( j+1 < rowCount ) {
588 double y = 0;
589 if ( sumValuesVector.at(j+1) != 0 )
590 y = nextValues/sumValuesVector.at(j+1) * maxValue;
591 QPointF toPoint = coordinatePlane()->translate( QPointF( j+1, y ) );
592 lineList.append( LineAttributesInfo( index, nextPoint, toPoint ) );
593 }
594 list.append( DataValueTextInfo( index, nextPoint, valueForCell( j, i ) ) );
595 }
596 QModelIndex index = model()->index( 0, i, rootIndex() );
597 LineAttributes laa = lineAttributes( index );
598 if ( laa.displayArea() )
599 paintAreas( ctx, index, area, laa.transparency() );
600 }
601 break;
602 }
603 default:
604 Q_ASSERT_X ( false, "paint()",
605 "Type item does not match a defined line chart Type." );
606 }
607 // paint all lines and their attributes
608 {
609 PainterSaver painterSaver( ctx->painter() );
610 if ( antiAliasing() )
611 ctx->painter()->setRenderHint ( QPainter::Antialiasing );
612 LineAttributesInfoListIterator itline ( lineList );
613 //qDebug() << "Rendering 1 in: " << t.msecsTo( QTime::currentTime() ) << endl;
614 while ( itline.hasNext() ) {
615 const LineAttributesInfo& lineInfo = itline.next();
616 paintLines( ctx,lineInfo.index, lineInfo.value, lineInfo.nextValue );
617 }
618 }
619 // paint all data value texts and the point markers
620 {
621 PainterSaver painterSaver( ctx->painter() );
622 DataValueTextInfoListIterator it( list );
623 while ( it.hasNext() ) {
624 const DataValueTextInfo& info = it.next();
625 paintDataValueText( ctx->painter(), info.index, info.pos, info.value );
626 paintMarker( ctx->painter(), info.index, info.pos );
627 }
628 }
629 //qDebug() << "Rendering 2 in: " << t.msecsTo( QTime::currentTime() ) << endl;
630 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


454 KD Chart 2 Class Documentation

6.33.3.40 void AbstractDiagram::paintDataValueText (QPainter ∗ painter, const QModelIndex &


index, const QPointF & pos, double value) [protected, inherited]

Definition at line 318 of file KDChartAbstractDiagram.cpp.


References KDChart::DataValueAttributes::dataLabel(), KDChart::AbstractDiagram::dataValue-
Attributes(), KDChart::DataValueAttributes::decimalDigits(), KDChart::TextAttributes::font(),
KDChart::TextAttributes::isVisible(), KDChart::DataValueAttributes::isVisible(), KDChart::Text-
Attributes::pen(), KDChart::DataValueAttributes::prefix(), KDChart::TextAttributes::rotation(),
KDChart::DataValueAttributes::suffix(), and KDChart::DataValueAttributes::textAttributes().
Referenced by KDChart::RingDiagram::paint(), KDChart::PolarDiagram::paint(), paint(), and
KDChart::BarDiagram::paint().

320 {
321 // paint one data series
322 DataValueAttributes a = dataValueAttributes(index);
323 if ( !a.isVisible() ) return;
324
325 // handle decimal digits
326 int decimalDigits = a.decimalDigits();
327 int decimalPos = QString::number( value ).indexOf( QLatin1Char( ’.’ ) );
328 QString roundedValue;
329 if ( a.dataLabel().isNull() ) {
330 if ( decimalPos > 0 && value != 0 )
331 roundedValue = roundValues ( value, decimalPos, decimalDigits );
332 else
333 roundedValue = QString::number( value );
334 } else
335 roundedValue = a.dataLabel();
336 // handle prefix and suffix
337 if ( !a.prefix().isNull() )
338 roundedValue.prepend( a.prefix() );
339
340 if ( !a.suffix().isNull() )
341 roundedValue.append( a.suffix() );
342
343 PainterSaver painterSaver( painter );
344 // FIXME draw the non-text bits, background, etc
345 const TextAttributes &ta = a.textAttributes();
346 if ( ta.isVisible() ) {
347 painter->setPen( ta.pen() );
348 painter->setFont( ta.font() );
349 painter->translate( pos );
350 painter->rotate( ta.rotation() );
351 painter->drawText( QPointF(0, 0), roundedValue );
352 }
353 }
354
355 QString AbstractDiagram::roundValues( double value,

6.33.3.41 void AbstractDiagram::paintDataValueTexts (QPainter ∗ painter) [protected,


virtual, inherited]

Definition at line 382 of file KDChartAbstractDiagram.cpp.

385 {
386 for ( int j=0; j< rowCount; ++j ) {
387 const QModelIndex index = model()->index( j, i, rootIndex() );
388 double value = model()->data( index ).toDouble();
389 const QPointF pos = coordinatePlane()->translate( QPointF( j, value ) );
390 paintDataValueText( painter, index, pos, value );

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.33 KDChart::LineDiagram Class Reference 455

391 }
392 }
393 }
394
395

6.33.3.42 void LineDiagram::paintEvent (QPaintEvent ∗) [protected]

Definition at line 367 of file KDChartLineDiagram.cpp.


References paint(), KDChart::PaintContext::setPainter(), and KDChart::PaintContext::setRectangle().

368 {
369 //qDebug() << "starting LineDiagram::paintEvent ( QPaintEvent*)";
370 QPainter painter ( viewport() );
371 PaintContext ctx;
372 ctx.setPainter ( &painter );
373 ctx.setRectangle ( QRectF ( 0, 0, width(), height() ) );
374 paint ( &ctx );
375 //qDebug() << " LineDiagram::paintEvent ( QPaintEvent*) ended.";
376 }

6.33.3.43 void AbstractDiagram::paintMarker (QPainter ∗ painter, const QModelIndex & index,


const QPointF & pos) [protected, inherited]

Definition at line 398 of file KDChartAbstractDiagram.cpp.


References KDChart::AbstractDiagram::brush(), KDChart::AbstractDiagram::checkInvariants(),
KDChart::AbstractDiagram::dataValueAttributes(), KDChart::MarkerAttributes::isVisible(),
KDChart::DataValueAttributes::isVisible(), KDChart::DataValueAttributes::markerAttributes(),
KDChart::MarkerAttributes::markerColor(), KDChart::MarkerAttributes::markerSize(),
KDChart::AbstractDiagram::paintMarker(), and KDChart::MarkerAttributes::pen().

399 {
400
401 if ( !checkInvariants() ) return;
402 DataValueAttributes a = dataValueAttributes(index);
403 if ( !a.isVisible() ) return;
404 const MarkerAttributes &ma = a.markerAttributes();
405 if ( !ma.isVisible() ) return;
406
407 PainterSaver painterSaver( painter );
408 QSizeF maSize( ma.markerSize() );
409 QBrush indexBrush( brush( index ) );
410 QPen indexPen( ma.pen() );
411 if ( ma.markerColor().isValid() )
412 indexBrush.setColor( ma.markerColor() );
413
414 paintMarker( painter, ma, indexBrush, indexPen, pos, maSize );
415 }
416
417

6.33.3.44 void AbstractDiagram::paintMarker (QPainter ∗ painter, const MarkerAttributes &


markerAttributes, const QBrush & brush, const QPen &, const QPointF & point, const
QSizeF & size) [virtual, inherited]

Definition at line 420 of file KDChartAbstractDiagram.cpp.

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


456 KD Chart 2 Class Documentation

References KDChart::MarkerAttributes::markerStyle().
Referenced by paint(), KDChart::MarkerLayoutItem::paint(), and KDChart::AbstractDiagram::paint-
Marker().

424 {
425 PainterSaver painterSaver( painter );
426 painter->setBrush( brush );
427 painter->setPen( pen );
428 painter->setRenderHint ( QPainter::Antialiasing );
429 painter->translate( pos );
430 switch ( markerAttributes.markerStyle() ) {
431 case MarkerAttributes::MarkerCircle:
432 painter->drawEllipse( QRectF( 0 - maSize.height()/2, 0 - maSize.width()/2,
433 maSize.height(), maSize.width()) );
434 break;
435 case MarkerAttributes::MarkerSquare:
436 {
437 QRectF rect( 0 - maSize.height()/2, 0 - maSize.width()/2,
438 maSize.height(), maSize.width() );
439 painter->drawRect( rect );
440 painter->fillRect( rect, painter->brush() );
441 break;
442 }
443 case MarkerAttributes::MarkerDiamond:
444 {
445 QVector <QPointF > diamondPoints;
446 QPointF top, left, bottom, right;
447 top = QPointF( 0, 0 - maSize.height()/2 );
448 left = QPointF( 0 - maSize.width()/2, 0 );
449 bottom = QPointF( 0, maSize.height()/2 );
450 right = QPointF( maSize.width()/2, 0 );
451 diamondPoints << top << left << bottom << right;
452 painter->drawPolygon( diamondPoints );
453 break;
454 }
455 //Pending Michel: do we need that? Ask: What is the idea about
456 // Marker1Pixel and Marker4Pixels.
457 case MarkerAttributes::Marker1Pixel:
458 {
459 QSizeF pSize(4,4);
460 QPen pen1Pixel;
461 pen1Pixel.setColor( painter->background().color() );
462 QRectF centerRect( -pSize.height()/2, -pSize.width()/2,
463 pSize.height(), pSize.width() );
464 painter->setPen( pen1Pixel );
465 painter->drawEllipse( centerRect );
466 break;
467 }
468 case MarkerAttributes::Marker4Pixels:
469 {
470 QSizeF pSize(8, 8);
471 QPen pen4Pixel;
472 pen4Pixel.setColor( painter->background().color() );
473 QRectF centerRect( -pSize.height()/2, -pSize.width()/2,
474 pSize.height(), pSize.width() );
475 painter->setPen( pen4Pixel );
476 painter->drawEllipse( centerRect );
477 break;
478 }
479 case MarkerAttributes::MarkerRing:
480 {
481 painter->setBrush( Qt::NoBrush );
482 painter->drawEllipse( QRectF( 0 - maSize.height()/2, 0 - maSize.width()/2,
483 maSize.height(), maSize.width()) );
484 break;
485 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.33 KDChart::LineDiagram Class Reference 457

486 case MarkerAttributes::MarkerCross:


487 {
488 QVector <QPointF > crossPoints;
489 QPointF leftTop, leftBottom, centerBottomLeft, bottomLeft, bottomRight,
490 centerBottomRight,rightBottom, rightTop, centerTopRight, topRight, topLeft,
491 centerTopLeft;
492 leftTop = QPointF( -maSize.width()/2, -maSize.height()/4 );
493 leftBottom = QPointF( -maSize.width()/2, maSize.height()/4 );
494 centerBottomLeft = QPointF( -maSize.width()/4, maSize.height()/4 );
495 bottomLeft = QPointF( -maSize.width()/4, maSize.height()/2 );
496 bottomRight = QPointF( maSize.width()/4, maSize.height()/2 );
497 centerBottomRight = QPointF( maSize.width()/4, maSize.height()/4 );
498 rightBottom = QPointF( maSize.width()/2, maSize.height()/4 );
499 rightTop = QPointF( maSize.width()/2, -maSize.height()/4 );
500 centerTopRight = QPointF( maSize.width()/4, -maSize.height()/4 );
501 topRight = QPointF( maSize.width()/4, -maSize.height()/2 );
502 topLeft = QPointF( -maSize.width()/4, -maSize.height()/2 );
503 centerTopLeft = QPointF( -maSize.width()/4, -maSize.height()/4 );
504
505 crossPoints << leftTop << leftBottom << centerBottomLeft
506 << bottomLeft << bottomRight << centerBottomRight
507 << rightBottom << rightTop << centerTopRight
508 << topRight << topLeft << centerTopLeft;
509
510 painter->drawPolygon( crossPoints );
511 break;
512 }
513 case MarkerAttributes::MarkerFastCross:
514 {
515 QPointF left, right, top, bottom;
516 left = QPointF( -maSize.width()/2, 0 );
517 right = QPointF( maSize.width()/2, 0 );
518 top = QPointF( 0, -maSize.height()/2 );
519 bottom= QPointF( 0, maSize.height()/2 );
520 painter->drawLine( left, right );
521 painter->drawLine( top, bottom );
522 break;
523 }
524 default:
525 Q_ASSERT_X ( false, "paintMarkers()",
526 "Type item does not match a defined Marker Type." );
527 }
528 }
529
530 void AbstractDiagram::paintMarkers( QPainter* painter )

6.33.3.45 void AbstractDiagram::paintMarkers (QPainter ∗ painter) [protected,


virtual, inherited]

Definition at line 532 of file KDChartAbstractDiagram.cpp.

535 {
536 for ( int j=0; j< rowCount; ++j ) {
537 const QModelIndex index = model()->index( j, i, rootIndex() );
538 double value = model()->data( index ).toDouble();
539 const QPointF pos = coordinatePlane()->translate( QPointF( j, value ) );
540 paintMarker( painter, index, pos );
541 }
542 }
543 }
544
545

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


458 KD Chart 2 Class Documentation

6.33.3.46 QPen AbstractDiagram::pen (const QModelIndex & index) const [inherited]

Retrieve the pen to be used, for painting the datapoint at the given index in the model.

Parameters:
index The index of the datapoint in the model.

Returns:
The pen to use for painting.

Definition at line 586 of file KDChartAbstractDiagram.cpp.

593 {

6.33.3.47 QPen AbstractDiagram::pen (int dataset) const [inherited]

Retrieve the pen to be used for the given dataset.


This will fall back automatically to what was set at model level, if there are no dataset specific settings.

Parameters:
dataset The dataset to retrieve the pen for.

Returns:
The pen to use for painting.

Definition at line 578 of file KDChartAbstractDiagram.cpp.

585 {

6.33.3.48 QPen AbstractDiagram::pen () const [inherited]

Retrieve the pen to be used for painting datapoints globally.


This will fall back automatically to the default settings, if there are no specific settings.

Returns:
The pen to use for painting.

Definition at line 572 of file KDChartAbstractDiagram.cpp.


Referenced by KDChart::PieDiagram::paint().

577 {

6.33.3.49 bool AbstractDiagram::percentMode () const [inherited]

Definition at line 313 of file KDChartAbstractDiagram.cpp.


References d.
Referenced by KDChart::CartesianCoordinatePlane::getDataDimensionsList().

320 {

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.33 KDChart::LineDiagram Class Reference 459

6.33.3.50 void KDChart::AbstractDiagram::propertiesChanged () [protected,


inherited]

Emitted upon change of a property of the Diagram.


Referenced by KDChart::AbstractDiagram::setDataValueAttributes(), setLineAttributes(), setThreeDLine-
Attributes(), and setType().

6.33.3.51 AbstractCartesianDiagram ∗ AbstractCartesianDiagram::referenceDiagram () const


[virtual, inherited]

Definition at line 123 of file KDChartAbstractCartesianDiagram.cpp.


References d.

124 {
125 return d->referenceDiagram;
126 }

6.33.3.52 QPointF AbstractCartesianDiagram::referenceDiagramOffset () const [virtual,


inherited]

Definition at line 128 of file KDChartAbstractCartesianDiagram.cpp.


References d.

129 {
130 return d->referenceDiagramOffset;
131 }

6.33.3.53 void LineDiagram::resize (const QSizeF & area) [virtual]

Called by the widget’s sizeEvent.


Adjust all internal structures, that are calculated, dependending on the size of the widget.

Parameters:
area

Implements KDChart::AbstractDiagram.
Definition at line 707 of file KDChartLineDiagram.cpp.

708 {
709 }

6.33.3.54 void LineDiagram::resizeEvent (QResizeEvent ∗) [protected]

Definition at line 225 of file KDChartLineDiagram.cpp.

226 {
227 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


460 KD Chart 2 Class Documentation

6.33.3.55 void AbstractDiagram::scrollTo (const QModelIndex & index, ScrollHint hint =


EnsureVisible) [virtual, inherited]

[reimplemented]
Definition at line 646 of file KDChartAbstractDiagram.cpp.

648 { return QModelIndex(); }

6.33.3.56 void AbstractDiagram::setAllowOverlappingDataValueTexts (bool allow)


[inherited]

Set whether data value labels are allowed to overlap.

Parameters:
allow True means that overlapping labels are allowed.

Definition at line 285 of file KDChartAbstractDiagram.cpp.


References d.

290 {

6.33.3.57 void AbstractDiagram::setAntiAliasing (bool enabled) [inherited]

Set whether anti-aliasing is to be used while rendering this diagram.

Parameters:
enabled True means that AA is enabled.

Definition at line 296 of file KDChartAbstractDiagram.cpp.


References d.

301 {

6.33.3.58 void AbstractDiagram::setAttributesModel (AttributesModel ∗ model) [virtual,


inherited]

Associate an AttributesModel with this diagram.


Note that the diagram does _not_ take ownership of the AttributesModel. This should thus only be used
with AttributesModels that have been explicitely created by the user, and are owned by her. Setting an
AttributesModel that is internal to another diagram is an error.
Correct:

AttributesModel *am = new AttributesModel( model, 0 );


diagram1->setAttributesModel( am );
diagram2->setAttributesModel( am );

Wrong:

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.33 KDChart::LineDiagram Class Reference 461

diagram1->setAttributesModel( diagram2->attributesModel() );

Parameters:
model The AttributesModel to use for this diagram.

See also:
AttributesModel

Definition at line 160 of file KDChartAbstractDiagram.cpp.


References d, and KDChart::AbstractDiagram::modelsChanged().

161 {
162 if( amodel->sourceModel() != model() ) {
163 qWarning("KDChart::AbstractDiagram::setAttributesModel() failed: "
164 "Trying to set an attributesmodel which works on a different "
165 "model than the diagram.");
166 return;
167 }
168 if( qobject_cast<PrivateAttributesModel*>(amodel) ) {
169 qWarning("KDChart::AbstractDiagram::setAttributesModel() failed: "
170 "Trying to set an attributesmodel that is private to another diagram.");
171 return;
172 }
173 d->setAttributesModel(amodel);
174 scheduleDelayedItemsLayout();
175 d->databoundariesDirty = true;
176 emit modelsChanged();
177 }

6.33.3.59 void AbstractDiagram::setAttributesModelRootIndex (const QModelIndex & idx)


[protected, inherited]

Definition at line 195 of file KDChartAbstractDiagram.cpp.


References d.

6.33.3.60 void AbstractDiagram::setBrush (const QBrush & brush) [inherited]

Set the brush to be used, for painting all datasets in the model.

Parameters:
brush The brush to use.

Definition at line 602 of file KDChartAbstractDiagram.cpp.

608 {

6.33.3.61 void AbstractDiagram::setBrush (int dataset, const QBrush & brush) [inherited]

Set the brush to be used, for painting the given dataset.

Parameters:
dataset The dataset’s column in the model.

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


462 KD Chart 2 Class Documentation

pen The brush to use.

Definition at line 609 of file KDChartAbstractDiagram.cpp.

617 {

6.33.3.62 void AbstractDiagram::setBrush (const QModelIndex & index, const QBrush & brush)
[inherited]

Set the brush to be used, for painting the datapoint at the given index.

Parameters:
index The datapoint’s index in the model.
brush The brush to use.

Definition at line 594 of file KDChartAbstractDiagram.cpp.

601 {

6.33.3.63 void KDChart::AbstractCartesianDiagram::setCoordinatePlane


(AbstractCoordinatePlane ∗ plane) [virtual, inherited]

Set the coordinate plane associated with the diagram.


This determines how coordinates in value space are mapped into pixel space. The chart takes ownership.

Returns:
The coordinate plane associated with the diagram.

Reimplemented from KDChart::AbstractDiagram.


Definition at line 100 of file KDChartAbstractCartesianDiagram.cpp.
References KDChart::AbstractDiagram::coordinatePlane(), and KDChart::AbstractDiagram::set-
CoordinatePlane().

101 {
102 if( coordinatePlane() ) disconnect( coordinatePlane() );
103 AbstractDiagram::setCoordinatePlane(plane);
104
105 // show the axes, after all have been adjusted
106 // (because they might be dependend on each other)
107 /*
108 if( plane )
109 Q_FOREACH( CartesianAxis* axis, d->axesList )
110 axis->show();
111 else
112 Q_FOREACH( CartesianAxis* axis, d->axesList )
113 axis->hide();
114 */
115 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.33 KDChart::LineDiagram Class Reference 463

6.33.3.64 void AbstractDiagram::setDataBoundariesDirty () const [protected,


inherited]

Definition at line 139 of file KDChartAbstractDiagram.cpp.


References d.
Referenced by KDChart::BarDiagram::setThreeDBarAttributes(), setThreeDLineAttributes(), setType(),
and KDChart::BarDiagram::setType().

140 {
141 d->databoundariesDirty = true;
142 }

6.33.3.65 void AbstractDiagram::setDatasetDimension (int dimension) [inherited]

Sets the dataset dimension of the diagram.

See also:
datasetDimension.

Parameters:
dimension

Definition at line 763 of file KDChartAbstractDiagram.cpp.


References d.

770 {

6.33.3.66 void AbstractDiagram::setDataValueAttributes (const DataValueAttributes & a)


[inherited]

Set the DataValueAttributes for all datapoints in the model.

Parameters:
a The attributes to set.

Definition at line 279 of file KDChartAbstractDiagram.cpp.


References d.

284 {

6.33.3.67 void AbstractDiagram::setDataValueAttributes (int dataset, const DataValueAttributes


& a) [inherited]

Set the DataValueAttributes for the given dataset.

Parameters:
dataset The dataset to set the attributes for.

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


464 KD Chart 2 Class Documentation

a The attributes to set.

Definition at line 251 of file KDChartAbstractDiagram.cpp.


References d.

259 {

6.33.3.68 void AbstractDiagram::setDataValueAttributes (const QModelIndex & index, const


DataValueAttributes & a) [inherited]

Set the DataValueAttributes for the given index.

Parameters:
index The datapoint to set the attributes for.
a The attributes to set.

Definition at line 240 of file KDChartAbstractDiagram.cpp.


References d, KDChart::DataValueLabelAttributesRole, and KDChart::AbstractDiagram::properties-
Changed().

240 {
241 d->attributesModel->setData(
242 d->attributesModel->mapFromSource( index ),
243 qVariantFromValue( a ),
244 DataValueLabelAttributesRole );
245 emit propertiesChanged();
246 }
247
248

6.33.3.69 void LineDiagram::setLineAttributes (const QModelIndex & index, const LineAttributes


& a)

Definition at line 119 of file KDChartLineDiagram.cpp.


References d, KDChart::LineAttributesRole, and KDChart::AbstractDiagram::propertiesChanged().

122 {
123 d->attributesModel->setData(
124 d->attributesModel->mapFromSource(index),
125 qVariantFromValue( ta ),
126 LineAttributesRole );
127 emit propertiesChanged();
128 }

6.33.3.70 void LineDiagram::setLineAttributes (int column, const LineAttributes & a)

Definition at line 107 of file KDChartLineDiagram.cpp.


References d, KDChart::LineAttributesRole, and KDChart::AbstractDiagram::propertiesChanged().

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.33 KDChart::LineDiagram Class Reference 465

110 {
111 d->attributesModel->setHeaderData(
112 column,
113 Qt::Vertical,
114 qVariantFromValue( ta ),
115 LineAttributesRole );
116 emit propertiesChanged();
117 }

6.33.3.71 void LineDiagram::setLineAttributes (const LineAttributes & a)

Definition at line 99 of file KDChartLineDiagram.cpp.


References d, KDChart::LineAttributesRole, and KDChart::AbstractDiagram::propertiesChanged().

100 {
101 d->attributesModel->setModelData(
102 qVariantFromValue( ta ),
103 LineAttributesRole );
104 emit propertiesChanged();
105 }

6.33.3.72 void AbstractDiagram::setModel (QAbstractItemModel ∗ model) [virtual,


inherited]

Associate a model with the diagram.


Definition at line 144 of file KDChartAbstractDiagram.cpp.
References d, KDChart::AttributesModel::initFrom(), and KDChart::AbstractDiagram::modelsChanged().

145 {
146 QAbstractItemView::setModel( newModel );
147 AttributesModel* amodel = new PrivateAttributesModel( newModel, this );
148 amodel->initFrom( d->attributesModel );
149 d->setAttributesModel(amodel);
150 scheduleDelayedItemsLayout();
151 d->databoundariesDirty = true;
152 emit modelsChanged();
153 }

6.33.3.73 void AbstractDiagram::setPen (const QPen & pen) [inherited]

Set the pen to be used, for painting all datasets in the model.

Parameters:
pen The pen to use.

Definition at line 556 of file KDChartAbstractDiagram.cpp.

562 {

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


466 KD Chart 2 Class Documentation

6.33.3.74 void AbstractDiagram::setPen (int dataset, const QPen & pen) [inherited]

Set the pen to be used, for painting the given dataset.

Parameters:
dataset The dataset’s row in the model.
pen The pen to use.

Definition at line 563 of file KDChartAbstractDiagram.cpp.

571 {

6.33.3.75 void AbstractDiagram::setPen (const QModelIndex & index, const QPen & pen)
[inherited]

Set the pen to be used, for painting the datapoint at the given index.

Parameters:
index The datapoint’s index in the model.
pen The pen to use.

Definition at line 548 of file KDChartAbstractDiagram.cpp.

555 {

6.33.3.76 void AbstractDiagram::setPercentMode (bool percent) [inherited]

Definition at line 307 of file KDChartAbstractDiagram.cpp.


References d.
Referenced by setType(), and KDChart::BarDiagram::setType().

312 {

6.33.3.77 void AbstractCartesianDiagram::setReferenceDiagram (AbstractCartesianDiagram ∗


diagram, const QPointF & offset = QPointF()) [virtual, inherited]

Definition at line 117 of file KDChartAbstractCartesianDiagram.cpp.


References d.

118 {
119 d->referenceDiagram = diagram;
120 d->referenceDiagramOffset = offset;
121 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.33 KDChart::LineDiagram Class Reference 467

6.33.3.78 void AbstractDiagram::setRootIndex (const QModelIndex & idx) [virtual,


inherited]

Set the root index in the model, where the diagram starts referencing data for display.
[reimplemented]
Definition at line 188 of file KDChartAbstractDiagram.cpp.
References d.

6.33.3.79 void AbstractDiagram::setSelection (const QRect & rect,


QItemSelectionModel::SelectionFlags command) [virtual, inherited]

[reimplemented]
Definition at line 664 of file KDChartAbstractDiagram.cpp.

666 { return QRegion(); }

6.33.3.80 void LineDiagram::setThreeDLineAttributes (const QModelIndex & index, const


ThreeDLineAttributes & a)

Definition at line 176 of file KDChartLineDiagram.cpp.


References d, KDChart::AbstractDiagram::propertiesChanged(), KDChart::AbstractDiagram::setData-
BoundariesDirty(), and KDChart::ThreeDLineAttributesRole.

179 {
180 setDataBoundariesDirty();
181 d->attributesModel->setData(
182 d->attributesModel->mapFromSource(index),
183 qVariantFromValue( ta ),
184 ThreeDLineAttributesRole );
185 emit propertiesChanged();
186 }

6.33.3.81 void LineDiagram::setThreeDLineAttributes (int column, const ThreeDLineAttributes


& a)

Definition at line 163 of file KDChartLineDiagram.cpp.


References d, KDChart::AbstractDiagram::propertiesChanged(), KDChart::AbstractDiagram::setData-
BoundariesDirty(), and KDChart::ThreeDLineAttributesRole.

166 {
167 setDataBoundariesDirty();
168 d->attributesModel->setHeaderData(
169 column,
170 Qt::Vertical,
171 qVariantFromValue( ta ),
172 ThreeDLineAttributesRole );
173 emit propertiesChanged();
174 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


468 KD Chart 2 Class Documentation

6.33.3.82 void LineDiagram::setThreeDLineAttributes (const ThreeDLineAttributes & a)

Definition at line 153 of file KDChartLineDiagram.cpp.


References d, KDChart::AbstractDiagram::propertiesChanged(), KDChart::AbstractDiagram::setData-
BoundariesDirty(), and KDChart::ThreeDLineAttributesRole.

155 {
156 setDataBoundariesDirty();
157 d->attributesModel->setModelData(
158 qVariantFromValue( ta ),
159 ThreeDLineAttributesRole );
160 emit propertiesChanged();
161 }

6.33.3.83 void LineDiagram::setType (const LineType type)

Definition at line 78 of file KDChartLineDiagram.cpp.


References d, KDChart::AbstractDiagram::datasetDimension(), KDChart::AbstractDiagram::properties-
Changed(), KDChart::AbstractDiagram::setDataBoundariesDirty(), and KDChart::AbstractDiagram::set-
PercentMode().

79 {
80 if ( d->lineType == type ) return;
81 if ( type != LineDiagram::Normal && datasetDimension() > 1 ) {
82 Q_ASSERT_X ( false, "setType()",
83 "This line chart type can’t be used with multi-dimensional data." );
84 return;
85 }
86 d->lineType = type;
87 // AbstractAxis settings - see AbstractDiagram and CartesianAxis
88 setPercentMode( type == LineDiagram::Percent );
89 setDataBoundariesDirty();
90 emit layoutChanged( this );
91 emit propertiesChanged();
92 }

6.33.3.84 void AbstractCartesianDiagram::takeAxis (CartesianAxis ∗ axis) [virtual,


inherited]

Removes the axis from the diagram, without deleting it.


The diagram no longer owns the axis, so it is the caller’s responsibility to delete the axis.

See also:
addAxis

Definition at line 75 of file KDChartAbstractCartesianDiagram.cpp.


References d, KDChart::AbstractAxis::deleteObserver(), KDChart::AbstractCartesianDiagram::layout-
Planes(), and KDChart::AbstractLayoutItem::setParentWidget().
Referenced by KDChart::CartesianAxis::∼CartesianAxis().

76 {
77 const int idx = d->axesList.indexOf( axis );

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.33 KDChart::LineDiagram Class Reference 469

78 if( idx != -1 )
79 d->axesList.takeAt( idx );
80 axis->deleteObserver( this );
81 axis->setParentWidget( 0 );
82 layoutPlanes();
83 }

6.33.3.85 double LineDiagram::threeDItemDepth (int column) const [protected,


virtual]

Implements KDChart::AbstractCartesianDiagram.
Definition at line 216 of file KDChartLineDiagram.cpp.
References d.

217 {
218 return qVariantValue<ThreeDLineAttributes>(
219 d->attributesModel->headerData (
220 column,
221 Qt::Vertical,
222 KDChart::ThreeDLineAttributesRole ) ).validDepth();
223 }

6.33.3.86 double LineDiagram::threeDItemDepth (const QModelIndex & index) const


[protected, virtual]

Implements KDChart::AbstractCartesianDiagram.
Definition at line 211 of file KDChartLineDiagram.cpp.
References threeDLineAttributes(), and KDChart::AbstractThreeDAttributes::validDepth().

212 {
213 return threeDLineAttributes( index ).validDepth();
214 }

6.33.3.87 ThreeDLineAttributes LineDiagram::threeDLineAttributes (const QModelIndex &


index) const

Definition at line 202 of file KDChartLineDiagram.cpp.


References d.

204 {
205 return qVariantValue<ThreeDLineAttributes>(
206 d->attributesModel->data(
207 d->attributesModel->mapFromSource( index ),
208 KDChart::ThreeDLineAttributesRole ) );
209 }

6.33.3.88 ThreeDLineAttributes LineDiagram::threeDLineAttributes (int column) const

Definition at line 194 of file KDChartLineDiagram.cpp.


References d.

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


470 KD Chart 2 Class Documentation

195 {
196 return qVariantValue<ThreeDLineAttributes>(
197 d->attributesModel->data(
198 d->attributesModel->mapFromSource( columnToIndex( column ) ),
199 KDChart::ThreeDLineAttributesRole ) );
200 }

6.33.3.89 ThreeDLineAttributes LineDiagram::threeDLineAttributes () const

Definition at line 188 of file KDChartLineDiagram.cpp.


References d.
Referenced by threeDItemDepth().

189 {
190 return qVariantValue<ThreeDLineAttributes>(
191 d->attributesModel->data( KDChart::ThreeDLineAttributesRole ) );
192 }

6.33.3.90 LineDiagram::LineType LineDiagram::type () const

Definition at line 94 of file KDChartLineDiagram.cpp.


References d.
Referenced by calculateDataBoundaries(), and paint().

95 {
96 return d->lineType;
97 }

6.33.3.91 void AbstractDiagram::update () const [inherited]

Definition at line 777 of file KDChartAbstractDiagram.cpp.


References d.
Referenced by KDChart::AbstractDiagram::doItemsLayout().

6.33.3.92 void KDChart::AbstractDiagram::useDefaultColors () [inherited]

Set the palette to be used, for painting datasets to the default palette.

See also:
KDChart::Palette. FIXME: fold into one usePalette (KDChart::Palette&) method

Definition at line 671 of file KDChartAbstractDiagram.cpp.


References d.

675 {

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.33 KDChart::LineDiagram Class Reference 471

6.33.3.93 void KDChart::AbstractDiagram::useRainbowColors () [inherited]

Set the palette to be used, for painting datasets to the rainbow palette.

See also:
KDChart::Palette.

Definition at line 681 of file KDChartAbstractDiagram.cpp.


References d.

685 {

6.33.3.94 void KDChart::AbstractDiagram::useSubduedColors () [inherited]

Set the palette to be used, for painting datasets to the subdued palette.

See also:
KDChart::Palette.

Definition at line 676 of file KDChartAbstractDiagram.cpp.


References d.

680 {

6.33.3.95 double AbstractDiagram::valueForCell (int row, int column) const [protected,


inherited]

Helper method, retrieving the data value (DisplayRole) for a given row and column.

Parameters:
row The row to query.
column The column to query.

Returns:
The value of the display role at the given row and column as a double.

Definition at line 771 of file KDChartAbstractDiagram.cpp.


References KDChart::AbstractDiagram::attributesModelRootIndex(), and d.
Referenced by paint().

776 {

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


472 KD Chart 2 Class Documentation

6.33.3.96 double LineDiagram::valueForCellTesting (int row, int column, bool & bOK) const
[protected]

Definition at line 379 of file KDChartLineDiagram.cpp.


References d.
Referenced by calculateDataBoundaries(), and getCellValues().

380 {
381 double value =
382 d->attributesModel->data(
383 d->attributesModel->index( row, column, attributesModelRootIndex() )
384 ).toDouble( &bOK );
385 if( ! bOK )
386 value = 0.0;
387
388 return value;
389 }

6.33.3.97 int AbstractDiagram::verticalOffset () const [virtual, inherited]

[reimplemented]
Definition at line 658 of file KDChartAbstractDiagram.cpp.

660 { return true; }

6.33.3.98 QRect AbstractDiagram::visualRect (const QModelIndex & index) const [virtual,


inherited]

[reimplemented]
Definition at line 641 of file KDChartAbstractDiagram.cpp.

645 {}

6.33.3.99 QRegion AbstractDiagram::visualRegionForSelection (const QItemSelection &


selection) const [virtual, inherited]

[reimplemented]
Definition at line 667 of file KDChartAbstractDiagram.cpp.

6.33.4 Member Data Documentation

6.33.4.1 Q_SIGNALS KDChart::AbstractDiagram::__pad0__ [protected, inherited]

Definition at line 506 of file KDChartAbstractDiagram.h.


The documentation for this class was generated from the following files:

• KDChartLineDiagram.h
• KDChartLineDiagram.cpp

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.34 KDChart::MarkerAttributes Class Reference 473

6.34 KDChart::MarkerAttributes Class Reference


#include <KDChartMarkerAttributes.h>

Public Types

• enum MarkerStyle {
MarkerCircle = 0,
MarkerSquare = 1,
MarkerDiamond = 2,
Marker1Pixel = 3,
Marker4Pixels = 4,
MarkerRing = 5,
MarkerCross = 6,
MarkerFastCross = 7 }
• typedef QMap< uint, MarkerStyle > MarkerStylesMap

Public Member Functions

• bool isVisible () const


• MarkerAttributes (const MarkerAttributes &)
• MarkerAttributes ()
• QColor markerColor () const
• QSizeF markerSize () const
• MarkerStyle markerStyle () const
• MarkerStylesMap markerStylesMap () const
• bool operator!= (const MarkerAttributes &) const
• MarkerAttributes & operator= (const MarkerAttributes &)
• bool operator== (const MarkerAttributes &) const
• QPen pen () const
• void setMarkerColor (const QColor &color)
• void setMarkerSize (const QSizeF &size)
• void setMarkerStyle (MarkerStyle style)
• void setMarkerStylesMap (const MarkerStylesMap &map)
• void setPen (const QPen &pen)
• void setVisible (bool visible)
• ∼MarkerAttributes ()

6.34.1 Member Typedef Documentation

6.34.1.1 typedef QMap<uint, MarkerStyle> KDChart::MarkerAttributes::MarkerStylesMap

Definition at line 65 of file KDChartMarkerAttributes.h.

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


474 KD Chart 2 Class Documentation

6.34.2 Member Enumeration Documentation

6.34.2.1 enum KDChart::MarkerAttributes::MarkerStyle

Enumeration values:
MarkerCircle
MarkerSquare
MarkerDiamond
Marker1Pixel
Marker4Pixels
MarkerRing
MarkerCross
MarkerFastCross

Definition at line 53 of file KDChartMarkerAttributes.h.

53 { MarkerCircle = 0,
54 MarkerSquare = 1,
55 MarkerDiamond = 2,
56 Marker1Pixel = 3,
57 Marker4Pixels = 4,
58 MarkerRing = 5,
59 MarkerCross = 6,
60 MarkerFastCross = 7 };

6.34.3 Constructor & Destructor Documentation

6.34.3.1 KDChart::MarkerAttributes::MarkerAttributes ()

6.34.3.2 KDChart::MarkerAttributes::MarkerAttributes (const MarkerAttributes &)

6.34.3.3 KDChart::MarkerAttributes::∼MarkerAttributes ()

6.34.4 Member Function Documentation

6.34.4.1 bool KDChart::MarkerAttributes::isVisible () const

Referenced by operator<<(), and KDChart::AbstractDiagram::paintMarker().

6.34.4.2 QColor KDChart::MarkerAttributes::markerColor () const

Referenced by operator<<(), and KDChart::AbstractDiagram::paintMarker().

6.34.4.3 QSizeF KDChart::MarkerAttributes::markerSize () const

Referenced by KDChart::AbstractDiagram::paintMarker(), and KDChart::MarkerLayoutItem::sizeHint().

6.34.4.4 MarkerStyle KDChart::MarkerAttributes::markerStyle () const

Referenced by operator<<(), and KDChart::AbstractDiagram::paintMarker().

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.34 KDChart::MarkerAttributes Class Reference 475

6.34.4.5 MarkerStylesMap KDChart::MarkerAttributes::markerStylesMap () const

Referenced by operator<<().

6.34.4.6 bool KDChart::MarkerAttributes::operator!= (const MarkerAttributes &) const

Definition at line 89 of file KDChartMarkerAttributes.h.


References operator==().

89 { return !operator==( other ); }

6.34.4.7 MarkerAttributes& KDChart::MarkerAttributes::operator= (const MarkerAttributes


&)

6.34.4.8 bool KDChart::MarkerAttributes::operator== (const MarkerAttributes &) const

Referenced by operator!=().

6.34.4.9 QPen KDChart::MarkerAttributes::pen () const

Referenced by operator<<(), and KDChart::AbstractDiagram::paintMarker().

6.34.4.10 void KDChart::MarkerAttributes::setMarkerColor (const QColor & color)

6.34.4.11 void KDChart::MarkerAttributes::setMarkerSize (const QSizeF & size)

6.34.4.12 void KDChart::MarkerAttributes::setMarkerStyle (MarkerStyle style)

6.34.4.13 void KDChart::MarkerAttributes::setMarkerStylesMap (const MarkerStylesMap &


map)

6.34.4.14 void KDChart::MarkerAttributes::setPen (const QPen & pen)

6.34.4.15 void KDChart::MarkerAttributes::setVisible (bool visible)

The documentation for this class was generated from the following file:

• KDChartMarkerAttributes.h

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


476 KD Chart 2 Class Documentation

6.35 KDChart::MarkerLayoutItem Class Reference


#include <KDChartLayoutItems.h>
Inheritance diagram for KDChart::MarkerLayoutItem:Collaboration diagram for KDChart::MarkerLayout-
Item:

Public Member Functions


• virtual Qt::Orientations expandingDirections () const
• virtual QRect geometry () const
• virtual bool isEmpty () const
• MarkerLayoutItem (AbstractDiagram ∗diagram, const MarkerAttributes &marker, const QBrush
&brush, const QPen &pen, Qt::Alignment alignment=0)
• virtual QSize maximumSize () const
• virtual QSize minimumSize () const
• virtual void paint (QPainter ∗)
• virtual void paintCtx (PaintContext ∗context)
Default impl: Paint the complete item using its layouted position and size.

• void removeFromParentLayout ()
• virtual void setGeometry (const QRect &r)
• void setParentLayout (QLayout ∗lay)
• virtual void setParentWidget (QWidget ∗widget)
Inform the item about its widget: This enables the item, to trigger that widget’s update, whenever the size
of the item’s contents has changed.

• virtual QSize sizeHint () const


• virtual void sizeHintChanged () const
Report changed size hint: ask the parent widget to recalculate the layout.

Protected Attributes
• QWidget ∗ mParent
• QLayout ∗ mParentLayout

6.35.1 Constructor & Destructor Documentation

6.35.1.1 KDChart::MarkerLayoutItem::MarkerLayoutItem (AbstractDiagram ∗ diagram, const


MarkerAttributes & marker, const QBrush & brush, const QPen & pen, Qt::Alignment
alignment = 0)

Definition at line 344 of file KDChartLayoutItems.cpp.

348 : AbstractLayoutItem( alignment )


349 , mDiagram( diagram )
350 , mMarker( marker )
351 , mBrush( brush )
352 , mPen( pen )
353 {
354 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.35 KDChart::MarkerLayoutItem Class Reference 477

6.35.2 Member Function Documentation

6.35.2.1 Qt::Orientations KDChart::MarkerLayoutItem::expandingDirections () const


[virtual]

Definition at line 356 of file KDChartLayoutItems.cpp.

357 {
358 return 0; // Grow neither vertically nor horizontally
359 }

6.35.2.2 QRect KDChart::MarkerLayoutItem::geometry () const [virtual]

Definition at line 361 of file KDChartLayoutItems.cpp.


Referenced by paint().

362 {
363 return mRect;
364 }

6.35.2.3 bool KDChart::MarkerLayoutItem::isEmpty () const [virtual]

Definition at line 366 of file KDChartLayoutItems.cpp.

367 {
368 return false; // never empty, otherwise the layout item would not exist
369 }

6.35.2.4 QSize KDChart::MarkerLayoutItem::maximumSize () const [virtual]

Definition at line 371 of file KDChartLayoutItems.cpp.


References sizeHint().

372 {
373 return sizeHint(); // PENDING(kalle) Review, quite inflexible
374 }

6.35.2.5 QSize KDChart::MarkerLayoutItem::minimumSize () const [virtual]

Definition at line 376 of file KDChartLayoutItems.cpp.


References sizeHint().

377 {
378 return sizeHint(); // PENDING(kalle) Review, quite inflexible
379 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


478 KD Chart 2 Class Documentation

6.35.2.6 void KDChart::MarkerLayoutItem::paint (QPainter ∗) [virtual]

Implements KDChart::AbstractLayoutItem.
Definition at line 391 of file KDChartLayoutItems.cpp.
References geometry(), KDChart::AbstractDiagram::paintMarker(), and sizeHint().

392 {
393 if( !mRect.isValid() )
394 return;
395
396 // The layout management may assign a larger rect than what we
397 // wanted. We need to adjust the position.
398 QPointF pos = geometry().topLeft();
399 pos += QPointF( static_cast<qreal>(( geometry().width() - sizeHint().width()) / 2.0 ),
400 static_cast<qreal>(( geometry().height() - sizeHint().height()) / 2.0 ) );
401
402 // And finally, drawMarker() assumes the position to be the center
403 // of the marker, adjust again.
404 pos += QPointF( static_cast<qreal>( sizeHint().width() ) / 2.0,
405 static_cast<qreal>( sizeHint().height() )/ 2.0 );
406
407 mDiagram->paintMarker( painter, mMarker, mBrush, mPen, pos.toPoint(), sizeHint() );
408 }

6.35.2.7 void KDChart::AbstractLayoutItem::paintCtx (PaintContext ∗ context) [virtual,


inherited]

Default impl: Paint the complete item using its layouted position and size.
Reimplemented in KDChart::CartesianAxis.
Definition at line 64 of file KDChartLayoutItems.cpp.
References KDChart::AbstractLayoutItem::paint(), and KDChart::PaintContext::painter().

65 {
66 if( context )
67 paint( context->painter() );
68 }

6.35.2.8 void KDChart::AbstractLayoutItem::removeFromParentLayout () [inherited]

Definition at line 66 of file KDChartLayoutItems.h.


Referenced by KDChart::Chart::takeCoordinatePlane().

67 {
68 if( mParentLayout ){
69 if( widget() )
70 mParentLayout->removeWidget( widget() );
71 else
72 mParentLayout->removeItem( this );
73 }
74 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.35 KDChart::MarkerLayoutItem Class Reference 479

6.35.2.9 void KDChart::MarkerLayoutItem::setGeometry (const QRect & r) [virtual]

Definition at line 381 of file KDChartLayoutItems.cpp.

382 {
383 mRect = r;
384 }

6.35.2.10 void KDChart::AbstractLayoutItem::setParentLayout (QLayout ∗ lay) [inherited]

Definition at line 62 of file KDChartLayoutItems.h.

63 {
64 mParentLayout = lay;
65 }

6.35.2.11 void KDChart::AbstractLayoutItem::setParentWidget (QWidget ∗ widget)


[virtual, inherited]

Inform the item about its widget: This enables the item, to trigger that widget’s update, whenever the size
of the item’s contents has changed.
Thus, you need to call setParentWidget on every item, that has a non-fixed size.
Definition at line 56 of file KDChartLayoutItems.cpp.
References KDChart::AbstractLayoutItem::mParent.
Referenced by KDChart::Legend::buildLegend(), and KDChart::AbstractCartesianDiagram::takeAxis().

57 {
58 mParent = widget;
59 }

6.35.2.12 QSize KDChart::MarkerLayoutItem::sizeHint () const [virtual]

Definition at line 386 of file KDChartLayoutItems.cpp.


References KDChart::MarkerAttributes::markerSize().
Referenced by KDChart::Legend::buildLegend(), maximumSize(), minimumSize(), and paint().

387 {
388 return mMarker.markerSize().toSize();
389 }

6.35.2.13 void KDChart::AbstractLayoutItem::sizeHintChanged () const [virtual,


inherited]

Report changed size hint: ask the parent widget to recalculate the layout.
Definition at line 73 of file KDChartLayoutItems.cpp.
Referenced by KDChart::TextLayoutItem::sizeHint().

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


480 KD Chart 2 Class Documentation

74 {
75 // This is exactly like what QWidget::updateGeometry does.
76 // qDebug("KDChart::AbstractLayoutItem::sizeHintChanged() called");
77 if( mParent ) {
78 if ( mParent->layout() )
79 mParent->layout()->invalidate();
80 else
81 QApplication::postEvent( mParent, new QEvent( QEvent::LayoutRequest ) );
82 }
83 }

6.35.3 Member Data Documentation

6.35.3.1 QWidget∗ KDChart::AbstractLayoutItem::mParent [protected, inherited]

Definition at line 76 of file KDChartLayoutItems.h.


Referenced by KDChart::AbstractLayoutItem::setParentWidget().

6.35.3.2 QLayout∗ KDChart::AbstractLayoutItem::mParentLayout [protected,


inherited]

Definition at line 77 of file KDChartLayoutItems.h.


The documentation for this class was generated from the following files:

• KDChartLayoutItems.h
• KDChartLayoutItems.cpp

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.36 KDChart::Measure Class Reference 481

6.36 KDChart::Measure Class Reference


#include <KDChartMeasure.h>
Collaboration diagram for KDChart::Measure:

Public Member Functions


• qreal calculatedValue (const QObject ∗autoArea, KDChartEnums::MeasureOrientation auto-
Orientation) const
The reference area must either be derived from AbstractArea or be derived from QWidget, so e.g.

• KDChartEnums::MeasureCalculationMode calculationMode () const


• Measure (const Measure &)
• Measure (qreal value, KDChartEnums::MeasureCalculationMode mode=KDChartEnums::Measure-
CalculationModeAuto, KDChartEnums::MeasureOrientation orientation=KDChart-
Enums::MeasureOrientationAuto)
• Measure ()
• bool operator!= (const Measure &other) const
• Measure & operator= (const Measure &)
• bool operator== (const Measure &) const
• const QObject ∗ referenceArea () const
The returned reference area will either be derived from AbstractArea or be derived from QWidget.

• KDChartEnums::MeasureOrientation referenceOrientation () const


• void setCalculationMode (KDChartEnums::MeasureCalculationMode mode)
• void setReferenceArea (const QObject ∗area)
The reference area must either be derived from AbstractArea or be derived from QWidget, so e.g.

• void setReferenceOrientation (KDChartEnums::MeasureOrientation orientation)


• void setRelativeMode (const QObject ∗area, KDChartEnums::MeasureOrientation orientation)
The reference area must either be derived from AbstractArea or be derived from QWidget, so e.g.

• void setValue (qreal val)


• qreal value () const

6.36.1 Constructor & Destructor Documentation

6.36.1.1 KDChart::Measure::Measure ()

Definition at line 41 of file KDChartMeasure.cpp.

42 : mValue( 0.0 ),
43 mMode( KDChartEnums::MeasureCalculationModeAuto ),
44 mArea( 0 ),
45 mOrientation( KDChartEnums::MeasureOrientationAuto )
46 {
47 // this bloc left empty intentionally
48 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


482 KD Chart 2 Class Documentation

6.36.1.2 KDChart::Measure::Measure (qreal value, KDChartEnums::MeasureCalculationMode


mode = KDChartEnums::MeasureCalculationModeAuto, KDChartEnums::Measure-
Orientation orientation = KDChartEnums::MeasureOrientationAuto)

Definition at line 50 of file KDChartMeasure.cpp.

53 : mValue( value ),
54 mMode( mode ),
55 mArea( 0 ),
56 mOrientation( orientation )
57 {
58 // this bloc left empty intentionally
59 }

6.36.1.3 KDChart::Measure::Measure (const Measure &)

Definition at line 61 of file KDChartMeasure.cpp.

62 : mValue( r.value() ),
63 mMode( r.calculationMode() ),
64 mArea( r.referenceArea() ),
65 mOrientation( r.referenceOrientation() )
66 {
67 // this bloc left empty intentionally
68 }

6.36.2 Member Function Documentation

6.36.2.1 qreal KDChart::Measure::calculatedValue (const QObject ∗ autoArea,


KDChartEnums::MeasureOrientation autoOrientation) const

The reference area must either be derived from AbstractArea or be derived from QWidget, so e.g.
it could be derived from AbstractAreaWidget too.
Definition at line 83 of file KDChartMeasure.cpp.
References value().
Referenced by KDChart::TextLayoutItem::realFontSize().

85 {
86 if( mMode == KDChartEnums::MeasureCalculationModeAbsolute ){
87 return mValue;
88 }else{
89 qreal value = 0.0;
90 const QObject* area = mArea ? mArea : autoArea;
91 KDChartEnums::MeasureOrientation orientation = mOrientation;
92 switch( mMode ){
93 case KDChartEnums::MeasureCalculationModeAuto:
94 area = autoArea;
95 orientation = autoOrientation;
96 break;
97 case KDChartEnums::MeasureCalculationModeAutoArea:
98 area = autoArea;
99 break;
100 case KDChartEnums::MeasureCalculationModeAutoOrientation:
101 orientation = autoOrientation;
102 break;

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.36 KDChart::Measure Class Reference 483

103 case KDChartEnums::MeasureCalculationModeAbsolute: // fall through intended


104 case KDChartEnums::MeasureCalculationModeRelative:
105 break;
106 }
107 if( area ){
108 QSize size;
109 const QWidget* widget = dynamic_cast<const QWidget*>(area);
110 if( widget ){
111 size = widget->geometry().size();
112 }else{
113 const AbstractArea* kdcArea = dynamic_cast<const AbstractArea*>(area);
114 if( kdcArea ){
115 size = kdcArea->geometry().size();
116 }else if( mMode != KDChartEnums::MeasureCalculationModeAbsolute ){
117 qDebug("Measure::calculatedValue() has no reference area.");
118 return 1.0;
119 }
120 }
121 qreal referenceValue;
122 switch( orientation ){
123 case KDChartEnums::MeasureOrientationAuto: // fall through intended
124 case KDChartEnums::MeasureOrientationMinimum:
125 referenceValue = qMin( size.width(), size.height() );
126 break;
127 case KDChartEnums::MeasureOrientationMaximum:
128 referenceValue = qMax( size.width(), size.height() );
129 break;
130 case KDChartEnums::MeasureOrientationHorizontal:
131 referenceValue = size.width();
132 break;
133 case KDChartEnums::MeasureOrientationVertical:
134 referenceValue = size.height();
135 break;
136 }
137 value = mValue / 1000.0 * referenceValue;
138 }
139 return value;
140 }
141 }

6.36.2.2 KDChartEnums::MeasureCalculationMode KDChart::Measure::calculationMode ()


const

Definition at line 57 of file KDChartMeasure.h.


Referenced by operator<<(), operator=(), and operator==().

57 { return mMode; }

6.36.2.3 bool KDChart::Measure::operator!= (const Measure & other) const

Definition at line 95 of file KDChartMeasure.h.

95 { return !operator==(other); }

6.36.2.4 Measure & KDChart::Measure::operator= (const Measure &)

Definition at line 70 of file KDChartMeasure.cpp.

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


484 KD Chart 2 Class Documentation

References calculationMode(), referenceArea(), referenceOrientation(), and value().

71 {
72 if( this != &r ){
73 mValue = r.value();
74 mMode = r.calculationMode();
75 mArea = r.referenceArea();
76 mOrientation = r.referenceOrientation();
77 }
78
79 return *this;
80 }

6.36.2.5 bool KDChart::Measure::operator== (const Measure &) const

Definition at line 144 of file KDChartMeasure.cpp.


References calculationMode(), referenceArea(), referenceOrientation(), and value().

145 {
146 return( mValue == r.value() &&
147 mMode == r.calculationMode() &&
148 mArea == r.referenceArea() &&
149 mOrientation == r.referenceOrientation() );
150 }

6.36.2.6 const QObject∗ KDChart::Measure::referenceArea () const

The returned reference area will either be derived from AbstractArea or be derived from QWidget.
Definition at line 82 of file KDChartMeasure.h.
Referenced by operator<<(), operator=(), and operator==().

82 { return mArea; }

6.36.2.7 KDChartEnums::MeasureOrientation KDChart::Measure::referenceOrientation () const

Definition at line 85 of file KDChartMeasure.h.


Referenced by operator<<(), operator=(), and operator==().

85 { return mOrientation; }

6.36.2.8 void KDChart::Measure::setCalculationMode (KDChartEnums::MeasureCalculation-


Mode mode)

Definition at line 56 of file KDChartMeasure.h.

56 { mMode = mode; }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.36 KDChart::Measure Class Reference 485

6.36.2.9 void KDChart::Measure::setReferenceArea (const QObject ∗ area)

The reference area must either be derived from AbstractArea or be derived from QWidget, so e.g.
it could be derived from AbstractAreaWidget too.
Definition at line 77 of file KDChartMeasure.h.

77 { mArea = area; }

6.36.2.10 void KDChart::Measure::setReferenceOrientation (KDChartEnums::Measure-


Orientation orientation)

Definition at line 84 of file KDChartMeasure.h.

84 { mOrientation = orientation; }

6.36.2.11 void KDChart::Measure::setRelativeMode (const QObject ∗ area,


KDChartEnums::MeasureOrientation orientation)

The reference area must either be derived from AbstractArea or be derived from QWidget, so e.g.
it could be derived from AbstractAreaWidget too.
Definition at line 64 of file KDChartMeasure.h.

66 {
67 mMode = KDChartEnums::MeasureCalculationModeRelative;
68 mArea = area;
69 mOrientation = orientation;
70 }

6.36.2.12 void KDChart::Measure::setValue (qreal val)

Definition at line 53 of file KDChartMeasure.h.


Referenced by KDChart::CartesianAxis::titleTextAttributes().

53 { mValue = val; }

6.36.2.13 qreal KDChart::Measure::value () const

Definition at line 54 of file KDChartMeasure.h.


Referenced by calculatedValue(), operator<<(), operator=(), operator==(), and KDChart::Cartesian-
Axis::titleTextAttributes().

54 { return mValue; }

The documentation for this class was generated from the following files:

• KDChartMeasure.h
• KDChartMeasure.cpp

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


486 KD Chart 2 Class Documentation

6.37 KDChart::PaintContext Class Reference


#include <KDChartPaintContext.h>
Collaboration diagram for KDChart::PaintContext:

Public Member Functions

• AbstractCoordinatePlane ∗ coordinatePlane () const


• PaintContext ()
• QPainter ∗ painter () const
• const QRectF rectangle () const
• void setCoordinatePlane (AbstractCoordinatePlane ∗plane)
• void setPainter (QPainter ∗painter)
• void setRectangle (const QRectF &rect)

6.37.1 Constructor & Destructor Documentation

6.37.1.1 KDChart::PaintContext::PaintContext ()

6.37.2 Member Function Documentation

6.37.2.1 AbstractCoordinatePlane∗ KDChart::PaintContext::coordinatePlane () const

Referenced by KDChart::CartesianAxis::paintCtx().

6.37.2.2 QPainter∗ KDChart::PaintContext::painter () const

Referenced by KDChart::RingDiagram::paint(), KDChart::PolarDiagram::paint(), KDChart::Pie-


Diagram::paint(), KDChart::LineDiagram::paint(), KDChart::BarDiagram::paint(), KDChart::Abstract-
LayoutItem::paintCtx(), and KDChart::PolarDiagram::paintPolarMarkers().

6.37.2.3 const QRectF KDChart::PaintContext::rectangle () const

Referenced by KDChart::PolarDiagram::paint(), KDChart::PieDiagram::paint(), and KDChart::Bar-


Diagram::paint().

6.37.2.4 void KDChart::PaintContext::setCoordinatePlane (AbstractCoordinatePlane ∗ plane)

Referenced by KDChart::PolarCoordinatePlane::paint(), KDChart::CartesianCoordinatePlane::paint(), and


KDChart::CartesianAxis::paint().

6.37.2.5 void KDChart::PaintContext::setPainter (QPainter ∗ painter)

Referenced by KDChart::PolarCoordinatePlane::paint(), KDChart::CartesianCoordinatePlane::paint(),


KDChart::CartesianAxis::paint(), KDChart::RingDiagram::paintEvent(), KDChart::PolarDiagram::paint-
Event(), KDChart::PieDiagram::paintEvent(), and KDChart::LineDiagram::paintEvent().

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.37 KDChart::PaintContext Class Reference 487

6.37.2.6 void KDChart::PaintContext::setRectangle (const QRectF & rect)

Referenced by KDChart::PolarCoordinatePlane::paint(), KDChart::CartesianCoordinatePlane::paint(),


KDChart::CartesianAxis::paint(), KDChart::RingDiagram::paintEvent(), KDChart::PolarDiagram::paint-
Event(), KDChart::PieDiagram::paintEvent(), and KDChart::LineDiagram::paintEvent().
The documentation for this class was generated from the following file:

• KDChartPaintContext.h

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


488 KD Chart 2 Class Documentation

6.38 KDChart::Palette Class Reference


#include <KDChartPalette.h>
Inheritance diagram for KDChart::Palette:Collaboration diagram for KDChart::Palette:

6.38.1 Detailed Description

A Palette is a set of brushes (or colors) to be used for painting data sets.
The palette class encapsulates a colletion of brushes, which in the simplest case are colors, to be used for
painting a series of data sets. When asked for the m-th color, a palette of size n will wrap around and thus
cycle through the available colors.
Three builtin palettes are provided for convenience, one with a default set of colors, one with a subdued
color selection, one with rainbow colors.
When a palette changes, it emits a changed() signal. Hook up to it, if you want to repaint when the color
selection changes.
Definition at line 55 of file KDChartPalette.h.

Public Member Functions


• void addBrush (const QBrush &brush, int position=-1)
Adds brush to the palette.

• QBrush getBrush (int position) const


Query the palette for a brush at the specified position.

• bool isValid () const


Returns wether this represents a valid palette.

• Palette & operator= (const Palette &)


• Palette (const Palette &)
• Palette (QObject ∗parent=0)
• void removeBrush (int position)
Remove the brush at position.

• int size () const


Return the number of brushed in the palette.

• ∼Palette ()

Static Public Member Functions


• const Palette & defaultPalette ()
Provide access to the three builtin palettes, one with standard bright colors, one with more subdued colors,
and one with rainbow colors.

• const Palette & rainbowPalette ()


• const Palette & subduedPalette ()

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.38 KDChart::Palette Class Reference 489

Public Attributes
• Q_SIGNALS __pad0__: void changed()

6.38.2 Constructor & Destructor Documentation

6.38.2.1 KDChart::Palette::Palette (QObject ∗ parent = 0) [explicit]

6.38.2.2 KDChart::Palette::Palette (const Palette &)

6.38.2.3 KDChart::Palette::∼Palette ()

6.38.3 Member Function Documentation

6.38.3.1 void KDChart::Palette::addBrush (const QBrush & brush, int position = -1)

Adds brush to the palette.


If no position is specified, the brush is appended.
Referenced by makeDefaultPalette(), makeRainbowPalette(), and makeSubduedPalette().

6.38.3.2 const Palette& KDChart::Palette::defaultPalette () [static]

Provide access to the three builtin palettes, one with standard bright colors, one with more subdued colors,
and one with rainbow colors.
Referenced by KDChart::AttributesModel::headerData().

6.38.3.3 QBrush KDChart::Palette::getBrush (int position) const

Query the palette for a brush at the specified position.


If the position exceeds the size of the palette, it wraps around.
Referenced by KDChart::AttributesModel::headerData(), and makeRainbowPalette().

6.38.3.4 bool KDChart::Palette::isValid () const

Returns wether this represents a valid palette.


For a palette to be valid it needs to have at least one brush associated.

6.38.3.5 Palette& KDChart::Palette::operator= (const Palette &)

6.38.3.6 const Palette& KDChart::Palette::rainbowPalette () [static]

Referenced by KDChart::AttributesModel::headerData().

6.38.3.7 void KDChart::Palette::removeBrush (int position)

Remove the brush at position.

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


490 KD Chart 2 Class Documentation

Parameters:
position,if there is one.

6.38.3.8 int KDChart::Palette::size () const

Return the number of brushed in the palette.

6.38.3.9 const Palette& KDChart::Palette::subduedPalette () [static]

Referenced by KDChart::AttributesModel::headerData().

6.38.4 Member Data Documentation

6.38.4.1 Q_SIGNALS KDChart::Palette::__pad0__

Definition at line 94 of file KDChartPalette.h.


The documentation for this class was generated from the following file:

• KDChartPalette.h

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.39 KDChart::PieAttributes Class Reference 491

6.39 KDChart::PieAttributes Class Reference


#include <KDChartPieAttributes.h>

Public Member Functions


• bool explode () const
• qreal explodeFactor () const
• bool operator!= (const PieAttributes &other) const
• PieAttributes & operator= (const PieAttributes &)
• bool operator== (const PieAttributes &) const
• PieAttributes (const PieAttributes &)
• PieAttributes ()
• void setExplode (bool explode)
Enable or disable exploding the respective pie piece(s).

• void setExplodeFactor (qreal factor)


Set the explode factor.

• ∼PieAttributes ()

6.39.1 Constructor & Destructor Documentation

6.39.1.1 PieAttributes::PieAttributes ()

Definition at line 45 of file KDChartPieAttributes.cpp.

46 : _d( new Private() )


47 {
48 }

6.39.1.2 PieAttributes::PieAttributes (const PieAttributes &)

Definition at line 50 of file KDChartPieAttributes.cpp.


References d.

51 : _d( new Private( *r.d ) )


52 {
53 }

6.39.1.3 PieAttributes::∼PieAttributes ()

Definition at line 65 of file KDChartPieAttributes.cpp.

66 {
67 delete _d; _d = 0;
68 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


492 KD Chart 2 Class Documentation

6.39.2 Member Function Documentation

6.39.2.1 bool PieAttributes::explode () const

Returns:
whether the respective pie piece(s) will be exploded.

Definition at line 90 of file KDChartPieAttributes.cpp.


References d.
Referenced by KDChart::PieDiagram::calculateDataBoundaries().

91 {
92 return (d->explodeFactor != 0.0);
93 }

6.39.2.2 qreal PieAttributes::explodeFactor () const

Returns:
the explode factor set by setExplode or by setExplodeFactor.

Definition at line 100 of file KDChartPieAttributes.cpp.


References d.
Referenced by KDChart::PieDiagram::calculateDataBoundaries(), operator<<(), operator==(), and
KDChart::PieDiagram::paint().

101 {
102 return d->explodeFactor;
103 }

6.39.2.3 bool KDChart::PieAttributes::operator!= (const PieAttributes & other) const

Definition at line 72 of file KDChartPieAttributes.h.

72 { return !operator==(other); }

6.39.2.4 PieAttributes & PieAttributes::operator= (const PieAttributes &)

Definition at line 55 of file KDChartPieAttributes.cpp.


References d.

56 {
57 if( this == &r )
58 return *this;
59
60 *d = *r.d;
61
62 return *this;
63 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.39 KDChart::PieAttributes Class Reference 493

6.39.2.5 bool PieAttributes::operator== (const PieAttributes &) const

Definition at line 71 of file KDChartPieAttributes.cpp.


References explodeFactor().

72 {
73 if( explodeFactor() == r.explodeFactor() )
74 return true;
75 else
76 return false;
77 }

6.39.2.6 void PieAttributes::setExplode (bool explode)

Enable or disable exploding the respective pie piece(s).


The default explode factor is 10 percent; use setExplodeFactor to specify a different factor.

Note:
This is a convenience function: Calling setExplode( true ) does the same as calling setExplodeFactor(
0.1 ), and calling setExplode( false ) does the same as calling setExplodeFactor( 0.0 ).

See also:
setExplodeFactor

Definition at line 85 of file KDChartPieAttributes.cpp.


References d.

86 {
87 d->explodeFactor = (enabled ? 0.1 : 0.0);
88 }

6.39.2.7 void PieAttributes::setExplodeFactor (qreal factor)

Set the explode factor.


The explode factor is a qreal between 0 and 1, and is interpreted as a percentage of the total available radius
of the pie.

See also:
setExplode

Definition at line 95 of file KDChartPieAttributes.cpp.


References d.

96 {
97 d->explodeFactor = factor;
98 }

The documentation for this class was generated from the following files:

• KDChartPieAttributes.h
• KDChartPieAttributes.cpp

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


494 KD Chart 2 Class Documentation

6.40 KDChart::PieDiagram Class Reference


#include <KDChartPieDiagram.h>
Inheritance diagram for KDChart::PieDiagram:Collaboration diagram for KDChart::PieDiagram:

Public Member Functions


• bool allowOverlappingDataValueTexts () const
• bool antiAliasing () const
• virtual AttributesModel ∗ attributesModel () const
Returns the AttributesModel, that is used by this diagram.

• QBrush brush (const QModelIndex &index) const


Retrieve the brush to be used, for painting the datapoint at the given index in the model.

• QBrush brush (int dataset) const


Retrieve the brush to be used for the given dataset.

• QBrush brush () const


Retrieve the brush to be used for painting datapoints globally.

• virtual PieDiagram ∗ clone () const


• int columnCount () const
• AbstractCoordinatePlane ∗ coordinatePlane () const
The coordinate plane associated with the diagram.

• const QPair< QPointF, QPointF > dataBoundaries () const


Return the bottom left and top right data point, that the diagram will display (unless the grid adjusts these
values).

• virtual void dataChanged (const QModelIndex &topLeft, const QModelIndex &bottomRight)


[reimplemented]

• QList< QBrush > datasetBrushes () const


The set of dataset brushes currently used, for use in legends, etc.

• int datasetDimension () const


The dataset dimension of a diagram determines, how many value dimensions it expects each datapoint to
have.

• QStringList datasetLabels () const


The set of dataset labels currently displayed, for use in legends, etc.

• QList< MarkerAttributes > datasetMarkers () const


The set of dataset markers currently used, for use in legends, etc.

• QList< QPen > datasetPens () const


The set of dataset pens currently used, for use in legends, etc.

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.40 KDChart::PieDiagram Class Reference 495

• DataValueAttributes dataValueAttributes (const QModelIndex &index) const


Retrieve the DataValueAttributes for the given index.

• DataValueAttributes dataValueAttributes (int column) const


Retrieve the DataValueAttributes for the given dataset.

• DataValueAttributes dataValueAttributes () const


Retrieve the DataValueAttributes speficied globally.

• virtual void doItemsLayout ()


[reimplemented]

• qreal granularity () const


• virtual int horizontalOffset () const
[reimplemented]

• virtual QModelIndex indexAt (const QPoint &point) const


[reimplemented]

• virtual bool isIndexHidden (const QModelIndex &index) const


[reimplemented]

• QStringList itemRowLabels () const


The set of item row labels currently displayed, for use in Abscissa axes, etc.

• virtual QModelIndex moveCursor (CursorAction cursorAction, Qt::KeyboardModifiers modifiers)


[reimplemented]

• virtual double numberOfGridRings () const


[reimplemented]

• virtual double numberOfValuesPerDataset () const


[reimplemented]

• virtual void paintMarker (QPainter ∗painter, const MarkerAttributes &markerAttributes, const


QBrush &brush, const QPen &, const QPointF &point, const QSizeF &size)
• QPen pen (const QModelIndex &index) const
Retrieve the pen to be used, for painting the datapoint at the given index in the model.

• QPen pen (int dataset) const


Retrieve the pen to be used for the given dataset.

• QPen pen () const


Retrieve the pen to be used for painting datapoints globally.

• bool percentMode () const


• PieAttributes pieAttributes (const QModelIndex &index) const
• PieAttributes pieAttributes (int column) const
• PieAttributes pieAttributes () const
• PieDiagram (QWidget ∗parent=0, PolarCoordinatePlane ∗plane=0)

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


496 KD Chart 2 Class Documentation

• const PolarCoordinatePlane ∗ polarCoordinatePlane () const


• virtual void resize (const QSizeF &area)
[reimplemented]

• virtual void scrollTo (const QModelIndex &index, ScrollHint hint=EnsureVisible)


[reimplemented]

• void setAllowOverlappingDataValueTexts (bool allow)


Set whether data value labels are allowed to overlap.

• void setAntiAliasing (bool enabled)


Set whether anti-aliasing is to be used while rendering this diagram.

• virtual void setAttributesModel (AttributesModel ∗model)


Associate an AttributesModel with this diagram.

• void setBrush (const QBrush &brush)


Set the brush to be used, for painting all datasets in the model.

• void setBrush (int dataset, const QBrush &brush)


Set the brush to be used, for painting the given dataset.

• void setBrush (const QModelIndex &index, const QBrush &brush)


Set the brush to be used, for painting the datapoint at the given index.

• virtual void setCoordinatePlane (AbstractCoordinatePlane ∗plane)


Set the coordinate plane associated with the diagram.

• void setDatasetDimension (int dimension)


Sets the dataset dimension of the diagram.

• void setDataValueAttributes (const DataValueAttributes &a)


Set the DataValueAttributes for all datapoints in the model.

• void setDataValueAttributes (int dataset, const DataValueAttributes &a)


Set the DataValueAttributes for the given dataset.

• void setDataValueAttributes (const QModelIndex &index, const DataValueAttributes &a)


Set the DataValueAttributes for the given index.

• void setGranularity (qreal value)


Set the granularity: the smaller the granularity the more your diagram segments will show facettes instead
of rounded segments.

• virtual void setModel (QAbstractItemModel ∗model)


Associate a model with the diagram.

• void setPen (const QPen &pen)


Set the pen to be used, for painting all datasets in the model.

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.40 KDChart::PieDiagram Class Reference 497

• void setPen (int dataset, const QPen &pen)


Set the pen to be used, for painting the given dataset.

• void setPen (const QModelIndex &index, const QPen &pen)


Set the pen to be used, for painting the datapoint at the given index.

• void setPercentMode (bool percent)


• void setPieAttributes (int column, const PieAttributes &a)
• void setPieAttributes (const PieAttributes &a)
• virtual void setRootIndex (const QModelIndex &idx)
Set the root index in the model, where the diagram starts referencing data for display.

• virtual void setSelection (const QRect &rect, QItemSelectionModel::SelectionFlags command)


[reimplemented]

• void setStartPosition (qreal degrees)


Set the starting angle for the first dataset.

• void setThreeDPieAttributes (const QModelIndex &index, const ThreeDPieAttributes &a)


• void setThreeDPieAttributes (int column, const ThreeDPieAttributes &a)
• void setThreeDPieAttributes (const ThreeDPieAttributes &a)
• qreal startPosition () const
• ThreeDPieAttributes threeDPieAttributes (const QModelIndex &index) const
• ThreeDPieAttributes threeDPieAttributes (int column) const
• ThreeDPieAttributes threeDPieAttributes () const
• void update () const
• void useDefaultColors ()
Set the palette to be used, for painting datasets to the default palette.

• void useRainbowColors ()
Set the palette to be used, for painting datasets to the rainbow palette.

• void useSubduedColors ()
Set the palette to be used, for painting datasets to the subdued palette.

• virtual double valueTotals () const


[reimplemented]

• virtual int verticalOffset () const


[reimplemented]

• virtual QRect visualRect (const QModelIndex &index) const


[reimplemented]

• virtual QRegion visualRegionForSelection (const QItemSelection &selection) const


[reimplemented]

• virtual ∼PieDiagram ()

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


498 KD Chart 2 Class Documentation

Protected Member Functions


• QModelIndex attributesModelRootIndex () const
• virtual const QPair< QPointF, QPointF > calculateDataBoundaries () const
[reimplemented]

• virtual bool checkInvariants (bool justReturnTheStatus=false) const


• QModelIndex columnToIndex (int column) const
• void modelsChanged ()
This signal is emitted, when either the model or the AttributesModel is replaced.

• virtual void paint (PaintContext ∗paintContext)


[reimplemented]

• void paintDataValueText (QPainter ∗painter, const QModelIndex &index, const QPointF &pos, dou-
ble value)
• virtual void paintDataValueTexts (QPainter ∗painter)
• void paintEvent (QPaintEvent ∗)
• void paintMarker (QPainter ∗painter, const QModelIndex &index, const QPointF &pos)
• virtual void paintMarkers (QPainter ∗painter)
• void propertiesChanged ()
Emitted upon change of a property of the Diagram.

• void resizeEvent (QResizeEvent ∗)


• void setAttributesModelRootIndex (const QModelIndex &)
• void setDataBoundariesDirty () const
• double valueForCell (int row, int column) const
Helper method, retrieving the data value (DisplayRole) for a given row and column.

Protected Attributes
• Q_SIGNALS __pad0__: void layoutChanged( AbstractDiagram∗ )

6.40.1 Constructor & Destructor Documentation

6.40.1.1 PieDiagram::PieDiagram (QWidget ∗ parent = 0, PolarCoordinatePlane ∗ plane = 0)


[explicit]

Definition at line 52 of file KDChartPieDiagram.cpp.


Referenced by clone().

52 :
53 AbstractPieDiagram( new Private(), parent, plane )
54 {
55 init();
56 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.40 KDChart::PieDiagram Class Reference 499

6.40.1.2 PieDiagram::∼PieDiagram () [virtual]

Definition at line 58 of file KDChartPieDiagram.cpp.

59 {
60 }

6.40.2 Member Function Documentation

6.40.2.1 bool AbstractDiagram::allowOverlappingDataValueTexts () const [inherited]

Returns:
Whether data value labels are allowed to overlap.

Definition at line 291 of file KDChartAbstractDiagram.cpp.


References d.

295 {

6.40.2.2 bool AbstractDiagram::antiAliasing () const [inherited]

Returns:
Whether anti-aliasing is to be used for rendering this diagram.

Definition at line 302 of file KDChartAbstractDiagram.cpp.


References d.
Referenced by KDChart::LineDiagram::paint().

306 {

6.40.2.3 AttributesModel ∗ AbstractDiagram::attributesModel () const [virtual,


inherited]

Returns the AttributesModel, that is used by this diagram.


By default each diagram owns its own AttributesModel, which should never be deleted. Only if a user-
supplied AttributesModel has been set does the pointer returned here not belong to the diagram.

Returns:
The AttributesModel associated with the diagram.

See also:
setAttributesModel

Definition at line 180 of file KDChartAbstractDiagram.cpp.


References d.
Referenced by KDChart::RingDiagram::paint(), KDChart::PolarDiagram::paint(), and KDChart::Bar-
Diagram::setBarAttributes().

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


500 KD Chart 2 Class Documentation

181 {
182 return d->attributesModel;
183 }

6.40.2.4 QModelIndex AbstractDiagram::attributesModelRootIndex () const [protected,


inherited]

returns a QModelIndex pointing into the AttributesModel that corresponds to the root index of the diagram.
Definition at line 204 of file KDChartAbstractDiagram.cpp.
References d.
Referenced by KDChart::LineDiagram::calculateDataBoundaries(), KDChart::BarDiagram::calculate-
DataBoundaries(), KDChart::LineDiagram::numberOfAbscissaSegments(), KDChart::Bar-
Diagram::numberOfAbscissaSegments(), KDChart::LineDiagram::numberOfOrdinateSegments(),
KDChart::BarDiagram::numberOfOrdinateSegments(), KDChart::LineDiagram::paint(), KDChart::Bar-
Diagram::paint(), and KDChart::AbstractDiagram::valueForCell().

210 {

6.40.2.5 QBrush AbstractDiagram::brush (const QModelIndex & index) const [inherited]

Retrieve the brush to be used, for painting the datapoint at the given index in the model.

Parameters:
index The index of the datapoint in the model.

Returns:
The brush to use for painting.

Definition at line 632 of file KDChartAbstractDiagram.cpp.

638 :
QRect AbstractDiagram::visualRect(const QModelIndex &) const

6.40.2.6 QBrush AbstractDiagram::brush (int dataset) const [inherited]

Retrieve the brush to be used for the given dataset.


This will fall back automatically to what was set at model level, if there are no dataset specific settings.

Parameters:
dataset The dataset to retrieve the brush for.

Returns:
The brush to use for painting.

Definition at line 624 of file KDChartAbstractDiagram.cpp.

631 {

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.40 KDChart::PieDiagram Class Reference 501

6.40.2.7 QBrush AbstractDiagram::brush () const [inherited]

Retrieve the brush to be used for painting datapoints globally.


This will fall back automatically to the default settings, if there are no specific settings.

Returns:
The brush to use for painting.

Definition at line 618 of file KDChartAbstractDiagram.cpp.


Referenced by paint(), and KDChart::AbstractDiagram::paintMarker().

623 {

6.40.2.8 const QPair< QPointF, QPointF > PieDiagram::calculateDataBoundaries () const


[protected, virtual]

[reimplemented]
Implements KDChart::AbstractDiagram.
Definition at line 71 of file KDChartPieDiagram.cpp.
References KDChart::AbstractDiagram::checkInvariants(), KDChart::AbstractPolarDiagram::column-
Count(), KDChart::PieAttributes::explode(), KDChart::PieAttributes::explodeFactor(), and
KDChart::AbstractPieDiagram::pieAttributes().

72 {
73 if ( !checkInvariants( true ) ) return QPair<QPointF, QPointF>( QPointF( 0, 0 ), QPointF( 0, 0 ) );
74
75 const PieAttributes attrs( pieAttributes( model()->index( 0, 0, rootIndex() ) ) );
76
77 QPointF bottomLeft ( QPointF( 0, 0 ) );
78 QPointF topRight;
79 // If we explode, we need extra space for the pie slice that has
80 // the largest explosion distance.
81 if ( attrs.explode() ) {
82 const int colCount = columnCount();
83 qreal maxExplode = 0.0;
84 for( int j = 0; j < colCount; ++j ){
85 const PieAttributes columnAttrs( pieAttributes( model()->index( 0, j, rootIndex() ) ) );
86 maxExplode = qMax( maxExplode, columnAttrs.explodeFactor() );
87 }
88 topRight = QPointF( 1.0+maxExplode, 1.0+maxExplode );
89 }else{
90 topRight = QPointF( 1.0, 1.0 );
91 }
92 return QPair<QPointF, QPointF> ( bottomLeft, topRight );
93 }

6.40.2.9 bool AbstractDiagram::checkInvariants (bool justReturnTheStatus = false) const


[protected, virtual, inherited]

Definition at line 746 of file KDChartAbstractDiagram.cpp.


References KDChart::AbstractDiagram::coordinatePlane().

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


502 KD Chart 2 Class Documentation

Referenced by KDChart::RingDiagram::calculateDataBoundaries(), KDChart::PolarDiagram::calculate-


DataBoundaries(), calculateDataBoundaries(), KDChart::LineDiagram::calculateDataBoundaries(),
KDChart::BarDiagram::calculateDataBoundaries(), KDChart::RingDiagram::paint(), KDChart::Polar-
Diagram::paint(), paint(), KDChart::LineDiagram::paint(), KDChart::BarDiagram::paint(), and
KDChart::AbstractDiagram::paintMarker().

746 {
747 Q_ASSERT_X ( model(), "AbstractDiagram::checkInvariants()",
748 "There is no usable model set, for the diagram." );
749
750 Q_ASSERT_X ( coordinatePlane(), "AbstractDiagram::checkInvariants()",
751 "There is no usable coordinate plane set, for the diagram." );
752 }
753 return model() && coordinatePlane();
754 }
755
756 int AbstractDiagram::datasetDimension( ) const

6.40.2.10 PieDiagram ∗ PieDiagram::clone () const [virtual]

Definition at line 66 of file KDChartPieDiagram.cpp.


References d, and PieDiagram().

67 {
68 return new PieDiagram( new Private( *d ) );
69 }

6.40.2.11 int AbstractPolarDiagram::columnCount () const [inherited]

Definition at line 58 of file KDChartAbstractPolarDiagram.cpp.


References KDChart::AbstractPolarDiagram::numberOfValuesPerDataset().
Referenced by calculateDataBoundaries(), paint(), and valueTotals().

59 {
60 return static_cast<int>( numberOfValuesPerDataset() );
61 }

6.40.2.12 QModelIndex AbstractDiagram::columnToIndex (int column) const [protected,


inherited]

Definition at line 211 of file KDChartAbstractDiagram.cpp.

217 {

6.40.2.13 AbstractCoordinatePlane ∗ AbstractDiagram::coordinatePlane () const


[inherited]

The coordinate plane associated with the diagram.


This determines how coordinates in value space are mapped into pixel space. By default this is a Cartesian-
CoordinatePlane.

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.40 KDChart::PieDiagram Class Reference 503

Returns:
The coordinate plane associated with the diagram.

Definition at line 125 of file KDChartAbstractDiagram.cpp.


References d.
Referenced by KDChart::BarDiagram::calculateDataBoundaries(), KDChart::AbstractDiagram::check-
Invariants(), KDChart::AbstractCartesianDiagram::layoutPlanes(), KDChart::PolarDiagram::paint(),
KDChart::LineDiagram::paint(), KDChart::BarDiagram::paint(), KDChart::AbstractPolarDiagram::polar-
CoordinatePlane(), and KDChart::AbstractCartesianDiagram::setCoordinatePlane().

126 {
127 return d->plane;
128 }

6.40.2.14 const QPair< QPointF, QPointF > AbstractDiagram::dataBoundaries () const


[inherited]

Return the bottom left and top right data point, that the diagram will display (unless the grid adjusts these
values).
This method returns a chached result of calculations done by calculateDataBoundaries. Classes derived
from AbstractDiagram must implement the calculateDataBoundaries function, to specify their own way of
calculating the data boundaries. If derived classes want to force recalculation of the data boundaries, they
can call setDataBoundariesDirty()
Returned value is in diagram coordinates.
Definition at line 130 of file KDChartAbstractDiagram.cpp.
References KDChart::AbstractDiagram::calculateDataBoundaries(), and d.
Referenced by KDChart::CartesianCoordinatePlane::calculateRawDataBoundingRect(), KDChart::Polar-
CoordinatePlane::layoutDiagrams(), KDChart::LineDiagram::paint(), and KDChart::BarDiagram::paint().

131 {
132 if( d->databoundariesDirty ){
133 d->databoundaries = calculateDataBoundaries ();
134 d->databoundariesDirty = false;
135 }
136 return d->databoundaries;
137 }

6.40.2.15 void AbstractDiagram::dataChanged (const QModelIndex & topLeft, const


QModelIndex & bottomRight) [virtual, inherited]

[reimplemented]
Definition at line 232 of file KDChartAbstractDiagram.cpp.
References d.

232 {
233 // We are still too dumb to do intelligent updates...
234 d->databoundariesDirty = true;
235 scheduleDelayedItemsLayout();
236 }
237
238 void AbstractDiagram::setDataValueAttributes( const QModelIndex & index,

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


504 KD Chart 2 Class Documentation

6.40.2.16 QList< QBrush > AbstractDiagram::datasetBrushes () const [inherited]

The set of dataset brushes currently used, for use in legends, etc.

Note:
Cell-level override brushes, if set, take precedence over the dataset values, so you might need to check
these too, in order to find the brush, that is used for a single cell.

Returns:
The current set of dataset brushes.

Definition at line 710 of file KDChartAbstractDiagram.cpp.


Referenced by KDChart::Legend::buildLegend(), KDChart::Legend::datasetCount(), and
KDChart::Legend::setBrushesFromDiagram().

712 {
713 QBrush brush = qVariantValue<QBrush>( attributesModel()->headerData( i, Qt::Vertical, DatasetB
714 ret << brush;
715 }
716
717 return ret;
718 }
719
720 QList<QPen> AbstractDiagram::datasetPens() const

6.40.2.17 int AbstractDiagram::datasetDimension () const [inherited]

The dataset dimension of a diagram determines, how many value dimensions it expects each datapoint to
have.
For each dimension it will expect one column of values in the model. If the dimensionality is 1, automatic
values will be used for the abscissa.
For example a diagram with the default dimension of 1, will have one column per datapoint (the y values)
and will use automatic values for the x axis (1, 2, 3, ... n). If the dimension is 2, the diagram will use the
first, (and the third, fifth, etc) columns as X values, and the second, (and the fourth, sixth, etc) column as Y
values.

Returns:
The dataset dimension of the diagram.

Definition at line 758 of file KDChartAbstractDiagram.cpp.


References d.
Referenced by KDChart::LineDiagram::calculateDataBoundaries(), KDChart::LineDiagram::get-
CellValues(), KDChart::CartesianCoordinatePlane::getDataDimensionsList(), KDChart::Line-
Diagram::paint(), and KDChart::LineDiagram::setType().

762 {

6.40.2.18 QStringList AbstractDiagram::datasetLabels () const [inherited]

The set of dataset labels currently displayed, for use in legends, etc.

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.40 KDChart::PieDiagram Class Reference 505

Returns:
The set of dataset labels currently displayed.

Definition at line 698 of file KDChartAbstractDiagram.cpp.


Referenced by KDChart::Legend::buildLegend(), and KDChart::Legend::datasetCount().

699 : " << attributesModel()->columnCount(attributesModel


700 const int columnCount = attributesModel()->columnCount(attributesModelRootIndex());
701 for( int i = datasetDimension()-1; i < columnCount; i += datasetDimension() ){
702 //qDebug() << "label: " << attributesModel()->headerData( i, Qt::Horizontal, Qt::DisplayRole )
703 ret << attributesModel()->headerData( i, Qt::Horizontal, Qt::DisplayRole ).toString();
704 }
705 return ret;
706 }
707
708 QList<QBrush> AbstractDiagram::datasetBrushes() const

6.40.2.19 QList< MarkerAttributes > AbstractDiagram::datasetMarkers () const


[inherited]

The set of dataset markers currently used, for use in legends, etc.

Note:
Cell-level override markers, if set, take precedence over the dataset values, so you might need to check
these too, in order to find the marker, that is shown for a single cell.

Returns:
The current set of dataset brushes.

Definition at line 733 of file KDChartAbstractDiagram.cpp.


Referenced by KDChart::Legend::buildLegend().

735 {
736 DataValueAttributes a =
737 qVariantValue<DataValueAttributes>( attributesModel()->headerData( i, Qt::Vertical, DataVa
738 const MarkerAttributes &ma = a.markerAttributes();
739 ret << ma;
740 }
741 return ret;
742 }
743
744 bool AbstractDiagram::checkInvariants( bool justReturnTheStatus ) const

6.40.2.20 QList< QPen > AbstractDiagram::datasetPens () const [inherited]

The set of dataset pens currently used, for use in legends, etc.

Note:
Cell-level override pens, if set, take precedence over the dataset values, so you might need to check
these too, in order to find the pens, that is used for a single cell.

Returns:
The current set of dataset pens.

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


506 KD Chart 2 Class Documentation

Definition at line 722 of file KDChartAbstractDiagram.cpp.


Referenced by KDChart::Legend::buildLegend().

724 {
725 QPen pen = qVariantValue<QPen>( attributesModel()->headerData( i, Qt::Vertical, DatasetPenRole
726 ret << pen;
727 }
728 return ret;
729 }
730
731 QList<MarkerAttributes> AbstractDiagram::datasetMarkers() const

6.40.2.21 DataValueAttributes AbstractDiagram::dataValueAttributes (const QModelIndex &


index) const [inherited]

Retrieve the DataValueAttributes for the given index.


This will fall back automatically to what was set at dataset or model level, if there are no datapoint specific
settings.

Parameters:
index The datapoint to retrieve the attributes for.

Returns:
The DataValueAttributes for the given index.

Definition at line 272 of file KDChartAbstractDiagram.cpp.

278 {

6.40.2.22 DataValueAttributes AbstractDiagram::dataValueAttributes (int column) const


[inherited]

Retrieve the DataValueAttributes for the given dataset.


This will fall back automatically to what was set at model level, if there are no dataset specific settings.

Parameters:
dataset The dataset to retrieve the attributes for.

Returns:
The DataValueAttributes for the given dataset.

Definition at line 265 of file KDChartAbstractDiagram.cpp.

271 {

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.40 KDChart::PieDiagram Class Reference 507

6.40.2.23 DataValueAttributes AbstractDiagram::dataValueAttributes () const [inherited]

Retrieve the DataValueAttributes speficied globally.


This will fall back automatically to the default settings, if there are no specific settings.

Returns:
The global DataValueAttributes.

Definition at line 260 of file KDChartAbstractDiagram.cpp.


Referenced by KDChart::AbstractDiagram::paintDataValueText(), and KDChart::AbstractDiagram::paint-
Marker().

264 {

6.40.2.24 void AbstractDiagram::doItemsLayout () [virtual, inherited]

[reimplemented]
Definition at line 223 of file KDChartAbstractDiagram.cpp.
References d, and KDChart::AbstractDiagram::update().

223 {
224 d->plane->layoutDiagrams();
225 update();
226 }
227 QAbstractItemView::doItemsLayout();
228 }
229
230 void AbstractDiagram::dataChanged( const QModelIndex &topLeft,

6.40.2.25 qreal AbstractPieDiagram::granularity () const [inherited]

Returns:
the granularity.

Definition at line 81 of file KDChartAbstractPieDiagram.cpp.


References d.
Referenced by paint().

82 {
83 return (d->granularity < 0.05 || d->granularity > 36.0)
84 ? 1.0
85 : d->granularity;
86 }

6.40.2.26 int AbstractDiagram::horizontalOffset () const [virtual, inherited]

[reimplemented]
Definition at line 655 of file KDChartAbstractDiagram.cpp.

657 { return 0; }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


508 KD Chart 2 Class Documentation

6.40.2.27 QModelIndex AbstractDiagram::indexAt (const QPoint & point) const [virtual,


inherited]

[reimplemented]
Definition at line 649 of file KDChartAbstractDiagram.cpp.

651 { return QModelIndex(); }

6.40.2.28 bool AbstractDiagram::isIndexHidden (const QModelIndex & index) const


[virtual, inherited]

[reimplemented]
Definition at line 661 of file KDChartAbstractDiagram.cpp.

663 {}

6.40.2.29 QStringList AbstractDiagram::itemRowLabels () const [inherited]

The set of item row labels currently displayed, for use in Abscissa axes, etc.

Returns:
The set of item row labels currently displayed.

Definition at line 686 of file KDChartAbstractDiagram.cpp.

687 : " << attributesModel()->rowCount(attributesModelRoo


688 const int rowCount = attributesModel()->rowCount(attributesModelRootIndex());
689 for( int i = 0; i < rowCount; ++i ){
690 //qDebug() << "label: " << attributesModel()->headerData( i, Qt::Vertical, Qt::DisplayRole ).t
691 ret << attributesModel()->headerData( i, Qt::Vertical, Qt::DisplayRole ).toString();
692 }
693 return ret;
694 }
695
696 QStringList AbstractDiagram::datasetLabels() const

6.40.2.30 void KDChart::AbstractDiagram::modelsChanged () [protected, inherited]

This signal is emitted, when either the model or the AttributesModel is replaced.
Referenced by KDChart::AbstractDiagram::setAttributesModel(), and KDChart::AbstractDiagram::set-
Model().

6.40.2.31 QModelIndex AbstractDiagram::moveCursor (CursorAction cursorAction,


Qt::KeyboardModifiers modifiers) [virtual, inherited]

[reimplemented]
Definition at line 652 of file KDChartAbstractDiagram.cpp.

654 { return 0; }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.40 KDChart::PieDiagram Class Reference 509

6.40.2.32 double PieDiagram::numberOfGridRings () const [virtual]

[reimplemented]
Implements KDChart::AbstractPolarDiagram.
Definition at line 1105 of file KDChartPieDiagram.cpp.

1106 {
1107 return 1;
1108 }

6.40.2.33 double PieDiagram::numberOfValuesPerDataset () const [virtual]

[reimplemented]
Implements KDChart::AbstractPolarDiagram.
Definition at line 1099 of file KDChartPieDiagram.cpp.

1100 {
1101 return model()->columnCount( rootIndex() );
1102 }

6.40.2.34 void PieDiagram::paint (PaintContext ∗ paintContext) [protected, virtual]

[reimplemented]
Implements KDChart::AbstractDiagram.
Definition at line 169 of file KDChartPieDiagram.cpp.
References KDChart::AbstractDiagram::brush(), buildReferenceRect(), KDChart::Abstract-
Diagram::checkInvariants(), KDChart::AbstractPolarDiagram::columnCount(), d, KDChart::Abstract-
ThreeDAttributes::depth(), KDChart::PieAttributes::explodeFactor(), KDChart::AbstractPie-
Diagram::granularity(), KDChart::AbstractThreeDAttributes::isEnabled(), KDChart::Paint-
Context::painter(), KDChart::AbstractDiagram::pen(), KDChart::AbstractPieDiagram::pieAttributes(),
KDChart::AbstractPolarDiagram::polarCoordinatePlane(), KDChart::PaintContext::rectangle(),
KDChart::AbstractPieDiagram::startPosition(), KDChart::AbstractPieDiagram::threeDPieAttributes(),
and valueTotals().
Referenced by paintEvent().

170 {
171 if ( !checkInvariants() )
172 return;
173
174 const PieAttributes attrs( pieAttributes() );
175 const ThreeDPieAttributes threeDAttrs( threeDPieAttributes( model()->index( 0, 0, rootIndex() ) )
176
177 const int colCount = columnCount();
178
179 QRectF contentsRect( buildReferenceRect( polarCoordinatePlane() ) );
180 contentsRect = ctx->rectangle();
181 // contentsRect = geometry();
182 //qDebug() << contentsRect;
183 if( contentsRect.isEmpty() )
184 return;
185

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


510 KD Chart 2 Class Documentation

186 DataValueTextInfoList list;


187 const qreal sum = valueTotals();
188
189 if( sum == 0.0 ) //nothing to draw
190 return;
191
192 d->startAngles.resize( colCount );
193 d->angleLens.resize( colCount );
194
195 // compute position
196 d->size = qMin( contentsRect.width(), contentsRect.height() ); // initial size
197
198 // if the pies explode, we need to give them additional space =>
199 // make the basic size smaller
200 qreal maxExplode = 0.0;
201 for( int j = 0; j < colCount; ++j ){
202 const PieAttributes columnAttrs( pieAttributes( model()->index( 0, j, rootIndex() ) ) );
203 maxExplode = qMax( maxExplode, columnAttrs.explodeFactor() );
204 }
205 d->size /= ( 1.0 + 2.0 * maxExplode );
206
207
208 qreal sizeFor3DEffect = 0.0;
209 if ( ! threeDAttrs.isEnabled() ) {
210
211 qreal x = ( contentsRect.width() == d->size ) ? 0.0 : ( ( contentsRect.width() - d->size ) / 2
212 qreal y = ( contentsRect.height() == d->size ) ? 0.0 : ( ( contentsRect.height() - d->size ) /
213 d->position = QRectF( x, y, d->size, d->size );
214 d->position.translate( contentsRect.left(), contentsRect.top() );
215 } else {
216 // threeD: width is the maximum possible width; height is 1/2 of that
217 qreal x = ( contentsRect.width() == d->size ) ? 0.0 : ( ( contentsRect.width() - d->size ) / 2
218 qreal height = d->size;
219 // make sure that the height plus the threeDheight is not more than the
220 // available size
221 if ( threeDAttrs.depth() >= 0.0 ) {
222 // positive pie height: absolute value
223 sizeFor3DEffect = threeDAttrs.depth();
224 height = d->size - sizeFor3DEffect;
225 } else {
226 // negative pie height: relative value
227 sizeFor3DEffect = - threeDAttrs.depth() / 100.0 * height;
228 height = d->size - sizeFor3DEffect;
229 }
230 qreal y = ( contentsRect.height() == height ) ? 0.0 : ( ( contentsRect.height() - height - siz
231
232 d->position = QRectF( contentsRect.left() + x, contentsRect.top() + y,
233 d->size, height );
234 // d->position.moveBy( contentsRect.left(), contentsRect.top() );
235 }
236
237 const qreal sectorsPerValue = 360.0 / sum;
238 const qreal startAngle = startPosition();
239 qreal currentValue = startAngle;
240
241 bool atLeastOneValue = false; // guard against completely empty tables
242 QVariant vValY;
243 for ( int iColumn = 0; iColumn < colCount; ++iColumn ) {
244 // is there anything at all at this column?
245 bool bOK;
246 const double cellValue = qAbs( model()->data( model()->index( 0, iColumn, rootIndex() ) )
247 .toDouble( &bOK ) );
248
249 if( bOK ){
250 d->startAngles[ iColumn ] = currentValue;
251 d->angleLens[ iColumn ] = cellValue * sectorsPerValue;
252 atLeastOneValue = true;

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.40 KDChart::PieDiagram Class Reference 511

253 } else { // mark as non-existent


254 d->angleLens[ iColumn ] = 0.0;
255 if ( iColumn > 0.0 )
256 d->startAngles[ iColumn ] = d->startAngles[ iColumn - 1 ];
257 else
258 d->startAngles[ iColumn ] = currentValue;
259 }
260 //qDebug() << "d->startAngles["<<iColumn<<"] == " << d->startAngles[ iColumn ]
261 // << " + d->angleLens["<<iColumn<<"]" << d->angleLens[ iColumn ]
262 // << " = " << d->startAngles[ iColumn ]+d->angleLens[ iColumn ];
263
264 currentValue = d->startAngles[ iColumn ] + d->angleLens[ iColumn ];
265 }
266
267 // If there was no value at all, bail out, to avoid endless loops
268 // later on (e.g. in findPieAt()).
269 if( ! atLeastOneValue )
270 return;
271
272
273 // Find the backmost pie which is at +90Âř and needs to be drawn
274 // first
275 int backmostpie = findPieAt( 90, colCount );
276 // Find the frontmost pie (at -90Âř/+270Âř) that should be drawn last
277 int frontmostpie = findPieAt( 270, colCount );
278 // the right- and the leftmost (only needed in some special cases...)
279 int rightmostpie = findPieAt( 0, colCount );
280 int leftmostpie = findPieAt( 180, colCount );
281
282
283 int currentLeftPie = backmostpie;
284 int currentRightPie = backmostpie;
285
286 drawOnePie( ctx->painter(), 0, backmostpie, granularity(), sizeFor3DEffect );
287
288 if( backmostpie == frontmostpie )
289 {
290 if( backmostpie == leftmostpie )
291 currentLeftPie = findLeftPie( currentLeftPie, colCount );
292 if( backmostpie == rightmostpie )
293 currentRightPie = findRightPie( currentRightPie, colCount );
294 }
295 while( currentLeftPie != frontmostpie )
296 {
297 if( currentLeftPie != backmostpie )
298 drawOnePie( ctx->painter(), 0, currentLeftPie, granularity(), sizeFor3DEffect );
299 currentLeftPie = findLeftPie( currentLeftPie, colCount );
300 }
301 while( currentRightPie != frontmostpie )
302 {
303 if( currentRightPie != backmostpie )
304 drawOnePie( ctx->painter(), 0, currentRightPie, granularity(), sizeFor3DEffect );
305 currentRightPie = findRightPie( currentRightPie, colCount );
306 }
307
308 // if the backmost pie is not the frontmost pie, we draw the frontmost at last
309 if( backmostpie != frontmostpie || ! threeDPieAttributes().isEnabled() )
310 {
311 drawOnePie( ctx->painter(), 0, frontmostpie, granularity(), sizeFor3DEffect );
312 // else, this gets a bit mor complicated...
313 } else if( threeDPieAttributes().isEnabled() ) {
314 drawPieSurface( ctx->painter(), 0, frontmostpie, granularity() );
315 const QModelIndex index = model()->index( 0, frontmostpie, rootIndex() );
316 QPen pen = this->pen( index );
317 ctx->painter()->setRenderHint ( QPainter::Antialiasing );
318 ctx->painter()->setBrush( brush( index ) );
319 if ( threeDAttrs.isEnabled() )

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


512 KD Chart 2 Class Documentation

320 pen.setColor( QColor( 0, 0, 0 ) );


321 ctx->painter()->setPen( pen );
322
323 qreal startAngle = d->startAngles[ frontmostpie ];
324 if( startAngle > 360 )
325 startAngle -= 360;
326
327 qreal endAngle = startAngle + d->angleLens[ frontmostpie ];
328 startAngle = qMax( startAngle, 180.0 );
329
330 drawArcEffectSegment( ctx->painter(), piePosition( 0, frontmostpie),
331 sizeFor3DEffect, startAngle, endAngle, granularity() );
332 }
333 }

6.40.2.35 void AbstractDiagram::paintDataValueText (QPainter ∗ painter, const QModelIndex &


index, const QPointF & pos, double value) [protected, inherited]

Definition at line 318 of file KDChartAbstractDiagram.cpp.


References KDChart::DataValueAttributes::dataLabel(), KDChart::AbstractDiagram::dataValue-
Attributes(), KDChart::DataValueAttributes::decimalDigits(), KDChart::TextAttributes::font(),
KDChart::TextAttributes::isVisible(), KDChart::DataValueAttributes::isVisible(), KDChart::Text-
Attributes::pen(), KDChart::DataValueAttributes::prefix(), KDChart::TextAttributes::rotation(),
KDChart::DataValueAttributes::suffix(), and KDChart::DataValueAttributes::textAttributes().
Referenced by KDChart::RingDiagram::paint(), KDChart::PolarDiagram::paint(), KDChart::Line-
Diagram::paint(), and KDChart::BarDiagram::paint().

320 {
321 // paint one data series
322 DataValueAttributes a = dataValueAttributes(index);
323 if ( !a.isVisible() ) return;
324
325 // handle decimal digits
326 int decimalDigits = a.decimalDigits();
327 int decimalPos = QString::number( value ).indexOf( QLatin1Char( ’.’ ) );
328 QString roundedValue;
329 if ( a.dataLabel().isNull() ) {
330 if ( decimalPos > 0 && value != 0 )
331 roundedValue = roundValues ( value, decimalPos, decimalDigits );
332 else
333 roundedValue = QString::number( value );
334 } else
335 roundedValue = a.dataLabel();
336 // handle prefix and suffix
337 if ( !a.prefix().isNull() )
338 roundedValue.prepend( a.prefix() );
339
340 if ( !a.suffix().isNull() )
341 roundedValue.append( a.suffix() );
342
343 PainterSaver painterSaver( painter );
344 // FIXME draw the non-text bits, background, etc
345 const TextAttributes &ta = a.textAttributes();
346 if ( ta.isVisible() ) {
347 painter->setPen( ta.pen() );
348 painter->setFont( ta.font() );
349 painter->translate( pos );
350 painter->rotate( ta.rotation() );
351 painter->drawText( QPointF(0, 0), roundedValue );
352 }
353 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.40 KDChart::PieDiagram Class Reference 513

354
355 QString AbstractDiagram::roundValues( double value,

6.40.2.36 void AbstractDiagram::paintDataValueTexts (QPainter ∗ painter) [protected,


virtual, inherited]

Definition at line 382 of file KDChartAbstractDiagram.cpp.

385 {
386 for ( int j=0; j< rowCount; ++j ) {
387 const QModelIndex index = model()->index( j, i, rootIndex() );
388 double value = model()->data( index ).toDouble();
389 const QPointF pos = coordinatePlane()->translate( QPointF( j, value ) );
390 paintDataValueText( painter, index, pos, value );
391 }
392 }
393 }
394
395

6.40.2.37 void PieDiagram::paintEvent (QPaintEvent ∗) [protected]

Definition at line 96 of file KDChartPieDiagram.cpp.


References paint(), KDChart::PaintContext::setPainter(), and KDChart::PaintContext::setRectangle().

97 {
98 QPainter painter ( viewport() );
99 PaintContext ctx;
100 ctx.setPainter ( &painter );
101 ctx.setRectangle( QRectF ( 0, 0, width(), height() ) );
102 paint ( &ctx );
103 }

6.40.2.38 void AbstractDiagram::paintMarker (QPainter ∗ painter, const QModelIndex & index,


const QPointF & pos) [protected, inherited]

Definition at line 398 of file KDChartAbstractDiagram.cpp.


References KDChart::AbstractDiagram::brush(), KDChart::AbstractDiagram::checkInvariants(),
KDChart::AbstractDiagram::dataValueAttributes(), KDChart::MarkerAttributes::isVisible(),
KDChart::DataValueAttributes::isVisible(), KDChart::DataValueAttributes::markerAttributes(),
KDChart::MarkerAttributes::markerColor(), KDChart::MarkerAttributes::markerSize(),
KDChart::AbstractDiagram::paintMarker(), and KDChart::MarkerAttributes::pen().

399 {
400
401 if ( !checkInvariants() ) return;
402 DataValueAttributes a = dataValueAttributes(index);
403 if ( !a.isVisible() ) return;
404 const MarkerAttributes &ma = a.markerAttributes();
405 if ( !ma.isVisible() ) return;
406
407 PainterSaver painterSaver( painter );
408 QSizeF maSize( ma.markerSize() );
409 QBrush indexBrush( brush( index ) );

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


514 KD Chart 2 Class Documentation

410 QPen indexPen( ma.pen() );


411 if ( ma.markerColor().isValid() )
412 indexBrush.setColor( ma.markerColor() );
413
414 paintMarker( painter, ma, indexBrush, indexPen, pos, maSize );
415 }
416
417

6.40.2.39 void AbstractDiagram::paintMarker (QPainter ∗ painter, const MarkerAttributes &


markerAttributes, const QBrush & brush, const QPen &, const QPointF & point, const
QSizeF & size) [virtual, inherited]

Definition at line 420 of file KDChartAbstractDiagram.cpp.


References KDChart::MarkerAttributes::markerStyle().
Referenced by KDChart::LineDiagram::paint(), KDChart::MarkerLayoutItem::paint(), and
KDChart::AbstractDiagram::paintMarker().

424 {
425 PainterSaver painterSaver( painter );
426 painter->setBrush( brush );
427 painter->setPen( pen );
428 painter->setRenderHint ( QPainter::Antialiasing );
429 painter->translate( pos );
430 switch ( markerAttributes.markerStyle() ) {
431 case MarkerAttributes::MarkerCircle:
432 painter->drawEllipse( QRectF( 0 - maSize.height()/2, 0 - maSize.width()/2,
433 maSize.height(), maSize.width()) );
434 break;
435 case MarkerAttributes::MarkerSquare:
436 {
437 QRectF rect( 0 - maSize.height()/2, 0 - maSize.width()/2,
438 maSize.height(), maSize.width() );
439 painter->drawRect( rect );
440 painter->fillRect( rect, painter->brush() );
441 break;
442 }
443 case MarkerAttributes::MarkerDiamond:
444 {
445 QVector <QPointF > diamondPoints;
446 QPointF top, left, bottom, right;
447 top = QPointF( 0, 0 - maSize.height()/2 );
448 left = QPointF( 0 - maSize.width()/2, 0 );
449 bottom = QPointF( 0, maSize.height()/2 );
450 right = QPointF( maSize.width()/2, 0 );
451 diamondPoints << top << left << bottom << right;
452 painter->drawPolygon( diamondPoints );
453 break;
454 }
455 //Pending Michel: do we need that? Ask: What is the idea about
456 // Marker1Pixel and Marker4Pixels.
457 case MarkerAttributes::Marker1Pixel:
458 {
459 QSizeF pSize(4,4);
460 QPen pen1Pixel;
461 pen1Pixel.setColor( painter->background().color() );
462 QRectF centerRect( -pSize.height()/2, -pSize.width()/2,
463 pSize.height(), pSize.width() );
464 painter->setPen( pen1Pixel );
465 painter->drawEllipse( centerRect );
466 break;
467 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.40 KDChart::PieDiagram Class Reference 515

468 case MarkerAttributes::Marker4Pixels:


469 {
470 QSizeF pSize(8, 8);
471 QPen pen4Pixel;
472 pen4Pixel.setColor( painter->background().color() );
473 QRectF centerRect( -pSize.height()/2, -pSize.width()/2,
474 pSize.height(), pSize.width() );
475 painter->setPen( pen4Pixel );
476 painter->drawEllipse( centerRect );
477 break;
478 }
479 case MarkerAttributes::MarkerRing:
480 {
481 painter->setBrush( Qt::NoBrush );
482 painter->drawEllipse( QRectF( 0 - maSize.height()/2, 0 - maSize.width()/2,
483 maSize.height(), maSize.width()) );
484 break;
485 }
486 case MarkerAttributes::MarkerCross:
487 {
488 QVector <QPointF > crossPoints;
489 QPointF leftTop, leftBottom, centerBottomLeft, bottomLeft, bottomRight,
490 centerBottomRight,rightBottom, rightTop, centerTopRight, topRight, topLeft,
491 centerTopLeft;
492 leftTop = QPointF( -maSize.width()/2, -maSize.height()/4 );
493 leftBottom = QPointF( -maSize.width()/2, maSize.height()/4 );
494 centerBottomLeft = QPointF( -maSize.width()/4, maSize.height()/4 );
495 bottomLeft = QPointF( -maSize.width()/4, maSize.height()/2 );
496 bottomRight = QPointF( maSize.width()/4, maSize.height()/2 );
497 centerBottomRight = QPointF( maSize.width()/4, maSize.height()/4 );
498 rightBottom = QPointF( maSize.width()/2, maSize.height()/4 );
499 rightTop = QPointF( maSize.width()/2, -maSize.height()/4 );
500 centerTopRight = QPointF( maSize.width()/4, -maSize.height()/4 );
501 topRight = QPointF( maSize.width()/4, -maSize.height()/2 );
502 topLeft = QPointF( -maSize.width()/4, -maSize.height()/2 );
503 centerTopLeft = QPointF( -maSize.width()/4, -maSize.height()/4 );
504
505 crossPoints << leftTop << leftBottom << centerBottomLeft
506 << bottomLeft << bottomRight << centerBottomRight
507 << rightBottom << rightTop << centerTopRight
508 << topRight << topLeft << centerTopLeft;
509
510 painter->drawPolygon( crossPoints );
511 break;
512 }
513 case MarkerAttributes::MarkerFastCross:
514 {
515 QPointF left, right, top, bottom;
516 left = QPointF( -maSize.width()/2, 0 );
517 right = QPointF( maSize.width()/2, 0 );
518 top = QPointF( 0, -maSize.height()/2 );
519 bottom= QPointF( 0, maSize.height()/2 );
520 painter->drawLine( left, right );
521 painter->drawLine( top, bottom );
522 break;
523 }
524 default:
525 Q_ASSERT_X ( false, "paintMarkers()",
526 "Type item does not match a defined Marker Type." );
527 }
528 }
529
530 void AbstractDiagram::paintMarkers( QPainter* painter )

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


516 KD Chart 2 Class Documentation

6.40.2.40 void AbstractDiagram::paintMarkers (QPainter ∗ painter) [protected,


virtual, inherited]

Definition at line 532 of file KDChartAbstractDiagram.cpp.

535 {
536 for ( int j=0; j< rowCount; ++j ) {
537 const QModelIndex index = model()->index( j, i, rootIndex() );
538 double value = model()->data( index ).toDouble();
539 const QPointF pos = coordinatePlane()->translate( QPointF( j, value ) );
540 paintMarker( painter, index, pos );
541 }
542 }
543 }
544
545

6.40.2.41 QPen AbstractDiagram::pen (const QModelIndex & index) const [inherited]

Retrieve the pen to be used, for painting the datapoint at the given index in the model.

Parameters:
index The index of the datapoint in the model.

Returns:
The pen to use for painting.

Definition at line 586 of file KDChartAbstractDiagram.cpp.

593 {

6.40.2.42 QPen AbstractDiagram::pen (int dataset) const [inherited]

Retrieve the pen to be used for the given dataset.


This will fall back automatically to what was set at model level, if there are no dataset specific settings.

Parameters:
dataset The dataset to retrieve the pen for.

Returns:
The pen to use for painting.

Definition at line 578 of file KDChartAbstractDiagram.cpp.

585 {

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.40 KDChart::PieDiagram Class Reference 517

6.40.2.43 QPen AbstractDiagram::pen () const [inherited]

Retrieve the pen to be used for painting datapoints globally.


This will fall back automatically to the default settings, if there are no specific settings.

Returns:
The pen to use for painting.

Definition at line 572 of file KDChartAbstractDiagram.cpp.


Referenced by paint().

577 {

6.40.2.44 bool AbstractDiagram::percentMode () const [inherited]

Definition at line 313 of file KDChartAbstractDiagram.cpp.


References d.
Referenced by KDChart::CartesianCoordinatePlane::getDataDimensionsList().

320 {

6.40.2.45 PieAttributes AbstractPieDiagram::pieAttributes (const QModelIndex & index) const


[inherited]

Definition at line 122 of file KDChartAbstractPieDiagram.cpp.


References d, and KDChart::PieAttributesRole.

123 {
124 return qVariantValue<PieAttributes>(
125 d->attributesModel->data(
126 d->attributesModel->mapFromSource( index ),
127 PieAttributesRole ) );
128 }

6.40.2.46 PieAttributes AbstractPieDiagram::pieAttributes (int column) const [inherited]

Definition at line 114 of file KDChartAbstractPieDiagram.cpp.


References d, and KDChart::PieAttributesRole.

115 {
116 return qVariantValue<PieAttributes>(
117 d->attributesModel->data(
118 d->attributesModel->mapFromSource( columnToIndex( column ) ).column(),
119 PieAttributesRole ) );
120 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


518 KD Chart 2 Class Documentation

6.40.2.47 PieAttributes AbstractPieDiagram::pieAttributes () const [inherited]

Definition at line 105 of file KDChartAbstractPieDiagram.cpp.


References d, and KDChart::PieAttributesRole.
Referenced by calculateDataBoundaries(), and paint().

106 {
107 return qVariantValue<PieAttributes>(
108 d->attributesModel->data( PieAttributesRole ) );
109 }

6.40.2.48 const PolarCoordinatePlane ∗ AbstractPolarDiagram::polarCoordinatePlane () const


[inherited]

Definition at line 53 of file KDChartAbstractPolarDiagram.cpp.


References KDChart::AbstractDiagram::coordinatePlane().
Referenced by paint().

54 {
55 return dynamic_cast<const PolarCoordinatePlane*>( coordinatePlane() );
56 }

6.40.2.49 void KDChart::AbstractDiagram::propertiesChanged () [protected,


inherited]

Emitted upon change of a property of the Diagram.


Referenced by KDChart::AbstractDiagram::setDataValueAttributes(), KDChart::LineDiagram::setLine-
Attributes(), KDChart::LineDiagram::setThreeDLineAttributes(), and KDChart::LineDiagram::setType().

6.40.2.50 void PieDiagram::resize (const QSizeF & area) [virtual]

[reimplemented]
Implements KDChart::AbstractDiagram.
Definition at line 109 of file KDChartPieDiagram.cpp.

110 {
111 }

6.40.2.51 void PieDiagram::resizeEvent (QResizeEvent ∗) [protected]

Definition at line 105 of file KDChartPieDiagram.cpp.

106 {
107 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.40 KDChart::PieDiagram Class Reference 519

6.40.2.52 void AbstractDiagram::scrollTo (const QModelIndex & index, ScrollHint hint =


EnsureVisible) [virtual, inherited]

[reimplemented]
Definition at line 646 of file KDChartAbstractDiagram.cpp.

648 { return QModelIndex(); }

6.40.2.53 void AbstractDiagram::setAllowOverlappingDataValueTexts (bool allow)


[inherited]

Set whether data value labels are allowed to overlap.

Parameters:
allow True means that overlapping labels are allowed.

Definition at line 285 of file KDChartAbstractDiagram.cpp.


References d.

290 {

6.40.2.54 void AbstractDiagram::setAntiAliasing (bool enabled) [inherited]

Set whether anti-aliasing is to be used while rendering this diagram.

Parameters:
enabled True means that AA is enabled.

Definition at line 296 of file KDChartAbstractDiagram.cpp.


References d.

301 {

6.40.2.55 void AbstractDiagram::setAttributesModel (AttributesModel ∗ model) [virtual,


inherited]

Associate an AttributesModel with this diagram.


Note that the diagram does _not_ take ownership of the AttributesModel. This should thus only be used
with AttributesModels that have been explicitely created by the user, and are owned by her. Setting an
AttributesModel that is internal to another diagram is an error.
Correct:

AttributesModel *am = new AttributesModel( model, 0 );


diagram1->setAttributesModel( am );
diagram2->setAttributesModel( am );

Wrong:

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


520 KD Chart 2 Class Documentation

diagram1->setAttributesModel( diagram2->attributesModel() );

Parameters:
model The AttributesModel to use for this diagram.

See also:
AttributesModel

Definition at line 160 of file KDChartAbstractDiagram.cpp.


References d, and KDChart::AbstractDiagram::modelsChanged().

161 {
162 if( amodel->sourceModel() != model() ) {
163 qWarning("KDChart::AbstractDiagram::setAttributesModel() failed: "
164 "Trying to set an attributesmodel which works on a different "
165 "model than the diagram.");
166 return;
167 }
168 if( qobject_cast<PrivateAttributesModel*>(amodel) ) {
169 qWarning("KDChart::AbstractDiagram::setAttributesModel() failed: "
170 "Trying to set an attributesmodel that is private to another diagram.");
171 return;
172 }
173 d->setAttributesModel(amodel);
174 scheduleDelayedItemsLayout();
175 d->databoundariesDirty = true;
176 emit modelsChanged();
177 }

6.40.2.56 void AbstractDiagram::setAttributesModelRootIndex (const QModelIndex & idx)


[protected, inherited]

Definition at line 195 of file KDChartAbstractDiagram.cpp.


References d.

6.40.2.57 void AbstractDiagram::setBrush (const QBrush & brush) [inherited]

Set the brush to be used, for painting all datasets in the model.

Parameters:
brush The brush to use.

Definition at line 602 of file KDChartAbstractDiagram.cpp.

608 {

6.40.2.58 void AbstractDiagram::setBrush (int dataset, const QBrush & brush) [inherited]

Set the brush to be used, for painting the given dataset.

Parameters:
dataset The dataset’s column in the model.

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.40 KDChart::PieDiagram Class Reference 521

pen The brush to use.

Definition at line 609 of file KDChartAbstractDiagram.cpp.

617 {

6.40.2.59 void AbstractDiagram::setBrush (const QModelIndex & index, const QBrush & brush)
[inherited]

Set the brush to be used, for painting the datapoint at the given index.

Parameters:
index The datapoint’s index in the model.
brush The brush to use.

Definition at line 594 of file KDChartAbstractDiagram.cpp.

601 {

6.40.2.60 void AbstractDiagram::setCoordinatePlane (AbstractCoordinatePlane ∗ plane)


[virtual, inherited]

Set the coordinate plane associated with the diagram.


This determines how coordinates in value space are mapped into pixel space. The chart takes ownership.

Returns:
The coordinate plane associated with the diagram.

Reimplemented in KDChart::AbstractCartesianDiagram.
Definition at line 218 of file KDChartAbstractDiagram.cpp.
References d.
Referenced by KDChart::AbstractCoordinatePlane::addDiagram(), KDChart::AbstractCartesian-
Diagram::setCoordinatePlane(), and KDChart::AbstractCoordinatePlane::takeDiagram().

222 {

6.40.2.61 void AbstractDiagram::setDataBoundariesDirty () const [protected,


inherited]

Definition at line 139 of file KDChartAbstractDiagram.cpp.


References d.
Referenced by KDChart::BarDiagram::setThreeDBarAttributes(), KDChart::LineDiagram::setThree-
DLineAttributes(), KDChart::LineDiagram::setType(), and KDChart::BarDiagram::setType().

140 {
141 d->databoundariesDirty = true;
142 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


522 KD Chart 2 Class Documentation

6.40.2.62 void AbstractDiagram::setDatasetDimension (int dimension) [inherited]

Sets the dataset dimension of the diagram.

See also:
datasetDimension.

Parameters:
dimension

Definition at line 763 of file KDChartAbstractDiagram.cpp.


References d.

770 {

6.40.2.63 void AbstractDiagram::setDataValueAttributes (const DataValueAttributes & a)


[inherited]

Set the DataValueAttributes for all datapoints in the model.

Parameters:
a The attributes to set.

Definition at line 279 of file KDChartAbstractDiagram.cpp.


References d.

284 {

6.40.2.64 void AbstractDiagram::setDataValueAttributes (int dataset, const DataValueAttributes


& a) [inherited]

Set the DataValueAttributes for the given dataset.

Parameters:
dataset The dataset to set the attributes for.
a The attributes to set.

Definition at line 251 of file KDChartAbstractDiagram.cpp.


References d.

259 {

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.40 KDChart::PieDiagram Class Reference 523

6.40.2.65 void AbstractDiagram::setDataValueAttributes (const QModelIndex & index, const


DataValueAttributes & a) [inherited]

Set the DataValueAttributes for the given index.

Parameters:
index The datapoint to set the attributes for.
a The attributes to set.

Definition at line 240 of file KDChartAbstractDiagram.cpp.


References d, KDChart::DataValueLabelAttributesRole, and KDChart::AbstractDiagram::properties-
Changed().

240 {
241 d->attributesModel->setData(
242 d->attributesModel->mapFromSource( index ),
243 qVariantFromValue( a ),
244 DataValueLabelAttributesRole );
245 emit propertiesChanged();
246 }
247
248

6.40.2.66 void AbstractPieDiagram::setGranularity (qreal value) [inherited]

Set the granularity: the smaller the granularity the more your diagram segments will show facettes instead
of rounded segments.

Parameters:
value the granularity value between 0.05 (one twentieth of a degree) and 36.0 (one tenth of a full
circle), other values will be interpreted as 1.0.

Definition at line 76 of file KDChartAbstractPieDiagram.cpp.


References d.

77 {
78 d->granularity = value;
79 }

6.40.2.67 void AbstractDiagram::setModel (QAbstractItemModel ∗ model) [virtual,


inherited]

Associate a model with the diagram.


Definition at line 144 of file KDChartAbstractDiagram.cpp.
References d, KDChart::AttributesModel::initFrom(), and KDChart::AbstractDiagram::modelsChanged().

145 {
146 QAbstractItemView::setModel( newModel );
147 AttributesModel* amodel = new PrivateAttributesModel( newModel, this );
148 amodel->initFrom( d->attributesModel );
149 d->setAttributesModel(amodel);

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


524 KD Chart 2 Class Documentation

150 scheduleDelayedItemsLayout();
151 d->databoundariesDirty = true;
152 emit modelsChanged();
153 }

6.40.2.68 void AbstractDiagram::setPen (const QPen & pen) [inherited]

Set the pen to be used, for painting all datasets in the model.

Parameters:
pen The pen to use.

Definition at line 556 of file KDChartAbstractDiagram.cpp.

562 {

6.40.2.69 void AbstractDiagram::setPen (int dataset, const QPen & pen) [inherited]

Set the pen to be used, for painting the given dataset.

Parameters:
dataset The dataset’s row in the model.
pen The pen to use.

Definition at line 563 of file KDChartAbstractDiagram.cpp.

571 {

6.40.2.70 void AbstractDiagram::setPen (const QModelIndex & index, const QPen & pen)
[inherited]

Set the pen to be used, for painting the datapoint at the given index.

Parameters:
index The datapoint’s index in the model.
pen The pen to use.

Definition at line 548 of file KDChartAbstractDiagram.cpp.

555 {

6.40.2.71 void AbstractDiagram::setPercentMode (bool percent) [inherited]

Definition at line 307 of file KDChartAbstractDiagram.cpp.


References d.
Referenced by KDChart::LineDiagram::setType(), and KDChart::BarDiagram::setType().

312 {

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.40 KDChart::PieDiagram Class Reference 525

6.40.2.72 void AbstractPieDiagram::setPieAttributes (int column, const PieAttributes & a)


[inherited]

Definition at line 95 of file KDChartAbstractPieDiagram.cpp.


References d, and KDChart::PieAttributesRole.

96 {
97 d->attributesModel->setHeaderData(
98 column, Qt::Vertical, qVariantFromValue( attrs ), PieAttributesRole );
99 emit layoutChanged( this );
100 }

6.40.2.73 void AbstractPieDiagram::setPieAttributes (const PieAttributes & a) [inherited]

Definition at line 89 of file KDChartAbstractPieDiagram.cpp.


References d, and KDChart::PieAttributesRole.

90 {
91 d->attributesModel->setModelData( qVariantFromValue( attrs ), PieAttributesRole );
92 emit layoutChanged( this );
93 }

6.40.2.74 void AbstractDiagram::setRootIndex (const QModelIndex & idx) [virtual,


inherited]

Set the root index in the model, where the diagram starts referencing data for display.
[reimplemented]
Definition at line 188 of file KDChartAbstractDiagram.cpp.
References d.

6.40.2.75 void AbstractDiagram::setSelection (const QRect & rect,


QItemSelectionModel::SelectionFlags command) [virtual, inherited]

[reimplemented]
Definition at line 664 of file KDChartAbstractDiagram.cpp.

666 { return QRegion(); }

6.40.2.76 void AbstractPieDiagram::setStartPosition (qreal degrees) [inherited]

Set the starting angle for the first dataset.


Definition at line 65 of file KDChartAbstractPieDiagram.cpp.
References d.

66 {
67 d->startPosition = degrees;
68 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


526 KD Chart 2 Class Documentation

6.40.2.77 void AbstractPieDiagram::setThreeDPieAttributes (const QModelIndex & index, const


ThreeDPieAttributes & a) [inherited]

Definition at line 144 of file KDChartAbstractPieDiagram.cpp.


References KDChart::ThreeDPieAttributesRole.

145 {
146 model()->setData( index, qVariantFromValue( tda ), ThreeDPieAttributesRole );
147 emit layoutChanged( this );
148 }

6.40.2.78 void AbstractPieDiagram::setThreeDPieAttributes (int column, const


ThreeDPieAttributes & a) [inherited]

Definition at line 137 of file KDChartAbstractPieDiagram.cpp.


References d, and KDChart::ThreeDPieAttributesRole.

138 {
139 d->attributesModel->setHeaderData(
140 column, Qt::Vertical, qVariantFromValue( tda ), ThreeDPieAttributesRole );
141 emit layoutChanged( this );
142 }

6.40.2.79 void AbstractPieDiagram::setThreeDPieAttributes (const ThreeDPieAttributes & a)


[inherited]

Definition at line 131 of file KDChartAbstractPieDiagram.cpp.


References d, and KDChart::ThreeDPieAttributesRole.

132 {
133 d->attributesModel->setModelData( qVariantFromValue( tda ), ThreeDPieAttributesRole );
134 emit layoutChanged( this );
135 }

6.40.2.80 qreal AbstractPieDiagram::startPosition () const [inherited]

Returns:
the starting angle for the first dataset.

Definition at line 70 of file KDChartAbstractPieDiagram.cpp.


References d.
Referenced by paint().

71 {
72 return d->startPosition;
73 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.40 KDChart::PieDiagram Class Reference 527

6.40.2.81 ThreeDPieAttributes AbstractPieDiagram::threeDPieAttributes (const QModelIndex &


index) const [inherited]

Definition at line 170 of file KDChartAbstractPieDiagram.cpp.


References d, and KDChart::ThreeDPieAttributesRole.

171 {
172 return qVariantValue<ThreeDPieAttributes>(
173 d->attributesModel->data(
174 d->attributesModel->mapFromSource( index ),
175 ThreeDPieAttributesRole ) );
176 }

6.40.2.82 ThreeDPieAttributes AbstractPieDiagram::threeDPieAttributes (int column) const


[inherited]

Definition at line 162 of file KDChartAbstractPieDiagram.cpp.


References d, and KDChart::ThreeDPieAttributesRole.

163 {
164 return qVariantValue<ThreeDPieAttributes>(
165 d->attributesModel->data(
166 d->attributesModel->mapFromSource( columnToIndex( column ) ).column(),
167 ThreeDPieAttributesRole ) );
168 }

6.40.2.83 ThreeDPieAttributes AbstractPieDiagram::threeDPieAttributes () const


[inherited]

Definition at line 153 of file KDChartAbstractPieDiagram.cpp.


References d, and KDChart::ThreeDPieAttributesRole.
Referenced by paint().

154 {
155 return qVariantValue<ThreeDPieAttributes>(
156 d->attributesModel->data( ThreeDPieAttributesRole ) );
157 }

6.40.2.84 void AbstractDiagram::update () const [inherited]

Definition at line 777 of file KDChartAbstractDiagram.cpp.


References d.
Referenced by KDChart::AbstractDiagram::doItemsLayout().

6.40.2.85 void KDChart::AbstractDiagram::useDefaultColors () [inherited]

Set the palette to be used, for painting datasets to the default palette.

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


528 KD Chart 2 Class Documentation

See also:
KDChart::Palette. FIXME: fold into one usePalette (KDChart::Palette&) method

Definition at line 671 of file KDChartAbstractDiagram.cpp.


References d.

675 {

6.40.2.86 void KDChart::AbstractDiagram::useRainbowColors () [inherited]

Set the palette to be used, for painting datasets to the rainbow palette.

See also:
KDChart::Palette.

Definition at line 681 of file KDChartAbstractDiagram.cpp.


References d.

685 {

6.40.2.87 void KDChart::AbstractDiagram::useSubduedColors () [inherited]

Set the palette to be used, for painting datasets to the subdued palette.

See also:
KDChart::Palette.

Definition at line 676 of file KDChartAbstractDiagram.cpp.


References d.

680 {

6.40.2.88 double AbstractDiagram::valueForCell (int row, int column) const [protected,


inherited]

Helper method, retrieving the data value (DisplayRole) for a given row and column.

Parameters:
row The row to query.
column The column to query.

Returns:
The value of the display role at the given row and column as a double.

Definition at line 771 of file KDChartAbstractDiagram.cpp.


References KDChart::AbstractDiagram::attributesModelRootIndex(), and d.
Referenced by KDChart::LineDiagram::paint().

776 {

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.40 KDChart::PieDiagram Class Reference 529

6.40.2.89 double PieDiagram::valueTotals () const [virtual]

[reimplemented]
Implements KDChart::AbstractPolarDiagram.
Definition at line 1087 of file KDChartPieDiagram.cpp.
References KDChart::AbstractPolarDiagram::columnCount().
Referenced by paint().

1088 {
1089 const int colCount = columnCount();
1090 double total = 0.0;
1091 for ( int j = 0; j < colCount; ++j ) {
1092 total += qAbs(model()->data( model()->index( 0, j, rootIndex() ) ).toDouble());
1093 //qDebug() << model()->data( model()->index( 0, j, rootIndex() ) ).toDouble();
1094 }
1095 return total;
1096 }

6.40.2.90 int AbstractDiagram::verticalOffset () const [virtual, inherited]

[reimplemented]
Definition at line 658 of file KDChartAbstractDiagram.cpp.

660 { return true; }

6.40.2.91 QRect AbstractDiagram::visualRect (const QModelIndex & index) const [virtual,


inherited]

[reimplemented]
Definition at line 641 of file KDChartAbstractDiagram.cpp.

645 {}

6.40.2.92 QRegion AbstractDiagram::visualRegionForSelection (const QItemSelection &


selection) const [virtual, inherited]

[reimplemented]
Definition at line 667 of file KDChartAbstractDiagram.cpp.

6.40.3 Member Data Documentation

6.40.3.1 Q_SIGNALS KDChart::AbstractDiagram::__pad0__ [protected, inherited]

Definition at line 506 of file KDChartAbstractDiagram.h.


The documentation for this class was generated from the following files:

• KDChartPieDiagram.h
• KDChartPieDiagram.cpp

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


530 KD Chart 2 Class Documentation

6.41 KDChart::PolarCoordinatePlane Class Reference


#include <KDChartPolarCoordinatePlane.h>
Inheritance diagram for KDChart::PolarCoordinatePlane:Collaboration diagram for KDChart::Polar-
CoordinatePlane:

Public Types
• enum AxesCalcMode {
Linear,
Logarithmic }
• typedef QList< CoordinateTransformation > CoordinateTransformationList

Public Member Functions


• void addDiagram (AbstractDiagram ∗diagram)
Adds a diagram to this coordinate plane.

• void alignToReferencePoint (const RelativePosition &position)


• qreal angleUnit () const
• BackgroundAttributes backgroundAttributes () const
• AbstractDiagram ∗ diagram ()
• ConstAbstractDiagramList diagrams () const
• AbstractDiagramList diagrams ()
• virtual Qt::Orientations expandingDirections () const
pure virtual in QLayoutItem

• FrameAttributes frameAttributes () const


• virtual QRect geometry () const
pure virtual in QLayoutItem

• GridAttributes globalGridAttributes () const


• GridAttributes gridAttributes (bool circular) const
• DataDimensionsList gridDimensionsList ()
Returns the dimensions used for drawing the grid lines.

• bool hasOwnGridAttributes (bool circular) const


• virtual bool isEmpty () const
pure virtual in QLayoutItem

• void layoutPlanes ()
Calling layoutPlanes() on the plane triggers the global KDChart::Chart::slotLayoutPlanes().

• virtual QSize maximumSize () const


pure virtual in QLayoutItem

• virtual QSize minimumSize () const


pure virtual in QLayoutItem

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.41 KDChart::PolarCoordinatePlane Class Reference 531

• virtual QSize minimumSizeHint () const


[reimplemented]

• void needLayoutPlanes ()
Emitted when plane needs to trigger the Chart’s layouting of the coord.

• void needRelayout ()
Emitted when plane needs to trigger the Chart’s layouting.

• void needUpdate ()
Emitted when plane needs to update its drawings.

• virtual void paint (QPainter ∗)


reimpl

• void paintAll (QPainter &painter)


Call paintAll, if you want the background and the frame to be drawn before the normal paint() is invoked
automatically.

• virtual void paintBackground (QPainter &painter, const QRect &rectangle)


• virtual void paintCtx (PaintContext ∗context)
Default impl: Paint the complete item using its layouted position and size.

• virtual void paintFrame (QPainter &painter, const QRect &rectangle)


• virtual void paintIntoRect (QPainter &painter, const QRect &rect)
Draws the background and frame, then calls paint().

• const Chart ∗ parent () const


• Chart ∗ parent ()
• PolarCoordinatePlane (Chart ∗parent=0)
• void propertiesChanged ()
Emitted upon change of a property of the Coordinate Plane or any of its components.

• AbstractCoordinatePlane ∗ referenceCoordinatePlane () const


There are two ways, in which planes can be caused to interact, in where they are put layouting wise: The
first is the reference plane.

• void relayout ()
Calling relayout() on the plane triggers the global KDChart::Chart::slotRelayout().

• void removeFromParentLayout ()
• virtual void replaceDiagram (AbstractDiagram ∗diagram, AbstractDiagram ∗oldDiagram=0)
Replaces the old diagram, or appends the diagram, it there is none yet.

• void resetGridAttributes (bool circular)


Reset the attributes to be used for grid lines drawn in circular direction (or in sagittal direction, resp.).

• void setBackgroundAttributes (const BackgroundAttributes &a)


• void setFrameAttributes (const FrameAttributes &a)

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


532 KD Chart 2 Class Documentation

• virtual void setGeometry (const QRect &r)


pure virtual in QLayoutItem

• void setGlobalGridAttributes (const GridAttributes &)


Set the grid attributes to be used by this coordinate plane.

• void setGridAttributes (bool circular, const GridAttributes &)


Set the attributes to be used for grid lines drawn in circular direction (or in sagittal direction, resp.).

• void setParent (Chart ∗parent)


Called internally by KDChart::Chart.

• void setParentLayout (QLayout ∗lay)


• virtual void setParentWidget (QWidget ∗widget)
Inform the item about its widget: This enables the item, to trigger that widget’s update, whenever the size
of the item’s contents has changed.

• void setReferenceCoordinatePlane (AbstractCoordinatePlane ∗plane)


Set another coordinate plane to be used as the reference plane for this one.

• virtual void setZoomCenter (QPointF center)


Set the point (in value coordinates) to be used as the center point in zoom operations.

• virtual void setZoomFactorX (double factor)


Sets the zoom factor in horizontal direction, that is applied to all coordinate transformations.

• virtual void setZoomFactorY (double factor)


Sets the zoom factor in vertical direction, that is applied to all coordinate transformations.

• virtual QSize sizeHint () const


pure virtual in QLayoutItem

• virtual void sizeHintChanged () const


Report changed size hint: ask the parent widget to recalculate the layout.

• virtual QSizePolicy sizePolicy () const


[reimplemented]

• virtual void takeDiagram (AbstractDiagram ∗diagram)


Removes the diagram from the plane, without deleting it.

• const QPointF translate (const QPointF &diagramPoint) const


Translate the given point in value space coordinates to a position in pixel space.

• const QPointF translatePolar (const QPointF &diagramPoint) const


• virtual QPointF zoomCenter () const
• virtual double zoomFactorX () const
• virtual double zoomFactorY () const
• ∼PolarCoordinatePlane ()

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.41 KDChart::PolarCoordinatePlane Class Reference 533

Public Attributes
• Q_SIGNALS __pad0__: void destroyedCoordinatePlane( AbstractCoordinatePlane∗ )

Protected Member Functions


• virtual QRect areaGeometry () const
• virtual DataDimensionsList getDataDimensionsList () const
• QRect innerRect () const
• void layoutDiagrams ()
Distribute the available space among the diagrams and axes.

• void paintEvent (QPaintEvent ∗)


• virtual void positionHasChanged ()
• void resizeEvent (QResizeEvent ∗)

Protected Attributes
• QWidget ∗ mParent
• QLayout ∗ mParentLayout
• protected Q_SLOTS: void slotLayoutChanged( AbstractDiagram∗ diagram )

6.41.1 Member Typedef Documentation

6.41.1.1 typedef QList<CoordinateTransformation> KDChart::PolarCoordinate-


Plane::CoordinateTransformationList

Definition at line 45 of file KDChartPolarCoordinatePlane.h.

6.41.2 Member Enumeration Documentation

6.41.2.1 enum KDChart::AbstractCoordinatePlane::AxesCalcMode [inherited]

Enumeration values:
Linear
Logarithmic

Definition at line 55 of file KDChartAbstractCoordinatePlane.h.

55 { Linear, Logarithmic };

6.41.3 Constructor & Destructor Documentation

6.41.3.1 PolarCoordinatePlane::PolarCoordinatePlane (Chart ∗ parent = 0) [explicit]

Definition at line 114 of file KDChartPolarCoordinatePlane.cpp.

115 : AbstractCoordinatePlane ( new Private(), parent )


116 {
117 // this bloc left empty intentionally
118 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


534 KD Chart 2 Class Documentation

6.41.3.2 PolarCoordinatePlane::∼PolarCoordinatePlane ()

Definition at line 120 of file KDChartPolarCoordinatePlane.cpp.

121 {
122 // this bloc left empty intentionally
123 }

6.41.4 Member Function Documentation

6.41.4.1 void PolarCoordinatePlane::addDiagram (AbstractDiagram ∗ diagram) [virtual]

Adds a diagram to this coordinate plane.

Parameters:
diagram The diagram to add.

See also:
replaceDiagram, takeDiagram

Reimplemented from KDChart::AbstractCoordinatePlane.


Definition at line 130 of file KDChartPolarCoordinatePlane.cpp.
References KDChart::AbstractCoordinatePlane::addDiagram().

131 {
132 Q_ASSERT_X ( dynamic_cast<AbstractPolarDiagram*> ( diagram ),
133 "PolarCoordinatePlane::addDiagram", "Only polar"
134 "diagrams can be added to a polar coordinate plane!" );
135 AbstractCoordinatePlane::addDiagram ( diagram );
136 connect ( diagram, SIGNAL ( layoutChanged ( AbstractDiagram* ) ),
137 SLOT ( slotLayoutChanged ( AbstractDiagram* ) ) );
138
139 }

6.41.4.2 void AbstractAreaBase::alignToReferencePoint (const RelativePosition & position)


[inherited]

Definition at line 75 of file KDChartAbstractAreaBase.cpp.

76 {
77 Q_UNUSED( position );
78 // PENDING(kalle) FIXME
79 qWarning( "Sorry, not implemented: void AbstractAreaBase::alignToReferencePoint( const RelativePosi
80 }

6.41.4.3 qreal PolarCoordinatePlane::angleUnit () const

Definition at line 292 of file KDChartPolarCoordinatePlane.cpp.


References d.
Referenced by layoutDiagrams().

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.41 KDChart::PolarCoordinatePlane Class Reference 535

293 {
294 Q_ASSERT_X ( d->currentTransformation != 0, "PolarCoordinatePlane::translate",
295 "Only call translate() from within paint()." );
296 return d->currentTransformation->angleUnit;
297 }

6.41.4.4 QRect AbstractArea::areaGeometry () const [protected, virtual,


inherited]

Implements KDChart::AbstractAreaBase.
Definition at line 105 of file KDChartAbstractArea.cpp.
Referenced by KDChart::CartesianCoordinatePlane::drawingArea(), layoutDiagrams(),
KDChart::CartesianAxis::paint(), KDChart::AbstractArea::paintAll(), and KDChart::Cartesian-
Axis::paintCtx().

106 {
107 return geometry();
108 }

6.41.4.5 BackgroundAttributes AbstractAreaBase::backgroundAttributes () const


[inherited]

Definition at line 97 of file KDChartAbstractAreaBase.cpp.


References d.

98 {
99 return d->backgroundAttributes;
100 }

6.41.4.6 AbstractDiagram ∗ AbstractCoordinatePlane::diagram () [inherited]

Returns:
The first diagram associated with this coordinate plane.

Definition at line 113 of file KDChartAbstractCoordinatePlane.cpp.


References d.
Referenced by KDChart::Widget::diagram().

114 {
115 if ( d->diagrams.isEmpty() )
116 {
117 return 0;
118 } else {
119 return d->diagrams.first();
120 }
121 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


536 KD Chart 2 Class Documentation

6.41.4.7 ConstAbstractDiagramList AbstractCoordinatePlane::diagrams () const


[inherited]

Returns:
The list of diagrams associated with this coordinate plane.

Definition at line 128 of file KDChartAbstractCoordinatePlane.cpp.


References KDChart::ConstAbstractDiagramList, and d.

129 {
130 ConstAbstractDiagramList list;
131 #ifndef QT_NO_STL
132 qCopy( d->diagrams.begin(), d->diagrams.end(), std::back_inserter( list ) );
133 #else
134 Q_FOREACH( AbstractDiagram * a, d->diagrams )
135 list.push_back( a );
136 #endif
137 return list;
138 }

6.41.4.8 AbstractDiagramList AbstractCoordinatePlane::diagrams () [inherited]

Returns:
The list of diagrams associated with this coordinate plane.

Definition at line 123 of file KDChartAbstractCoordinatePlane.cpp.


References KDChart::AbstractDiagramList, and d.
Referenced by KDChart::CartesianCoordinatePlane::calculateRawDataBoundingRect(),
KDChart::CartesianCoordinatePlane::getDataDimensionsList(), layoutDiagrams(), KDChart::Cartesian-
CoordinatePlane::layoutDiagrams(), paint(), and KDChart::CartesianCoordinatePlane::paint().

124 {
125 return d->diagrams;
126 }

6.41.4.9 Qt::Orientations KDChart::AbstractCoordinatePlane::expandingDirections () const


[virtual, inherited]

pure virtual in QLayoutItem


Definition at line 200 of file KDChartAbstractCoordinatePlane.cpp.

201 {
202 return Qt::Vertical | Qt::Horizontal;
203 }

6.41.4.10 FrameAttributes AbstractAreaBase::frameAttributes () const [inherited]

Definition at line 87 of file KDChartAbstractAreaBase.cpp.


References d.
Referenced by KDChart::Legend::clone().

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.41 KDChart::PolarCoordinatePlane Class Reference 537

88 {
89 return d->frameAttributes;
90 }

6.41.4.11 QRect KDChart::AbstractCoordinatePlane::geometry () const [virtual,


inherited]

pure virtual in QLayoutItem


Definition at line 237 of file KDChartAbstractCoordinatePlane.cpp.
References d.
Referenced by paint().

238 {
239 return d->geometry;
240 }

6.41.4.12 DataDimensionsList PolarCoordinatePlane::getDataDimensionsList () const


[protected, virtual]

Implements KDChart::AbstractCoordinatePlane.
Definition at line 335 of file KDChartPolarCoordinatePlane.cpp.
References KDChart::DataDimensionsList.

336 {
337 DataDimensionsList l;
338
339 //FIXME(khz): do the real calculation
340
341 return l;
342 }

6.41.4.13 GridAttributes KDChart::AbstractCoordinatePlane::globalGridAttributes () const


[inherited]

Returns:
The grid attributes used by this coordinate plane.

See also:
setGlobalGridAttributes
CartesianCoordinatePlane::gridAttributes

Definition at line 157 of file KDChartAbstractCoordinatePlane.cpp.


References d.
Referenced by gridAttributes(), and KDChart::CartesianCoordinatePlane::gridAttributes().

158 {
159 return d->gridAttributes;
160 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


538 KD Chart 2 Class Documentation

6.41.4.14 GridAttributes KDChart::PolarCoordinatePlane::gridAttributes (bool circular) const

Returns:
The attributes used for grid lines drawn in circular direction (or in sagittal direction, resp.).

Note:
This function always returns a valid set of grid attributes: If no special grid attributes were set for
this direction the global attributes are returned, as returned by AbstractCoordinatePlane::globalGrid-
Attributes.

See also:
setGridAttributes
resetGridAttributes
AbstractCoordinatePlane::globalGridAttributes
hasOwnGridAttributes

Definition at line 364 of file KDChartPolarCoordinatePlane.cpp.


References d, KDChart::AbstractCoordinatePlane::globalGridAttributes(), and hasOwnGridAttributes().

366 {
367 if( hasOwnGridAttributes( circular ) ){
368 if( circular )
369 return d->gridAttributesCircular;
370 else
371 return d->gridAttributesSagittal;
372 }else{
373 return globalGridAttributes();
374 }
375 }

6.41.4.15 KDChart::DataDimensionsList KDChart::AbstractCoordinatePlane::gridDimensions-


List () [inherited]

Returns the dimensions used for drawing the grid lines.


Returned data is the result of (cached) grid calculations, so - if you need that information for your own
tasks - make sure to call again this function after every data modification that has changed the data range,
since grid calculation is based upon the data range, thus the grid start/end might have changed if the data
was changed.

Note:
Returned list will contain different numbers of DataDimension, depending on the kind of coordinate
plane used. For CartesianCoordinatePlane two DataDimension are returned: the first representing
grid lines in X direction (matching the Abscissa axes) and the second indicating vertical grid lines (or
Ordinate axes, resp.).

Returns:
The dimensions used for drawing the grid lines.

See also:
DataDimension

Definition at line 162 of file KDChartAbstractCoordinatePlane.cpp.

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.41 KDChart::PolarCoordinatePlane Class Reference 539

References d, and KDChart::DataDimensionsList.


Referenced by KDChart::CartesianCoordinatePlane::layoutDiagrams(), KDChart::Cartesian-
Axis::maximumSize(), and KDChart::CartesianAxis::paintCtx().

163 {
164 return d->grid->updateData( this );
165 }

6.41.4.16 bool KDChart::PolarCoordinatePlane::hasOwnGridAttributes (bool circular) const

Returns:
Returns whether the grid attributes have been set for the respective direction via setGridAttributes(
bool circular ).

If false, the grid will use the global attributes set by AbstractCoordinatePlane::globalGridAttributes (or the
default attributes, resp.)

See also:
setGridAttributes
resetGridAttributes
AbstractCoordinatePlane::globalGridAttributes

Definition at line 387 of file KDChartPolarCoordinatePlane.cpp.


References d.
Referenced by gridAttributes().

389 {
390 return
391 ( circular )
392 ? d->hasOwnGridAttributesCircular
393 : d->hasOwnGridAttributesSagittal;
394 }

6.41.4.17 QRect AbstractAreaBase::innerRect () const [protected, inherited]

Definition at line 175 of file KDChartAbstractAreaBase.cpp.


References KDChart::AbstractAreaBase::areaGeometry(), and d.
Referenced by KDChart::TextArea::paintAll(), KDChart::AbstractAreaWidget::paintAll(), and
KDChart::AbstractArea::paintAll().

176 {
177 Q_ASSERT_X ( d != 0, "AbstractAreaBase::innerRect()",
178 "Private class was not initialized!" );
179
180 const int padding
181 = d->frameAttributes.isVisible()
182 ? qMax( d->frameAttributes.padding(), 0 ) : 0;
183 return
184 QRect( QPoint(0,0), areaGeometry().size() )
185 .adjusted( padding, padding, -padding, -padding );
186 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


540 KD Chart 2 Class Documentation

6.41.4.18 bool KDChart::AbstractCoordinatePlane::isEmpty () const [virtual,


inherited]

pure virtual in QLayoutItem


Definition at line 193 of file KDChartAbstractCoordinatePlane.cpp.

194 {
195 return false; // never empty!
196 // coordinate planes with no associated diagrams
197 // are showing a default grid of ()1..10, 1..10) stepWidth 1
198 }

6.41.4.19 void PolarCoordinatePlane::layoutDiagrams () [protected, virtual]

Distribute the available space among the diagrams and axes.


Implements KDChart::AbstractCoordinatePlane.
Definition at line 238 of file KDChartPolarCoordinatePlane.cpp.
References angleUnit(), KDChart::AbstractArea::areaGeometry(), d, KDChart::AbstractDiagram::data-
Boundaries(), KDChart::AbstractCoordinatePlane::diagrams(), and KDChart::AbstractPolar-
Diagram::valueTotals().
Referenced by resizeEvent().

239 {
240 // the rectangle the diagrams cover in the *plane*:
241 // (Why -3? We save 1px on each side for the antialiased drawing, and
242 // respect the way QPainter calculates the width of a painted rect (the
243 // size is the rectangle size plus the pen width). This way, most clipping
244 // for regular pens should be avoided. When pens with a penWidth or larger
245 // than 1 are used, this may not b sufficient.
246 const QRect rect( areaGeometry() );
247 d->contentRect = QRectF ( 1, 1, rect.width() - 3, rect.height() - 3 );
248
249 // FIXME distribute space according to options:
250 d->coordinateTransformations.clear();
251 Q_FOREACH( AbstractDiagram* diagram, diagrams() )
252 {
253 AbstractPolarDiagram *polarDiagram = dynamic_cast<AbstractPolarDiagram*>( diagram );
254 Q_ASSERT( polarDiagram );
255 QPair<QPointF, QPointF> dataBoundariesPair = polarDiagram->dataBoundaries();
256
257 const double angleUnit = 360 / polarDiagram->valueTotals();
258 //qDebug() << "--------------------------------------------------------";
259 const double radius = dataBoundariesPair.second.y();
260 //qDebug() << radius <<"="<<dataBoundariesPair.second.y();
261 const double diagramWidth = radius * 2; // == height
262 const double planeWidth = d->contentRect.width();
263 const double planeHeight = d->contentRect.height();
264 const double radiusUnit = qMin( planeWidth, planeHeight ) / diagramWidth;
265 //qDebug() << radiusUnit <<"=" << "qMin( "<<planeWidth<<","<< planeHeight <<") / "<<diagramWidth;
266 QPointF coordinateOrigin = QPointF ( planeWidth / 2, planeHeight / 2 );
267 coordinateOrigin += d->contentRect.topLeft();
268
269 CoordinateTransformation diagramTransposition;
270 diagramTransposition.originTranslation = coordinateOrigin;
271 diagramTransposition.radiusUnit = radiusUnit;
272 diagramTransposition.angleUnit = angleUnit;
273 diagramTransposition.zoom = ZoomParameters();
274 d->coordinateTransformations.append( diagramTransposition );

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.41 KDChart::PolarCoordinatePlane Class Reference 541

275 }
276 }

6.41.4.20 void KDChart::AbstractCoordinatePlane::layoutPlanes () [inherited]

Calling layoutPlanes() on the plane triggers the global KDChart::Chart::slotLayoutPlanes().


Definition at line 254 of file KDChartAbstractCoordinatePlane.cpp.
References KDChart::AbstractCoordinatePlane::needLayoutPlanes().
Referenced by KDChart::AbstractCoordinatePlane::addDiagram(), KDChart::CartesianAxis::layout-
Planes(), KDChart::AbstractCartesianDiagram::layoutPlanes(), and KDChart::AbstractCoordinate-
Plane::replaceDiagram().

255 {
256 //qDebug("KDChart::AbstractCoordinatePlane::relayout() called");
257 emit needLayoutPlanes();
258 }

6.41.4.21 QSize KDChart::AbstractCoordinatePlane::maximumSize () const [virtual,


inherited]

pure virtual in QLayoutItem


Definition at line 205 of file KDChartAbstractCoordinatePlane.cpp.
References d.
Referenced by KDChart::AbstractCoordinatePlane::sizeHint().

206 {
207 if( d->parent )
208 return d->parent->size();
209 // Note: At external layut calculation time the coord.plane *will*
210 // have a parent widget, so returning a default size here
211 // will not affect its real drawing size.
212 return QSize(1000, 1000);
213 }

6.41.4.22 QSize KDChart::AbstractCoordinatePlane::minimumSize () const [virtual,


inherited]

pure virtual in QLayoutItem


Definition at line 215 of file KDChartAbstractCoordinatePlane.cpp.

216 {
217 return QSize(60, 60); // this default can be overwritten by derived classes
218 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


542 KD Chart 2 Class Documentation

6.41.4.23 QSize KDChart::AbstractCoordinatePlane::minimumSizeHint () const [virtual,


inherited]

[reimplemented]
Definition at line 140 of file KDChartAbstractCoordinatePlane.cpp.

141 {
142 return QSize( 200, 200 );
143 }

6.41.4.24 void KDChart::AbstractCoordinatePlane::needLayoutPlanes () [inherited]

Emitted when plane needs to trigger the Chart’s layouting of the coord.
planes.
Referenced by KDChart::AbstractCoordinatePlane::layoutPlanes().

6.41.4.25 void KDChart::AbstractCoordinatePlane::needRelayout () [inherited]

Emitted when plane needs to trigger the Chart’s layouting.


Referenced by KDChart::AbstractCoordinatePlane::relayout().

6.41.4.26 void KDChart::AbstractCoordinatePlane::needUpdate () [inherited]

Emitted when plane needs to update its drawings.

6.41.4.27 void PolarCoordinatePlane::paint (QPainter ∗) [virtual]

reimpl
Implements KDChart::AbstractLayoutItem.
Definition at line 141 of file KDChartPolarCoordinatePlane.cpp.
References KDChart::AbstractDiagramList, d, KDChart::AbstractCoordinatePlane::diagrams(),
KDChart::AbstractCoordinatePlane::geometry(), KDChart::PaintContext::setCoordinatePlane(),
KDChart::PaintContext::setPainter(), and KDChart::PaintContext::setRectangle().

142 {
143 AbstractDiagramList diags = diagrams();
144 if ( d->coordinateTransformations.size() == diags.size() )
145 {
146 PaintContext ctx;
147 ctx.setPainter ( painter );
148 ctx.setCoordinatePlane ( this );
149 ctx.setRectangle ( geometry() /*d->contentRect*/ );
150
151 // paint the coordinate system rulers:
152 d->currentTransformation = & ( d->coordinateTransformations[0] );
153 d->grid->drawGrid( &ctx );
154
155 // paint the diagrams:
156 for ( int i = 0; i < diags.size(); i++ )
157 {

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.41 KDChart::PolarCoordinatePlane Class Reference 543

158 d->currentTransformation = & ( d->coordinateTransformations[i] );


159 PainterSaver painterSaver( painter );
160 diags[i]->paint ( &ctx );
161 }
162 d->currentTransformation = 0;
163 } // else: diagrams have not been set up yet
164 }

6.41.4.28 void AbstractArea::paintAll (QPainter & painter) [inherited]

Call paintAll, if you want the background and the frame to be drawn before the normal paint() is invoked
automatically.
Definition at line 83 of file KDChartAbstractArea.cpp.
References KDChart::AbstractArea::areaGeometry(), KDChart::AbstractAreaBase::innerRect(),
KDChart::AbstractLayoutItem::paint(), KDChart::AbstractAreaBase::paintBackground(), and
KDChart::AbstractAreaBase::paintFrame().
Referenced by KDChart::Chart::paint(), and KDChart::AbstractArea::paintIntoRect().

84 {
85 // Paint the background and frame
86 paintBackground( painter, geometry() );
87 paintFrame( painter, geometry() );
88
89 // temporarily adjust the widget size, to be sure all content gets calculated
90 // to fit into the inner rectangle
91 const QRect oldGeometry( areaGeometry() );
92 QRect inner( innerRect() );
93 inner.moveTo(
94 oldGeometry.left() + inner.left(),
95 oldGeometry.top() + inner.top() );
96 const bool needAdjustGeometry = oldGeometry != inner;
97 if( needAdjustGeometry )
98 setGeometry( inner );
99 paint( &painter );
100 if( needAdjustGeometry )
101 setGeometry( oldGeometry );
102 //qDebug() << "AbstractAreaWidget::paintAll() done.";
103 }

6.41.4.29 void AbstractAreaBase::paintBackground (QPainter & painter, const QRect &


rectangle) [virtual, inherited]

Definition at line 103 of file KDChartAbstractAreaBase.cpp.


References attributes, and d.
Referenced by KDChart::TextArea::paintAll(), KDChart::AbstractAreaWidget::paintAll(), and
KDChart::AbstractArea::paintAll().

104 {
105 Q_ASSERT_X ( d != 0, "AbstractAreaBase::paintBackground()",
106 "Private class was not initialized!" );
107
108 #define attributes d->backgroundAttributes
109
110 if( !attributes.isVisible() ) return;
111

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


544 KD Chart 2 Class Documentation

112 /* first draw the brush (may contain a pixmap)*/


113 if( Qt::NoBrush != attributes.brush().style() ) {
114 KDChart::PainterSaver painterSaver( &painter );
115 painter.setPen( Qt::NoPen );
116 const QPointF newTopLeft( painter.deviceMatrix().map( rect.topLeft() ) );
117 painter.setBrushOrigin( newTopLeft );
118 painter.setBrush( attributes.brush() );
119 painter.drawRect( rect );
120 }
121 /* next draw the backPixmap over the brush */
122 if( !attributes.pixmap().isNull() &&
123 attributes.pixmapMode() != BackgroundAttributes::BackgroundPixmapModeNone ) {
124 QPointF ol = rect.topLeft();
125 if( BackgroundAttributes::BackgroundPixmapModeCentered == attributes.pixmapMode() )
126 {
127 ol.setX( rect.center().x() - attributes.pixmap().width() / 2 );
128 ol.setY( rect.center().y() - attributes.pixmap().height()/ 2 );
129 painter.drawPixmap( ol, attributes.pixmap() );
130 } else {
131 QMatrix m;
132 double zW = (double)rect.width() / (double)attributes.pixmap().width();
133 double zH = (double)rect.height() / (double)attributes.pixmap().height();
134 switch( attributes.pixmapMode() ) {
135 case BackgroundAttributes::BackgroundPixmapModeScaled:
136 {
137 double z;
138 z = qMin( zW, zH );
139 m.scale( z, z );
140 }
141 break;
142 case BackgroundAttributes::BackgroundPixmapModeStretched:
143 m.scale( zW, zH );
144 break;
145 default:
146 ; // Cannot happen, previously checked
147 }
148 QPixmap pm = attributes.pixmap().transformed( m );
149 ol.setX( rect.center().x() - pm.width() / 2 );
150 ol.setY( rect.center().y() - pm.height()/ 2 );
151 painter.drawPixmap( ol, pm );
152 }
153 }
154 #undef attributes
155 }

6.41.4.30 void KDChart::AbstractLayoutItem::paintCtx (PaintContext ∗ context) [virtual,


inherited]

Default impl: Paint the complete item using its layouted position and size.
Reimplemented in KDChart::CartesianAxis.
Definition at line 64 of file KDChartLayoutItems.cpp.
References KDChart::AbstractLayoutItem::paint(), and KDChart::PaintContext::painter().

65 {
66 if( context )
67 paint( context->painter() );
68 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.41 KDChart::PolarCoordinatePlane Class Reference 545

6.41.4.31 void KDChart::PolarCoordinatePlane::paintEvent (QPaintEvent ∗) [protected]

6.41.4.32 void AbstractAreaBase::paintFrame (QPainter & painter, const QRect & rectangle)
[virtual, inherited]

Definition at line 158 of file KDChartAbstractAreaBase.cpp.


References attributes, and d.
Referenced by KDChart::TextArea::paintAll(), KDChart::AbstractAreaWidget::paintAll(), and
KDChart::AbstractArea::paintAll().

159 {
160 Q_ASSERT_X ( d != 0, "AbstractAreaBase::paintFrame()",
161 "Private class was not initialized!" );
162
163 #define attributes d->frameAttributes
164
165 if( !attributes.isVisible() ) return;
166
167 const QPen oldPen( painter.pen() );
168 painter.setPen( attributes.pen() );
169 painter.drawRect( rect );
170 painter.setPen( oldPen );
171 #undef attributes
172 }

6.41.4.33 void AbstractArea::paintIntoRect (QPainter & painter, const QRect & rect)
[virtual, inherited]

Draws the background and frame, then calls paint().


In most cases there is no need to overwrite this method in a derived class, but you would overwrite Abstract-
LayoutItem::paint() instead.
Definition at line 71 of file KDChartAbstractArea.cpp.
References KDChart::AbstractArea::paintAll().

72 {
73 const QRect oldGeometry( geometry() );
74 if( oldGeometry != rect )
75 setGeometry( rect );
76 painter.translate( rect.left(), rect.top() );
77 paintAll( painter );
78 painter.translate( -rect.left(), -rect.top() );
79 if( oldGeometry != rect )
80 setGeometry( oldGeometry );
81 }

6.41.4.34 const KDChart::Chart ∗ KDChart::AbstractCoordinatePlane::parent () const


[inherited]

Definition at line 182 of file KDChartAbstractCoordinatePlane.cpp.


References d.

183 {
184 return d->parent;
185 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


546 KD Chart 2 Class Documentation

6.41.4.35 KDChart::Chart ∗ KDChart::AbstractCoordinatePlane::parent () [inherited]

Definition at line 187 of file KDChartAbstractCoordinatePlane.cpp.


References d.
Referenced by KDChart::CartesianAxis::maximumSize(), and KDChart::CartesianAxis::paintCtx().

188 {
189 return d->parent;
190 }

6.41.4.36 void AbstractArea::positionHasChanged () [protected, virtual,


inherited]

Reimplemented from KDChart::AbstractAreaBase.


Definition at line 110 of file KDChartAbstractArea.cpp.

111 {
112 emit positionChanged( this );
113 }

6.41.4.37 void KDChart::AbstractCoordinatePlane::propertiesChanged () [inherited]

Emitted upon change of a property of the Coordinate Plane or any of its components.
Referenced by KDChart::CartesianCoordinatePlane::addDiagram(), KDChart::Cartesian-
CoordinatePlane::setAxesCalcModes(), KDChart::CartesianCoordinatePlane::setAxesCalcModeX(),
KDChart::CartesianCoordinatePlane::setAxesCalcModeY(), setGridAttributes(), KDChart::Cartesian-
CoordinatePlane::setGridAttributes(), KDChart::CartesianCoordinatePlane::setHorizontalRange(),
KDChart::CartesianCoordinatePlane::setIsometricScaling(), KDChart::CartesianCoordinatePlane::set-
VerticalRange(), KDChart::CartesianCoordinatePlane::setZoomCenter(), KDChart::CartesianCoordinate-
Plane::setZoomFactorX(), and KDChart::CartesianCoordinatePlane::setZoomFactorY().

6.41.4.38 AbstractCoordinatePlane ∗ KDChart::AbstractCoordinatePlane::referenceCoordinate-


Plane () const [inherited]

There are two ways, in which planes can be caused to interact, in where they are put layouting wise: The
first is the reference plane.
If such a reference plane is set, on a plane, it will use the same cell in the layout as that one. In addition
to this, planes can share an axis. In that case they will be layed out in relation to each other as suggested
by the position of the axis. If, for example Plane1 and Plane2 share an axis at position Left, that will result
in the layout: Axis Plane1 Plane 2, vertically. If Plane1 also happens to be Plane2’s reference plane, both
planes are drawn over each other. The reference plane concept allows two planes to share the same space
even if neither has any axis, and in case there are shared axis, it is used to decided, whether the planes
should be painted on top of each other or layed out vertically or horizontally next to each other.

Returns:
The reference coordinate plane associated with this one.

Definition at line 172 of file KDChartAbstractCoordinatePlane.cpp.


References d.

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.41 KDChart::PolarCoordinatePlane Class Reference 547

173 {
174 return d->referenceCoordinatePlane;
175 }

6.41.4.39 void KDChart::AbstractCoordinatePlane::relayout () [inherited]

Calling relayout() on the plane triggers the global KDChart::Chart::slotRelayout().


Definition at line 248 of file KDChartAbstractCoordinatePlane.cpp.
References KDChart::AbstractCoordinatePlane::needRelayout().

249 {
250 //qDebug("KDChart::AbstractCoordinatePlane::relayout() called");
251 emit needRelayout();
252 }

6.41.4.40 void KDChart::AbstractLayoutItem::removeFromParentLayout () [inherited]

Definition at line 66 of file KDChartLayoutItems.h.


Referenced by KDChart::Chart::takeCoordinatePlane().

67 {
68 if( mParentLayout ){
69 if( widget() )
70 mParentLayout->removeWidget( widget() );
71 else
72 mParentLayout->removeItem( this );
73 }
74 }

6.41.4.41 void AbstractCoordinatePlane::replaceDiagram (AbstractDiagram ∗ diagram,


AbstractDiagram ∗ oldDiagram = 0) [virtual, inherited]

Replaces the old diagram, or appends the diagram, it there is none yet.

Parameters:
diagram The diagram to be used instead of the old diagram. This parameter must not be zero, or the
method will do nothing.
oldDiagram The diagram to be removed by the new diagram. This diagram will be deleted automat-
ically. If the parameter is omitted, the very first diagram will be replaced. In case, there was no
diagram yet, the new diagram will just be added.

Note:
If you want to re-use the old diagram, call takeDiagram and addDiagram, instead of using replace-
Diagram.

See also:
addDiagram, takeDiagram

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


548 KD Chart 2 Class Documentation

Definition at line 82 of file KDChartAbstractCoordinatePlane.cpp.


References KDChart::AbstractCoordinatePlane::addDiagram(), d, KDChart::AbstractCoordinate-
Plane::layoutDiagrams(), KDChart::AbstractCoordinatePlane::layoutPlanes(), and KDChart::Abstract-
CoordinatePlane::takeDiagram().

83 {
84 if( diagram && oldDiagram_ != diagram ){
85 AbstractDiagram* oldDiagram = oldDiagram_;
86 if( d->diagrams.count() ){
87 if( ! oldDiagram )
88 oldDiagram = d->diagrams.first();
89 takeDiagram( oldDiagram );
90 }
91 delete oldDiagram;
92 addDiagram( diagram );
93 layoutDiagrams();
94 layoutPlanes(); // there might be new axes, etc
95 update();
96 }
97 }

6.41.4.42 void KDChart::PolarCoordinatePlane::resetGridAttributes (bool circular)

Reset the attributes to be used for grid lines drawn in circular direction (or in sagittal direction, resp.).
By calling this method you specify that the global attributes set by AbstractCoordinatePlane::setGlobal-
GridAttributes be used.

See also:
setGridAttributes, gridAttributes
AbstractCoordinatePlane::globalGridAttributes
hasOwnGridAttributes

Definition at line 357 of file KDChartPolarCoordinatePlane.cpp.

359 {
360 setHasOwnGridAttributes( circular, false );
361 update();
362 }

6.41.4.43 void PolarCoordinatePlane::resizeEvent (QResizeEvent ∗) [protected]

Definition at line 232 of file KDChartPolarCoordinatePlane.cpp.


References d, and layoutDiagrams().

233 {
234 d->initialResizeEventReceived = true;
235 layoutDiagrams();
236 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.41 KDChart::PolarCoordinatePlane Class Reference 549

6.41.4.44 void AbstractAreaBase::setBackgroundAttributes (const BackgroundAttributes & a)


[inherited]

Definition at line 92 of file KDChartAbstractAreaBase.cpp.


References d.

93 {
94 d->backgroundAttributes = a;
95 }

6.41.4.45 void AbstractAreaBase::setFrameAttributes (const FrameAttributes & a)


[inherited]

Definition at line 82 of file KDChartAbstractAreaBase.cpp.


References d.
Referenced by KDChart::Legend::clone().

83 {
84 d->frameAttributes = a;
85 }

6.41.4.46 void KDChart::AbstractCoordinatePlane::setGeometry (const QRect & r)


[virtual, inherited]

pure virtual in QLayoutItem

Note:
Do not call this function directly, unless you know exactly what you are doing. Geometry management
is done by KD Chart’s internal layouting measures.

Definition at line 227 of file KDChartAbstractCoordinatePlane.cpp.


References d.

228 {
229 // qDebug() << "KDChart::AbstractCoordinatePlane::setGeometry(" << r << ") called";
230 if( d->geometry != r ){
231 d->geometry = r;
232 // Note: We do *not* call update() here
233 // because it would invoke KDChart::update() recursively.
234 }
235 }

6.41.4.47 void KDChart::AbstractCoordinatePlane::setGlobalGridAttributes (const


GridAttributes &) [inherited]

Set the grid attributes to be used by this coordinate plane.


To disable grid painting, for example, your code should like this:

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


550 KD Chart 2 Class Documentation

GridAttributes ga = plane->globalGridAttributes();
ga.setGlobalGridVisible( false );
plane->setGlobalGridAttributes( ga );

See also:
globalGridAttributes
CartesianCoordinatePlane::setGridAttributes

Definition at line 151 of file KDChartAbstractCoordinatePlane.cpp.


References d.

152 {
153 d->gridAttributes = a;
154 update();
155 }

6.41.4.48 void KDChart::PolarCoordinatePlane::setGridAttributes (bool circular, const


GridAttributes &)

Set the attributes to be used for grid lines drawn in circular direction (or in sagittal direction, resp.).
To disable circular grid painting, for example, your code should like this:

GridAttributes ga = plane->gridAttributes( bool );


ga.setGridVisible( false );
plane-setGridAttributes( bool, ga );

Note:
setGridAttributes overwrites the global attributes that were set by AbstractCoordinatePlane::setGlobal-
GridAttributes. To re-activate these global attributes you can call resetGridAttributes.

See also:
resetGridAttributes, gridAttributes
AbstractCoordinatePlane::setGlobalGridAttributes
hasOwnGridAttributes

Definition at line 344 of file KDChartPolarCoordinatePlane.cpp.


References d, and KDChart::AbstractCoordinatePlane::propertiesChanged().

347 {
348 if( circular )
349 d->gridAttributesCircular = a;
350 else
351 d->gridAttributesSagittal = a;
352 setHasOwnGridAttributes( circular, true );
353 update();
354 emit propertiesChanged();
355 }

6.41.4.49 void KDChart::AbstractCoordinatePlane::setParent (Chart ∗ parent) [inherited]

Called internally by KDChart::Chart.

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.41 KDChart::PolarCoordinatePlane Class Reference 551

Definition at line 177 of file KDChartAbstractCoordinatePlane.cpp.


References d.
Referenced by KDChart::Chart::addCoordinatePlane(), and KDChart::Chart::takeCoordinatePlane().

178 {
179 d->parent = parent;
180 }

6.41.4.50 void KDChart::AbstractLayoutItem::setParentLayout (QLayout ∗ lay) [inherited]

Definition at line 62 of file KDChartLayoutItems.h.

63 {
64 mParentLayout = lay;
65 }

6.41.4.51 void KDChart::AbstractLayoutItem::setParentWidget (QWidget ∗ widget)


[virtual, inherited]

Inform the item about its widget: This enables the item, to trigger that widget’s update, whenever the size
of the item’s contents has changed.
Thus, you need to call setParentWidget on every item, that has a non-fixed size.
Definition at line 56 of file KDChartLayoutItems.cpp.
References KDChart::AbstractLayoutItem::mParent.
Referenced by KDChart::Legend::buildLegend(), and KDChart::AbstractCartesianDiagram::takeAxis().

57 {
58 mParent = widget;
59 }

6.41.4.52 void KDChart::AbstractCoordinatePlane::setReferenceCoordinatePlane


(AbstractCoordinatePlane ∗ plane) [inherited]

Set another coordinate plane to be used as the reference plane for this one.

Parameters:
plane The coordinate plane to be used the reference plane for this one.

See also:
referenceCoordinatePlane

Definition at line 167 of file KDChartAbstractCoordinatePlane.cpp.


References d.

168 {
169 d->referenceCoordinatePlane = plane;
170 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


552 KD Chart 2 Class Documentation

6.41.4.53 void PolarCoordinatePlane::setZoomCenter (QPointF center) [virtual]

Set the point (in value coordinates) to be used as the center point in zoom operations.

Parameters:
center The point to use.

Reimplemented from KDChart::AbstractCoordinatePlane.


Definition at line 329 of file KDChartPolarCoordinatePlane.cpp.
References d.

330 {
331 d->coordinateTransformations[0].zoom.xCenter = center.x();
332 d->coordinateTransformations[0].zoom.yCenter = center.y();
333 }

6.41.4.54 void PolarCoordinatePlane::setZoomFactorX (double factor) [virtual]

Sets the zoom factor in horizontal direction, that is applied to all coordinate transformations.
Reimplemented from KDChart::AbstractCoordinatePlane.
Definition at line 314 of file KDChartPolarCoordinatePlane.cpp.
References d.

315 {
316 d->coordinateTransformations[0].zoom.xFactor = factor;
317 }

6.41.4.55 void PolarCoordinatePlane::setZoomFactorY (double factor) [virtual]

Sets the zoom factor in vertical direction, that is applied to all coordinate transformations.
Reimplemented from KDChart::AbstractCoordinatePlane.
Definition at line 319 of file KDChartPolarCoordinatePlane.cpp.
References d.

320 {
321 d->coordinateTransformations[0].zoom.yFactor = factor;
322 }

6.41.4.56 QSize KDChart::AbstractCoordinatePlane::sizeHint () const [virtual,


inherited]

pure virtual in QLayoutItem


Definition at line 220 of file KDChartAbstractCoordinatePlane.cpp.
References KDChart::AbstractCoordinatePlane::maximumSize().

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.41 KDChart::PolarCoordinatePlane Class Reference 553

221 {
222 // we return our maxiumu (which is the full size of the Chart)
223 // even if we know the plane will be smaller
224 return maximumSize();
225 }

6.41.4.57 void KDChart::AbstractLayoutItem::sizeHintChanged () const [virtual,


inherited]

Report changed size hint: ask the parent widget to recalculate the layout.
Definition at line 73 of file KDChartLayoutItems.cpp.
Referenced by KDChart::TextLayoutItem::sizeHint().

74 {
75 // This is exactly like what QWidget::updateGeometry does.
76 // qDebug("KDChart::AbstractLayoutItem::sizeHintChanged() called");
77 if( mParent ) {
78 if ( mParent->layout() )
79 mParent->layout()->invalidate();
80 else
81 QApplication::postEvent( mParent, new QEvent( QEvent::LayoutRequest ) );
82 }
83 }

6.41.4.58 QSizePolicy KDChart::AbstractCoordinatePlane::sizePolicy () const [virtual,


inherited]

[reimplemented]
Definition at line 146 of file KDChartAbstractCoordinatePlane.cpp.

147 {
148 return QSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding );
149 }

6.41.4.59 void AbstractCoordinatePlane::takeDiagram (AbstractDiagram ∗ diagram)


[virtual, inherited]

Removes the diagram from the plane, without deleting it.


The plane no longer owns the diagram, so it is the caller’s responsibility to delete the diagram.

See also:
addDiagram, replaceDiagram

Definition at line 100 of file KDChartAbstractCoordinatePlane.cpp.


References d, KDChart::AbstractCoordinatePlane::layoutDiagrams(), and KDChart::Abstract-
Diagram::setCoordinatePlane().
Referenced by KDChart::AbstractCoordinatePlane::replaceDiagram().

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


554 KD Chart 2 Class Documentation

101 {
102 const int idx = d->diagrams.indexOf( diagram );
103 if( idx != -1 ){
104 d->diagrams.removeAt( idx );
105 diagram->setParent( 0 );
106 diagram->setCoordinatePlane( 0 );
107 layoutDiagrams();
108 update();
109 }
110 }

6.41.4.60 const QPointF PolarCoordinatePlane::translate (const QPointF & diagramPoint) const


[virtual]

Translate the given point in value space coordinates to a position in pixel space.

Parameters:
diagramPoint The point in value coordinates.

Returns:
The translated point.

Implements KDChart::AbstractCoordinatePlane.
Definition at line 278 of file KDChartPolarCoordinatePlane.cpp.
References d.
Referenced by buildReferenceRect().

279 {
280 Q_ASSERT_X ( d->currentTransformation != 0, "PolarCoordinatePlane::translate",
281 "Only call translate() from within paint()." );
282 return d->currentTransformation->translate ( diagramPoint );
283 }

6.41.4.61 const QPointF PolarCoordinatePlane::translatePolar (const QPointF & diagramPoint)


const

Definition at line 285 of file KDChartPolarCoordinatePlane.cpp.


References d.

286 {
287 Q_ASSERT_X ( d->currentTransformation != 0, "PolarCoordinatePlane::translate",
288 "Only call translate() from within paint()." );
289 return d->currentTransformation->translatePolar ( diagramPoint );
290 }

6.41.4.62 QPointF PolarCoordinatePlane::zoomCenter () const [virtual]

Returns:
The center point (in value coordinates) of the coordinate plane, that is used for zoom operations.

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.41 KDChart::PolarCoordinatePlane Class Reference 555

Reimplemented from KDChart::AbstractCoordinatePlane.


Definition at line 324 of file KDChartPolarCoordinatePlane.cpp.
References d.

325 {
326 return QPointF( d->coordinateTransformations[0].zoom.xCenter, d->coordinateTransformations[0].zoom
327 }

6.41.4.63 double PolarCoordinatePlane::zoomFactorX () const [virtual]

Returns:
The zoom factor in horizontal direction, that is applied to all coordinate transformations.

Reimplemented from KDChart::AbstractCoordinatePlane.


Definition at line 304 of file KDChartPolarCoordinatePlane.cpp.
References d.

305 {
306 return d->coordinateTransformations[0].zoom.xFactor;
307 }

6.41.4.64 double PolarCoordinatePlane::zoomFactorY () const [virtual]

Returns:
The zoom factor in vertical direction, that is applied to all coordinate transformations.

Reimplemented from KDChart::AbstractCoordinatePlane.


Definition at line 309 of file KDChartPolarCoordinatePlane.cpp.
References d.

310 {
311 return d->coordinateTransformations[0].zoom.yFactor;
312 }

6.41.5 Member Data Documentation

6.41.5.1 Q_SIGNALS KDChart::AbstractCoordinatePlane::__pad0__ [inherited]

Reimplemented from KDChart::AbstractArea.


Definition at line 284 of file KDChartAbstractCoordinatePlane.h.

6.41.5.2 QWidget∗ KDChart::AbstractLayoutItem::mParent [protected, inherited]

Definition at line 76 of file KDChartLayoutItems.h.


Referenced by KDChart::AbstractLayoutItem::setParentWidget().

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


556 KD Chart 2 Class Documentation

6.41.5.3 QLayout∗ KDChart::AbstractLayoutItem::mParentLayout [protected,


inherited]

Definition at line 77 of file KDChartLayoutItems.h.

6.41.5.4 protected KDChart::PolarCoordinatePlane::Q_SLOTS [protected]

Reimplemented from KDChart::AbstractCoordinatePlane.


Definition at line 141 of file KDChartPolarCoordinatePlane.h.
The documentation for this class was generated from the following files:

• KDChartPolarCoordinatePlane.h
• KDChartPolarCoordinatePlane.cpp

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.42 KDChart::PolarDiagram Class Reference 557

6.42 KDChart::PolarDiagram Class Reference


#include <KDChartPolarDiagram.h>
Inheritance diagram for KDChart::PolarDiagram:Collaboration diagram for KDChart::PolarDiagram:

Public Member Functions


• bool allowOverlappingDataValueTexts () const
• bool antiAliasing () const
• virtual AttributesModel ∗ attributesModel () const
Returns the AttributesModel, that is used by this diagram.

• QBrush brush (const QModelIndex &index) const


Retrieve the brush to be used, for painting the datapoint at the given index in the model.

• QBrush brush (int dataset) const


Retrieve the brush to be used for the given dataset.

• QBrush brush () const


Retrieve the brush to be used for painting datapoints globally.

• virtual PolarDiagram ∗ clone () const


• int columnCount () const
• AbstractCoordinatePlane ∗ coordinatePlane () const
The coordinate plane associated with the diagram.

• const QPair< QPointF, QPointF > dataBoundaries () const


Return the bottom left and top right data point, that the diagram will display (unless the grid adjusts these
values).

• virtual void dataChanged (const QModelIndex &topLeft, const QModelIndex &bottomRight)


[reimplemented]

• QList< QBrush > datasetBrushes () const


The set of dataset brushes currently used, for use in legends, etc.

• int datasetDimension () const


The dataset dimension of a diagram determines, how many value dimensions it expects each datapoint to
have.

• QStringList datasetLabels () const


The set of dataset labels currently displayed, for use in legends, etc.

• QList< MarkerAttributes > datasetMarkers () const


The set of dataset markers currently used, for use in legends, etc.

• QList< QPen > datasetPens () const


The set of dataset pens currently used, for use in legends, etc.

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


558 KD Chart 2 Class Documentation

• DataValueAttributes dataValueAttributes (const QModelIndex &index) const


Retrieve the DataValueAttributes for the given index.

• DataValueAttributes dataValueAttributes (int column) const


Retrieve the DataValueAttributes for the given dataset.

• DataValueAttributes dataValueAttributes () const


Retrieve the DataValueAttributes speficied globally.

• virtual void doItemsLayout ()


[reimplemented]

• virtual int horizontalOffset () const


[reimplemented]

• virtual QModelIndex indexAt (const QPoint &point) const


[reimplemented]

• virtual bool isIndexHidden (const QModelIndex &index) const


[reimplemented]

• QStringList itemRowLabels () const


The set of item row labels currently displayed, for use in Abscissa axes, etc.

• virtual QModelIndex moveCursor (CursorAction cursorAction, Qt::KeyboardModifiers modifiers)


[reimplemented]

• virtual double numberOfGridRings () const


[reimplemented]

• virtual double numberOfValuesPerDataset () const


[reimplemented]

• virtual void paintMarker (QPainter ∗painter, const MarkerAttributes &markerAttributes, const


QBrush &brush, const QPen &, const QPointF &point, const QSizeF &size)
• QPen pen (const QModelIndex &index) const
Retrieve the pen to be used, for painting the datapoint at the given index in the model.

• QPen pen (int dataset) const


Retrieve the pen to be used for the given dataset.

• QPen pen () const


Retrieve the pen to be used for painting datapoints globally.

• bool percentMode () const


• const PolarCoordinatePlane ∗ polarCoordinatePlane () const
• PolarDiagram (QWidget ∗parent=0, PolarCoordinatePlane ∗plane=0)
• virtual void resize (const QSizeF &area)
[reimplemented]

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.42 KDChart::PolarDiagram Class Reference 559

• bool rotateCircularLabels () const


• virtual void scrollTo (const QModelIndex &index, ScrollHint hint=EnsureVisible)
[reimplemented]

• void setAllowOverlappingDataValueTexts (bool allow)


Set whether data value labels are allowed to overlap.

• void setAntiAliasing (bool enabled)


Set whether anti-aliasing is to be used while rendering this diagram.

• virtual void setAttributesModel (AttributesModel ∗model)


Associate an AttributesModel with this diagram.

• void setBrush (const QBrush &brush)


Set the brush to be used, for painting all datasets in the model.

• void setBrush (int dataset, const QBrush &brush)


Set the brush to be used, for painting the given dataset.

• void setBrush (const QModelIndex &index, const QBrush &brush)


Set the brush to be used, for painting the datapoint at the given index.

• virtual void setCoordinatePlane (AbstractCoordinatePlane ∗plane)


Set the coordinate plane associated with the diagram.

• void setDatasetDimension (int dimension)


Sets the dataset dimension of the diagram.

• void setDataValueAttributes (const DataValueAttributes &a)


Set the DataValueAttributes for all datapoints in the model.

• void setDataValueAttributes (int dataset, const DataValueAttributes &a)


Set the DataValueAttributes for the given dataset.

• void setDataValueAttributes (const QModelIndex &index, const DataValueAttributes &a)


Set the DataValueAttributes for the given index.

• virtual void setModel (QAbstractItemModel ∗model)


Associate a model with the diagram.

• void setPen (const QPen &pen)


Set the pen to be used, for painting all datasets in the model.

• void setPen (int dataset, const QPen &pen)


Set the pen to be used, for painting the given dataset.

• void setPen (const QModelIndex &index, const QPen &pen)


Set the pen to be used, for painting the datapoint at the given index.

• void setPercentMode (bool percent)

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


560 KD Chart 2 Class Documentation

• virtual void setRootIndex (const QModelIndex &idx)


Set the root index in the model, where the diagram starts referencing data for display.

• void setRotateCircularLabels (bool rotateCircularLabels)


• virtual void setSelection (const QRect &rect, QItemSelectionModel::SelectionFlags command)
[reimplemented]

• void setShowDelimitersAtPosition (Position position, bool showDelimiters)


• void setShowLabelsAtPosition (Position position, bool showLabels)
• void setZeroDegreePosition (int degrees)
• bool showDelimitersAtPosition (Position position) const
• bool showLabelsAtPosition (Position position) const
• void update () const
• void useDefaultColors ()
Set the palette to be used, for painting datasets to the default palette.

• void useRainbowColors ()
Set the palette to be used, for painting datasets to the rainbow palette.

• void useSubduedColors ()
Set the palette to be used, for painting datasets to the subdued palette.

• virtual double valueTotals () const


[reimplemented]

• virtual int verticalOffset () const


[reimplemented]

• virtual QRect visualRect (const QModelIndex &index) const


[reimplemented]

• virtual QRegion visualRegionForSelection (const QItemSelection &selection) const


[reimplemented]

• int zeroDegreePosition () const


• virtual ∼PolarDiagram ()

Protected Member Functions


• QModelIndex attributesModelRootIndex () const
• virtual const QPair< QPointF, QPointF > calculateDataBoundaries () const
[reimplemented]

• virtual bool checkInvariants (bool justReturnTheStatus=false) const


• QModelIndex columnToIndex (int column) const
• void modelsChanged ()
This signal is emitted, when either the model or the AttributesModel is replaced.

• virtual void paint (PaintContext ∗paintContext)

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.42 KDChart::PolarDiagram Class Reference 561

[reimplemented]

• void paintDataValueText (QPainter ∗painter, const QModelIndex &index, const QPointF &pos, dou-
ble value)
• virtual void paintDataValueTexts (QPainter ∗painter)
• void paintEvent (QPaintEvent ∗)
• void paintMarker (QPainter ∗painter, const QModelIndex &index, const QPointF &pos)
• virtual void paintMarkers (QPainter ∗painter)
• virtual void paintPolarMarkers (PaintContext ∗ctx, const QPolygonF &polygon)
• void propertiesChanged ()
Emitted upon change of a property of the Diagram.

• void resizeEvent (QResizeEvent ∗)


• void setAttributesModelRootIndex (const QModelIndex &)
• void setDataBoundariesDirty () const
• double valueForCell (int row, int column) const
Helper method, retrieving the data value (DisplayRole) for a given row and column.

Protected Attributes
• Q_SIGNALS __pad0__: void layoutChanged( AbstractDiagram∗ )

6.42.1 Constructor & Destructor Documentation

6.42.1.1 PolarDiagram::PolarDiagram (QWidget ∗ parent = 0, PolarCoordinatePlane ∗ plane = 0)


[explicit]

Definition at line 49 of file KDChartPolarDiagram.cpp.


Referenced by clone().

49 :
50 AbstractPolarDiagram( new Private( ), parent, plane )
51 {
52 }

6.42.1.2 PolarDiagram::∼PolarDiagram () [virtual]

Definition at line 54 of file KDChartPolarDiagram.cpp.

55 {
56 }

6.42.2 Member Function Documentation

6.42.2.1 bool AbstractDiagram::allowOverlappingDataValueTexts () const [inherited]

Returns:
Whether data value labels are allowed to overlap.

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


562 KD Chart 2 Class Documentation

Definition at line 291 of file KDChartAbstractDiagram.cpp.


References d.

295 {

6.42.2.2 bool AbstractDiagram::antiAliasing () const [inherited]

Returns:
Whether anti-aliasing is to be used for rendering this diagram.

Definition at line 302 of file KDChartAbstractDiagram.cpp.


References d.
Referenced by KDChart::LineDiagram::paint().

306 {

6.42.2.3 AttributesModel ∗ AbstractDiagram::attributesModel () const [virtual,


inherited]

Returns the AttributesModel, that is used by this diagram.


By default each diagram owns its own AttributesModel, which should never be deleted. Only if a user-
supplied AttributesModel has been set does the pointer returned here not belong to the diagram.

Returns:
The AttributesModel associated with the diagram.

See also:
setAttributesModel

Definition at line 180 of file KDChartAbstractDiagram.cpp.


References d.
Referenced by KDChart::RingDiagram::paint(), paint(), and KDChart::BarDiagram::setBarAttributes().

181 {
182 return d->attributesModel;
183 }

6.42.2.4 QModelIndex AbstractDiagram::attributesModelRootIndex () const [protected,


inherited]

returns a QModelIndex pointing into the AttributesModel that corresponds to the root index of the diagram.
Definition at line 204 of file KDChartAbstractDiagram.cpp.
References d.
Referenced by KDChart::LineDiagram::calculateDataBoundaries(), KDChart::BarDiagram::calculate-
DataBoundaries(), KDChart::LineDiagram::numberOfAbscissaSegments(), KDChart::Bar-
Diagram::numberOfAbscissaSegments(), KDChart::LineDiagram::numberOfOrdinateSegments(),
KDChart::BarDiagram::numberOfOrdinateSegments(), KDChart::LineDiagram::paint(), KDChart::Bar-
Diagram::paint(), and KDChart::AbstractDiagram::valueForCell().

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.42 KDChart::PolarDiagram Class Reference 563

210 {

6.42.2.5 QBrush AbstractDiagram::brush (const QModelIndex & index) const [inherited]

Retrieve the brush to be used, for painting the datapoint at the given index in the model.

Parameters:
index The index of the datapoint in the model.

Returns:
The brush to use for painting.

Definition at line 632 of file KDChartAbstractDiagram.cpp.

638 :
QRect AbstractDiagram::visualRect(const QModelIndex &) const

6.42.2.6 QBrush AbstractDiagram::brush (int dataset) const [inherited]

Retrieve the brush to be used for the given dataset.


This will fall back automatically to what was set at model level, if there are no dataset specific settings.

Parameters:
dataset The dataset to retrieve the brush for.

Returns:
The brush to use for painting.

Definition at line 624 of file KDChartAbstractDiagram.cpp.

631 {

6.42.2.7 QBrush AbstractDiagram::brush () const [inherited]

Retrieve the brush to be used for painting datapoints globally.


This will fall back automatically to the default settings, if there are no specific settings.

Returns:
The brush to use for painting.

Definition at line 618 of file KDChartAbstractDiagram.cpp.


Referenced by KDChart::PieDiagram::paint(), and KDChart::AbstractDiagram::paintMarker().

623 {

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


564 KD Chart 2 Class Documentation

6.42.2.8 const QPair< QPointF, QPointF > PolarDiagram::calculateDataBoundaries () const


[protected, virtual]

[reimplemented]
Implements KDChart::AbstractDiagram.
Definition at line 91 of file KDChartPolarDiagram.cpp.
References KDChart::AbstractDiagram::checkInvariants().

92 {
93 if ( !checkInvariants() ) return QPair<QPointF, QPointF>( QPointF( 0, 0 ), QPointF( 0, 0 ) );
94 const int rowCount = model()->rowCount(rootIndex());
95 const int colCount = model()->columnCount(rootIndex());
96 double xMin = 0.0;
97 double xMax = colCount;
98 double yMin = 0, yMax = 0;
99 for ( int j=0; j<colCount; ++j ) {
100 for ( int i=0; i< rowCount; ++i ) {
101 double value = model()->data( model()->index( i, j, rootIndex() ) ).toDouble();
102 yMax = qMax( yMax, value );
103 }
104 }
105 QPointF bottomLeft ( QPointF( xMin, yMin ) );
106 QPointF topRight ( QPointF( xMax, yMax ) );
107 return QPair<QPointF, QPointF> ( bottomLeft, topRight );
108 }

6.42.2.9 bool AbstractDiagram::checkInvariants (bool justReturnTheStatus = false) const


[protected, virtual, inherited]

Definition at line 746 of file KDChartAbstractDiagram.cpp.


References KDChart::AbstractDiagram::coordinatePlane().
Referenced by KDChart::RingDiagram::calculateDataBoundaries(), calculateDataBoundaries(),
KDChart::PieDiagram::calculateDataBoundaries(), KDChart::LineDiagram::calculateDataBoundaries(),
KDChart::BarDiagram::calculateDataBoundaries(), KDChart::RingDiagram::paint(), paint(),
KDChart::PieDiagram::paint(), KDChart::LineDiagram::paint(), KDChart::BarDiagram::paint(), and
KDChart::AbstractDiagram::paintMarker().

746 {
747 Q_ASSERT_X ( model(), "AbstractDiagram::checkInvariants()",
748 "There is no usable model set, for the diagram." );
749
750 Q_ASSERT_X ( coordinatePlane(), "AbstractDiagram::checkInvariants()",
751 "There is no usable coordinate plane set, for the diagram." );
752 }
753 return model() && coordinatePlane();
754 }
755
756 int AbstractDiagram::datasetDimension( ) const

6.42.2.10 PolarDiagram ∗ PolarDiagram::clone () const [virtual]

Definition at line 82 of file KDChartPolarDiagram.cpp.


References d, PolarDiagram(), showDelimitersAtPosition(), and showLabelsAtPosition().

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.42 KDChart::PolarDiagram Class Reference 565

83 {
84 PolarDiagram* newDiagram = new PolarDiagram( new Private( *d ) );
85 // This needs to be copied after the fact
86 newDiagram->d->showDelimitersAtPosition = d->showDelimitersAtPosition;
87 newDiagram->d->showLabelsAtPosition = d->showLabelsAtPosition;
88 return newDiagram;
89 }

6.42.2.11 int AbstractPolarDiagram::columnCount () const [inherited]

Definition at line 58 of file KDChartAbstractPolarDiagram.cpp.


References KDChart::AbstractPolarDiagram::numberOfValuesPerDataset().
Referenced by KDChart::PieDiagram::calculateDataBoundaries(), KDChart::PieDiagram::paint(), and
KDChart::PieDiagram::valueTotals().

59 {
60 return static_cast<int>( numberOfValuesPerDataset() );
61 }

6.42.2.12 QModelIndex AbstractDiagram::columnToIndex (int column) const [protected,


inherited]

Definition at line 211 of file KDChartAbstractDiagram.cpp.

217 {

6.42.2.13 AbstractCoordinatePlane ∗ AbstractDiagram::coordinatePlane () const


[inherited]

The coordinate plane associated with the diagram.


This determines how coordinates in value space are mapped into pixel space. By default this is a Cartesian-
CoordinatePlane.

Returns:
The coordinate plane associated with the diagram.

Definition at line 125 of file KDChartAbstractDiagram.cpp.


References d.
Referenced by KDChart::BarDiagram::calculateDataBoundaries(), KDChart::AbstractDiagram::check-
Invariants(), KDChart::AbstractCartesianDiagram::layoutPlanes(), paint(), KDChart::Line-
Diagram::paint(), KDChart::BarDiagram::paint(), KDChart::AbstractPolarDiagram::polarCoordinate-
Plane(), and KDChart::AbstractCartesianDiagram::setCoordinatePlane().

126 {
127 return d->plane;
128 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


566 KD Chart 2 Class Documentation

6.42.2.14 const QPair< QPointF, QPointF > AbstractDiagram::dataBoundaries () const


[inherited]

Return the bottom left and top right data point, that the diagram will display (unless the grid adjusts these
values).
This method returns a chached result of calculations done by calculateDataBoundaries. Classes derived
from AbstractDiagram must implement the calculateDataBoundaries function, to specify their own way of
calculating the data boundaries. If derived classes want to force recalculation of the data boundaries, they
can call setDataBoundariesDirty()
Returned value is in diagram coordinates.
Definition at line 130 of file KDChartAbstractDiagram.cpp.
References KDChart::AbstractDiagram::calculateDataBoundaries(), and d.
Referenced by KDChart::CartesianCoordinatePlane::calculateRawDataBoundingRect(), KDChart::Polar-
CoordinatePlane::layoutDiagrams(), KDChart::LineDiagram::paint(), and KDChart::BarDiagram::paint().

131 {
132 if( d->databoundariesDirty ){
133 d->databoundaries = calculateDataBoundaries ();
134 d->databoundariesDirty = false;
135 }
136 return d->databoundaries;
137 }

6.42.2.15 void AbstractDiagram::dataChanged (const QModelIndex & topLeft, const


QModelIndex & bottomRight) [virtual, inherited]

[reimplemented]
Definition at line 232 of file KDChartAbstractDiagram.cpp.
References d.

232 {
233 // We are still too dumb to do intelligent updates...
234 d->databoundariesDirty = true;
235 scheduleDelayedItemsLayout();
236 }
237
238 void AbstractDiagram::setDataValueAttributes( const QModelIndex & index,

6.42.2.16 QList< QBrush > AbstractDiagram::datasetBrushes () const [inherited]

The set of dataset brushes currently used, for use in legends, etc.

Note:
Cell-level override brushes, if set, take precedence over the dataset values, so you might need to check
these too, in order to find the brush, that is used for a single cell.

Returns:
The current set of dataset brushes.

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.42 KDChart::PolarDiagram Class Reference 567

Definition at line 710 of file KDChartAbstractDiagram.cpp.


Referenced by KDChart::Legend::buildLegend(), KDChart::Legend::datasetCount(), and
KDChart::Legend::setBrushesFromDiagram().

712 {
713 QBrush brush = qVariantValue<QBrush>( attributesModel()->headerData( i, Qt::Vertical, DatasetB
714 ret << brush;
715 }
716
717 return ret;
718 }
719
720 QList<QPen> AbstractDiagram::datasetPens() const

6.42.2.17 int AbstractDiagram::datasetDimension () const [inherited]

The dataset dimension of a diagram determines, how many value dimensions it expects each datapoint to
have.
For each dimension it will expect one column of values in the model. If the dimensionality is 1, automatic
values will be used for the abscissa.
For example a diagram with the default dimension of 1, will have one column per datapoint (the y values)
and will use automatic values for the x axis (1, 2, 3, ... n). If the dimension is 2, the diagram will use the
first, (and the third, fifth, etc) columns as X values, and the second, (and the fourth, sixth, etc) column as Y
values.

Returns:
The dataset dimension of the diagram.

Definition at line 758 of file KDChartAbstractDiagram.cpp.


References d.
Referenced by KDChart::LineDiagram::calculateDataBoundaries(), KDChart::LineDiagram::get-
CellValues(), KDChart::CartesianCoordinatePlane::getDataDimensionsList(), KDChart::Line-
Diagram::paint(), and KDChart::LineDiagram::setType().

762 {

6.42.2.18 QStringList AbstractDiagram::datasetLabels () const [inherited]

The set of dataset labels currently displayed, for use in legends, etc.

Returns:
The set of dataset labels currently displayed.

Definition at line 698 of file KDChartAbstractDiagram.cpp.


Referenced by KDChart::Legend::buildLegend(), and KDChart::Legend::datasetCount().

699 : " << attributesModel()->columnCount(attributesModel


700 const int columnCount = attributesModel()->columnCount(attributesModelRootIndex());
701 for( int i = datasetDimension()-1; i < columnCount; i += datasetDimension() ){
702 //qDebug() << "label: " << attributesModel()->headerData( i, Qt::Horizontal, Qt::DisplayRole )

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


568 KD Chart 2 Class Documentation

703 ret << attributesModel()->headerData( i, Qt::Horizontal, Qt::DisplayRole ).toString();


704 }
705 return ret;
706 }
707
708 QList<QBrush> AbstractDiagram::datasetBrushes() const

6.42.2.19 QList< MarkerAttributes > AbstractDiagram::datasetMarkers () const


[inherited]

The set of dataset markers currently used, for use in legends, etc.

Note:
Cell-level override markers, if set, take precedence over the dataset values, so you might need to check
these too, in order to find the marker, that is shown for a single cell.

Returns:
The current set of dataset brushes.

Definition at line 733 of file KDChartAbstractDiagram.cpp.


Referenced by KDChart::Legend::buildLegend().

735 {
736 DataValueAttributes a =
737 qVariantValue<DataValueAttributes>( attributesModel()->headerData( i, Qt::Vertical, DataVa
738 const MarkerAttributes &ma = a.markerAttributes();
739 ret << ma;
740 }
741 return ret;
742 }
743
744 bool AbstractDiagram::checkInvariants( bool justReturnTheStatus ) const

6.42.2.20 QList< QPen > AbstractDiagram::datasetPens () const [inherited]

The set of dataset pens currently used, for use in legends, etc.

Note:
Cell-level override pens, if set, take precedence over the dataset values, so you might need to check
these too, in order to find the pens, that is used for a single cell.

Returns:
The current set of dataset pens.

Definition at line 722 of file KDChartAbstractDiagram.cpp.


Referenced by KDChart::Legend::buildLegend().

724 {
725 QPen pen = qVariantValue<QPen>( attributesModel()->headerData( i, Qt::Vertical, DatasetPenRole
726 ret << pen;
727 }
728 return ret;
729 }
730
731 QList<MarkerAttributes> AbstractDiagram::datasetMarkers() const

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.42 KDChart::PolarDiagram Class Reference 569

6.42.2.21 DataValueAttributes AbstractDiagram::dataValueAttributes (const QModelIndex &


index) const [inherited]

Retrieve the DataValueAttributes for the given index.


This will fall back automatically to what was set at dataset or model level, if there are no datapoint specific
settings.

Parameters:
index The datapoint to retrieve the attributes for.

Returns:
The DataValueAttributes for the given index.

Definition at line 272 of file KDChartAbstractDiagram.cpp.

278 {

6.42.2.22 DataValueAttributes AbstractDiagram::dataValueAttributes (int column) const


[inherited]

Retrieve the DataValueAttributes for the given dataset.


This will fall back automatically to what was set at model level, if there are no dataset specific settings.

Parameters:
dataset The dataset to retrieve the attributes for.

Returns:
The DataValueAttributes for the given dataset.

Definition at line 265 of file KDChartAbstractDiagram.cpp.

271 {

6.42.2.23 DataValueAttributes AbstractDiagram::dataValueAttributes () const [inherited]

Retrieve the DataValueAttributes speficied globally.


This will fall back automatically to the default settings, if there are no specific settings.

Returns:
The global DataValueAttributes.

Definition at line 260 of file KDChartAbstractDiagram.cpp.


Referenced by KDChart::AbstractDiagram::paintDataValueText(), and KDChart::AbstractDiagram::paint-
Marker().

264 {

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


570 KD Chart 2 Class Documentation

6.42.2.24 void AbstractDiagram::doItemsLayout () [virtual, inherited]

[reimplemented]
Definition at line 223 of file KDChartAbstractDiagram.cpp.
References d, and KDChart::AbstractDiagram::update().

223 {
224 d->plane->layoutDiagrams();
225 update();
226 }
227 QAbstractItemView::doItemsLayout();
228 }
229
230 void AbstractDiagram::dataChanged( const QModelIndex &topLeft,

6.42.2.25 int AbstractDiagram::horizontalOffset () const [virtual, inherited]

[reimplemented]
Definition at line 655 of file KDChartAbstractDiagram.cpp.

657 { return 0; }

6.42.2.26 QModelIndex AbstractDiagram::indexAt (const QPoint & point) const [virtual,


inherited]

[reimplemented]
Definition at line 649 of file KDChartAbstractDiagram.cpp.

651 { return QModelIndex(); }

6.42.2.27 bool AbstractDiagram::isIndexHidden (const QModelIndex & index) const


[virtual, inherited]

[reimplemented]
Definition at line 661 of file KDChartAbstractDiagram.cpp.

663 {}

6.42.2.28 QStringList AbstractDiagram::itemRowLabels () const [inherited]

The set of item row labels currently displayed, for use in Abscissa axes, etc.

Returns:
The set of item row labels currently displayed.

Definition at line 686 of file KDChartAbstractDiagram.cpp.

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.42 KDChart::PolarDiagram Class Reference 571

687 : " << attributesModel()->rowCount(attributesModelRoo


688 const int rowCount = attributesModel()->rowCount(attributesModelRootIndex());
689 for( int i = 0; i < rowCount; ++i ){
690 //qDebug() << "label: " << attributesModel()->headerData( i, Qt::Vertical, Qt::DisplayRole ).t
691 ret << attributesModel()->headerData( i, Qt::Vertical, Qt::DisplayRole ).toString();
692 }
693 return ret;
694 }
695
696 QStringList AbstractDiagram::datasetLabels() const

6.42.2.29 void KDChart::AbstractDiagram::modelsChanged () [protected, inherited]

This signal is emitted, when either the model or the AttributesModel is replaced.
Referenced by KDChart::AbstractDiagram::setAttributesModel(), and KDChart::AbstractDiagram::set-
Model().

6.42.2.30 QModelIndex AbstractDiagram::moveCursor (CursorAction cursorAction,


Qt::KeyboardModifiers modifiers) [virtual, inherited]

[reimplemented]
Definition at line 652 of file KDChartAbstractDiagram.cpp.

654 { return 0; }

6.42.2.31 double PolarDiagram::numberOfGridRings () const [virtual]

[reimplemented]
Implements KDChart::AbstractPolarDiagram.
Definition at line 189 of file KDChartPolarDiagram.cpp.

190 {
191 return 5; // FIXME
192 }

6.42.2.32 double PolarDiagram::numberOfValuesPerDataset () const [virtual]

[reimplemented]
Implements KDChart::AbstractPolarDiagram.
Definition at line 183 of file KDChartPolarDiagram.cpp.

184 {
185 return model()->rowCount(rootIndex());
186 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


572 KD Chart 2 Class Documentation

6.42.2.33 void PolarDiagram::paint (PaintContext ∗ paintContext) [protected, virtual]

[reimplemented]
Implements KDChart::AbstractDiagram.
Definition at line 136 of file KDChartPolarDiagram.cpp.
References KDChart::AbstractDiagram::attributesModel(), KDChart::AbstractDiagram::check-
Invariants(), KDChart::AbstractDiagram::coordinatePlane(), KDChart::AttributesModel::headerData(),
KDChart::AbstractDiagram::paintDataValueText(), KDChart::PaintContext::painter(), paintPolar-
Markers(), KDChart::PaintContext::rectangle(), and KDChart::AbstractCoordinatePlane::translate().
Referenced by paintEvent().

137 {
138 if ( !checkInvariants() )
139 return;
140 const int rowCount = model()->rowCount( rootIndex() );
141 const int colCount = model()->columnCount( rootIndex() );
142 DataValueTextInfoList list;
143
144 for ( int j=0; j < colCount; ++j ) {
145 QBrush brush = qVariantValue<QBrush>( attributesModel()->headerData( j, Qt::Vertical, KDChart:
146 QPolygonF polygon;
147 for ( int i=0; i < rowCount; ++i ) {
148 QModelIndex index = model()->index( i, j, rootIndex() );
149 const double value = model()->data( index ).toDouble();
150 QPointF point = coordinatePlane()->translate( QPointF( value, i ) );
151 polygon.append( point );
152 list.append( DataValueTextInfo( index, point, value ) );
153 }
154 PainterSaver painterSaver( ctx->painter() );
155 ctx->painter()->setRenderHint ( QPainter::Antialiasing );
156 ctx->painter()->setBrush( brush );
157 QPen p( ctx->painter()->pen() );
158 p.setColor( brush.color() ); // FIXME use DatasetPenRole
159 p.setWidth( 2 );// FIXME properties
160 ctx->painter()->setPen( p );
161 polygon.translate( ctx->rectangle().topLeft() );
162 ctx->painter()->drawPolyline( polygon );
163 paintPolarMarkers( ctx, polygon );
164 }
165 DataValueTextInfoListIterator it( list );
166 while ( it.hasNext() ) {
167 const DataValueTextInfo& info = it.next();
168 paintDataValueText( ctx->painter(), info.index, info.pos, info.value );
169 }
170 }

6.42.2.34 void AbstractDiagram::paintDataValueText (QPainter ∗ painter, const QModelIndex &


index, const QPointF & pos, double value) [protected, inherited]

Definition at line 318 of file KDChartAbstractDiagram.cpp.


References KDChart::DataValueAttributes::dataLabel(), KDChart::AbstractDiagram::dataValue-
Attributes(), KDChart::DataValueAttributes::decimalDigits(), KDChart::TextAttributes::font(),
KDChart::TextAttributes::isVisible(), KDChart::DataValueAttributes::isVisible(), KDChart::Text-
Attributes::pen(), KDChart::DataValueAttributes::prefix(), KDChart::TextAttributes::rotation(),
KDChart::DataValueAttributes::suffix(), and KDChart::DataValueAttributes::textAttributes().
Referenced by KDChart::RingDiagram::paint(), paint(), KDChart::LineDiagram::paint(), and
KDChart::BarDiagram::paint().

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.42 KDChart::PolarDiagram Class Reference 573

320 {
321 // paint one data series
322 DataValueAttributes a = dataValueAttributes(index);
323 if ( !a.isVisible() ) return;
324
325 // handle decimal digits
326 int decimalDigits = a.decimalDigits();
327 int decimalPos = QString::number( value ).indexOf( QLatin1Char( ’.’ ) );
328 QString roundedValue;
329 if ( a.dataLabel().isNull() ) {
330 if ( decimalPos > 0 && value != 0 )
331 roundedValue = roundValues ( value, decimalPos, decimalDigits );
332 else
333 roundedValue = QString::number( value );
334 } else
335 roundedValue = a.dataLabel();
336 // handle prefix and suffix
337 if ( !a.prefix().isNull() )
338 roundedValue.prepend( a.prefix() );
339
340 if ( !a.suffix().isNull() )
341 roundedValue.append( a.suffix() );
342
343 PainterSaver painterSaver( painter );
344 // FIXME draw the non-text bits, background, etc
345 const TextAttributes &ta = a.textAttributes();
346 if ( ta.isVisible() ) {
347 painter->setPen( ta.pen() );
348 painter->setFont( ta.font() );
349 painter->translate( pos );
350 painter->rotate( ta.rotation() );
351 painter->drawText( QPointF(0, 0), roundedValue );
352 }
353 }
354
355 QString AbstractDiagram::roundValues( double value,

6.42.2.35 void AbstractDiagram::paintDataValueTexts (QPainter ∗ painter) [protected,


virtual, inherited]

Definition at line 382 of file KDChartAbstractDiagram.cpp.

385 {
386 for ( int j=0; j< rowCount; ++j ) {
387 const QModelIndex index = model()->index( j, i, rootIndex() );
388 double value = model()->data( index ).toDouble();
389 const QPointF pos = coordinatePlane()->translate( QPointF( j, value ) );
390 paintDataValueText( painter, index, pos, value );
391 }
392 }
393 }
394
395

6.42.2.36 void PolarDiagram::paintEvent (QPaintEvent ∗) [protected]

Definition at line 112 of file KDChartPolarDiagram.cpp.


References paint(), KDChart::PaintContext::setPainter(), and KDChart::PaintContext::setRectangle().

113 {

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


574 KD Chart 2 Class Documentation

114 QPainter painter ( viewport() );


115 PaintContext ctx;
116 ctx.setPainter ( &painter );
117 ctx.setRectangle( QRectF ( 0, 0, width(), height() ) );
118 paint ( &ctx );
119 }

6.42.2.37 void AbstractDiagram::paintMarker (QPainter ∗ painter, const QModelIndex & index,


const QPointF & pos) [protected, inherited]

Definition at line 398 of file KDChartAbstractDiagram.cpp.


References KDChart::AbstractDiagram::brush(), KDChart::AbstractDiagram::checkInvariants(),
KDChart::AbstractDiagram::dataValueAttributes(), KDChart::MarkerAttributes::isVisible(),
KDChart::DataValueAttributes::isVisible(), KDChart::DataValueAttributes::markerAttributes(),
KDChart::MarkerAttributes::markerColor(), KDChart::MarkerAttributes::markerSize(),
KDChart::AbstractDiagram::paintMarker(), and KDChart::MarkerAttributes::pen().

399 {
400
401 if ( !checkInvariants() ) return;
402 DataValueAttributes a = dataValueAttributes(index);
403 if ( !a.isVisible() ) return;
404 const MarkerAttributes &ma = a.markerAttributes();
405 if ( !ma.isVisible() ) return;
406
407 PainterSaver painterSaver( painter );
408 QSizeF maSize( ma.markerSize() );
409 QBrush indexBrush( brush( index ) );
410 QPen indexPen( ma.pen() );
411 if ( ma.markerColor().isValid() )
412 indexBrush.setColor( ma.markerColor() );
413
414 paintMarker( painter, ma, indexBrush, indexPen, pos, maSize );
415 }
416
417

6.42.2.38 void AbstractDiagram::paintMarker (QPainter ∗ painter, const MarkerAttributes &


markerAttributes, const QBrush & brush, const QPen &, const QPointF & point, const
QSizeF & size) [virtual, inherited]

Definition at line 420 of file KDChartAbstractDiagram.cpp.


References KDChart::MarkerAttributes::markerStyle().
Referenced by KDChart::LineDiagram::paint(), KDChart::MarkerLayoutItem::paint(), and
KDChart::AbstractDiagram::paintMarker().

424 {
425 PainterSaver painterSaver( painter );
426 painter->setBrush( brush );
427 painter->setPen( pen );
428 painter->setRenderHint ( QPainter::Antialiasing );
429 painter->translate( pos );
430 switch ( markerAttributes.markerStyle() ) {
431 case MarkerAttributes::MarkerCircle:
432 painter->drawEllipse( QRectF( 0 - maSize.height()/2, 0 - maSize.width()/2,
433 maSize.height(), maSize.width()) );

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.42 KDChart::PolarDiagram Class Reference 575

434 break;
435 case MarkerAttributes::MarkerSquare:
436 {
437 QRectF rect( 0 - maSize.height()/2, 0 - maSize.width()/2,
438 maSize.height(), maSize.width() );
439 painter->drawRect( rect );
440 painter->fillRect( rect, painter->brush() );
441 break;
442 }
443 case MarkerAttributes::MarkerDiamond:
444 {
445 QVector <QPointF > diamondPoints;
446 QPointF top, left, bottom, right;
447 top = QPointF( 0, 0 - maSize.height()/2 );
448 left = QPointF( 0 - maSize.width()/2, 0 );
449 bottom = QPointF( 0, maSize.height()/2 );
450 right = QPointF( maSize.width()/2, 0 );
451 diamondPoints << top << left << bottom << right;
452 painter->drawPolygon( diamondPoints );
453 break;
454 }
455 //Pending Michel: do we need that? Ask: What is the idea about
456 // Marker1Pixel and Marker4Pixels.
457 case MarkerAttributes::Marker1Pixel:
458 {
459 QSizeF pSize(4,4);
460 QPen pen1Pixel;
461 pen1Pixel.setColor( painter->background().color() );
462 QRectF centerRect( -pSize.height()/2, -pSize.width()/2,
463 pSize.height(), pSize.width() );
464 painter->setPen( pen1Pixel );
465 painter->drawEllipse( centerRect );
466 break;
467 }
468 case MarkerAttributes::Marker4Pixels:
469 {
470 QSizeF pSize(8, 8);
471 QPen pen4Pixel;
472 pen4Pixel.setColor( painter->background().color() );
473 QRectF centerRect( -pSize.height()/2, -pSize.width()/2,
474 pSize.height(), pSize.width() );
475 painter->setPen( pen4Pixel );
476 painter->drawEllipse( centerRect );
477 break;
478 }
479 case MarkerAttributes::MarkerRing:
480 {
481 painter->setBrush( Qt::NoBrush );
482 painter->drawEllipse( QRectF( 0 - maSize.height()/2, 0 - maSize.width()/2,
483 maSize.height(), maSize.width()) );
484 break;
485 }
486 case MarkerAttributes::MarkerCross:
487 {
488 QVector <QPointF > crossPoints;
489 QPointF leftTop, leftBottom, centerBottomLeft, bottomLeft, bottomRight,
490 centerBottomRight,rightBottom, rightTop, centerTopRight, topRight, topLeft,
491 centerTopLeft;
492 leftTop = QPointF( -maSize.width()/2, -maSize.height()/4 );
493 leftBottom = QPointF( -maSize.width()/2, maSize.height()/4 );
494 centerBottomLeft = QPointF( -maSize.width()/4, maSize.height()/4 );
495 bottomLeft = QPointF( -maSize.width()/4, maSize.height()/2 );
496 bottomRight = QPointF( maSize.width()/4, maSize.height()/2 );
497 centerBottomRight = QPointF( maSize.width()/4, maSize.height()/4 );
498 rightBottom = QPointF( maSize.width()/2, maSize.height()/4 );
499 rightTop = QPointF( maSize.width()/2, -maSize.height()/4 );
500 centerTopRight = QPointF( maSize.width()/4, -maSize.height()/4 );

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


576 KD Chart 2 Class Documentation

501 topRight = QPointF( maSize.width()/4, -maSize.height()/2 );


502 topLeft = QPointF( -maSize.width()/4, -maSize.height()/2 );
503 centerTopLeft = QPointF( -maSize.width()/4, -maSize.height()/4 );
504
505 crossPoints << leftTop << leftBottom << centerBottomLeft
506 << bottomLeft << bottomRight << centerBottomRight
507 << rightBottom << rightTop << centerTopRight
508 << topRight << topLeft << centerTopLeft;
509
510 painter->drawPolygon( crossPoints );
511 break;
512 }
513 case MarkerAttributes::MarkerFastCross:
514 {
515 QPointF left, right, top, bottom;
516 left = QPointF( -maSize.width()/2, 0 );
517 right = QPointF( maSize.width()/2, 0 );
518 top = QPointF( 0, -maSize.height()/2 );
519 bottom= QPointF( 0, maSize.height()/2 );
520 painter->drawLine( left, right );
521 painter->drawLine( top, bottom );
522 break;
523 }
524 default:
525 Q_ASSERT_X ( false, "paintMarkers()",
526 "Type item does not match a defined Marker Type." );
527 }
528 }
529
530 void AbstractDiagram::paintMarkers( QPainter* painter )

6.42.2.39 void AbstractDiagram::paintMarkers (QPainter ∗ painter) [protected,


virtual, inherited]

Definition at line 532 of file KDChartAbstractDiagram.cpp.

535 {
536 for ( int j=0; j< rowCount; ++j ) {
537 const QModelIndex index = model()->index( j, i, rootIndex() );
538 double value = model()->data( index ).toDouble();
539 const QPointF pos = coordinatePlane()->translate( QPointF( j, value ) );
540 paintMarker( painter, index, pos );
541 }
542 }
543 }
544
545

6.42.2.40 void PolarDiagram::paintPolarMarkers (PaintContext ∗ ctx, const QPolygonF &


polygon) [protected, virtual]

Definition at line 125 of file KDChartPolarDiagram.cpp.


References KDChart::PaintContext::painter().
Referenced by paint().

126 {
127 const double markerSize = 4; // FIXME use real markers
128 for ( int i=0; i<polygon.size(); ++i ) {

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.42 KDChart::PolarDiagram Class Reference 577

129 QPointF p = polygon.at( i );


130 p.setX( p.x() - markerSize/2 );
131 p.setY( p.y() - markerSize/2 );
132 ctx->painter()->drawRect( QRectF( p, QSizeF( markerSize, markerSize ) ) );
133 }
134 }

6.42.2.41 QPen AbstractDiagram::pen (const QModelIndex & index) const [inherited]

Retrieve the pen to be used, for painting the datapoint at the given index in the model.

Parameters:
index The index of the datapoint in the model.

Returns:
The pen to use for painting.

Definition at line 586 of file KDChartAbstractDiagram.cpp.

593 {

6.42.2.42 QPen AbstractDiagram::pen (int dataset) const [inherited]

Retrieve the pen to be used for the given dataset.


This will fall back automatically to what was set at model level, if there are no dataset specific settings.

Parameters:
dataset The dataset to retrieve the pen for.

Returns:
The pen to use for painting.

Definition at line 578 of file KDChartAbstractDiagram.cpp.

585 {

6.42.2.43 QPen AbstractDiagram::pen () const [inherited]

Retrieve the pen to be used for painting datapoints globally.


This will fall back automatically to the default settings, if there are no specific settings.

Returns:
The pen to use for painting.

Definition at line 572 of file KDChartAbstractDiagram.cpp.


Referenced by KDChart::PieDiagram::paint().

577 {

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


578 KD Chart 2 Class Documentation

6.42.2.44 bool AbstractDiagram::percentMode () const [inherited]

Definition at line 313 of file KDChartAbstractDiagram.cpp.


References d.
Referenced by KDChart::CartesianCoordinatePlane::getDataDimensionsList().

320 {

6.42.2.45 const PolarCoordinatePlane ∗ AbstractPolarDiagram::polarCoordinatePlane () const


[inherited]

Definition at line 53 of file KDChartAbstractPolarDiagram.cpp.


References KDChart::AbstractDiagram::coordinatePlane().
Referenced by KDChart::PieDiagram::paint().

54 {
55 return dynamic_cast<const PolarCoordinatePlane*>( coordinatePlane() );
56 }

6.42.2.46 void KDChart::AbstractDiagram::propertiesChanged () [protected,


inherited]

Emitted upon change of a property of the Diagram.


Referenced by KDChart::AbstractDiagram::setDataValueAttributes(), KDChart::LineDiagram::setLine-
Attributes(), KDChart::LineDiagram::setThreeDLineAttributes(), and KDChart::LineDiagram::setType().

6.42.2.47 void PolarDiagram::resize (const QSizeF & area) [virtual]

[reimplemented]
Implements KDChart::AbstractDiagram.
Definition at line 172 of file KDChartPolarDiagram.cpp.

173 {
174 }

6.42.2.48 void PolarDiagram::resizeEvent (QResizeEvent ∗) [protected]

Definition at line 121 of file KDChartPolarDiagram.cpp.

122 {
123 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.42 KDChart::PolarDiagram Class Reference 579

6.42.2.49 bool PolarDiagram::rotateCircularLabels () const

Definition at line 209 of file KDChartPolarDiagram.cpp.


References d.

210 {
211 return d->rotateCircularLabels;
212 }

6.42.2.50 void AbstractDiagram::scrollTo (const QModelIndex & index, ScrollHint hint =


EnsureVisible) [virtual, inherited]

[reimplemented]
Definition at line 646 of file KDChartAbstractDiagram.cpp.

648 { return QModelIndex(); }

6.42.2.51 void AbstractDiagram::setAllowOverlappingDataValueTexts (bool allow)


[inherited]

Set whether data value labels are allowed to overlap.

Parameters:
allow True means that overlapping labels are allowed.

Definition at line 285 of file KDChartAbstractDiagram.cpp.


References d.

290 {

6.42.2.52 void AbstractDiagram::setAntiAliasing (bool enabled) [inherited]

Set whether anti-aliasing is to be used while rendering this diagram.

Parameters:
enabled True means that AA is enabled.

Definition at line 296 of file KDChartAbstractDiagram.cpp.


References d.

301 {

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


580 KD Chart 2 Class Documentation

6.42.2.53 void AbstractDiagram::setAttributesModel (AttributesModel ∗ model) [virtual,


inherited]

Associate an AttributesModel with this diagram.


Note that the diagram does _not_ take ownership of the AttributesModel. This should thus only be used
with AttributesModels that have been explicitely created by the user, and are owned by her. Setting an
AttributesModel that is internal to another diagram is an error.
Correct:

AttributesModel *am = new AttributesModel( model, 0 );


diagram1->setAttributesModel( am );
diagram2->setAttributesModel( am );

Wrong:

diagram1->setAttributesModel( diagram2->attributesModel() );

Parameters:
model The AttributesModel to use for this diagram.

See also:
AttributesModel

Definition at line 160 of file KDChartAbstractDiagram.cpp.


References d, and KDChart::AbstractDiagram::modelsChanged().

161 {
162 if( amodel->sourceModel() != model() ) {
163 qWarning("KDChart::AbstractDiagram::setAttributesModel() failed: "
164 "Trying to set an attributesmodel which works on a different "
165 "model than the diagram.");
166 return;
167 }
168 if( qobject_cast<PrivateAttributesModel*>(amodel) ) {
169 qWarning("KDChart::AbstractDiagram::setAttributesModel() failed: "
170 "Trying to set an attributesmodel that is private to another diagram.");
171 return;
172 }
173 d->setAttributesModel(amodel);
174 scheduleDelayedItemsLayout();
175 d->databoundariesDirty = true;
176 emit modelsChanged();
177 }

6.42.2.54 void AbstractDiagram::setAttributesModelRootIndex (const QModelIndex & idx)


[protected, inherited]

Definition at line 195 of file KDChartAbstractDiagram.cpp.


References d.

6.42.2.55 void AbstractDiagram::setBrush (const QBrush & brush) [inherited]

Set the brush to be used, for painting all datasets in the model.

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.42 KDChart::PolarDiagram Class Reference 581

Parameters:
brush The brush to use.

Definition at line 602 of file KDChartAbstractDiagram.cpp.

608 {

6.42.2.56 void AbstractDiagram::setBrush (int dataset, const QBrush & brush) [inherited]

Set the brush to be used, for painting the given dataset.

Parameters:
dataset The dataset’s column in the model.
pen The brush to use.

Definition at line 609 of file KDChartAbstractDiagram.cpp.

617 {

6.42.2.57 void AbstractDiagram::setBrush (const QModelIndex & index, const QBrush & brush)
[inherited]

Set the brush to be used, for painting the datapoint at the given index.

Parameters:
index The datapoint’s index in the model.
brush The brush to use.

Definition at line 594 of file KDChartAbstractDiagram.cpp.

601 {

6.42.2.58 void AbstractDiagram::setCoordinatePlane (AbstractCoordinatePlane ∗ plane)


[virtual, inherited]

Set the coordinate plane associated with the diagram.


This determines how coordinates in value space are mapped into pixel space. The chart takes ownership.

Returns:
The coordinate plane associated with the diagram.

Reimplemented in KDChart::AbstractCartesianDiagram.
Definition at line 218 of file KDChartAbstractDiagram.cpp.
References d.
Referenced by KDChart::AbstractCoordinatePlane::addDiagram(), KDChart::AbstractCartesian-
Diagram::setCoordinatePlane(), and KDChart::AbstractCoordinatePlane::takeDiagram().

222 {

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


582 KD Chart 2 Class Documentation

6.42.2.59 void AbstractDiagram::setDataBoundariesDirty () const [protected,


inherited]

Definition at line 139 of file KDChartAbstractDiagram.cpp.


References d.
Referenced by KDChart::BarDiagram::setThreeDBarAttributes(), KDChart::LineDiagram::setThree-
DLineAttributes(), KDChart::LineDiagram::setType(), and KDChart::BarDiagram::setType().

140 {
141 d->databoundariesDirty = true;
142 }

6.42.2.60 void AbstractDiagram::setDatasetDimension (int dimension) [inherited]

Sets the dataset dimension of the diagram.

See also:
datasetDimension.

Parameters:
dimension

Definition at line 763 of file KDChartAbstractDiagram.cpp.


References d.

770 {

6.42.2.61 void AbstractDiagram::setDataValueAttributes (const DataValueAttributes & a)


[inherited]

Set the DataValueAttributes for all datapoints in the model.

Parameters:
a The attributes to set.

Definition at line 279 of file KDChartAbstractDiagram.cpp.


References d.

284 {

6.42.2.62 void AbstractDiagram::setDataValueAttributes (int dataset, const DataValueAttributes


& a) [inherited]

Set the DataValueAttributes for the given dataset.

Parameters:
dataset The dataset to set the attributes for.

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.42 KDChart::PolarDiagram Class Reference 583

a The attributes to set.

Definition at line 251 of file KDChartAbstractDiagram.cpp.


References d.

259 {

6.42.2.63 void AbstractDiagram::setDataValueAttributes (const QModelIndex & index, const


DataValueAttributes & a) [inherited]

Set the DataValueAttributes for the given index.

Parameters:
index The datapoint to set the attributes for.
a The attributes to set.

Definition at line 240 of file KDChartAbstractDiagram.cpp.


References d, KDChart::DataValueLabelAttributesRole, and KDChart::AbstractDiagram::properties-
Changed().

240 {
241 d->attributesModel->setData(
242 d->attributesModel->mapFromSource( index ),
243 qVariantFromValue( a ),
244 DataValueLabelAttributesRole );
245 emit propertiesChanged();
246 }
247
248

6.42.2.64 void AbstractDiagram::setModel (QAbstractItemModel ∗ model) [virtual,


inherited]

Associate a model with the diagram.


Definition at line 144 of file KDChartAbstractDiagram.cpp.
References d, KDChart::AttributesModel::initFrom(), and KDChart::AbstractDiagram::modelsChanged().

145 {
146 QAbstractItemView::setModel( newModel );
147 AttributesModel* amodel = new PrivateAttributesModel( newModel, this );
148 amodel->initFrom( d->attributesModel );
149 d->setAttributesModel(amodel);
150 scheduleDelayedItemsLayout();
151 d->databoundariesDirty = true;
152 emit modelsChanged();
153 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


584 KD Chart 2 Class Documentation

6.42.2.65 void AbstractDiagram::setPen (const QPen & pen) [inherited]

Set the pen to be used, for painting all datasets in the model.

Parameters:
pen The pen to use.

Definition at line 556 of file KDChartAbstractDiagram.cpp.

562 {

6.42.2.66 void AbstractDiagram::setPen (int dataset, const QPen & pen) [inherited]

Set the pen to be used, for painting the given dataset.

Parameters:
dataset The dataset’s row in the model.
pen The pen to use.

Definition at line 563 of file KDChartAbstractDiagram.cpp.

571 {

6.42.2.67 void AbstractDiagram::setPen (const QModelIndex & index, const QPen & pen)
[inherited]

Set the pen to be used, for painting the datapoint at the given index.

Parameters:
index The datapoint’s index in the model.
pen The pen to use.

Definition at line 548 of file KDChartAbstractDiagram.cpp.

555 {

6.42.2.68 void AbstractDiagram::setPercentMode (bool percent) [inherited]

Definition at line 307 of file KDChartAbstractDiagram.cpp.


References d.
Referenced by KDChart::LineDiagram::setType(), and KDChart::BarDiagram::setType().

312 {

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.42 KDChart::PolarDiagram Class Reference 585

6.42.2.69 void AbstractDiagram::setRootIndex (const QModelIndex & idx) [virtual,


inherited]

Set the root index in the model, where the diagram starts referencing data for display.
[reimplemented]
Definition at line 188 of file KDChartAbstractDiagram.cpp.
References d.

6.42.2.70 void PolarDiagram::setRotateCircularLabels (bool rotateCircularLabels)

Definition at line 204 of file KDChartPolarDiagram.cpp.


References d.

205 {
206 d->rotateCircularLabels = rotateCircularLabels;
207 }

6.42.2.71 void AbstractDiagram::setSelection (const QRect & rect,


QItemSelectionModel::SelectionFlags command) [virtual, inherited]

[reimplemented]
Definition at line 664 of file KDChartAbstractDiagram.cpp.

666 { return QRegion(); }

6.42.2.72 void PolarDiagram::setShowDelimitersAtPosition (Position position, bool


showDelimiters)

Definition at line 214 of file KDChartPolarDiagram.cpp.


References d, and KDChart::Position::value().

216 {
217 d->showDelimitersAtPosition[position.value()] = showDelimiters;
218 }

6.42.2.73 void PolarDiagram::setShowLabelsAtPosition (Position position, bool showLabels)

Definition at line 220 of file KDChartPolarDiagram.cpp.


References d, and KDChart::Position::value().

222 {
223 d->showLabelsAtPosition[position.value()] = showLabels;
224 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


586 KD Chart 2 Class Documentation

6.42.2.74 void PolarDiagram::setZeroDegreePosition (int degrees)

Definition at line 194 of file KDChartPolarDiagram.cpp.


References d.

195 {
196 d->zeroDegreePosition = degrees;
197 }

6.42.2.75 bool PolarDiagram::showDelimitersAtPosition (Position position) const

Definition at line 226 of file KDChartPolarDiagram.cpp.


References d, and KDChart::Position::value().
Referenced by clone().

227 {
228 return d->showDelimitersAtPosition[position.value()];
229 }

6.42.2.76 bool PolarDiagram::showLabelsAtPosition (Position position) const

Definition at line 231 of file KDChartPolarDiagram.cpp.


References d, and KDChart::Position::value().
Referenced by clone().

232 {
233 return d->showLabelsAtPosition[position.value()];
234 }

6.42.2.77 void AbstractDiagram::update () const [inherited]

Definition at line 777 of file KDChartAbstractDiagram.cpp.


References d.
Referenced by KDChart::AbstractDiagram::doItemsLayout().

6.42.2.78 void KDChart::AbstractDiagram::useDefaultColors () [inherited]

Set the palette to be used, for painting datasets to the default palette.

See also:
KDChart::Palette. FIXME: fold into one usePalette (KDChart::Palette&) method

Definition at line 671 of file KDChartAbstractDiagram.cpp.


References d.

675 {

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.42 KDChart::PolarDiagram Class Reference 587

6.42.2.79 void KDChart::AbstractDiagram::useRainbowColors () [inherited]

Set the palette to be used, for painting datasets to the rainbow palette.

See also:
KDChart::Palette.

Definition at line 681 of file KDChartAbstractDiagram.cpp.


References d.

685 {

6.42.2.80 void KDChart::AbstractDiagram::useSubduedColors () [inherited]

Set the palette to be used, for painting datasets to the subdued palette.

See also:
KDChart::Palette.

Definition at line 676 of file KDChartAbstractDiagram.cpp.


References d.

680 {

6.42.2.81 double AbstractDiagram::valueForCell (int row, int column) const [protected,


inherited]

Helper method, retrieving the data value (DisplayRole) for a given row and column.

Parameters:
row The row to query.
column The column to query.

Returns:
The value of the display role at the given row and column as a double.

Definition at line 771 of file KDChartAbstractDiagram.cpp.


References KDChart::AbstractDiagram::attributesModelRootIndex(), and d.
Referenced by KDChart::LineDiagram::paint().

776 {

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


588 KD Chart 2 Class Documentation

6.42.2.82 double PolarDiagram::valueTotals () const [virtual]

[reimplemented]
Implements KDChart::AbstractPolarDiagram.
Definition at line 177 of file KDChartPolarDiagram.cpp.

178 {
179 return model()->rowCount(rootIndex());
180 }

6.42.2.83 int AbstractDiagram::verticalOffset () const [virtual, inherited]

[reimplemented]
Definition at line 658 of file KDChartAbstractDiagram.cpp.

660 { return true; }

6.42.2.84 QRect AbstractDiagram::visualRect (const QModelIndex & index) const [virtual,


inherited]

[reimplemented]
Definition at line 641 of file KDChartAbstractDiagram.cpp.

645 {}

6.42.2.85 QRegion AbstractDiagram::visualRegionForSelection (const QItemSelection &


selection) const [virtual, inherited]

[reimplemented]
Definition at line 667 of file KDChartAbstractDiagram.cpp.

6.42.2.86 int PolarDiagram::zeroDegreePosition () const

Definition at line 199 of file KDChartPolarDiagram.cpp.


References d.

200 {
201 return d->zeroDegreePosition;
202 }

6.42.3 Member Data Documentation

6.42.3.1 Q_SIGNALS KDChart::AbstractDiagram::__pad0__ [protected, inherited]

Definition at line 506 of file KDChartAbstractDiagram.h.


The documentation for this class was generated from the following files:

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.42 KDChart::PolarDiagram Class Reference 589

• KDChartPolarDiagram.h
• KDChartPolarDiagram.cpp

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


590 KD Chart 2 Class Documentation

6.43 KDChart::Position Class Reference


#include <KDChartPosition.h>
Collaboration diagram for KDChart::Position:

6.43.1 Detailed Description

Defines a position, using compass terminology.


Using KDChartPosition you can specify one of nine pre-defined, logical points (see the static const
getter methods below), in a similar way, as you would use a compass to navigate on a map.
Often you will declare a Position together with the RelativePosition class, to specify a logical point,
which then will be used to layout your chart at runtime, e.g. for specifying the location of a floating Legend
box.
For comparing a Position’s value with a switch() statement, you can use numeric values defined in
KDChartEnums, like this:

switch( yourPosition().value() ) {
case KDChartEnums::PositionNorthWest:
// your code ...
break;
case KDChartEnums::PositionNorth:
// your code ...
break;
}

See also:
RelativePosition, KDChartEnums::PositionValue

Definition at line 75 of file KDChartPosition.h.

Public Types
• enum Option {
IncludeCenter = 0,
ExcludeCenter = 1 }

Public Member Functions


• bool isCorner () const
• bool isEastSide () const
• bool isNorthSide () const
• bool isPole () const
• bool isSouthSide () const
• bool isWestSide () const
• const char ∗ name () const
Returns a non-translated string in English language, corresponding to this Position.

• bool operator!= (int) const


• bool operator!= (const Position &) const

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.43 KDChart::Position Class Reference 591

• bool operator== (int) const


• bool operator== (const Position &) const
• Position (KDChartEnums::PositionValue value)
Constructor.

• Position ()
Default constructor.

• QString printableName () const


Returns a translated string, corresponding to this Position.

• KDChartEnums::PositionValue value () const


Returns an integer value corresponding to this Position.

Static Public Member Functions


• Position fromName (const QByteArray &name)
• Position fromName (const char ∗name)
• QList< QByteArray > names (Options options=IncludeCenter)
Returns a list of all string, corresponding to the pre-defined positions.

• QStringList printableNames (Options options=IncludeCenter)


Returns a list of all translated string, corresponding to the pre-defined positions.

Static Public Attributes


• const Position & Center = staticPositionCenter
• const Position & East = staticPositionEast
• const Position & North = staticPositionNorth
• const Position & NorthEast = staticPositionNorthEast
• const Position & NorthWest = staticPositionNorthWest
• const Position & South = staticPositionSouth
• const Position & SouthEast = staticPositionSouthEast
• const Position & SouthWest = staticPositionSouthWest
• const Position & Unknown = staticPositionUnknown
• const Position & West = staticPositionWest

6.43.2 Member Enumeration Documentation

6.43.2.1 enum KDChart::Position::Option

Enumeration values:
IncludeCenter
ExcludeCenter

Definition at line 107 of file KDChartPosition.h.

107 { IncludeCenter=0, ExcludeCenter=1 };

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


592 KD Chart 2 Class Documentation

6.43.3 Constructor & Destructor Documentation

6.43.3.1 Position::Position ()

Default constructor.
Creates a new Position, defaulting it to Position::Unknown.
Definition at line 97 of file KDChartPosition.cpp.
Referenced by fromName(), and printableNames().

98 : m_value( KDChartEnums::PositionUnknown )
99 {
100
101 }

6.43.3.2 Position::Position (KDChartEnums::PositionValue value)

Constructor.
Creates a new Position, defaulting it to the respective value.
Valid values ranging from zero (unknown value) to 10. If invalid value is passed, a Position::Unknown is
created.

Note:
Normally there is no need to call this constructor, but you would rather use one of the nine pre-defined,
static values, e.g. like this:

* const KDChart::Position myPosition = KDChart::Position::NorthEast;


*

Definition at line 121 of file KDChartPosition.cpp.

122 : m_value( value )


123 {
124
125 }

6.43.4 Member Function Documentation

6.43.4.1 Position Position::fromName (const QByteArray & name) [static]

Definition at line 230 of file KDChartPosition.cpp.


References fromName().

230 {
231 return fromName( name.data() );
232 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.43 KDChart::Position Class Reference 593

6.43.4.2 Position Position::fromName (const char ∗ name) [static]

Definition at line 222 of file KDChartPosition.cpp.


References maxPositionValue, Position(), and staticPositionNames.
Referenced by fromName().

223 {
224 for( int i=1; i<=maxPositionValue; ++i)
225 if ( !qstricmp( name, staticPositionNames[i] ) )
226 return Position(i);
227 return Position(0);
228 }

6.43.4.3 bool Position::isCorner () const

Definition at line 160 of file KDChartPosition.cpp.


References value().

161 {
162 return m_value == Position::NorthWest.value() ||
163 m_value == Position::NorthEast.value() ||
164 m_value == Position::SouthEast.value() ||
165 m_value == Position::SouthWest.value();
166 }

6.43.4.4 bool Position::isEastSide () const

Definition at line 147 of file KDChartPosition.cpp.


References value().

148 {
149 return m_value == Position::NorthEast.value() ||
150 m_value == Position::East.value() ||
151 m_value == Position::SouthEast.value();
152 }

6.43.4.5 bool Position::isNorthSide () const

Definition at line 141 of file KDChartPosition.cpp.


References value().

142 {
143 return m_value == Position::NorthWest.value() ||
144 m_value == Position::North.value() ||
145 m_value == Position::NorthEast.value();
146 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


594 KD Chart 2 Class Documentation

6.43.4.6 bool Position::isPole () const

Definition at line 167 of file KDChartPosition.cpp.


References value().

168 {
169 return m_value == Position::North.value() ||
170 m_value == Position::South.value();
171 }

6.43.4.7 bool Position::isSouthSide () const

Definition at line 153 of file KDChartPosition.cpp.


References value().

154 {
155 return m_value == Position::SouthWest.value() ||
156 m_value == Position::South.value() ||
157 m_value == Position::SouthEast.value();
158 }

6.43.4.8 bool Position::isWestSide () const

Definition at line 135 of file KDChartPosition.cpp.


References value().

136 {
137 return m_value == Position::SouthWest.value() ||
138 m_value == Position::West.value() ||
139 m_value == Position::NorthWest.value();
140 }

6.43.4.9 const char ∗ Position::name () const

Returns a non-translated string in English language, corresponding to this Position.


Definition at line 176 of file KDChartPosition.cpp.
References staticPositionNames.
Referenced by operator<<().

177 {
178 return staticPositionNames[m_value];
179 }

6.43.4.10 QList< QByteArray > Position::names (Options options = IncludeCenter) [static]

Returns a list of all string, corresponding to the pre-defined positions.

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.43 KDChart::Position Class Reference 595

Parameters:
options if set to ExcludeCenter, the returned list does not contain the Center position.

Definition at line 197 of file KDChartPosition.cpp.


References IncludeCenter, maxPositionValue, and staticPositionNames.

198 {
199 QList<QByteArray> list;
200 const int start = ( options & IncludeCenter ) ? 1 : 2;
201 for( int i=start; i<=maxPositionValue; ++i)
202 list.append( staticPositionNames[i] );
203 return list;
204 }

6.43.4.11 bool KDChart::Position::operator!= (int) const

Definition at line 126 of file KDChartPosition.h.


References operator==().

126 { return !operator==( other ); }

6.43.4.12 bool KDChart::Position::operator!= (const Position &) const

Definition at line 125 of file KDChartPosition.h.


References operator==().

125 { return !operator==( other ); }

6.43.4.13 bool Position::operator== (int) const

Definition at line 240 of file KDChartPosition.cpp.


References value().

241 {
242 return ( value() == value_ );
243 }

6.43.4.14 bool Position::operator== (const Position &) const

Definition at line 234 of file KDChartPosition.cpp.


References value().
Referenced by operator!=().

235 {
236 return ( value() == r.value() );
237 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


596 KD Chart 2 Class Documentation

6.43.4.15 QString Position::printableName () const

Returns a translated string, corresponding to this Position.


Definition at line 184 of file KDChartPosition.cpp.
References staticPositionNames.
Referenced by printableNames().

185 {
186 return tr(staticPositionNames[m_value]);
187 }

6.43.4.16 QStringList Position::printableNames (Options options = IncludeCenter) [static]

Returns a list of all translated string, corresponding to the pre-defined positions.

Parameters:
options if set to ExcludeCenter, the returned list does not contain the Center position.

Definition at line 213 of file KDChartPosition.cpp.


References IncludeCenter, maxPositionValue, Position(), and printableName().

214 {
215 QStringList list;
216 const int start = ( options & IncludeCenter ) ? 1 : 2;
217 for( int i=start; i<=maxPositionValue; ++i)
218 list.append( Position(i).printableName() );
219 return list;
220 }

6.43.4.17 KDChartEnums::PositionValue Position::value () const

Returns an integer value corresponding to this Position.


Definition at line 130 of file KDChartPosition.cpp.
Referenced by isCorner(), isEastSide(), isNorthSide(), isPole(), isSouthSide(), isWestSide(), operator==(),
KDChart::PolarDiagram::setShowDelimitersAtPosition(), KDChart::PolarDiagram::setShowLabelsAt-
Position(), KDChart::PolarDiagram::showDelimitersAtPosition(), and KDChart::PolarDiagram::show-
LabelsAtPosition().

131 {
132 return static_cast<KDChartEnums::PositionValue>( m_value );
133 }

6.43.5 Member Data Documentation

6.43.5.1 const Position & Position::Center = staticPositionCenter [static]

Definition at line 83 of file KDChartPosition.cpp.

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.43 KDChart::Position Class Reference 597

6.43.5.2 const Position & Position::East = staticPositionEast [static]

Definition at line 87 of file KDChartPosition.cpp.

6.43.5.3 const Position & Position::North = staticPositionNorth [static]

Definition at line 85 of file KDChartPosition.cpp.

6.43.5.4 const Position & Position::NorthEast = staticPositionNorthEast [static]

Definition at line 86 of file KDChartPosition.cpp.

6.43.5.5 const Position & Position::NorthWest = staticPositionNorthWest [static]

Definition at line 84 of file KDChartPosition.cpp.

6.43.5.6 const Position & Position::South = staticPositionSouth [static]

Definition at line 89 of file KDChartPosition.cpp.

6.43.5.7 const Position & Position::SouthEast = staticPositionSouthEast [static]

Definition at line 88 of file KDChartPosition.cpp.

6.43.5.8 const Position & Position::SouthWest = staticPositionSouthWest [static]

Definition at line 90 of file KDChartPosition.cpp.

6.43.5.9 const Position & Position::Unknown = staticPositionUnknown [static]

Definition at line 82 of file KDChartPosition.cpp.

6.43.5.10 const Position & Position::West = staticPositionWest [static]

Definition at line 91 of file KDChartPosition.cpp.


The documentation for this class was generated from the following files:

• KDChartPosition.h
• KDChartPosition.cpp

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


598 KD Chart 2 Class Documentation

6.44 QAbstractItemView Class Reference


Inheritance diagram for QAbstractItemView:
The documentation for this class was generated from the following file:

• KDChartAbstractDiagram.h

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.45 QAbstractProxyModel Class Reference 599

6.45 QAbstractProxyModel Class Reference


Inheritance diagram for QAbstractProxyModel:
The documentation for this class was generated from the following file:

• KDChartAbstractProxyModel.h

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


600 KD Chart 2 Class Documentation

6.46 QFrame Class Reference


Inheritance diagram for QFrame:
The documentation for this class was generated from the following file:

• KDChartDatasetSelector.h

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.47 QLayoutItem Class Reference 601

6.47 QLayoutItem Class Reference


Inheritance diagram for QLayoutItem:
The documentation for this class was generated from the following file:

• KDChartLayoutItems.h

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


602 KD Chart 2 Class Documentation

6.48 QObject Class Reference


Inheritance diagram for QObject:
The documentation for this class was generated from the following file:

• KDChartAbstractArea.h

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.49 QSortFilterProxyModel Class Reference 603

6.49 QSortFilterProxyModel Class Reference


Inheritance diagram for QSortFilterProxyModel:
The documentation for this class was generated from the following file:

• KDChartDatasetProxyModel.h

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


604 KD Chart 2 Class Documentation

6.50 QTextDocument Class Reference


Inheritance diagram for QTextDocument:
The documentation for this class was generated from the following file:

• KDTextDocument.h

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.51 QWidget Class Reference 605

6.51 QWidget Class Reference


Inheritance diagram for QWidget:
The documentation for this class was generated from the following file:

• KDChartAbstractAreaWidget.h

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


606 KD Chart 2 Class Documentation

6.52 KDChart::RelativePosition Class Reference


#include <KDChartRelativePosition.h>

6.52.1 Detailed Description

Defines relative position information: reference area, position in this area, horizontal / vertical padding,
and rotating.
Using RelativePosition you can specify the relative parts of some position information, and you can specify
the absolute parts: the reference area, and the position in this area. To get an absolute position, you will
need to declare both, the relative and the absolute parts, otherwise the specification is incomplete and KD
Chart will ignore it.
Definition at line 56 of file KDChartRelativePosition.h.

Public Member Functions


• Qt::Alignment alignment () const
• Measure horizontalPadding () const
• bool operator!= (const RelativePosition &other) const
• RelativePosition & operator= (const RelativePosition &other)
• bool operator== (const RelativePosition &) const
• AbstractArea ∗ referenceArea () const
• Position referencePosition () const
• RelativePosition (const RelativePosition &)
• RelativePosition ()
• qreal rotation () const
• void setAlignment (Qt::Alignment flags)
• void setHorizontalPadding (const Measure &padding)
• void setReferenceArea (AbstractArea ∗area)
• void setReferencePosition (Position position)
• void setRotation (qreal rot)
• void setVerticalPadding (const Measure &padding)
• Measure verticalPadding () const
• ∼RelativePosition ()

6.52.2 Constructor & Destructor Documentation

6.52.2.1 KDChart::RelativePosition::RelativePosition ()

6.52.2.2 KDChart::RelativePosition::RelativePosition (const RelativePosition &)

6.52.2.3 KDChart::RelativePosition::∼RelativePosition ()

6.52.3 Member Function Documentation

6.52.3.1 Qt::Alignment KDChart::RelativePosition::alignment () const

Referenced by operator<<().

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.52 KDChart::RelativePosition Class Reference 607

6.52.3.2 Measure KDChart::RelativePosition::horizontalPadding () const

Referenced by operator<<().

6.52.3.3 bool KDChart::RelativePosition::operator!= (const RelativePosition & other) const

Definition at line 91 of file KDChartRelativePosition.h.


References operator==().

91 { return !operator==( other ); }

6.52.3.4 RelativePosition& KDChart::RelativePosition::operator= (const RelativePosition &


other)

6.52.3.5 bool KDChart::RelativePosition::operator== (const RelativePosition &) const

Referenced by operator!=().

6.52.3.6 AbstractArea∗ KDChart::RelativePosition::referenceArea () const

Referenced by operator<<().

6.52.3.7 Position KDChart::RelativePosition::referencePosition () const

Referenced by operator<<().

6.52.3.8 qreal KDChart::RelativePosition::rotation () const

Referenced by operator<<().

6.52.3.9 void KDChart::RelativePosition::setAlignment (Qt::Alignment flags)

6.52.3.10 void KDChart::RelativePosition::setHorizontalPadding (const Measure & padding)

6.52.3.11 void KDChart::RelativePosition::setReferenceArea (AbstractArea ∗ area)

6.52.3.12 void KDChart::RelativePosition::setReferencePosition (Position position)

6.52.3.13 void KDChart::RelativePosition::setRotation (qreal rot)

6.52.3.14 void KDChart::RelativePosition::setVerticalPadding (const Measure & padding)

6.52.3.15 Measure KDChart::RelativePosition::verticalPadding () const

Referenced by operator<<().
The documentation for this class was generated from the following file:

• KDChartRelativePosition.h

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


608 KD Chart 2 Class Documentation

6.53 KDChart::RingDiagram Class Reference


#include <KDChartRingDiagram.h>
Inheritance diagram for KDChart::RingDiagram:Collaboration diagram for KDChart::RingDiagram:

Public Member Functions


• bool allowOverlappingDataValueTexts () const
• bool antiAliasing () const
• virtual AttributesModel ∗ attributesModel () const
Returns the AttributesModel, that is used by this diagram.

• QBrush brush (const QModelIndex &index) const


Retrieve the brush to be used, for painting the datapoint at the given index in the model.

• QBrush brush (int dataset) const


Retrieve the brush to be used for the given dataset.

• QBrush brush () const


Retrieve the brush to be used for painting datapoints globally.

• virtual RingDiagram ∗ clone () const


• int columnCount () const
• AbstractCoordinatePlane ∗ coordinatePlane () const
The coordinate plane associated with the diagram.

• const QPair< QPointF, QPointF > dataBoundaries () const


Return the bottom left and top right data point, that the diagram will display (unless the grid adjusts these
values).

• virtual void dataChanged (const QModelIndex &topLeft, const QModelIndex &bottomRight)


[reimplemented]

• QList< QBrush > datasetBrushes () const


The set of dataset brushes currently used, for use in legends, etc.

• int datasetDimension () const


The dataset dimension of a diagram determines, how many value dimensions it expects each datapoint to
have.

• QStringList datasetLabels () const


The set of dataset labels currently displayed, for use in legends, etc.

• QList< MarkerAttributes > datasetMarkers () const


The set of dataset markers currently used, for use in legends, etc.

• QList< QPen > datasetPens () const


The set of dataset pens currently used, for use in legends, etc.

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.53 KDChart::RingDiagram Class Reference 609

• DataValueAttributes dataValueAttributes (const QModelIndex &index) const


Retrieve the DataValueAttributes for the given index.

• DataValueAttributes dataValueAttributes (int column) const


Retrieve the DataValueAttributes for the given dataset.

• DataValueAttributes dataValueAttributes () const


Retrieve the DataValueAttributes speficied globally.

• virtual void doItemsLayout ()


[reimplemented]

• qreal granularity () const


• virtual int horizontalOffset () const
[reimplemented]

• virtual QModelIndex indexAt (const QPoint &point) const


[reimplemented]

• virtual bool isIndexHidden (const QModelIndex &index) const


[reimplemented]

• QStringList itemRowLabels () const


The set of item row labels currently displayed, for use in Abscissa axes, etc.

• virtual QModelIndex moveCursor (CursorAction cursorAction, Qt::KeyboardModifiers modifiers)


[reimplemented]

• virtual double numberOfGridRings () const


[reimplemented]

• virtual double numberOfValuesPerDataset () const


[reimplemented]

• virtual void paintMarker (QPainter ∗painter, const MarkerAttributes &markerAttributes, const


QBrush &brush, const QPen &, const QPointF &point, const QSizeF &size)
• QPen pen (const QModelIndex &index) const
Retrieve the pen to be used, for painting the datapoint at the given index in the model.

• QPen pen (int dataset) const


Retrieve the pen to be used for the given dataset.

• QPen pen () const


Retrieve the pen to be used for painting datapoints globally.

• bool percentMode () const


• PieAttributes pieAttributes (const QModelIndex &index) const
• PieAttributes pieAttributes (int column) const
• PieAttributes pieAttributes () const
• const PolarCoordinatePlane ∗ polarCoordinatePlane () const

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


610 KD Chart 2 Class Documentation

• bool relativeThickness () const


• virtual void resize (const QSizeF &area)
[reimplemented]

• RingDiagram (QWidget ∗parent=0, PolarCoordinatePlane ∗plane=0)


• virtual void scrollTo (const QModelIndex &index, ScrollHint hint=EnsureVisible)
[reimplemented]

• void setAllowOverlappingDataValueTexts (bool allow)


Set whether data value labels are allowed to overlap.

• void setAntiAliasing (bool enabled)


Set whether anti-aliasing is to be used while rendering this diagram.

• virtual void setAttributesModel (AttributesModel ∗model)


Associate an AttributesModel with this diagram.

• void setBrush (const QBrush &brush)


Set the brush to be used, for painting all datasets in the model.

• void setBrush (int dataset, const QBrush &brush)


Set the brush to be used, for painting the given dataset.

• void setBrush (const QModelIndex &index, const QBrush &brush)


Set the brush to be used, for painting the datapoint at the given index.

• virtual void setCoordinatePlane (AbstractCoordinatePlane ∗plane)


Set the coordinate plane associated with the diagram.

• void setDatasetDimension (int dimension)


Sets the dataset dimension of the diagram.

• void setDataValueAttributes (const DataValueAttributes &a)


Set the DataValueAttributes for all datapoints in the model.

• void setDataValueAttributes (int dataset, const DataValueAttributes &a)


Set the DataValueAttributes for the given dataset.

• void setDataValueAttributes (const QModelIndex &index, const DataValueAttributes &a)


Set the DataValueAttributes for the given index.

• void setGranularity (qreal value)


Set the granularity: the smaller the granularity the more your diagram segments will show facettes instead
of rounded segments.

• virtual void setModel (QAbstractItemModel ∗model)


Associate a model with the diagram.

• void setPen (const QPen &pen)


Set the pen to be used, for painting all datasets in the model.

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.53 KDChart::RingDiagram Class Reference 611

• void setPen (int dataset, const QPen &pen)


Set the pen to be used, for painting the given dataset.

• void setPen (const QModelIndex &index, const QPen &pen)


Set the pen to be used, for painting the datapoint at the given index.

• void setPercentMode (bool percent)


• void setPieAttributes (int column, const PieAttributes &a)
• void setPieAttributes (const PieAttributes &a)
• void setRelativeThickness (bool relativeThickness)
• virtual void setRootIndex (const QModelIndex &idx)
Set the root index in the model, where the diagram starts referencing data for display.

• virtual void setSelection (const QRect &rect, QItemSelectionModel::SelectionFlags command)


[reimplemented]

• void setStartPosition (qreal degrees)


Set the starting angle for the first dataset.

• void setThreeDPieAttributes (const QModelIndex &index, const ThreeDPieAttributes &a)


• void setThreeDPieAttributes (int column, const ThreeDPieAttributes &a)
• void setThreeDPieAttributes (const ThreeDPieAttributes &a)
• qreal startPosition () const
• ThreeDPieAttributes threeDPieAttributes (const QModelIndex &index) const
• ThreeDPieAttributes threeDPieAttributes (int column) const
• ThreeDPieAttributes threeDPieAttributes () const
• void update () const
• void useDefaultColors ()
Set the palette to be used, for painting datasets to the default palette.

• void useRainbowColors ()
Set the palette to be used, for painting datasets to the rainbow palette.

• void useSubduedColors ()
Set the palette to be used, for painting datasets to the subdued palette.

• virtual double valueTotals () const


[reimplemented]

• virtual int verticalOffset () const


[reimplemented]

• virtual QRect visualRect (const QModelIndex &index) const


[reimplemented]

• virtual QRegion visualRegionForSelection (const QItemSelection &selection) const


[reimplemented]

• virtual ∼RingDiagram ()

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


612 KD Chart 2 Class Documentation

Protected Member Functions


• QModelIndex attributesModelRootIndex () const
• virtual const QPair< QPointF, QPointF > calculateDataBoundaries () const
[reimplemented]

• virtual bool checkInvariants (bool justReturnTheStatus=false) const


• QModelIndex columnToIndex (int column) const
• void modelsChanged ()
This signal is emitted, when either the model or the AttributesModel is replaced.

• virtual void paint (PaintContext ∗paintContext)


[reimplemented]

• void paintDataValueText (QPainter ∗painter, const QModelIndex &index, const QPointF &pos, dou-
ble value)
• virtual void paintDataValueTexts (QPainter ∗painter)
• void paintEvent (QPaintEvent ∗)
• void paintMarker (QPainter ∗painter, const QModelIndex &index, const QPointF &pos)
• virtual void paintMarkers (QPainter ∗painter)
• void propertiesChanged ()
Emitted upon change of a property of the Diagram.

• void resizeEvent (QResizeEvent ∗)


• void setAttributesModelRootIndex (const QModelIndex &)
• void setDataBoundariesDirty () const
• double valueForCell (int row, int column) const
Helper method, retrieving the data value (DisplayRole) for a given row and column.

Protected Attributes
• Q_SIGNALS __pad0__: void layoutChanged( AbstractDiagram∗ )

6.53.1 Constructor & Destructor Documentation

6.53.1.1 RingDiagram::RingDiagram (QWidget ∗ parent = 0, PolarCoordinatePlane ∗ plane = 0)


[explicit]

Definition at line 50 of file KDChartRingDiagram.cpp.


Referenced by clone().

50 :
51 AbstractPieDiagram( new Private(), parent, plane )
52 {
53 init();
54 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.53 KDChart::RingDiagram Class Reference 613

6.53.1.2 RingDiagram::∼RingDiagram () [virtual]

Definition at line 56 of file KDChartRingDiagram.cpp.

57 {
58 }

6.53.2 Member Function Documentation

6.53.2.1 bool AbstractDiagram::allowOverlappingDataValueTexts () const [inherited]

Returns:
Whether data value labels are allowed to overlap.

Definition at line 291 of file KDChartAbstractDiagram.cpp.


References d.

295 {

6.53.2.2 bool AbstractDiagram::antiAliasing () const [inherited]

Returns:
Whether anti-aliasing is to be used for rendering this diagram.

Definition at line 302 of file KDChartAbstractDiagram.cpp.


References d.
Referenced by KDChart::LineDiagram::paint().

306 {

6.53.2.3 AttributesModel ∗ AbstractDiagram::attributesModel () const [virtual,


inherited]

Returns the AttributesModel, that is used by this diagram.


By default each diagram owns its own AttributesModel, which should never be deleted. Only if a user-
supplied AttributesModel has been set does the pointer returned here not belong to the diagram.

Returns:
The AttributesModel associated with the diagram.

See also:
setAttributesModel

Definition at line 180 of file KDChartAbstractDiagram.cpp.


References d.
Referenced by paint(), KDChart::PolarDiagram::paint(), and KDChart::BarDiagram::setBarAttributes().

181 {
182 return d->attributesModel;
183 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


614 KD Chart 2 Class Documentation

6.53.2.4 QModelIndex AbstractDiagram::attributesModelRootIndex () const [protected,


inherited]

returns a QModelIndex pointing into the AttributesModel that corresponds to the root index of the diagram.
Definition at line 204 of file KDChartAbstractDiagram.cpp.
References d.
Referenced by KDChart::LineDiagram::calculateDataBoundaries(), KDChart::BarDiagram::calculate-
DataBoundaries(), KDChart::LineDiagram::numberOfAbscissaSegments(), KDChart::Bar-
Diagram::numberOfAbscissaSegments(), KDChart::LineDiagram::numberOfOrdinateSegments(),
KDChart::BarDiagram::numberOfOrdinateSegments(), KDChart::LineDiagram::paint(), KDChart::Bar-
Diagram::paint(), and KDChart::AbstractDiagram::valueForCell().

210 {

6.53.2.5 QBrush AbstractDiagram::brush (const QModelIndex & index) const [inherited]

Retrieve the brush to be used, for painting the datapoint at the given index in the model.

Parameters:
index The index of the datapoint in the model.

Returns:
The brush to use for painting.

Definition at line 632 of file KDChartAbstractDiagram.cpp.

638 :
QRect AbstractDiagram::visualRect(const QModelIndex &) const

6.53.2.6 QBrush AbstractDiagram::brush (int dataset) const [inherited]

Retrieve the brush to be used for the given dataset.


This will fall back automatically to what was set at model level, if there are no dataset specific settings.

Parameters:
dataset The dataset to retrieve the brush for.

Returns:
The brush to use for painting.

Definition at line 624 of file KDChartAbstractDiagram.cpp.

631 {

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.53 KDChart::RingDiagram Class Reference 615

6.53.2.7 QBrush AbstractDiagram::brush () const [inherited]

Retrieve the brush to be used for painting datapoints globally.


This will fall back automatically to the default settings, if there are no specific settings.

Returns:
The brush to use for painting.

Definition at line 618 of file KDChartAbstractDiagram.cpp.


Referenced by KDChart::PieDiagram::paint(), and KDChart::AbstractDiagram::paintMarker().

623 {

6.53.2.8 const QPair< QPointF, QPointF > RingDiagram::calculateDataBoundaries () const


[protected, virtual]

[reimplemented]
Implements KDChart::AbstractDiagram.
Definition at line 79 of file KDChartRingDiagram.cpp.
References KDChart::AbstractDiagram::checkInvariants().

80 {
81 if ( !checkInvariants() ) return QPair<QPointF, QPointF>( QPointF( 0, 0 ), QPointF( 0, 0 ) );
82
83 QPointF bottomLeft ( QPointF( 0, 0 ) );
84 QPointF topRight ( QPointF( 1, 1 ) );
85 return QPair<QPointF, QPointF> ( bottomLeft, topRight );
86 }

6.53.2.9 bool AbstractDiagram::checkInvariants (bool justReturnTheStatus = false) const


[protected, virtual, inherited]

Definition at line 746 of file KDChartAbstractDiagram.cpp.


References KDChart::AbstractDiagram::coordinatePlane().
Referenced by calculateDataBoundaries(), KDChart::PolarDiagram::calculateDataBoundaries(),
KDChart::PieDiagram::calculateDataBoundaries(), KDChart::LineDiagram::calculateDataBoundaries(),
KDChart::BarDiagram::calculateDataBoundaries(), paint(), KDChart::PolarDiagram::paint(),
KDChart::PieDiagram::paint(), KDChart::LineDiagram::paint(), KDChart::BarDiagram::paint(), and
KDChart::AbstractDiagram::paintMarker().

746 {
747 Q_ASSERT_X ( model(), "AbstractDiagram::checkInvariants()",
748 "There is no usable model set, for the diagram." );
749
750 Q_ASSERT_X ( coordinatePlane(), "AbstractDiagram::checkInvariants()",
751 "There is no usable coordinate plane set, for the diagram." );
752 }
753 return model() && coordinatePlane();
754 }
755
756 int AbstractDiagram::datasetDimension( ) const

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


616 KD Chart 2 Class Documentation

6.53.2.10 RingDiagram ∗ RingDiagram::clone () const [virtual]

Definition at line 64 of file KDChartRingDiagram.cpp.


References d, and RingDiagram().

65 {
66 return new RingDiagram( new Private( *d ) );
67 }

6.53.2.11 int AbstractPolarDiagram::columnCount () const [inherited]

Definition at line 58 of file KDChartAbstractPolarDiagram.cpp.


References KDChart::AbstractPolarDiagram::numberOfValuesPerDataset().
Referenced by KDChart::PieDiagram::calculateDataBoundaries(), KDChart::PieDiagram::paint(), and
KDChart::PieDiagram::valueTotals().

59 {
60 return static_cast<int>( numberOfValuesPerDataset() );
61 }

6.53.2.12 QModelIndex AbstractDiagram::columnToIndex (int column) const [protected,


inherited]

Definition at line 211 of file KDChartAbstractDiagram.cpp.

217 {

6.53.2.13 AbstractCoordinatePlane ∗ AbstractDiagram::coordinatePlane () const


[inherited]

The coordinate plane associated with the diagram.


This determines how coordinates in value space are mapped into pixel space. By default this is a Cartesian-
CoordinatePlane.

Returns:
The coordinate plane associated with the diagram.

Definition at line 125 of file KDChartAbstractDiagram.cpp.


References d.
Referenced by KDChart::BarDiagram::calculateDataBoundaries(), KDChart::AbstractDiagram::check-
Invariants(), KDChart::AbstractCartesianDiagram::layoutPlanes(), KDChart::PolarDiagram::paint(),
KDChart::LineDiagram::paint(), KDChart::BarDiagram::paint(), KDChart::AbstractPolarDiagram::polar-
CoordinatePlane(), and KDChart::AbstractCartesianDiagram::setCoordinatePlane().

126 {
127 return d->plane;
128 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.53 KDChart::RingDiagram Class Reference 617

6.53.2.14 const QPair< QPointF, QPointF > AbstractDiagram::dataBoundaries () const


[inherited]

Return the bottom left and top right data point, that the diagram will display (unless the grid adjusts these
values).
This method returns a chached result of calculations done by calculateDataBoundaries. Classes derived
from AbstractDiagram must implement the calculateDataBoundaries function, to specify their own way of
calculating the data boundaries. If derived classes want to force recalculation of the data boundaries, they
can call setDataBoundariesDirty()
Returned value is in diagram coordinates.
Definition at line 130 of file KDChartAbstractDiagram.cpp.
References KDChart::AbstractDiagram::calculateDataBoundaries(), and d.
Referenced by KDChart::CartesianCoordinatePlane::calculateRawDataBoundingRect(), KDChart::Polar-
CoordinatePlane::layoutDiagrams(), KDChart::LineDiagram::paint(), and KDChart::BarDiagram::paint().

131 {
132 if( d->databoundariesDirty ){
133 d->databoundaries = calculateDataBoundaries ();
134 d->databoundariesDirty = false;
135 }
136 return d->databoundaries;
137 }

6.53.2.15 void AbstractDiagram::dataChanged (const QModelIndex & topLeft, const


QModelIndex & bottomRight) [virtual, inherited]

[reimplemented]
Definition at line 232 of file KDChartAbstractDiagram.cpp.
References d.

232 {
233 // We are still too dumb to do intelligent updates...
234 d->databoundariesDirty = true;
235 scheduleDelayedItemsLayout();
236 }
237
238 void AbstractDiagram::setDataValueAttributes( const QModelIndex & index,

6.53.2.16 QList< QBrush > AbstractDiagram::datasetBrushes () const [inherited]

The set of dataset brushes currently used, for use in legends, etc.

Note:
Cell-level override brushes, if set, take precedence over the dataset values, so you might need to check
these too, in order to find the brush, that is used for a single cell.

Returns:
The current set of dataset brushes.

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


618 KD Chart 2 Class Documentation

Definition at line 710 of file KDChartAbstractDiagram.cpp.


Referenced by KDChart::Legend::buildLegend(), KDChart::Legend::datasetCount(), and
KDChart::Legend::setBrushesFromDiagram().

712 {
713 QBrush brush = qVariantValue<QBrush>( attributesModel()->headerData( i, Qt::Vertical, DatasetB
714 ret << brush;
715 }
716
717 return ret;
718 }
719
720 QList<QPen> AbstractDiagram::datasetPens() const

6.53.2.17 int AbstractDiagram::datasetDimension () const [inherited]

The dataset dimension of a diagram determines, how many value dimensions it expects each datapoint to
have.
For each dimension it will expect one column of values in the model. If the dimensionality is 1, automatic
values will be used for the abscissa.
For example a diagram with the default dimension of 1, will have one column per datapoint (the y values)
and will use automatic values for the x axis (1, 2, 3, ... n). If the dimension is 2, the diagram will use the
first, (and the third, fifth, etc) columns as X values, and the second, (and the fourth, sixth, etc) column as Y
values.

Returns:
The dataset dimension of the diagram.

Definition at line 758 of file KDChartAbstractDiagram.cpp.


References d.
Referenced by KDChart::LineDiagram::calculateDataBoundaries(), KDChart::LineDiagram::get-
CellValues(), KDChart::CartesianCoordinatePlane::getDataDimensionsList(), KDChart::Line-
Diagram::paint(), and KDChart::LineDiagram::setType().

762 {

6.53.2.18 QStringList AbstractDiagram::datasetLabels () const [inherited]

The set of dataset labels currently displayed, for use in legends, etc.

Returns:
The set of dataset labels currently displayed.

Definition at line 698 of file KDChartAbstractDiagram.cpp.


Referenced by KDChart::Legend::buildLegend(), and KDChart::Legend::datasetCount().

699 : " << attributesModel()->columnCount(attributesModel


700 const int columnCount = attributesModel()->columnCount(attributesModelRootIndex());
701 for( int i = datasetDimension()-1; i < columnCount; i += datasetDimension() ){
702 //qDebug() << "label: " << attributesModel()->headerData( i, Qt::Horizontal, Qt::DisplayRole )

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.53 KDChart::RingDiagram Class Reference 619

703 ret << attributesModel()->headerData( i, Qt::Horizontal, Qt::DisplayRole ).toString();


704 }
705 return ret;
706 }
707
708 QList<QBrush> AbstractDiagram::datasetBrushes() const

6.53.2.19 QList< MarkerAttributes > AbstractDiagram::datasetMarkers () const


[inherited]

The set of dataset markers currently used, for use in legends, etc.

Note:
Cell-level override markers, if set, take precedence over the dataset values, so you might need to check
these too, in order to find the marker, that is shown for a single cell.

Returns:
The current set of dataset brushes.

Definition at line 733 of file KDChartAbstractDiagram.cpp.


Referenced by KDChart::Legend::buildLegend().

735 {
736 DataValueAttributes a =
737 qVariantValue<DataValueAttributes>( attributesModel()->headerData( i, Qt::Vertical, DataVa
738 const MarkerAttributes &ma = a.markerAttributes();
739 ret << ma;
740 }
741 return ret;
742 }
743
744 bool AbstractDiagram::checkInvariants( bool justReturnTheStatus ) const

6.53.2.20 QList< QPen > AbstractDiagram::datasetPens () const [inherited]

The set of dataset pens currently used, for use in legends, etc.

Note:
Cell-level override pens, if set, take precedence over the dataset values, so you might need to check
these too, in order to find the pens, that is used for a single cell.

Returns:
The current set of dataset pens.

Definition at line 722 of file KDChartAbstractDiagram.cpp.


Referenced by KDChart::Legend::buildLegend().

724 {
725 QPen pen = qVariantValue<QPen>( attributesModel()->headerData( i, Qt::Vertical, DatasetPenRole
726 ret << pen;
727 }
728 return ret;
729 }
730
731 QList<MarkerAttributes> AbstractDiagram::datasetMarkers() const

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


620 KD Chart 2 Class Documentation

6.53.2.21 DataValueAttributes AbstractDiagram::dataValueAttributes (const QModelIndex &


index) const [inherited]

Retrieve the DataValueAttributes for the given index.


This will fall back automatically to what was set at dataset or model level, if there are no datapoint specific
settings.

Parameters:
index The datapoint to retrieve the attributes for.

Returns:
The DataValueAttributes for the given index.

Definition at line 272 of file KDChartAbstractDiagram.cpp.

278 {

6.53.2.22 DataValueAttributes AbstractDiagram::dataValueAttributes (int column) const


[inherited]

Retrieve the DataValueAttributes for the given dataset.


This will fall back automatically to what was set at model level, if there are no dataset specific settings.

Parameters:
dataset The dataset to retrieve the attributes for.

Returns:
The DataValueAttributes for the given dataset.

Definition at line 265 of file KDChartAbstractDiagram.cpp.

271 {

6.53.2.23 DataValueAttributes AbstractDiagram::dataValueAttributes () const [inherited]

Retrieve the DataValueAttributes speficied globally.


This will fall back automatically to the default settings, if there are no specific settings.

Returns:
The global DataValueAttributes.

Definition at line 260 of file KDChartAbstractDiagram.cpp.


Referenced by KDChart::AbstractDiagram::paintDataValueText(), and KDChart::AbstractDiagram::paint-
Marker().

264 {

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.53 KDChart::RingDiagram Class Reference 621

6.53.2.24 void AbstractDiagram::doItemsLayout () [virtual, inherited]

[reimplemented]
Definition at line 223 of file KDChartAbstractDiagram.cpp.
References d, and KDChart::AbstractDiagram::update().

223 {
224 d->plane->layoutDiagrams();
225 update();
226 }
227 QAbstractItemView::doItemsLayout();
228 }
229
230 void AbstractDiagram::dataChanged( const QModelIndex &topLeft,

6.53.2.25 qreal AbstractPieDiagram::granularity () const [inherited]

Returns:
the granularity.

Definition at line 81 of file KDChartAbstractPieDiagram.cpp.


References d.
Referenced by KDChart::PieDiagram::paint().

82 {
83 return (d->granularity < 0.05 || d->granularity > 36.0)
84 ? 1.0
85 : d->granularity;
86 }

6.53.2.26 int AbstractDiagram::horizontalOffset () const [virtual, inherited]

[reimplemented]
Definition at line 655 of file KDChartAbstractDiagram.cpp.

657 { return 0; }

6.53.2.27 QModelIndex AbstractDiagram::indexAt (const QPoint & point) const [virtual,


inherited]

[reimplemented]
Definition at line 649 of file KDChartAbstractDiagram.cpp.

651 { return QModelIndex(); }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


622 KD Chart 2 Class Documentation

6.53.2.28 bool AbstractDiagram::isIndexHidden (const QModelIndex & index) const


[virtual, inherited]

[reimplemented]
Definition at line 661 of file KDChartAbstractDiagram.cpp.

663 {}

6.53.2.29 QStringList AbstractDiagram::itemRowLabels () const [inherited]

The set of item row labels currently displayed, for use in Abscissa axes, etc.

Returns:
The set of item row labels currently displayed.

Definition at line 686 of file KDChartAbstractDiagram.cpp.

687 : " << attributesModel()->rowCount(attributesModelRoo


688 const int rowCount = attributesModel()->rowCount(attributesModelRootIndex());
689 for( int i = 0; i < rowCount; ++i ){
690 //qDebug() << "label: " << attributesModel()->headerData( i, Qt::Vertical, Qt::DisplayRole ).t
691 ret << attributesModel()->headerData( i, Qt::Vertical, Qt::DisplayRole ).toString();
692 }
693 return ret;
694 }
695
696 QStringList AbstractDiagram::datasetLabels() const

6.53.2.30 void KDChart::AbstractDiagram::modelsChanged () [protected, inherited]

This signal is emitted, when either the model or the AttributesModel is replaced.
Referenced by KDChart::AbstractDiagram::setAttributesModel(), and KDChart::AbstractDiagram::set-
Model().

6.53.2.31 QModelIndex AbstractDiagram::moveCursor (CursorAction cursorAction,


Qt::KeyboardModifiers modifiers) [virtual, inherited]

[reimplemented]
Definition at line 652 of file KDChartAbstractDiagram.cpp.

654 { return 0; }

6.53.2.32 double RingDiagram::numberOfGridRings () const [virtual]

[reimplemented]
Implements KDChart::AbstractPolarDiagram.
Definition at line 146 of file KDChartRingDiagram.cpp.

147 {
148 return 1;
149 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.53 KDChart::RingDiagram Class Reference 623

6.53.2.33 double RingDiagram::numberOfValuesPerDataset () const [virtual]

[reimplemented]
Implements KDChart::AbstractPolarDiagram.
Definition at line 140 of file KDChartRingDiagram.cpp.

141 {
142 return model()->columnCount(rootIndex());
143 }

6.53.2.34 void RingDiagram::paint (PaintContext ∗ paintContext) [protected, virtual]

[reimplemented]
Implements KDChart::AbstractDiagram.
Definition at line 101 of file KDChartRingDiagram.cpp.
References KDChart::AbstractDiagram::attributesModel(), KDChart::AbstractDiagram::check-
Invariants(), KDChart::AttributesModel::headerData(), KDChart::AbstractDiagram::paintDataValue-
Text(), and KDChart::PaintContext::painter().
Referenced by paintEvent().

102 {
103 if ( !checkInvariants() ) return;
104 const int colCount = model()->columnCount(rootIndex());
105 DataValueTextInfoList list;
106 for ( int j=0; j<colCount; ++j ) {
107 QBrush brush = qVariantValue<QBrush>( attributesModel()->headerData( j, Qt::Vertical, KDChart:
108 PainterSaver painterSaver( ctx->painter() );
109 ctx->painter()->setRenderHint ( QPainter::Antialiasing );
110 ctx->painter()->setBrush( brush );
111 QPen p( ctx->painter()->pen() );
112 p.setColor( brush.color() );
113 p.setWidth( 2 );// FIXME properties, use DatasetPenRole
114 ctx->painter()->setPen( p );
115 //ctx->painter()->drawPolyline( polygon );
116 }
117 DataValueTextInfoListIterator it( list );
118 while ( it.hasNext() ) {
119 const DataValueTextInfo& info = it.next();
120 paintDataValueText( ctx->painter(), info.index, info.pos, info.value );
121 }
122 }

6.53.2.35 void AbstractDiagram::paintDataValueText (QPainter ∗ painter, const QModelIndex &


index, const QPointF & pos, double value) [protected, inherited]

Definition at line 318 of file KDChartAbstractDiagram.cpp.


References KDChart::DataValueAttributes::dataLabel(), KDChart::AbstractDiagram::dataValue-
Attributes(), KDChart::DataValueAttributes::decimalDigits(), KDChart::TextAttributes::font(),
KDChart::TextAttributes::isVisible(), KDChart::DataValueAttributes::isVisible(), KDChart::Text-
Attributes::pen(), KDChart::DataValueAttributes::prefix(), KDChart::TextAttributes::rotation(),
KDChart::DataValueAttributes::suffix(), and KDChart::DataValueAttributes::textAttributes().

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


624 KD Chart 2 Class Documentation

Referenced by paint(), KDChart::PolarDiagram::paint(), KDChart::LineDiagram::paint(), and


KDChart::BarDiagram::paint().

320 {
321 // paint one data series
322 DataValueAttributes a = dataValueAttributes(index);
323 if ( !a.isVisible() ) return;
324
325 // handle decimal digits
326 int decimalDigits = a.decimalDigits();
327 int decimalPos = QString::number( value ).indexOf( QLatin1Char( ’.’ ) );
328 QString roundedValue;
329 if ( a.dataLabel().isNull() ) {
330 if ( decimalPos > 0 && value != 0 )
331 roundedValue = roundValues ( value, decimalPos, decimalDigits );
332 else
333 roundedValue = QString::number( value );
334 } else
335 roundedValue = a.dataLabel();
336 // handle prefix and suffix
337 if ( !a.prefix().isNull() )
338 roundedValue.prepend( a.prefix() );
339
340 if ( !a.suffix().isNull() )
341 roundedValue.append( a.suffix() );
342
343 PainterSaver painterSaver( painter );
344 // FIXME draw the non-text bits, background, etc
345 const TextAttributes &ta = a.textAttributes();
346 if ( ta.isVisible() ) {
347 painter->setPen( ta.pen() );
348 painter->setFont( ta.font() );
349 painter->translate( pos );
350 painter->rotate( ta.rotation() );
351 painter->drawText( QPointF(0, 0), roundedValue );
352 }
353 }
354
355 QString AbstractDiagram::roundValues( double value,

6.53.2.36 void AbstractDiagram::paintDataValueTexts (QPainter ∗ painter) [protected,


virtual, inherited]

Definition at line 382 of file KDChartAbstractDiagram.cpp.

385 {
386 for ( int j=0; j< rowCount; ++j ) {
387 const QModelIndex index = model()->index( j, i, rootIndex() );
388 double value = model()->data( index ).toDouble();
389 const QPointF pos = coordinatePlane()->translate( QPointF( j, value ) );
390 paintDataValueText( painter, index, pos, value );
391 }
392 }
393 }
394
395

6.53.2.37 void RingDiagram::paintEvent (QPaintEvent ∗) [protected]

Definition at line 88 of file KDChartRingDiagram.cpp.


References paint(), KDChart::PaintContext::setPainter(), and KDChart::PaintContext::setRectangle().

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.53 KDChart::RingDiagram Class Reference 625

89 {
90 QPainter painter ( viewport() );
91 PaintContext ctx;
92 ctx.setPainter ( &painter );
93 ctx.setRectangle( QRectF ( 0, 0, width(), height() ) );
94 paint ( &ctx );
95 }

6.53.2.38 void AbstractDiagram::paintMarker (QPainter ∗ painter, const QModelIndex & index,


const QPointF & pos) [protected, inherited]

Definition at line 398 of file KDChartAbstractDiagram.cpp.


References KDChart::AbstractDiagram::brush(), KDChart::AbstractDiagram::checkInvariants(),
KDChart::AbstractDiagram::dataValueAttributes(), KDChart::MarkerAttributes::isVisible(),
KDChart::DataValueAttributes::isVisible(), KDChart::DataValueAttributes::markerAttributes(),
KDChart::MarkerAttributes::markerColor(), KDChart::MarkerAttributes::markerSize(),
KDChart::AbstractDiagram::paintMarker(), and KDChart::MarkerAttributes::pen().

399 {
400
401 if ( !checkInvariants() ) return;
402 DataValueAttributes a = dataValueAttributes(index);
403 if ( !a.isVisible() ) return;
404 const MarkerAttributes &ma = a.markerAttributes();
405 if ( !ma.isVisible() ) return;
406
407 PainterSaver painterSaver( painter );
408 QSizeF maSize( ma.markerSize() );
409 QBrush indexBrush( brush( index ) );
410 QPen indexPen( ma.pen() );
411 if ( ma.markerColor().isValid() )
412 indexBrush.setColor( ma.markerColor() );
413
414 paintMarker( painter, ma, indexBrush, indexPen, pos, maSize );
415 }
416
417

6.53.2.39 void AbstractDiagram::paintMarker (QPainter ∗ painter, const MarkerAttributes &


markerAttributes, const QBrush & brush, const QPen &, const QPointF & point, const
QSizeF & size) [virtual, inherited]

Definition at line 420 of file KDChartAbstractDiagram.cpp.


References KDChart::MarkerAttributes::markerStyle().
Referenced by KDChart::LineDiagram::paint(), KDChart::MarkerLayoutItem::paint(), and
KDChart::AbstractDiagram::paintMarker().

424 {
425 PainterSaver painterSaver( painter );
426 painter->setBrush( brush );
427 painter->setPen( pen );
428 painter->setRenderHint ( QPainter::Antialiasing );
429 painter->translate( pos );
430 switch ( markerAttributes.markerStyle() ) {
431 case MarkerAttributes::MarkerCircle:
432 painter->drawEllipse( QRectF( 0 - maSize.height()/2, 0 - maSize.width()/2,

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


626 KD Chart 2 Class Documentation

433 maSize.height(), maSize.width()) );


434 break;
435 case MarkerAttributes::MarkerSquare:
436 {
437 QRectF rect( 0 - maSize.height()/2, 0 - maSize.width()/2,
438 maSize.height(), maSize.width() );
439 painter->drawRect( rect );
440 painter->fillRect( rect, painter->brush() );
441 break;
442 }
443 case MarkerAttributes::MarkerDiamond:
444 {
445 QVector <QPointF > diamondPoints;
446 QPointF top, left, bottom, right;
447 top = QPointF( 0, 0 - maSize.height()/2 );
448 left = QPointF( 0 - maSize.width()/2, 0 );
449 bottom = QPointF( 0, maSize.height()/2 );
450 right = QPointF( maSize.width()/2, 0 );
451 diamondPoints << top << left << bottom << right;
452 painter->drawPolygon( diamondPoints );
453 break;
454 }
455 //Pending Michel: do we need that? Ask: What is the idea about
456 // Marker1Pixel and Marker4Pixels.
457 case MarkerAttributes::Marker1Pixel:
458 {
459 QSizeF pSize(4,4);
460 QPen pen1Pixel;
461 pen1Pixel.setColor( painter->background().color() );
462 QRectF centerRect( -pSize.height()/2, -pSize.width()/2,
463 pSize.height(), pSize.width() );
464 painter->setPen( pen1Pixel );
465 painter->drawEllipse( centerRect );
466 break;
467 }
468 case MarkerAttributes::Marker4Pixels:
469 {
470 QSizeF pSize(8, 8);
471 QPen pen4Pixel;
472 pen4Pixel.setColor( painter->background().color() );
473 QRectF centerRect( -pSize.height()/2, -pSize.width()/2,
474 pSize.height(), pSize.width() );
475 painter->setPen( pen4Pixel );
476 painter->drawEllipse( centerRect );
477 break;
478 }
479 case MarkerAttributes::MarkerRing:
480 {
481 painter->setBrush( Qt::NoBrush );
482 painter->drawEllipse( QRectF( 0 - maSize.height()/2, 0 - maSize.width()/2,
483 maSize.height(), maSize.width()) );
484 break;
485 }
486 case MarkerAttributes::MarkerCross:
487 {
488 QVector <QPointF > crossPoints;
489 QPointF leftTop, leftBottom, centerBottomLeft, bottomLeft, bottomRight,
490 centerBottomRight,rightBottom, rightTop, centerTopRight, topRight, topLeft,
491 centerTopLeft;
492 leftTop = QPointF( -maSize.width()/2, -maSize.height()/4 );
493 leftBottom = QPointF( -maSize.width()/2, maSize.height()/4 );
494 centerBottomLeft = QPointF( -maSize.width()/4, maSize.height()/4 );
495 bottomLeft = QPointF( -maSize.width()/4, maSize.height()/2 );
496 bottomRight = QPointF( maSize.width()/4, maSize.height()/2 );
497 centerBottomRight = QPointF( maSize.width()/4, maSize.height()/4 );
498 rightBottom = QPointF( maSize.width()/2, maSize.height()/4 );
499 rightTop = QPointF( maSize.width()/2, -maSize.height()/4 );

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.53 KDChart::RingDiagram Class Reference 627

500 centerTopRight = QPointF( maSize.width()/4, -maSize.height()/4 );


501 topRight = QPointF( maSize.width()/4, -maSize.height()/2 );
502 topLeft = QPointF( -maSize.width()/4, -maSize.height()/2 );
503 centerTopLeft = QPointF( -maSize.width()/4, -maSize.height()/4 );
504
505 crossPoints << leftTop << leftBottom << centerBottomLeft
506 << bottomLeft << bottomRight << centerBottomRight
507 << rightBottom << rightTop << centerTopRight
508 << topRight << topLeft << centerTopLeft;
509
510 painter->drawPolygon( crossPoints );
511 break;
512 }
513 case MarkerAttributes::MarkerFastCross:
514 {
515 QPointF left, right, top, bottom;
516 left = QPointF( -maSize.width()/2, 0 );
517 right = QPointF( maSize.width()/2, 0 );
518 top = QPointF( 0, -maSize.height()/2 );
519 bottom= QPointF( 0, maSize.height()/2 );
520 painter->drawLine( left, right );
521 painter->drawLine( top, bottom );
522 break;
523 }
524 default:
525 Q_ASSERT_X ( false, "paintMarkers()",
526 "Type item does not match a defined Marker Type." );
527 }
528 }
529
530 void AbstractDiagram::paintMarkers( QPainter* painter )

6.53.2.40 void AbstractDiagram::paintMarkers (QPainter ∗ painter) [protected,


virtual, inherited]

Definition at line 532 of file KDChartAbstractDiagram.cpp.

535 {
536 for ( int j=0; j< rowCount; ++j ) {
537 const QModelIndex index = model()->index( j, i, rootIndex() );
538 double value = model()->data( index ).toDouble();
539 const QPointF pos = coordinatePlane()->translate( QPointF( j, value ) );
540 paintMarker( painter, index, pos );
541 }
542 }
543 }
544
545

6.53.2.41 QPen AbstractDiagram::pen (const QModelIndex & index) const [inherited]

Retrieve the pen to be used, for painting the datapoint at the given index in the model.

Parameters:
index The index of the datapoint in the model.

Returns:
The pen to use for painting.

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


628 KD Chart 2 Class Documentation

Definition at line 586 of file KDChartAbstractDiagram.cpp.

593 {

6.53.2.42 QPen AbstractDiagram::pen (int dataset) const [inherited]

Retrieve the pen to be used for the given dataset.


This will fall back automatically to what was set at model level, if there are no dataset specific settings.

Parameters:
dataset The dataset to retrieve the pen for.

Returns:
The pen to use for painting.

Definition at line 578 of file KDChartAbstractDiagram.cpp.

585 {

6.53.2.43 QPen AbstractDiagram::pen () const [inherited]

Retrieve the pen to be used for painting datapoints globally.


This will fall back automatically to the default settings, if there are no specific settings.

Returns:
The pen to use for painting.

Definition at line 572 of file KDChartAbstractDiagram.cpp.


Referenced by KDChart::PieDiagram::paint().

577 {

6.53.2.44 bool AbstractDiagram::percentMode () const [inherited]

Definition at line 313 of file KDChartAbstractDiagram.cpp.


References d.
Referenced by KDChart::CartesianCoordinatePlane::getDataDimensionsList().

320 {

6.53.2.45 PieAttributes AbstractPieDiagram::pieAttributes (const QModelIndex & index) const


[inherited]

Definition at line 122 of file KDChartAbstractPieDiagram.cpp.


References d, and KDChart::PieAttributesRole.

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.53 KDChart::RingDiagram Class Reference 629

123 {
124 return qVariantValue<PieAttributes>(
125 d->attributesModel->data(
126 d->attributesModel->mapFromSource( index ),
127 PieAttributesRole ) );
128 }

6.53.2.46 PieAttributes AbstractPieDiagram::pieAttributes (int column) const [inherited]

Definition at line 114 of file KDChartAbstractPieDiagram.cpp.


References d, and KDChart::PieAttributesRole.

115 {
116 return qVariantValue<PieAttributes>(
117 d->attributesModel->data(
118 d->attributesModel->mapFromSource( columnToIndex( column ) ).column(),
119 PieAttributesRole ) );
120 }

6.53.2.47 PieAttributes AbstractPieDiagram::pieAttributes () const [inherited]

Definition at line 105 of file KDChartAbstractPieDiagram.cpp.


References d, and KDChart::PieAttributesRole.
Referenced by KDChart::PieDiagram::calculateDataBoundaries(), and KDChart::PieDiagram::paint().

106 {
107 return qVariantValue<PieAttributes>(
108 d->attributesModel->data( PieAttributesRole ) );
109 }

6.53.2.48 const PolarCoordinatePlane ∗ AbstractPolarDiagram::polarCoordinatePlane () const


[inherited]

Definition at line 53 of file KDChartAbstractPolarDiagram.cpp.


References KDChart::AbstractDiagram::coordinatePlane().
Referenced by KDChart::PieDiagram::paint().

54 {
55 return dynamic_cast<const PolarCoordinatePlane*>( coordinatePlane() );
56 }

6.53.2.49 void KDChart::AbstractDiagram::propertiesChanged () [protected,


inherited]

Emitted upon change of a property of the Diagram.


Referenced by KDChart::AbstractDiagram::setDataValueAttributes(), KDChart::LineDiagram::setLine-
Attributes(), KDChart::LineDiagram::setThreeDLineAttributes(), and KDChart::LineDiagram::setType().

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


630 KD Chart 2 Class Documentation

6.53.2.50 bool RingDiagram::relativeThickness () const

Definition at line 74 of file KDChartRingDiagram.cpp.


References d.

75 {
76 return d->relativeThickness;
77 }

6.53.2.51 void RingDiagram::resize (const QSizeF & area) [virtual]

[reimplemented]
Implements KDChart::AbstractDiagram.
Definition at line 124 of file KDChartRingDiagram.cpp.

125 {
126 }

6.53.2.52 void RingDiagram::resizeEvent (QResizeEvent ∗) [protected]

Definition at line 97 of file KDChartRingDiagram.cpp.

98 {
99 }

6.53.2.53 void AbstractDiagram::scrollTo (const QModelIndex & index, ScrollHint hint =


EnsureVisible) [virtual, inherited]

[reimplemented]
Definition at line 646 of file KDChartAbstractDiagram.cpp.

648 { return QModelIndex(); }

6.53.2.54 void AbstractDiagram::setAllowOverlappingDataValueTexts (bool allow)


[inherited]

Set whether data value labels are allowed to overlap.

Parameters:
allow True means that overlapping labels are allowed.

Definition at line 285 of file KDChartAbstractDiagram.cpp.


References d.

290 {

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.53 KDChart::RingDiagram Class Reference 631

6.53.2.55 void AbstractDiagram::setAntiAliasing (bool enabled) [inherited]

Set whether anti-aliasing is to be used while rendering this diagram.

Parameters:
enabled True means that AA is enabled.

Definition at line 296 of file KDChartAbstractDiagram.cpp.


References d.

301 {

6.53.2.56 void AbstractDiagram::setAttributesModel (AttributesModel ∗ model) [virtual,


inherited]

Associate an AttributesModel with this diagram.


Note that the diagram does _not_ take ownership of the AttributesModel. This should thus only be used
with AttributesModels that have been explicitely created by the user, and are owned by her. Setting an
AttributesModel that is internal to another diagram is an error.
Correct:

AttributesModel *am = new AttributesModel( model, 0 );


diagram1->setAttributesModel( am );
diagram2->setAttributesModel( am );

Wrong:

diagram1->setAttributesModel( diagram2->attributesModel() );

Parameters:
model The AttributesModel to use for this diagram.

See also:
AttributesModel

Definition at line 160 of file KDChartAbstractDiagram.cpp.


References d, and KDChart::AbstractDiagram::modelsChanged().

161 {
162 if( amodel->sourceModel() != model() ) {
163 qWarning("KDChart::AbstractDiagram::setAttributesModel() failed: "
164 "Trying to set an attributesmodel which works on a different "
165 "model than the diagram.");
166 return;
167 }
168 if( qobject_cast<PrivateAttributesModel*>(amodel) ) {
169 qWarning("KDChart::AbstractDiagram::setAttributesModel() failed: "
170 "Trying to set an attributesmodel that is private to another diagram.");
171 return;
172 }
173 d->setAttributesModel(amodel);
174 scheduleDelayedItemsLayout();
175 d->databoundariesDirty = true;
176 emit modelsChanged();
177 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


632 KD Chart 2 Class Documentation

6.53.2.57 void AbstractDiagram::setAttributesModelRootIndex (const QModelIndex & idx)


[protected, inherited]

Definition at line 195 of file KDChartAbstractDiagram.cpp.


References d.

6.53.2.58 void AbstractDiagram::setBrush (const QBrush & brush) [inherited]

Set the brush to be used, for painting all datasets in the model.

Parameters:
brush The brush to use.

Definition at line 602 of file KDChartAbstractDiagram.cpp.

608 {

6.53.2.59 void AbstractDiagram::setBrush (int dataset, const QBrush & brush) [inherited]

Set the brush to be used, for painting the given dataset.

Parameters:
dataset The dataset’s column in the model.
pen The brush to use.

Definition at line 609 of file KDChartAbstractDiagram.cpp.

617 {

6.53.2.60 void AbstractDiagram::setBrush (const QModelIndex & index, const QBrush & brush)
[inherited]

Set the brush to be used, for painting the datapoint at the given index.

Parameters:
index The datapoint’s index in the model.
brush The brush to use.

Definition at line 594 of file KDChartAbstractDiagram.cpp.

601 {

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.53 KDChart::RingDiagram Class Reference 633

6.53.2.61 void AbstractDiagram::setCoordinatePlane (AbstractCoordinatePlane ∗ plane)


[virtual, inherited]

Set the coordinate plane associated with the diagram.


This determines how coordinates in value space are mapped into pixel space. The chart takes ownership.

Returns:
The coordinate plane associated with the diagram.

Reimplemented in KDChart::AbstractCartesianDiagram.
Definition at line 218 of file KDChartAbstractDiagram.cpp.
References d.
Referenced by KDChart::AbstractCoordinatePlane::addDiagram(), KDChart::AbstractCartesian-
Diagram::setCoordinatePlane(), and KDChart::AbstractCoordinatePlane::takeDiagram().

222 {

6.53.2.62 void AbstractDiagram::setDataBoundariesDirty () const [protected,


inherited]

Definition at line 139 of file KDChartAbstractDiagram.cpp.


References d.
Referenced by KDChart::BarDiagram::setThreeDBarAttributes(), KDChart::LineDiagram::setThree-
DLineAttributes(), KDChart::LineDiagram::setType(), and KDChart::BarDiagram::setType().

140 {
141 d->databoundariesDirty = true;
142 }

6.53.2.63 void AbstractDiagram::setDatasetDimension (int dimension) [inherited]

Sets the dataset dimension of the diagram.

See also:
datasetDimension.

Parameters:
dimension

Definition at line 763 of file KDChartAbstractDiagram.cpp.


References d.

770 {

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


634 KD Chart 2 Class Documentation

6.53.2.64 void AbstractDiagram::setDataValueAttributes (const DataValueAttributes & a)


[inherited]

Set the DataValueAttributes for all datapoints in the model.

Parameters:
a The attributes to set.

Definition at line 279 of file KDChartAbstractDiagram.cpp.


References d.

284 {

6.53.2.65 void AbstractDiagram::setDataValueAttributes (int dataset, const DataValueAttributes


& a) [inherited]

Set the DataValueAttributes for the given dataset.

Parameters:
dataset The dataset to set the attributes for.
a The attributes to set.

Definition at line 251 of file KDChartAbstractDiagram.cpp.


References d.

259 {

6.53.2.66 void AbstractDiagram::setDataValueAttributes (const QModelIndex & index, const


DataValueAttributes & a) [inherited]

Set the DataValueAttributes for the given index.

Parameters:
index The datapoint to set the attributes for.
a The attributes to set.

Definition at line 240 of file KDChartAbstractDiagram.cpp.


References d, KDChart::DataValueLabelAttributesRole, and KDChart::AbstractDiagram::properties-
Changed().

240 {
241 d->attributesModel->setData(
242 d->attributesModel->mapFromSource( index ),
243 qVariantFromValue( a ),
244 DataValueLabelAttributesRole );
245 emit propertiesChanged();
246 }
247
248

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.53 KDChart::RingDiagram Class Reference 635

6.53.2.67 void AbstractPieDiagram::setGranularity (qreal value) [inherited]

Set the granularity: the smaller the granularity the more your diagram segments will show facettes instead
of rounded segments.

Parameters:
value the granularity value between 0.05 (one twentieth of a degree) and 36.0 (one tenth of a full
circle), other values will be interpreted as 1.0.

Definition at line 76 of file KDChartAbstractPieDiagram.cpp.


References d.

77 {
78 d->granularity = value;
79 }

6.53.2.68 void AbstractDiagram::setModel (QAbstractItemModel ∗ model) [virtual,


inherited]

Associate a model with the diagram.


Definition at line 144 of file KDChartAbstractDiagram.cpp.
References d, KDChart::AttributesModel::initFrom(), and KDChart::AbstractDiagram::modelsChanged().

145 {
146 QAbstractItemView::setModel( newModel );
147 AttributesModel* amodel = new PrivateAttributesModel( newModel, this );
148 amodel->initFrom( d->attributesModel );
149 d->setAttributesModel(amodel);
150 scheduleDelayedItemsLayout();
151 d->databoundariesDirty = true;
152 emit modelsChanged();
153 }

6.53.2.69 void AbstractDiagram::setPen (const QPen & pen) [inherited]

Set the pen to be used, for painting all datasets in the model.

Parameters:
pen The pen to use.

Definition at line 556 of file KDChartAbstractDiagram.cpp.

562 {

6.53.2.70 void AbstractDiagram::setPen (int dataset, const QPen & pen) [inherited]

Set the pen to be used, for painting the given dataset.

Parameters:
dataset The dataset’s row in the model.

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


636 KD Chart 2 Class Documentation

pen The pen to use.

Definition at line 563 of file KDChartAbstractDiagram.cpp.

571 {

6.53.2.71 void AbstractDiagram::setPen (const QModelIndex & index, const QPen & pen)
[inherited]

Set the pen to be used, for painting the datapoint at the given index.

Parameters:
index The datapoint’s index in the model.
pen The pen to use.

Definition at line 548 of file KDChartAbstractDiagram.cpp.

555 {

6.53.2.72 void AbstractDiagram::setPercentMode (bool percent) [inherited]

Definition at line 307 of file KDChartAbstractDiagram.cpp.


References d.
Referenced by KDChart::LineDiagram::setType(), and KDChart::BarDiagram::setType().

312 {

6.53.2.73 void AbstractPieDiagram::setPieAttributes (int column, const PieAttributes & a)


[inherited]

Definition at line 95 of file KDChartAbstractPieDiagram.cpp.


References d, and KDChart::PieAttributesRole.

96 {
97 d->attributesModel->setHeaderData(
98 column, Qt::Vertical, qVariantFromValue( attrs ), PieAttributesRole );
99 emit layoutChanged( this );
100 }

6.53.2.74 void AbstractPieDiagram::setPieAttributes (const PieAttributes & a) [inherited]

Definition at line 89 of file KDChartAbstractPieDiagram.cpp.


References d, and KDChart::PieAttributesRole.

90 {
91 d->attributesModel->setModelData( qVariantFromValue( attrs ), PieAttributesRole );
92 emit layoutChanged( this );
93 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.53 KDChart::RingDiagram Class Reference 637

6.53.2.75 void RingDiagram::setRelativeThickness (bool relativeThickness)

Definition at line 69 of file KDChartRingDiagram.cpp.


References d.

70 {
71 d->relativeThickness = relativeThickness;
72 }

6.53.2.76 void AbstractDiagram::setRootIndex (const QModelIndex & idx) [virtual,


inherited]

Set the root index in the model, where the diagram starts referencing data for display.
[reimplemented]
Definition at line 188 of file KDChartAbstractDiagram.cpp.
References d.

6.53.2.77 void AbstractDiagram::setSelection (const QRect & rect,


QItemSelectionModel::SelectionFlags command) [virtual, inherited]

[reimplemented]
Definition at line 664 of file KDChartAbstractDiagram.cpp.

666 { return QRegion(); }

6.53.2.78 void AbstractPieDiagram::setStartPosition (qreal degrees) [inherited]

Set the starting angle for the first dataset.


Definition at line 65 of file KDChartAbstractPieDiagram.cpp.
References d.

66 {
67 d->startPosition = degrees;
68 }

6.53.2.79 void AbstractPieDiagram::setThreeDPieAttributes (const QModelIndex & index, const


ThreeDPieAttributes & a) [inherited]

Definition at line 144 of file KDChartAbstractPieDiagram.cpp.


References KDChart::ThreeDPieAttributesRole.

145 {
146 model()->setData( index, qVariantFromValue( tda ), ThreeDPieAttributesRole );
147 emit layoutChanged( this );
148 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


638 KD Chart 2 Class Documentation

6.53.2.80 void AbstractPieDiagram::setThreeDPieAttributes (int column, const


ThreeDPieAttributes & a) [inherited]

Definition at line 137 of file KDChartAbstractPieDiagram.cpp.


References d, and KDChart::ThreeDPieAttributesRole.

138 {
139 d->attributesModel->setHeaderData(
140 column, Qt::Vertical, qVariantFromValue( tda ), ThreeDPieAttributesRole );
141 emit layoutChanged( this );
142 }

6.53.2.81 void AbstractPieDiagram::setThreeDPieAttributes (const ThreeDPieAttributes & a)


[inherited]

Definition at line 131 of file KDChartAbstractPieDiagram.cpp.


References d, and KDChart::ThreeDPieAttributesRole.

132 {
133 d->attributesModel->setModelData( qVariantFromValue( tda ), ThreeDPieAttributesRole );
134 emit layoutChanged( this );
135 }

6.53.2.82 qreal AbstractPieDiagram::startPosition () const [inherited]

Returns:
the starting angle for the first dataset.

Definition at line 70 of file KDChartAbstractPieDiagram.cpp.


References d.
Referenced by KDChart::PieDiagram::paint().

71 {
72 return d->startPosition;
73 }

6.53.2.83 ThreeDPieAttributes AbstractPieDiagram::threeDPieAttributes (const QModelIndex &


index) const [inherited]

Definition at line 170 of file KDChartAbstractPieDiagram.cpp.


References d, and KDChart::ThreeDPieAttributesRole.

171 {
172 return qVariantValue<ThreeDPieAttributes>(
173 d->attributesModel->data(
174 d->attributesModel->mapFromSource( index ),
175 ThreeDPieAttributesRole ) );
176 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.53 KDChart::RingDiagram Class Reference 639

6.53.2.84 ThreeDPieAttributes AbstractPieDiagram::threeDPieAttributes (int column) const


[inherited]

Definition at line 162 of file KDChartAbstractPieDiagram.cpp.


References d, and KDChart::ThreeDPieAttributesRole.

163 {
164 return qVariantValue<ThreeDPieAttributes>(
165 d->attributesModel->data(
166 d->attributesModel->mapFromSource( columnToIndex( column ) ).column(),
167 ThreeDPieAttributesRole ) );
168 }

6.53.2.85 ThreeDPieAttributes AbstractPieDiagram::threeDPieAttributes () const


[inherited]

Definition at line 153 of file KDChartAbstractPieDiagram.cpp.


References d, and KDChart::ThreeDPieAttributesRole.
Referenced by KDChart::PieDiagram::paint().

154 {
155 return qVariantValue<ThreeDPieAttributes>(
156 d->attributesModel->data( ThreeDPieAttributesRole ) );
157 }

6.53.2.86 void AbstractDiagram::update () const [inherited]

Definition at line 777 of file KDChartAbstractDiagram.cpp.


References d.
Referenced by KDChart::AbstractDiagram::doItemsLayout().

6.53.2.87 void KDChart::AbstractDiagram::useDefaultColors () [inherited]

Set the palette to be used, for painting datasets to the default palette.

See also:
KDChart::Palette. FIXME: fold into one usePalette (KDChart::Palette&) method

Definition at line 671 of file KDChartAbstractDiagram.cpp.


References d.

675 {

6.53.2.88 void KDChart::AbstractDiagram::useRainbowColors () [inherited]

Set the palette to be used, for painting datasets to the rainbow palette.

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


640 KD Chart 2 Class Documentation

See also:
KDChart::Palette.

Definition at line 681 of file KDChartAbstractDiagram.cpp.


References d.

685 {

6.53.2.89 void KDChart::AbstractDiagram::useSubduedColors () [inherited]

Set the palette to be used, for painting datasets to the subdued palette.

See also:
KDChart::Palette.

Definition at line 676 of file KDChartAbstractDiagram.cpp.


References d.

680 {

6.53.2.90 double AbstractDiagram::valueForCell (int row, int column) const [protected,


inherited]

Helper method, retrieving the data value (DisplayRole) for a given row and column.

Parameters:
row The row to query.
column The column to query.

Returns:
The value of the display role at the given row and column as a double.

Definition at line 771 of file KDChartAbstractDiagram.cpp.


References KDChart::AbstractDiagram::attributesModelRootIndex(), and d.
Referenced by KDChart::LineDiagram::paint().

776 {

6.53.2.91 double RingDiagram::valueTotals () const [virtual]

[reimplemented]
Implements KDChart::AbstractPolarDiagram.
Definition at line 129 of file KDChartRingDiagram.cpp.

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.53 KDChart::RingDiagram Class Reference 641

130 {
131 double total = 0;
132 const int colCount = model()->columnCount(rootIndex());
133 for ( int j=0; j<colCount; ++j ) {
134 total += model()->data( model()->index( 0, j, rootIndex() ) ).toDouble();
135 }
136 return total;
137 }

6.53.2.92 int AbstractDiagram::verticalOffset () const [virtual, inherited]

[reimplemented]
Definition at line 658 of file KDChartAbstractDiagram.cpp.

660 { return true; }

6.53.2.93 QRect AbstractDiagram::visualRect (const QModelIndex & index) const [virtual,


inherited]

[reimplemented]
Definition at line 641 of file KDChartAbstractDiagram.cpp.

645 {}

6.53.2.94 QRegion AbstractDiagram::visualRegionForSelection (const QItemSelection &


selection) const [virtual, inherited]

[reimplemented]
Definition at line 667 of file KDChartAbstractDiagram.cpp.

6.53.3 Member Data Documentation

6.53.3.1 Q_SIGNALS KDChart::AbstractDiagram::__pad0__ [protected, inherited]

Definition at line 506 of file KDChartAbstractDiagram.h.


The documentation for this class was generated from the following files:

• KDChartRingDiagram.h
• KDChartRingDiagram.cpp

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


642 KD Chart 2 Class Documentation

6.54 KDChart::TextArea Class Reference


#include <KDChartTextArea.h>
Inheritance diagram for KDChart::TextArea:Collaboration diagram for KDChart::TextArea:

6.54.1 Detailed Description

A text area in the chart with a background, a frame, etc.


TextArea is the base class for all text containing non-widget chart elements that have a set of background
attributes and frame attributes, such as headers or footers.

Note:
This class inherits from AbstractAreaBase, TextLayoutItem, QObject. The reason for this tripple
inheritance is that neither AbstractAreaBase nor TextLayoutItem are QObject.

Definition at line 54 of file KDChartTextArea.h.

Public Member Functions


• void alignToReferencePoint (const RelativePosition &position)
• const QObject ∗ autoReferenceArea () const
• BackgroundAttributes backgroundAttributes () const
• virtual Qt::Orientations expandingDirections () const
pure virtual in QLayoutItem

• FrameAttributes frameAttributes () const


• virtual QRect geometry () const
pure virtual in QLayoutItem

• virtual bool intersects (const TextLayoutItem &other, const QPoint &myPos, const QPoint &other-
Pos) const
• virtual bool intersects (const TextLayoutItem &other, const QPointF &myPos, const QPointF
&otherPos) const
• virtual bool isEmpty () const
pure virtual in QLayoutItem

• virtual QSize maximumSize () const


pure virtual in QLayoutItem

• virtual QSize minimumSize () const


pure virtual in QLayoutItem

• virtual void paint (QPainter ∗)


• void paintAll (QPainter &painter)
Call paintAll, if you want the background and the frame to be drawn before the normal paint() is invoked
automatically.

• virtual void paintBackground (QPainter &painter, const QRect &rectangle)


• virtual void paintCtx (PaintContext ∗context)

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.54 KDChart::TextArea Class Reference 643

Default impl: Paint the complete item using its layouted position and size.

• virtual void paintFrame (QPainter &painter, const QRect &rectangle)


• virtual void paintIntoRect (QPainter &painter, const QRect &rect)
Draws the background and frame, then calls paint().

• virtual QFont realFont () const


• virtual qreal realFontSize () const
• void removeFromParentLayout ()
• void setAutoReferenceArea (const QObject ∗area)
• void setBackgroundAttributes (const BackgroundAttributes &a)
• void setFrameAttributes (const FrameAttributes &a)
• virtual void setGeometry (const QRect &r)
pure virtual in QLayoutItem

• void setParentLayout (QLayout ∗lay)


• virtual void setParentWidget (QWidget ∗widget)
Inform the item about its widget: This enables the item, to trigger that widget’s update, whenever the size
of the item’s contents has changed.

• void setText (const QString &text)


• void setTextAttributes (const TextAttributes &a)
Use this to specify the text attributes to be used for this item.

• virtual QSize sizeHint () const


pure virtual in QLayoutItem

• virtual void sizeHintChanged () const


Report changed size hint: ask the parent widget to recalculate the layout.

• QString text () const


• TextAttributes textAttributes () const
Returns the text attributes to be used for this item.

• virtual ∼TextArea ()

Protected Member Functions


• virtual QRect areaGeometry () const
• QRect innerRect () const
• virtual void positionHasChanged ()
• TextArea ()

Protected Attributes
• Q_SIGNALS __pad0__: void positionChanged( TextArea ∗ )
• QWidget ∗ mParent
• QLayout ∗ mParentLayout

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


644 KD Chart 2 Class Documentation

6.54.2 Constructor & Destructor Documentation

6.54.2.1 TextArea::∼TextArea () [virtual]

Definition at line 60 of file KDChartTextArea.cpp.

61 {
62 // this bloc left empty intentionally
63 }

6.54.2.2 TextArea::TextArea () [protected]

Definition at line 52 of file KDChartTextArea.cpp.

53 : QObject()
54 , KDChart::AbstractAreaBase()
55 , KDChart::TextLayoutItem()
56 {
57 // this bloc left empty intentionally
58 }

6.54.3 Member Function Documentation

6.54.3.1 void AbstractAreaBase::alignToReferencePoint (const RelativePosition & position)


[inherited]

Definition at line 75 of file KDChartAbstractAreaBase.cpp.

76 {
77 Q_UNUSED( position );
78 // PENDING(kalle) FIXME
79 qWarning( "Sorry, not implemented: void AbstractAreaBase::alignToReferencePoint( const RelativePosi
80 }

6.54.3.2 QRect TextArea::areaGeometry () const [protected, virtual]

Implements KDChart::AbstractAreaBase.
Definition at line 105 of file KDChartTextArea.cpp.
References KDChart::TextLayoutItem::geometry().
Referenced by paintAll().

106 {
107 return geometry();
108 }

6.54.3.3 const QObject ∗ KDChart::TextLayoutItem::autoReferenceArea () const


[inherited]

Definition at line 122 of file KDChartLayoutItems.cpp.


Referenced by KDChart::HeaderFooter::setParent().

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.54 KDChart::TextArea Class Reference 645

123 {
124 return mAutoReferenceArea;
125 }

6.54.3.4 BackgroundAttributes AbstractAreaBase::backgroundAttributes () const


[inherited]

Definition at line 97 of file KDChartAbstractAreaBase.cpp.


References d.

98 {
99 return d->backgroundAttributes;
100 }

6.54.3.5 Qt::Orientations KDChart::TextLayoutItem::expandingDirections () const [virtual,


inherited]

pure virtual in QLayoutItem


Definition at line 162 of file KDChartLayoutItems.cpp.

163 {
164 return 0; // Grow neither vertically nor horizontally
165 }

6.54.3.6 FrameAttributes AbstractAreaBase::frameAttributes () const [inherited]

Definition at line 87 of file KDChartAbstractAreaBase.cpp.


References d.
Referenced by KDChart::Legend::clone().

88 {
89 return d->frameAttributes;
90 }

6.54.3.7 QRect KDChart::TextLayoutItem::geometry () const [virtual, inherited]

pure virtual in QLayoutItem


Definition at line 167 of file KDChartLayoutItems.cpp.
Referenced by areaGeometry(), KDChart::TextLayoutItem::paint(), paintAll(), KDChart::Cartesian-
Axis::paintCtx(), and paintIntoRect().

168 {
169 return mRect;
170 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


646 KD Chart 2 Class Documentation

6.54.3.8 QRect AbstractAreaBase::innerRect () const [protected, inherited]

Definition at line 175 of file KDChartAbstractAreaBase.cpp.


References KDChart::AbstractAreaBase::areaGeometry(), and d.
Referenced by paintAll(), KDChart::AbstractAreaWidget::paintAll(), and KDChart::AbstractArea::paint-
All().

176 {
177 Q_ASSERT_X ( d != 0, "AbstractAreaBase::innerRect()",
178 "Private class was not initialized!" );
179
180 const int padding
181 = d->frameAttributes.isVisible()
182 ? qMax( d->frameAttributes.padding(), 0 ) : 0;
183 return
184 QRect( QPoint(0,0), areaGeometry().size() )
185 .adjusted( padding, padding, -padding, -padding );
186 }

6.54.3.9 bool KDChart::TextLayoutItem::intersects (const TextLayoutItem & other, const QPoint


& myPos, const QPoint & otherPos) const [virtual, inherited]

Definition at line 248 of file KDChartLayoutItems.cpp.


References KDChart::TextLayoutItem::mAttributes, PI, KDChart::TextLayoutItem::rotatedCorners(),
KDChart::TextAttributes::rotation(), and KDChart::TextLayoutItem::unrotatedSizeHint().

249 {
250 if ( mAttributes.rotation() != other.mAttributes.rotation() )
251 {
252 // that’s the code for the common case: the rotation angles don’t need to match here
253 QPolygon myPolygon( rotatedCorners() );
254 QPolygon otherPolygon( other.rotatedCorners() );
255
256 // move the polygons to their positions
257 myPolygon.translate( myPos );
258 otherPolygon.translate( otherPos );
259
260 // create regions out of it
261 QRegion myRegion( myPolygon );
262 QRegion otherRegion( otherPolygon );
263
264 // now the question - do they intersect or not?
265 return ! myRegion.intersect( otherRegion ).isEmpty();
266
267 } else {
268 // and that’s the code for the special case: the rotation angles match, which is less time con
269 const qreal angle = mAttributes.rotation() * PI / 180.0;
270 // both sizes
271 const QSizeF mySize( unrotatedSizeHint() );
272 const QSizeF otherSize( other.unrotatedSizeHint() );
273
274 // that’s myP1 relative to myPos
275 QPointF myP1( mySize.height() * sin( angle ), 0.0 );
276 // that’s otherP1 to myPos
277 QPointF otherP1 = QPointF( otherSize.height() * sin( angle ), 0.0 ) + otherPos - myPos;
278
279 // now rotate both points the negative angle around myPos
280 myP1 = QPointF( myP1.x() * cos( -angle ), myP1.x() * sin( -angle ) );
281 qreal r = sqrt( otherP1.x() * otherP1.x() + otherP1.y() * otherP1.y() );
282 otherP1 = QPointF( r * cos( -angle ), r * sin( -angle ) );

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.54 KDChart::TextArea Class Reference 647

283
284 // finally we look, whether both rectangles intersect or even not
285 return QRectF( myP1, mySize ).intersects( QRectF( otherP1, otherSize ) );
286 }
287 }

6.54.3.10 bool KDChart::TextLayoutItem::intersects (const TextLayoutItem & other, const


QPointF & myPos, const QPointF & otherPos) const [virtual, inherited]

Definition at line 243 of file KDChartLayoutItems.cpp.


Referenced by KDChart::CartesianAxis::paintCtx().

244 {
245 return intersects( other, myPos.toPoint(), otherPos.toPoint() );
246 }

6.54.3.11 bool KDChart::TextLayoutItem::isEmpty () const [virtual, inherited]

pure virtual in QLayoutItem


Definition at line 172 of file KDChartLayoutItems.cpp.

173 {
174 return false; // never empty, otherwise the layout item would not exist
175 }

6.54.3.12 QSize KDChart::TextLayoutItem::maximumSize () const [virtual, inherited]

pure virtual in QLayoutItem


Definition at line 177 of file KDChartLayoutItems.cpp.
References KDChart::TextLayoutItem::sizeHint().

178 {
179 return sizeHint(); // PENDING(kalle) Review, quite inflexible
180 }

6.54.3.13 QSize KDChart::TextLayoutItem::minimumSize () const [virtual, inherited]

pure virtual in QLayoutItem


Definition at line 182 of file KDChartLayoutItems.cpp.
References KDChart::TextLayoutItem::sizeHint().

183 {
184 return sizeHint(); // PENDING(kalle) Review, quite inflexible
185 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


648 KD Chart 2 Class Documentation

6.54.3.14 void KDChart::TextLayoutItem::paint (QPainter ∗) [virtual, inherited]

Implements KDChart::AbstractLayoutItem.
Definition at line 325 of file KDChartLayoutItems.cpp.
References KDChart::TextLayoutItem::geometry(), KDChart::TextAttributes::pen(), KDChart::Text-
Attributes::rotation(), and KDChart::TextLayoutItem::sizeHint().
Referenced by paintAll(), and KDChart::CartesianAxis::paintCtx().

326 {
327 // make sure, cached font is updated, if needed:
328 sizeHint();
329
330 if( !mRect.isValid() )
331 return;
332
333 PainterSaver painterSaver( painter );
334 painter->setFont( cachedFont );
335 painter->setPen( mAttributes.pen() );
336 QRectF rect = geometry();
337
338 painter->translate( rect.center() );
339 rect.moveTopLeft( QPointF( - rect.width() / 2, - rect.height() / 2 ) );
340 painter->rotate( mAttributes.rotation() );
341 painter->drawText( rect, Qt::AlignHCenter | Qt::AlignVCenter, mText );
342 }

6.54.3.15 void TextArea::paintAll (QPainter & painter)

Call paintAll, if you want the background and the frame to be drawn before the normal paint() is invoked
automatically.
Definition at line 83 of file KDChartTextArea.cpp.
References areaGeometry(), KDChart::TextLayoutItem::geometry(), KDChart::AbstractArea-
Base::innerRect(), KDChart::TextLayoutItem::paint(), KDChart::AbstractAreaBase::paintBackground(),
KDChart::AbstractAreaBase::paintFrame(), and KDChart::TextLayoutItem::setGeometry().
Referenced by KDChart::Chart::paint(), and paintIntoRect().

84 {
85 // Paint the background and frame
86 paintBackground( painter, geometry() );
87 paintFrame( painter, geometry() );
88
89 // temporarily adjust the widget size, to be sure all content gets calculated
90 // to fit into the inner rectangle
91 const QRect oldGeometry( areaGeometry() );
92 QRect inner( innerRect() );
93 inner.moveTo(
94 oldGeometry.left() + inner.left(),
95 oldGeometry.top() + inner.top() );
96 const bool needAdjustGeometry = oldGeometry != inner;
97 if( needAdjustGeometry )
98 setGeometry( inner );
99 paint( &painter );
100 if( needAdjustGeometry )
101 setGeometry( oldGeometry );
102 //qDebug() << "TextAreaWidget::paintAll() done.";
103 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.54 KDChart::TextArea Class Reference 649

6.54.3.16 void AbstractAreaBase::paintBackground (QPainter & painter, const QRect &


rectangle) [virtual, inherited]

Definition at line 103 of file KDChartAbstractAreaBase.cpp.


References attributes, and d.
Referenced by paintAll(), KDChart::AbstractAreaWidget::paintAll(), and KDChart::AbstractArea::paint-
All().

104 {
105 Q_ASSERT_X ( d != 0, "AbstractAreaBase::paintBackground()",
106 "Private class was not initialized!" );
107
108 #define attributes d->backgroundAttributes
109
110 if( !attributes.isVisible() ) return;
111
112 /* first draw the brush (may contain a pixmap)*/
113 if( Qt::NoBrush != attributes.brush().style() ) {
114 KDChart::PainterSaver painterSaver( &painter );
115 painter.setPen( Qt::NoPen );
116 const QPointF newTopLeft( painter.deviceMatrix().map( rect.topLeft() ) );
117 painter.setBrushOrigin( newTopLeft );
118 painter.setBrush( attributes.brush() );
119 painter.drawRect( rect );
120 }
121 /* next draw the backPixmap over the brush */
122 if( !attributes.pixmap().isNull() &&
123 attributes.pixmapMode() != BackgroundAttributes::BackgroundPixmapModeNone ) {
124 QPointF ol = rect.topLeft();
125 if( BackgroundAttributes::BackgroundPixmapModeCentered == attributes.pixmapMode() )
126 {
127 ol.setX( rect.center().x() - attributes.pixmap().width() / 2 );
128 ol.setY( rect.center().y() - attributes.pixmap().height()/ 2 );
129 painter.drawPixmap( ol, attributes.pixmap() );
130 } else {
131 QMatrix m;
132 double zW = (double)rect.width() / (double)attributes.pixmap().width();
133 double zH = (double)rect.height() / (double)attributes.pixmap().height();
134 switch( attributes.pixmapMode() ) {
135 case BackgroundAttributes::BackgroundPixmapModeScaled:
136 {
137 double z;
138 z = qMin( zW, zH );
139 m.scale( z, z );
140 }
141 break;
142 case BackgroundAttributes::BackgroundPixmapModeStretched:
143 m.scale( zW, zH );
144 break;
145 default:
146 ; // Cannot happen, previously checked
147 }
148 QPixmap pm = attributes.pixmap().transformed( m );
149 ol.setX( rect.center().x() - pm.width() / 2 );
150 ol.setY( rect.center().y() - pm.height()/ 2 );
151 painter.drawPixmap( ol, pm );
152 }
153 }
154 #undef attributes
155 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


650 KD Chart 2 Class Documentation

6.54.3.17 void KDChart::AbstractLayoutItem::paintCtx (PaintContext ∗ context) [virtual,


inherited]

Default impl: Paint the complete item using its layouted position and size.
Reimplemented in KDChart::CartesianAxis.
Definition at line 64 of file KDChartLayoutItems.cpp.
References KDChart::AbstractLayoutItem::paint(), and KDChart::PaintContext::painter().

65 {
66 if( context )
67 paint( context->painter() );
68 }

6.54.3.18 void AbstractAreaBase::paintFrame (QPainter & painter, const QRect & rectangle)
[virtual, inherited]

Definition at line 158 of file KDChartAbstractAreaBase.cpp.


References attributes, and d.
Referenced by paintAll(), KDChart::AbstractAreaWidget::paintAll(), and KDChart::AbstractArea::paint-
All().

159 {
160 Q_ASSERT_X ( d != 0, "AbstractAreaBase::paintFrame()",
161 "Private class was not initialized!" );
162
163 #define attributes d->frameAttributes
164
165 if( !attributes.isVisible() ) return;
166
167 const QPen oldPen( painter.pen() );
168 painter.setPen( attributes.pen() );
169 painter.drawRect( rect );
170 painter.setPen( oldPen );
171 #undef attributes
172 }

6.54.3.19 void TextArea::paintIntoRect (QPainter & painter, const QRect & rect) [virtual]

Draws the background and frame, then calls paint().


In most cases there is no need to overwrite this method in a derived class, but you would overwrite Text-
LayoutItem::paint() instead.
Definition at line 71 of file KDChartTextArea.cpp.
References KDChart::TextLayoutItem::geometry(), paintAll(), and KDChart::TextLayoutItem::set-
Geometry().

72 {
73 const QRect oldGeometry( geometry() );
74 if( oldGeometry != rect )
75 setGeometry( rect );
76 painter.translate( rect.left(), rect.top() );
77 paintAll( painter );

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.54 KDChart::TextArea Class Reference 651

78 painter.translate( -rect.left(), -rect.top() );


79 if( oldGeometry != rect )
80 setGeometry( oldGeometry );
81 }

6.54.3.20 void TextArea::positionHasChanged () [protected, virtual]

Reimplemented from KDChart::AbstractAreaBase.


Definition at line 110 of file KDChartTextArea.cpp.

111 {
112 emit positionChanged( this );
113 }

6.54.3.21 QFont KDChart::TextLayoutItem::realFont () const [virtual, inherited]

Definition at line 220 of file KDChartLayoutItems.cpp.


Referenced by KDChart::CartesianAxis::maximumSize(), and KDChart::CartesianAxis::paintCtx().

221 {
222 realFontWasRecalculated(); // we can safely ignore the boolean return value
223 return cachedFont;
224 }

6.54.3.22 qreal KDChart::TextLayoutItem::realFontSize () const [virtual, inherited]

Definition at line 193 of file KDChartLayoutItems.cpp.


References KDChart::Measure::calculatedValue(), KDChart::TextAttributes::fontSize(), and
KDChart::TextAttributes::minimalFontSize().

194 {
195 return qMax(
196 mAttributes.fontSize().calculatedValue(
197 mAutoReferenceArea,
198 mAutoReferenceOrientation ),
199 mAttributes.minimalFontSize().calculatedValue(
200 mAutoReferenceArea,
201 mAutoReferenceOrientation ) );
202 }

6.54.3.23 void KDChart::AbstractLayoutItem::removeFromParentLayout () [inherited]

Definition at line 66 of file KDChartLayoutItems.h.


Referenced by KDChart::Chart::takeCoordinatePlane().

67 {
68 if( mParentLayout ){
69 if( widget() )
70 mParentLayout->removeWidget( widget() );
71 else
72 mParentLayout->removeItem( this );
73 }
74 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


652 KD Chart 2 Class Documentation

6.54.3.24 void KDChart::TextLayoutItem::setAutoReferenceArea (const QObject ∗ area)


[inherited]

Definition at line 115 of file KDChartLayoutItems.cpp.


References KDChart::TextLayoutItem::sizeHint().
Referenced by KDChart::HeaderFooter::setParent().

116 {
117 mAutoReferenceArea = area;
118 cachedSizeHint = QSize();
119 sizeHint();
120 }

6.54.3.25 void AbstractAreaBase::setBackgroundAttributes (const BackgroundAttributes & a)


[inherited]

Definition at line 92 of file KDChartAbstractAreaBase.cpp.


References d.

93 {
94 d->backgroundAttributes = a;
95 }

6.54.3.26 void AbstractAreaBase::setFrameAttributes (const FrameAttributes & a)


[inherited]

Definition at line 82 of file KDChartAbstractAreaBase.cpp.


References d.
Referenced by KDChart::Legend::clone().

83 {
84 d->frameAttributes = a;
85 }

6.54.3.27 void KDChart::TextLayoutItem::setGeometry (const QRect & r) [virtual,


inherited]

pure virtual in QLayoutItem


Definition at line 187 of file KDChartLayoutItems.cpp.
Referenced by paintAll(), KDChart::CartesianAxis::paintCtx(), and paintIntoRect().

188 {
189 mRect = r;
190 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.54 KDChart::TextArea Class Reference 653

6.54.3.28 void KDChart::AbstractLayoutItem::setParentLayout (QLayout ∗ lay) [inherited]

Definition at line 62 of file KDChartLayoutItems.h.

63 {
64 mParentLayout = lay;
65 }

6.54.3.29 void KDChart::AbstractLayoutItem::setParentWidget (QWidget ∗ widget)


[virtual, inherited]

Inform the item about its widget: This enables the item, to trigger that widget’s update, whenever the size
of the item’s contents has changed.
Thus, you need to call setParentWidget on every item, that has a non-fixed size.
Definition at line 56 of file KDChartLayoutItems.cpp.
References KDChart::AbstractLayoutItem::mParent.
Referenced by KDChart::Legend::buildLegend(), and KDChart::AbstractCartesianDiagram::takeAxis().

57 {
58 mParent = widget;
59 }

6.54.3.30 void KDChart::TextLayoutItem::setText (const QString & text) [inherited]

Definition at line 127 of file KDChartLayoutItems.cpp.


References KDChart::TextLayoutItem::sizeHint().
Referenced by KDChart::Widget::addHeaderFooter(), KDChart::CartesianAxis::maximumSize(), and
KDChart::CartesianAxis::paintCtx().

128 {
129 mText = text;
130 cachedSizeHint = QSize();
131 sizeHint();
132 }

6.54.3.31 void KDChart::TextLayoutItem::setTextAttributes (const TextAttributes & a)


[inherited]

Use this to specify the text attributes to be used for this item.

See also:
textAttributes

Definition at line 144 of file KDChartLayoutItems.cpp.


References KDChart::TextLayoutItem::sizeHint().
Referenced by KDChart::HeaderFooter::clone().

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


654 KD Chart 2 Class Documentation

145 {
146 mAttributes = a;
147 cachedSizeHint = QSize(); // invalidate size hint
148 sizeHint();
149 }

6.54.3.32 QSize KDChart::TextLayoutItem::sizeHint () const [virtual, inherited]

pure virtual in QLayoutItem


Definition at line 289 of file KDChartLayoutItems.cpp.
References KDChart::AbstractLayoutItem::sizeHintChanged().
Referenced by KDChart::Legend::buildLegend(), KDChart::TextLayoutItem::maximumSize(),
KDChart::CartesianAxis::maximumSize(), KDChart::TextLayoutItem::minimumSize(), KDChart::Text-
LayoutItem::paint(), KDChart::CartesianAxis::paintCtx(), KDChart::TextLayoutItem::setAutoReference-
Area(), KDChart::TextLayoutItem::setText(), and KDChart::TextLayoutItem::setTextAttributes().

290 {
291 if( realFontWasRecalculated() )
292 {
293 cachedSizeHint = calcSizeHint( cachedFont );
294 sizeHintChanged();
295 }
296 //qDebug("cachedSizeHint.width(): %i",cachedSizeHint.width());
297 return cachedSizeHint;
298 }

6.54.3.33 void KDChart::AbstractLayoutItem::sizeHintChanged () const [virtual,


inherited]

Report changed size hint: ask the parent widget to recalculate the layout.
Definition at line 73 of file KDChartLayoutItems.cpp.
Referenced by KDChart::TextLayoutItem::sizeHint().

74 {
75 // This is exactly like what QWidget::updateGeometry does.
76 // qDebug("KDChart::AbstractLayoutItem::sizeHintChanged() called");
77 if( mParent ) {
78 if ( mParent->layout() )
79 mParent->layout()->invalidate();
80 else
81 QApplication::postEvent( mParent, new QEvent( QEvent::LayoutRequest ) );
82 }
83 }

6.54.3.34 QString KDChart::TextLayoutItem::text () const [inherited]

Definition at line 134 of file KDChartLayoutItems.cpp.


Referenced by KDChart::CartesianAxis::paintCtx().

135 {
136 return mText;
137 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.54 KDChart::TextArea Class Reference 655

6.54.3.35 KDChart::TextAttributes KDChart::TextLayoutItem::textAttributes () const


[inherited]

Returns the text attributes to be used for this item.

See also:
setTextAttributes

Definition at line 156 of file KDChartLayoutItems.cpp.


Referenced by KDChart::HeaderFooter::clone().

157 {
158 return mAttributes;
159 }

6.54.4 Member Data Documentation

6.54.4.1 Q_SIGNALS KDChart::TextArea::__pad0__ [protected]

Reimplemented in KDChart::HeaderFooter.
Definition at line 86 of file KDChartTextArea.h.

6.54.4.2 QWidget∗ KDChart::AbstractLayoutItem::mParent [protected, inherited]

Definition at line 76 of file KDChartLayoutItems.h.


Referenced by KDChart::AbstractLayoutItem::setParentWidget().

6.54.4.3 QLayout∗ KDChart::AbstractLayoutItem::mParentLayout [protected,


inherited]

Definition at line 77 of file KDChartLayoutItems.h.


The documentation for this class was generated from the following files:

• KDChartTextArea.h
• KDChartTextArea.cpp

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


656 KD Chart 2 Class Documentation

6.55 KDChart::TextAttributes Class Reference


#include <KDChartTextAttributes.h>

6.55.1 Detailed Description

A set of text attributes.


TextAttributes encapsulates settings that have to do with text. This includes font, fontsize, color, whether
the text is rotated, etc
Definition at line 50 of file KDChartTextAttributes.h.

Public Member Functions


• bool autoRotate () const
• bool autoShrink () const
• QFont font () const
• Measure fontSize () const
• bool hasAbsoluteFontSize () const
• bool isVisible () const
• Measure minimalFontSize () const
• bool operator!= (const TextAttributes &other) const
• TextAttributes & operator= (const TextAttributes &)
• bool operator== (const TextAttributes &) const
• QPen pen () const
• int rotation () const
• void setAutoRotate (bool autoRotate)
Set whether the text should be automatically rotated as needed when space is constraint.

• void setAutoShrink (bool autoShrink)


Set whether the text should automatically be shrunk, if space is constraint.

• void setFont (const QFont &font)


Set the font to be used for rendering the text.

• void setFontSize (const Measure &measure)


Set the size of the font used for rendering text.

• void setMinimalFontSize (const Measure &measure)


Set the minimal size of the font used for rendering text.

• void setPen (const QPen &pen)


Set the pen to use for rendering the text.

• void setRotation (int rotation)


Set the rotation angle to use for the text.

• void setVisible (bool visible)


Set whether the text is to be rendered at all.

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.55 KDChart::TextAttributes Class Reference 657

• TextAttributes (const TextAttributes &)


• TextAttributes ()
• ∼TextAttributes ()

6.55.2 Constructor & Destructor Documentation

6.55.2.1 KDChart::TextAttributes::TextAttributes ()

6.55.2.2 KDChart::TextAttributes::TextAttributes (const TextAttributes &)

6.55.2.3 KDChart::TextAttributes::∼TextAttributes ()

6.55.3 Member Function Documentation

6.55.3.1 bool KDChart::TextAttributes::autoRotate () const

Returns:
Whether text is automatically rotated when space is constrained.

Referenced by operator<<().

6.55.3.2 bool KDChart::TextAttributes::autoShrink () const

Returns:
Whether text is automatically shrunk if space is constraint.

Referenced by operator<<().

6.55.3.3 QFont KDChart::TextAttributes::font () const

Returns:
The font that is used for rendering text.

Referenced by operator<<(), and KDChart::AbstractDiagram::paintDataValueText().

6.55.3.4 Measure KDChart::TextAttributes::fontSize () const

Returns:
The measure used for the font size.

Referenced by operator<<(), KDChart::TextLayoutItem::realFontSize(), and KDChart::Cartesian-


Axis::titleTextAttributes().

6.55.3.5 bool KDChart::TextAttributes::hasAbsoluteFontSize () const

Returns:
Whether the text has an absolute font size set.

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


658 KD Chart 2 Class Documentation

6.55.3.6 bool KDChart::TextAttributes::isVisible () const

Returns:
Whether the text is visible.

Referenced by KDChart::Legend::buildLegend(), KDChart::CartesianAxis::maximumSize(),


operator<<(), KDChart::CartesianAxis::paintCtx(), and KDChart::AbstractDiagram::paintDataValue-
Text().

6.55.3.7 Measure KDChart::TextAttributes::minimalFontSize () const

Returns:
The measure used for the minimal font size.

Referenced by operator<<(), and KDChart::TextLayoutItem::realFontSize().

6.55.3.8 bool KDChart::TextAttributes::operator!= (const TextAttributes & other) const

Definition at line 57 of file KDChartTextAttributes.h.

58 { return !operator==(other); }

6.55.3.9 TextAttributes& KDChart::TextAttributes::operator= (const TextAttributes &)

6.55.3.10 bool KDChart::TextAttributes::operator== (const TextAttributes &) const

6.55.3.11 QPen KDChart::TextAttributes::pen () const

Returns:
The pen used for rendering the text.

Referenced by operator<<(), KDChart::TextLayoutItem::paint(), and KDChart::AbstractDiagram::paint-


DataValueText().

6.55.3.12 int KDChart::TextAttributes::rotation () const

Returns:
The rotation angle used for rendering the text.

Referenced by KDChart::TextLayoutItem::intersects(), operator<<(), KDChart::TextLayoutItem::paint(),


and KDChart::AbstractDiagram::paintDataValueText().

6.55.3.13 void KDChart::TextAttributes::setAutoRotate (bool autoRotate)

Set whether the text should be automatically rotated as needed when space is constraint.

Parameters:
autoRotate Whether text should be automatically rotated.

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.55 KDChart::TextAttributes Class Reference 659

6.55.3.14 void KDChart::TextAttributes::setAutoShrink (bool autoShrink)

Set whether the text should automatically be shrunk, if space is constraint.

Parameters:
autoShrink Whether text should be auto-shrunk.

6.55.3.15 void KDChart::TextAttributes::setFont (const QFont & font)

Set the font to be used for rendering the text.

Parameters:
font The font to use.

6.55.3.16 void KDChart::TextAttributes::setFontSize (const Measure & measure)

Set the size of the font used for rendering text.

Parameters:
measure The measure to use.

See also:
Measure

Referenced by KDChart::CartesianAxis::titleTextAttributes().

6.55.3.17 void KDChart::TextAttributes::setMinimalFontSize (const Measure & measure)

Set the minimal size of the font used for rendering text.

Parameters:
measure The measure to use.

See also:
Measure

6.55.3.18 void KDChart::TextAttributes::setPen (const QPen & pen)

Set the pen to use for rendering the text.

Parameters:
rotation The pen to use.

6.55.3.19 void KDChart::TextAttributes::setRotation (int rotation)

Set the rotation angle to use for the text.

Parameters:
rotation The rotation angle.

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


660 KD Chart 2 Class Documentation

6.55.3.20 void KDChart::TextAttributes::setVisible (bool visible)

Set whether the text is to be rendered at all.

Parameters:
visible Whether the text is visible.

The documentation for this class was generated from the following file:

• KDChartTextAttributes.h

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.56 KDChart::TextLayoutItem Class Reference 661

6.56 KDChart::TextLayoutItem Class Reference


#include <KDChartLayoutItems.h>
Inheritance diagram for KDChart::TextLayoutItem:Collaboration diagram for KDChart::TextLayoutItem:

Public Member Functions


• const QObject ∗ autoReferenceArea () const
• virtual Qt::Orientations expandingDirections () const
pure virtual in QLayoutItem

• virtual QRect geometry () const


pure virtual in QLayoutItem

• virtual bool intersects (const TextLayoutItem &other, const QPoint &myPos, const QPoint &other-
Pos) const
• virtual bool intersects (const TextLayoutItem &other, const QPointF &myPos, const QPointF
&otherPos) const
• virtual bool isEmpty () const
pure virtual in QLayoutItem

• virtual QSize maximumSize () const


pure virtual in QLayoutItem

• virtual QSize minimumSize () const


pure virtual in QLayoutItem

• virtual void paint (QPainter ∗)


• virtual void paintCtx (PaintContext ∗context)
Default impl: Paint the complete item using its layouted position and size.

• virtual QFont realFont () const


• virtual qreal realFontSize () const
• void removeFromParentLayout ()
• void setAutoReferenceArea (const QObject ∗area)
• virtual void setGeometry (const QRect &r)
pure virtual in QLayoutItem

• void setParentLayout (QLayout ∗lay)


• virtual void setParentWidget (QWidget ∗widget)
Inform the item about its widget: This enables the item, to trigger that widget’s update, whenever the size
of the item’s contents has changed.

• void setText (const QString &text)


• void setTextAttributes (const TextAttributes &a)
Use this to specify the text attributes to be used for this item.

• virtual QSize sizeHint () const


pure virtual in QLayoutItem

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


662 KD Chart 2 Class Documentation

• virtual void sizeHintChanged () const


Report changed size hint: ask the parent widget to recalculate the layout.

• QString text () const


• TextAttributes textAttributes () const
Returns the text attributes to be used for this item.

• TextLayoutItem (const QString &text, const TextAttributes &attributes, const QObject ∗auto-
ReferenceArea, KDChartEnums::MeasureOrientation autoReferenceOrientation, Qt::Alignment
alignment=0)
• TextLayoutItem ()

Protected Attributes
• QWidget ∗ mParent
• QLayout ∗ mParentLayout

6.56.1 Constructor & Destructor Documentation

6.56.1.1 KDChart::TextLayoutItem::TextLayoutItem ()

Definition at line 102 of file KDChartLayoutItems.cpp.

103 : AbstractLayoutItem( Qt::AlignLeft )


104 , mText()
105 , mAttributes()
106 , mAutoReferenceArea( 0 )
107 , mAutoReferenceOrientation( KDChartEnums::MeasureOrientationHorizontal )
108 , cachedSizeHint() // default this to invalid to force just-in-time calculation before first use o
109 , cachedFontSize( 0.0 )
110 , cachedFont( mAttributes.font() )
111 {
112
113 }

6.56.1.2 KDChart::TextLayoutItem::TextLayoutItem (const QString & text, const TextAttributes


& attributes, const QObject ∗ autoReferenceArea, KDChartEnums::MeasureOrientation
autoReferenceOrientation, Qt::Alignment alignment = 0)

Definition at line 86 of file KDChartLayoutItems.cpp.


References attributes.

91 : AbstractLayoutItem( alignment )
92 , mText( text )
93 , mAttributes( attributes )
94 , mAutoReferenceArea( area )
95 , mAutoReferenceOrientation( orientation )
96 , cachedSizeHint() // default this to invalid to force just-in-time calculation before first use of
97 , cachedFontSize( 0.0 )
98 , cachedFont( mAttributes.font() )
99 {
100 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.56 KDChart::TextLayoutItem Class Reference 663

6.56.2 Member Function Documentation

6.56.2.1 const QObject ∗ KDChart::TextLayoutItem::autoReferenceArea () const

Definition at line 122 of file KDChartLayoutItems.cpp.


Referenced by KDChart::HeaderFooter::setParent().

123 {
124 return mAutoReferenceArea;
125 }

6.56.2.2 Qt::Orientations KDChart::TextLayoutItem::expandingDirections () const [virtual]

pure virtual in QLayoutItem


Definition at line 162 of file KDChartLayoutItems.cpp.

163 {
164 return 0; // Grow neither vertically nor horizontally
165 }

6.56.2.3 QRect KDChart::TextLayoutItem::geometry () const [virtual]

pure virtual in QLayoutItem


Definition at line 167 of file KDChartLayoutItems.cpp.
Referenced by KDChart::TextArea::areaGeometry(), paint(), KDChart::TextArea::paintAll(),
KDChart::CartesianAxis::paintCtx(), and KDChart::TextArea::paintIntoRect().

168 {
169 return mRect;
170 }

6.56.2.4 bool KDChart::TextLayoutItem::intersects (const TextLayoutItem & other, const QPoint


& myPos, const QPoint & otherPos) const [virtual]

Definition at line 248 of file KDChartLayoutItems.cpp.


References mAttributes, PI, rotatedCorners(), KDChart::TextAttributes::rotation(), and unrotatedSize-
Hint().

249 {
250 if ( mAttributes.rotation() != other.mAttributes.rotation() )
251 {
252 // that’s the code for the common case: the rotation angles don’t need to match here
253 QPolygon myPolygon( rotatedCorners() );
254 QPolygon otherPolygon( other.rotatedCorners() );
255
256 // move the polygons to their positions
257 myPolygon.translate( myPos );
258 otherPolygon.translate( otherPos );
259
260 // create regions out of it

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


664 KD Chart 2 Class Documentation

261 QRegion myRegion( myPolygon );


262 QRegion otherRegion( otherPolygon );
263
264 // now the question - do they intersect or not?
265 return ! myRegion.intersect( otherRegion ).isEmpty();
266
267 } else {
268 // and that’s the code for the special case: the rotation angles match, which is less time con
269 const qreal angle = mAttributes.rotation() * PI / 180.0;
270 // both sizes
271 const QSizeF mySize( unrotatedSizeHint() );
272 const QSizeF otherSize( other.unrotatedSizeHint() );
273
274 // that’s myP1 relative to myPos
275 QPointF myP1( mySize.height() * sin( angle ), 0.0 );
276 // that’s otherP1 to myPos
277 QPointF otherP1 = QPointF( otherSize.height() * sin( angle ), 0.0 ) + otherPos - myPos;
278
279 // now rotate both points the negative angle around myPos
280 myP1 = QPointF( myP1.x() * cos( -angle ), myP1.x() * sin( -angle ) );
281 qreal r = sqrt( otherP1.x() * otherP1.x() + otherP1.y() * otherP1.y() );
282 otherP1 = QPointF( r * cos( -angle ), r * sin( -angle ) );
283
284 // finally we look, whether both rectangles intersect or even not
285 return QRectF( myP1, mySize ).intersects( QRectF( otherP1, otherSize ) );
286 }
287 }

6.56.2.5 bool KDChart::TextLayoutItem::intersects (const TextLayoutItem & other, const


QPointF & myPos, const QPointF & otherPos) const [virtual]

Definition at line 243 of file KDChartLayoutItems.cpp.


Referenced by KDChart::CartesianAxis::paintCtx().

244 {
245 return intersects( other, myPos.toPoint(), otherPos.toPoint() );
246 }

6.56.2.6 bool KDChart::TextLayoutItem::isEmpty () const [virtual]

pure virtual in QLayoutItem


Definition at line 172 of file KDChartLayoutItems.cpp.

173 {
174 return false; // never empty, otherwise the layout item would not exist
175 }

6.56.2.7 QSize KDChart::TextLayoutItem::maximumSize () const [virtual]

pure virtual in QLayoutItem


Definition at line 177 of file KDChartLayoutItems.cpp.
References sizeHint().

178 {
179 return sizeHint(); // PENDING(kalle) Review, quite inflexible
180 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.56 KDChart::TextLayoutItem Class Reference 665

6.56.2.8 QSize KDChart::TextLayoutItem::minimumSize () const [virtual]

pure virtual in QLayoutItem


Definition at line 182 of file KDChartLayoutItems.cpp.
References sizeHint().

183 {
184 return sizeHint(); // PENDING(kalle) Review, quite inflexible
185 }

6.56.2.9 void KDChart::TextLayoutItem::paint (QPainter ∗) [virtual]

Implements KDChart::AbstractLayoutItem.
Definition at line 325 of file KDChartLayoutItems.cpp.
References geometry(), KDChart::TextAttributes::pen(), KDChart::TextAttributes::rotation(), and size-
Hint().
Referenced by KDChart::TextArea::paintAll(), and KDChart::CartesianAxis::paintCtx().

326 {
327 // make sure, cached font is updated, if needed:
328 sizeHint();
329
330 if( !mRect.isValid() )
331 return;
332
333 PainterSaver painterSaver( painter );
334 painter->setFont( cachedFont );
335 painter->setPen( mAttributes.pen() );
336 QRectF rect = geometry();
337
338 painter->translate( rect.center() );
339 rect.moveTopLeft( QPointF( - rect.width() / 2, - rect.height() / 2 ) );
340 painter->rotate( mAttributes.rotation() );
341 painter->drawText( rect, Qt::AlignHCenter | Qt::AlignVCenter, mText );
342 }

6.56.2.10 void KDChart::AbstractLayoutItem::paintCtx (PaintContext ∗ context) [virtual,


inherited]

Default impl: Paint the complete item using its layouted position and size.
Reimplemented in KDChart::CartesianAxis.
Definition at line 64 of file KDChartLayoutItems.cpp.
References KDChart::AbstractLayoutItem::paint(), and KDChart::PaintContext::painter().

65 {
66 if( context )
67 paint( context->painter() );
68 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


666 KD Chart 2 Class Documentation

6.56.2.11 QFont KDChart::TextLayoutItem::realFont () const [virtual]

Definition at line 220 of file KDChartLayoutItems.cpp.


Referenced by KDChart::CartesianAxis::maximumSize(), and KDChart::CartesianAxis::paintCtx().

221 {
222 realFontWasRecalculated(); // we can safely ignore the boolean return value
223 return cachedFont;
224 }

6.56.2.12 qreal KDChart::TextLayoutItem::realFontSize () const [virtual]

Definition at line 193 of file KDChartLayoutItems.cpp.


References KDChart::Measure::calculatedValue(), KDChart::TextAttributes::fontSize(), and
KDChart::TextAttributes::minimalFontSize().

194 {
195 return qMax(
196 mAttributes.fontSize().calculatedValue(
197 mAutoReferenceArea,
198 mAutoReferenceOrientation ),
199 mAttributes.minimalFontSize().calculatedValue(
200 mAutoReferenceArea,
201 mAutoReferenceOrientation ) );
202 }

6.56.2.13 void KDChart::AbstractLayoutItem::removeFromParentLayout () [inherited]

Definition at line 66 of file KDChartLayoutItems.h.


Referenced by KDChart::Chart::takeCoordinatePlane().

67 {
68 if( mParentLayout ){
69 if( widget() )
70 mParentLayout->removeWidget( widget() );
71 else
72 mParentLayout->removeItem( this );
73 }
74 }

6.56.2.14 void KDChart::TextLayoutItem::setAutoReferenceArea (const QObject ∗ area)

Definition at line 115 of file KDChartLayoutItems.cpp.


References sizeHint().
Referenced by KDChart::HeaderFooter::setParent().

116 {
117 mAutoReferenceArea = area;
118 cachedSizeHint = QSize();
119 sizeHint();
120 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.56 KDChart::TextLayoutItem Class Reference 667

6.56.2.15 void KDChart::TextLayoutItem::setGeometry (const QRect & r) [virtual]

pure virtual in QLayoutItem


Definition at line 187 of file KDChartLayoutItems.cpp.
Referenced by KDChart::TextArea::paintAll(), KDChart::CartesianAxis::paintCtx(), and KDChart::Text-
Area::paintIntoRect().

188 {
189 mRect = r;
190 }

6.56.2.16 void KDChart::AbstractLayoutItem::setParentLayout (QLayout ∗ lay) [inherited]

Definition at line 62 of file KDChartLayoutItems.h.

63 {
64 mParentLayout = lay;
65 }

6.56.2.17 void KDChart::AbstractLayoutItem::setParentWidget (QWidget ∗ widget)


[virtual, inherited]

Inform the item about its widget: This enables the item, to trigger that widget’s update, whenever the size
of the item’s contents has changed.
Thus, you need to call setParentWidget on every item, that has a non-fixed size.
Definition at line 56 of file KDChartLayoutItems.cpp.
References KDChart::AbstractLayoutItem::mParent.
Referenced by KDChart::Legend::buildLegend(), and KDChart::AbstractCartesianDiagram::takeAxis().

57 {
58 mParent = widget;
59 }

6.56.2.18 void KDChart::TextLayoutItem::setText (const QString & text)

Definition at line 127 of file KDChartLayoutItems.cpp.


References sizeHint().
Referenced by KDChart::Widget::addHeaderFooter(), KDChart::CartesianAxis::maximumSize(), and
KDChart::CartesianAxis::paintCtx().

128 {
129 mText = text;
130 cachedSizeHint = QSize();
131 sizeHint();
132 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


668 KD Chart 2 Class Documentation

6.56.2.19 void KDChart::TextLayoutItem::setTextAttributes (const TextAttributes & a)

Use this to specify the text attributes to be used for this item.

See also:
textAttributes

Definition at line 144 of file KDChartLayoutItems.cpp.


References sizeHint().
Referenced by KDChart::HeaderFooter::clone().

145 {
146 mAttributes = a;
147 cachedSizeHint = QSize(); // invalidate size hint
148 sizeHint();
149 }

6.56.2.20 QSize KDChart::TextLayoutItem::sizeHint () const [virtual]

pure virtual in QLayoutItem


Definition at line 289 of file KDChartLayoutItems.cpp.
References KDChart::AbstractLayoutItem::sizeHintChanged().
Referenced by KDChart::Legend::buildLegend(), maximumSize(), KDChart::CartesianAxis::maximum-
Size(), minimumSize(), paint(), KDChart::CartesianAxis::paintCtx(), setAutoReferenceArea(), setText(),
and setTextAttributes().

290 {
291 if( realFontWasRecalculated() )
292 {
293 cachedSizeHint = calcSizeHint( cachedFont );
294 sizeHintChanged();
295 }
296 //qDebug("cachedSizeHint.width(): %i",cachedSizeHint.width());
297 return cachedSizeHint;
298 }

6.56.2.21 void KDChart::AbstractLayoutItem::sizeHintChanged () const [virtual,


inherited]

Report changed size hint: ask the parent widget to recalculate the layout.
Definition at line 73 of file KDChartLayoutItems.cpp.
Referenced by sizeHint().

74 {
75 // This is exactly like what QWidget::updateGeometry does.
76 // qDebug("KDChart::AbstractLayoutItem::sizeHintChanged() called");
77 if( mParent ) {
78 if ( mParent->layout() )
79 mParent->layout()->invalidate();
80 else
81 QApplication::postEvent( mParent, new QEvent( QEvent::LayoutRequest ) );
82 }
83 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.56 KDChart::TextLayoutItem Class Reference 669

6.56.2.22 QString KDChart::TextLayoutItem::text () const

Definition at line 134 of file KDChartLayoutItems.cpp.


Referenced by KDChart::CartesianAxis::paintCtx().

135 {
136 return mText;
137 }

6.56.2.23 KDChart::TextAttributes KDChart::TextLayoutItem::textAttributes () const

Returns the text attributes to be used for this item.

See also:
setTextAttributes

Definition at line 156 of file KDChartLayoutItems.cpp.


Referenced by KDChart::HeaderFooter::clone().

157 {
158 return mAttributes;
159 }

6.56.3 Member Data Documentation

6.56.3.1 QWidget∗ KDChart::AbstractLayoutItem::mParent [protected, inherited]

Definition at line 76 of file KDChartLayoutItems.h.


Referenced by KDChart::AbstractLayoutItem::setParentWidget().

6.56.3.2 QLayout∗ KDChart::AbstractLayoutItem::mParentLayout [protected,


inherited]

Definition at line 77 of file KDChartLayoutItems.h.


The documentation for this class was generated from the following files:

• KDChartLayoutItems.h
• KDChartLayoutItems.cpp

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


670 KD Chart 2 Class Documentation

6.57 KDChart::ThreeDBarAttributes Class Reference


#include <KDChartThreeDBarAttributes.h>
Inheritance diagram for KDChart::ThreeDBarAttributes:Collaboration diagram for KDChart::ThreeDBar-
Attributes:

Public Member Functions

• uint angle () const


• double depth () const
• bool isEnabled () const
• bool operator!= (const AbstractThreeDAttributes &other) const
• bool operator!= (const ThreeDBarAttributes &other) const
• ThreeDBarAttributes & operator= (const ThreeDBarAttributes &)
• bool operator== (const AbstractThreeDAttributes &) const
• bool operator== (const ThreeDBarAttributes &) const
• void setAngle (uint threeDAngle)
• void setDepth (double depth)
• void setEnabled (bool enabled)
• void setUseShadowColors (bool useShadowColors)
• ThreeDBarAttributes (const ThreeDBarAttributes &)
• ThreeDBarAttributes ()
• bool useShadowColors () const
• double validDepth () const
• ∼ThreeDBarAttributes ()

6.57.1 Constructor & Destructor Documentation

6.57.1.1 ThreeDBarAttributes::ThreeDBarAttributes ()

Definition at line 44 of file KDChartThreeDBarAttributes.cpp.

45 : AbstractThreeDAttributes( new Private() )


46 {
47
48 }

6.57.1.2 ThreeDBarAttributes::ThreeDBarAttributes (const ThreeDBarAttributes &)

Definition at line 50 of file KDChartThreeDBarAttributes.cpp.


References d.

51 : AbstractThreeDAttributes( new Private( *r.d) )


52 {
53 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.57 KDChart::ThreeDBarAttributes Class Reference 671

6.57.1.3 ThreeDBarAttributes::∼ThreeDBarAttributes ()

Definition at line 65 of file KDChartThreeDBarAttributes.cpp.

66 {
67 }

6.57.2 Member Function Documentation

6.57.2.1 uint ThreeDBarAttributes::angle () const

Definition at line 98 of file KDChartThreeDBarAttributes.cpp.


References d.
Referenced by operator<<(), and operator==().

99 {
100 return d->angle;
101 }

6.57.2.2 double AbstractThreeDAttributes::depth () const [inherited]

Definition at line 103 of file KDChartAbstractThreeDAttributes.cpp.


References d.
Referenced by operator<<(), KDChart::AbstractThreeDAttributes::operator==(), KDChart::Pie-
Diagram::paint(), and KDChart::BarDiagram::paint().

104 {
105 return d->depth;
106 }

6.57.2.3 bool AbstractThreeDAttributes::isEnabled () const [inherited]

Definition at line 92 of file KDChartAbstractThreeDAttributes.cpp.


References d.
Referenced by operator<<(), KDChart::AbstractThreeDAttributes::operator==(), KDChart::Pie-
Diagram::paint(), KDChart::BarDiagram::paint(), and KDChart::AbstractThreeDAttributes::validDepth().

93 {
94 return d->enabled;
95 }

6.57.2.4 bool KDChart::AbstractThreeDAttributes::operator!= (const AbstractThreeDAttributes


& other) const [inherited]

Definition at line 57 of file KDChartAbstractThreeDAttributes.h.

57 { return !operator==(other); }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


672 KD Chart 2 Class Documentation

6.57.2.5 bool KDChart::ThreeDBarAttributes::operator!= (const ThreeDBarAttributes & other)


const

Definition at line 53 of file KDChartThreeDBarAttributes.h.

53 { return !operator==(other); }

6.57.2.6 ThreeDBarAttributes & ThreeDBarAttributes::operator= (const ThreeDBarAttributes


&)

Definition at line 55 of file KDChartThreeDBarAttributes.cpp.


References d.

56 {
57 if( this == &r )
58 return *this;
59
60 *d = *r.d;
61
62 return *this;
63 }

6.57.2.7 bool AbstractThreeDAttributes::operator== (const AbstractThreeDAttributes &) const


[inherited]

Definition at line 72 of file KDChartAbstractThreeDAttributes.cpp.


References KDChart::AbstractThreeDAttributes::depth(), and KDChart::AbstractThreeDAttributes::is-
Enabled().
Referenced by KDChart::ThreeDPieAttributes::operator==(), KDChart::ThreeDLine-
Attributes::operator==(), and operator==().

73 {
74 if( isEnabled() == r.isEnabled() &&
75 depth() == r.depth() )
76 return true;
77 else
78 return false;
79 }

6.57.2.8 bool ThreeDBarAttributes::operator== (const ThreeDBarAttributes &) const

Definition at line 74 of file KDChartThreeDBarAttributes.cpp.


References angle(), KDChart::AbstractThreeDAttributes::operator==(), and useShadowColors().

75 {
76 return ( useShadowColors() == r.useShadowColors() &&
77 angle() == r.angle() &&
78 AbstractThreeDAttributes::operator==(r));
79 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.57 KDChart::ThreeDBarAttributes Class Reference 673

6.57.2.9 void ThreeDBarAttributes::setAngle (uint threeDAngle)

Definition at line 93 of file KDChartThreeDBarAttributes.cpp.


References d.

94 {
95 d->angle = threeDAngle;
96 }

6.57.2.10 void AbstractThreeDAttributes::setDepth (double depth) [inherited]

Definition at line 97 of file KDChartAbstractThreeDAttributes.cpp.


References d.

98 {
99 d->depth = depth;
100 }

6.57.2.11 void AbstractThreeDAttributes::setEnabled (bool enabled) [inherited]

Definition at line 87 of file KDChartAbstractThreeDAttributes.cpp.


References d.

88 {
89 d->enabled = enabled;
90 }

6.57.2.12 void ThreeDBarAttributes::setUseShadowColors (bool useShadowColors)

Definition at line 83 of file KDChartThreeDBarAttributes.cpp.


References d.

84 {
85 d->useShadowColors = shadowColors;
86 }

6.57.2.13 bool ThreeDBarAttributes::useShadowColors () const

Definition at line 88 of file KDChartThreeDBarAttributes.cpp.


References d.
Referenced by operator<<(), and operator==().

89 {
90 return d->useShadowColors;
91 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


674 KD Chart 2 Class Documentation

6.57.2.14 double AbstractThreeDAttributes::validDepth () const [inherited]

Definition at line 109 of file KDChartAbstractThreeDAttributes.cpp.


References d, and KDChart::AbstractThreeDAttributes::isEnabled().
Referenced by KDChart::LineDiagram::threeDItemDepth(), and KDChart::BarDiagram::threeDItem-
Depth().

110 {
111 return isEnabled() ? d->depth : 0.0;
112 }

The documentation for this class was generated from the following files:

• KDChartThreeDBarAttributes.h
• KDChartThreeDBarAttributes.cpp

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.58 KDChart::ThreeDLineAttributes Class Reference 675

6.58 KDChart::ThreeDLineAttributes Class Reference


#include <KDChartThreeDLineAttributes.h>
Inheritance diagram for KDChart::ThreeDLineAttributes:Collaboration diagram for KDChart::Three-
DLineAttributes:

Public Member Functions

• double depth () const


• bool isEnabled () const
• uint lineXRotation () const
• uint lineYRotation () const
• bool operator!= (const AbstractThreeDAttributes &other) const
• bool operator!= (const ThreeDLineAttributes &other) const
• ThreeDLineAttributes & operator= (const ThreeDLineAttributes &)
• bool operator== (const AbstractThreeDAttributes &) const
• bool operator== (const ThreeDLineAttributes &) const
• void setDepth (double depth)
• void setEnabled (bool enabled)
• void setLineXRotation (const uint degrees)
• void setLineYRotation (const uint degrees)
• ThreeDLineAttributes (const ThreeDLineAttributes &)
• ThreeDLineAttributes ()
• double validDepth () const
• ∼ThreeDLineAttributes ()

6.58.1 Constructor & Destructor Documentation

6.58.1.1 ThreeDLineAttributes::ThreeDLineAttributes ()

Definition at line 44 of file KDChartThreeDLineAttributes.cpp.

45 : AbstractThreeDAttributes( new Private() )


46 {
47
48 }

6.58.1.2 ThreeDLineAttributes::ThreeDLineAttributes (const ThreeDLineAttributes &)

Definition at line 50 of file KDChartThreeDLineAttributes.cpp.


References d.

51 : AbstractThreeDAttributes( new Private( *r.d) )


52 {
53 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


676 KD Chart 2 Class Documentation

6.58.1.3 ThreeDLineAttributes::∼ThreeDLineAttributes ()

Definition at line 65 of file KDChartThreeDLineAttributes.cpp.

66 {
67 }

6.58.2 Member Function Documentation

6.58.2.1 double AbstractThreeDAttributes::depth () const [inherited]

Definition at line 103 of file KDChartAbstractThreeDAttributes.cpp.


References d.
Referenced by operator<<(), KDChart::AbstractThreeDAttributes::operator==(), KDChart::Pie-
Diagram::paint(), and KDChart::BarDiagram::paint().

104 {
105 return d->depth;
106 }

6.58.2.2 bool AbstractThreeDAttributes::isEnabled () const [inherited]

Definition at line 92 of file KDChartAbstractThreeDAttributes.cpp.


References d.
Referenced by operator<<(), KDChart::AbstractThreeDAttributes::operator==(), KDChart::Pie-
Diagram::paint(), KDChart::BarDiagram::paint(), and KDChart::AbstractThreeDAttributes::validDepth().

93 {
94 return d->enabled;
95 }

6.58.2.3 uint ThreeDLineAttributes::lineXRotation () const

Definition at line 88 of file KDChartThreeDLineAttributes.cpp.


References d.
Referenced by operator<<(), and operator==().

89 {
90 return d->lineXRotation;
91 }

6.58.2.4 uint ThreeDLineAttributes::lineYRotation () const

Definition at line 98 of file KDChartThreeDLineAttributes.cpp.


References d.
Referenced by operator<<(), and operator==().

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.58 KDChart::ThreeDLineAttributes Class Reference 677

99 {
100 return d->lineYRotation;
101 }

6.58.2.5 bool KDChart::AbstractThreeDAttributes::operator!= (const AbstractThreeDAttributes


& other) const [inherited]

Definition at line 57 of file KDChartAbstractThreeDAttributes.h.

57 { return !operator==(other); }

6.58.2.6 bool KDChart::ThreeDLineAttributes::operator!= (const ThreeDLineAttributes & other)


const

Definition at line 51 of file KDChartThreeDLineAttributes.h.

51 { return !operator==(other); }

6.58.2.7 ThreeDLineAttributes & ThreeDLineAttributes::operator= (const ThreeDLineAttributes


&)

Definition at line 55 of file KDChartThreeDLineAttributes.cpp.


References d.

56 {
57 if( this == &r )
58 return *this;
59
60 *d = *r.d;
61
62 return *this;
63 }

6.58.2.8 bool AbstractThreeDAttributes::operator== (const AbstractThreeDAttributes &) const


[inherited]

Definition at line 72 of file KDChartAbstractThreeDAttributes.cpp.


References KDChart::AbstractThreeDAttributes::depth(), and KDChart::AbstractThreeDAttributes::is-
Enabled().
Referenced by KDChart::ThreeDPieAttributes::operator==(), operator==(), and KDChart::ThreeDBar-
Attributes::operator==().

73 {
74 if( isEnabled() == r.isEnabled() &&
75 depth() == r.depth() )
76 return true;
77 else
78 return false;
79 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


678 KD Chart 2 Class Documentation

6.58.2.9 bool ThreeDLineAttributes::operator== (const ThreeDLineAttributes &) const

Definition at line 74 of file KDChartThreeDLineAttributes.cpp.


References lineXRotation(), lineYRotation(), and KDChart::AbstractThreeDAttributes::operator==().

75 {
76 return ( lineXRotation() == r.lineXRotation() &&
77 lineYRotation() == r.lineYRotation() &&
78 AbstractThreeDAttributes::operator==(r));
79 }

6.58.2.10 void AbstractThreeDAttributes::setDepth (double depth) [inherited]

Definition at line 97 of file KDChartAbstractThreeDAttributes.cpp.


References d.

98 {
99 d->depth = depth;
100 }

6.58.2.11 void AbstractThreeDAttributes::setEnabled (bool enabled) [inherited]

Definition at line 87 of file KDChartAbstractThreeDAttributes.cpp.


References d.

88 {
89 d->enabled = enabled;
90 }

6.58.2.12 void ThreeDLineAttributes::setLineXRotation (const uint degrees)

Definition at line 83 of file KDChartThreeDLineAttributes.cpp.


References d.

84 {
85 d->lineXRotation = degrees;
86 }

6.58.2.13 void ThreeDLineAttributes::setLineYRotation (const uint degrees)

Definition at line 93 of file KDChartThreeDLineAttributes.cpp.


References d.

94 {
95 d->lineYRotation = degrees;
96 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.58 KDChart::ThreeDLineAttributes Class Reference 679

6.58.2.14 double AbstractThreeDAttributes::validDepth () const [inherited]

Definition at line 109 of file KDChartAbstractThreeDAttributes.cpp.


References d, and KDChart::AbstractThreeDAttributes::isEnabled().
Referenced by KDChart::LineDiagram::threeDItemDepth(), and KDChart::BarDiagram::threeDItem-
Depth().

110 {
111 return isEnabled() ? d->depth : 0.0;
112 }

The documentation for this class was generated from the following files:

• KDChartThreeDLineAttributes.h
• KDChartThreeDLineAttributes.cpp

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


680 KD Chart 2 Class Documentation

6.59 KDChart::ThreeDPieAttributes Class Reference


#include <KDChartThreeDPieAttributes.h>
Inheritance diagram for KDChart::ThreeDPieAttributes:Collaboration diagram for KDChart::ThreeDPie-
Attributes:

Public Member Functions


• double depth () const
• bool isEnabled () const
• bool operator!= (const AbstractThreeDAttributes &other) const
• bool operator!= (const ThreeDPieAttributes &other) const
• ThreeDPieAttributes & operator= (const ThreeDPieAttributes &)
• bool operator== (const AbstractThreeDAttributes &) const
• bool operator== (const ThreeDPieAttributes &) const
• void setDepth (double depth)
• void setEnabled (bool enabled)
• void setUseShadowColors (bool useShadowColors)
• ThreeDPieAttributes (const ThreeDPieAttributes &)
• ThreeDPieAttributes ()
• bool useShadowColors () const
• double validDepth () const
• ∼ThreeDPieAttributes ()

6.59.1 Constructor & Destructor Documentation

6.59.1.1 ThreeDPieAttributes::ThreeDPieAttributes ()

Definition at line 43 of file KDChartThreeDPieAttributes.cpp.

44 : AbstractThreeDAttributes( new Private() )


45 {
46
47 }

6.59.1.2 ThreeDPieAttributes::ThreeDPieAttributes (const ThreeDPieAttributes &)

Definition at line 49 of file KDChartThreeDPieAttributes.cpp.


References d.

50 : AbstractThreeDAttributes( new Private( *r.d) )


51 {
52 }

6.59.1.3 ThreeDPieAttributes::∼ThreeDPieAttributes ()

Definition at line 64 of file KDChartThreeDPieAttributes.cpp.

65 {
66 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.59 KDChart::ThreeDPieAttributes Class Reference 681

6.59.2 Member Function Documentation

6.59.2.1 double AbstractThreeDAttributes::depth () const [inherited]

Definition at line 103 of file KDChartAbstractThreeDAttributes.cpp.


References d.
Referenced by operator<<(), KDChart::AbstractThreeDAttributes::operator==(), KDChart::Pie-
Diagram::paint(), and KDChart::BarDiagram::paint().

104 {
105 return d->depth;
106 }

6.59.2.2 bool AbstractThreeDAttributes::isEnabled () const [inherited]

Definition at line 92 of file KDChartAbstractThreeDAttributes.cpp.


References d.
Referenced by operator<<(), KDChart::AbstractThreeDAttributes::operator==(), KDChart::Pie-
Diagram::paint(), KDChart::BarDiagram::paint(), and KDChart::AbstractThreeDAttributes::validDepth().

93 {
94 return d->enabled;
95 }

6.59.2.3 bool KDChart::AbstractThreeDAttributes::operator!= (const AbstractThreeDAttributes


& other) const [inherited]

Definition at line 57 of file KDChartAbstractThreeDAttributes.h.

57 { return !operator==(other); }

6.59.2.4 bool KDChart::ThreeDPieAttributes::operator!= (const ThreeDPieAttributes & other)


const

Definition at line 49 of file KDChartThreeDPieAttributes.h.

49 { return !operator==(other); }

6.59.2.5 ThreeDPieAttributes & ThreeDPieAttributes::operator= (const ThreeDPieAttributes &)

Definition at line 54 of file KDChartThreeDPieAttributes.cpp.


References d.

55 {
56 if( this == &r )
57 return *this;

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


682 KD Chart 2 Class Documentation

58
59 *d = *r.d;
60
61 return *this;
62 }

6.59.2.6 bool AbstractThreeDAttributes::operator== (const AbstractThreeDAttributes &) const


[inherited]

Definition at line 72 of file KDChartAbstractThreeDAttributes.cpp.


References KDChart::AbstractThreeDAttributes::depth(), and KDChart::AbstractThreeDAttributes::is-
Enabled().
Referenced by operator==(), KDChart::ThreeDLineAttributes::operator==(), and KDChart::ThreeDBar-
Attributes::operator==().

73 {
74 if( isEnabled() == r.isEnabled() &&
75 depth() == r.depth() )
76 return true;
77 else
78 return false;
79 }

6.59.2.7 bool ThreeDPieAttributes::operator== (const ThreeDPieAttributes &) const

Definition at line 73 of file KDChartThreeDPieAttributes.cpp.


References KDChart::AbstractThreeDAttributes::operator==(), and useShadowColors().

74 {
75 return ( useShadowColors() == r.useShadowColors() &&
76 AbstractThreeDAttributes::operator==(r));
77 }

6.59.2.8 void AbstractThreeDAttributes::setDepth (double depth) [inherited]

Definition at line 97 of file KDChartAbstractThreeDAttributes.cpp.


References d.

98 {
99 d->depth = depth;
100 }

6.59.2.9 void AbstractThreeDAttributes::setEnabled (bool enabled) [inherited]

Definition at line 87 of file KDChartAbstractThreeDAttributes.cpp.


References d.

88 {
89 d->enabled = enabled;
90 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.59 KDChart::ThreeDPieAttributes Class Reference 683

6.59.2.10 void ThreeDPieAttributes::setUseShadowColors (bool useShadowColors)

Definition at line 81 of file KDChartThreeDPieAttributes.cpp.


References d.

82 {
83 d->useShadowColors = shadowColors;
84 }

6.59.2.11 bool ThreeDPieAttributes::useShadowColors () const

Definition at line 86 of file KDChartThreeDPieAttributes.cpp.


References d.
Referenced by operator<<(), and operator==().

87 {
88 return d->useShadowColors;
89 }

6.59.2.12 double AbstractThreeDAttributes::validDepth () const [inherited]

Definition at line 109 of file KDChartAbstractThreeDAttributes.cpp.


References d, and KDChart::AbstractThreeDAttributes::isEnabled().
Referenced by KDChart::LineDiagram::threeDItemDepth(), and KDChart::BarDiagram::threeDItem-
Depth().

110 {
111 return isEnabled() ? d->depth : 0.0;
112 }

The documentation for this class was generated from the following files:

• KDChartThreeDPieAttributes.h
• KDChartThreeDPieAttributes.cpp

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


684 KD Chart 2 Class Documentation

6.60 KDChart::VerticalLineLayoutItem Class Reference

#include <KDChartLayoutItems.h>
Inheritance diagram for KDChart::VerticalLineLayoutItem:Collaboration diagram for KDChart::Vertical-
LineLayoutItem:

Public Member Functions

• virtual Qt::Orientations expandingDirections () const


• virtual QRect geometry () const
• virtual bool isEmpty () const
• virtual QSize maximumSize () const
• virtual QSize minimumSize () const
• virtual void paint (QPainter ∗)
• virtual void paintCtx (PaintContext ∗context)
Default impl: Paint the complete item using its layouted position and size.

• void removeFromParentLayout ()
• virtual void setGeometry (const QRect &r)
• void setParentLayout (QLayout ∗lay)
• virtual void setParentWidget (QWidget ∗widget)
Inform the item about its widget: This enables the item, to trigger that widget’s update, whenever the size
of the item’s contents has changed.

• virtual QSize sizeHint () const


• virtual void sizeHintChanged () const
Report changed size hint: ask the parent widget to recalculate the layout.

• VerticalLineLayoutItem ()

Protected Attributes

• QWidget ∗ mParent
• QLayout ∗ mParentLayout

6.60.1 Constructor & Destructor Documentation

6.60.1.1 KDChart::VerticalLineLayoutItem::VerticalLineLayoutItem ()

Definition at line 462 of file KDChartLayoutItems.cpp.

463 : AbstractLayoutItem( Qt::AlignCenter )


464 {
465 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.60 KDChart::VerticalLineLayoutItem Class Reference 685

6.60.2 Member Function Documentation

6.60.2.1 Qt::Orientations KDChart::VerticalLineLayoutItem::expandingDirections () const


[virtual]

Definition at line 467 of file KDChartLayoutItems.cpp.

468 {
469 return Qt::Vertical|Qt::Vertical; // Grow neither vertically nor horizontally
470 }

6.60.2.2 QRect KDChart::VerticalLineLayoutItem::geometry () const [virtual]

Definition at line 472 of file KDChartLayoutItems.cpp.

473 {
474 return mRect;
475 }

6.60.2.3 bool KDChart::VerticalLineLayoutItem::isEmpty () const [virtual]

Definition at line 477 of file KDChartLayoutItems.cpp.

478 {
479 return false; // never empty, otherwise the layout item would not exist
480 }

6.60.2.4 QSize KDChart::VerticalLineLayoutItem::maximumSize () const [virtual]

Definition at line 482 of file KDChartLayoutItems.cpp.

483 {
484 return QSize( QWIDGETSIZE_MAX, QWIDGETSIZE_MAX );
485 }

6.60.2.5 QSize KDChart::VerticalLineLayoutItem::minimumSize () const [virtual]

Definition at line 487 of file KDChartLayoutItems.cpp.

488 {
489 return QSize( 0, 0 );
490 }

6.60.2.6 void KDChart::VerticalLineLayoutItem::paint (QPainter ∗) [virtual]

Implements KDChart::AbstractLayoutItem.
Definition at line 503 of file KDChartLayoutItems.cpp.

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


686 KD Chart 2 Class Documentation

504 {
505 if( !mRect.isValid() )
506 return;
507
508 painter->drawLine( QPointF( mRect.center().x(), mRect.top() ),
509 QPointF( mRect.center().x(), mRect.bottom() ) );
510 }

6.60.2.7 void KDChart::AbstractLayoutItem::paintCtx (PaintContext ∗ context) [virtual,


inherited]

Default impl: Paint the complete item using its layouted position and size.
Reimplemented in KDChart::CartesianAxis.
Definition at line 64 of file KDChartLayoutItems.cpp.
References KDChart::AbstractLayoutItem::paint(), and KDChart::PaintContext::painter().

65 {
66 if( context )
67 paint( context->painter() );
68 }

6.60.2.8 void KDChart::AbstractLayoutItem::removeFromParentLayout () [inherited]

Definition at line 66 of file KDChartLayoutItems.h.


Referenced by KDChart::Chart::takeCoordinatePlane().

67 {
68 if( mParentLayout ){
69 if( widget() )
70 mParentLayout->removeWidget( widget() );
71 else
72 mParentLayout->removeItem( this );
73 }
74 }

6.60.2.9 void KDChart::VerticalLineLayoutItem::setGeometry (const QRect & r) [virtual]

Definition at line 492 of file KDChartLayoutItems.cpp.

493 {
494 mRect = r;
495 }

6.60.2.10 void KDChart::AbstractLayoutItem::setParentLayout (QLayout ∗ lay) [inherited]

Definition at line 62 of file KDChartLayoutItems.h.

63 {
64 mParentLayout = lay;
65 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.60 KDChart::VerticalLineLayoutItem Class Reference 687

6.60.2.11 void KDChart::AbstractLayoutItem::setParentWidget (QWidget ∗ widget)


[virtual, inherited]

Inform the item about its widget: This enables the item, to trigger that widget’s update, whenever the size
of the item’s contents has changed.
Thus, you need to call setParentWidget on every item, that has a non-fixed size.
Definition at line 56 of file KDChartLayoutItems.cpp.
References KDChart::AbstractLayoutItem::mParent.
Referenced by KDChart::Legend::buildLegend(), and KDChart::AbstractCartesianDiagram::takeAxis().

57 {
58 mParent = widget;
59 }

6.60.2.12 QSize KDChart::VerticalLineLayoutItem::sizeHint () const [virtual]

Definition at line 497 of file KDChartLayoutItems.cpp.

498 {
499 return QSize( 3, -1 ); // see qframe.cpp
500 }

6.60.2.13 void KDChart::AbstractLayoutItem::sizeHintChanged () const [virtual,


inherited]

Report changed size hint: ask the parent widget to recalculate the layout.
Definition at line 73 of file KDChartLayoutItems.cpp.
Referenced by KDChart::TextLayoutItem::sizeHint().

74 {
75 // This is exactly like what QWidget::updateGeometry does.
76 // qDebug("KDChart::AbstractLayoutItem::sizeHintChanged() called");
77 if( mParent ) {
78 if ( mParent->layout() )
79 mParent->layout()->invalidate();
80 else
81 QApplication::postEvent( mParent, new QEvent( QEvent::LayoutRequest ) );
82 }
83 }

6.60.3 Member Data Documentation

6.60.3.1 QWidget∗ KDChart::AbstractLayoutItem::mParent [protected, inherited]

Definition at line 76 of file KDChartLayoutItems.h.


Referenced by KDChart::AbstractLayoutItem::setParentWidget().

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


688 KD Chart 2 Class Documentation

6.60.3.2 QLayout∗ KDChart::AbstractLayoutItem::mParentLayout [protected,


inherited]

Definition at line 77 of file KDChartLayoutItems.h.


The documentation for this class was generated from the following files:

• KDChartLayoutItems.h
• KDChartLayoutItems.cpp

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.61 KDChart::Widget Class Reference 689

6.61 KDChart::Widget Class Reference


#include <KDChartWidget.h>
Inheritance diagram for KDChart::Widget:Collaboration diagram for KDChart::Widget:

6.61.1 Detailed Description

The KD Chart widget for usage without Model/View.


If you want to use KD Chart with Model/View, use KDChart::Chart instead.
Definition at line 63 of file KDChartWidget.h.

Public Types
• enum ChartType {
NoType,
Bar,
Line,
Pie,
Ring,
Polar }
• enum SubType {
Normal,
Stacked,
Percent,
Rows }
Sub type values, matching the values defines for the respective Diagram classes.

Public Member Functions


• void addHeaderFooter (HeaderFooter ∗header)
Adds an existing header / footer object.

• void addHeaderFooter (const QString &text, HeaderFooter::HeaderFooterType type, Position posi-


tion)
Adds a new header/footer with the given text to the position.

• void addLegend (Legend ∗legend)


Adds a new, already existing, legend.

• void addLegend (Position position)


Adds an empty legend on the given position.

• QList< HeaderFooter ∗ > allHeadersFooters ()


Returns a list with all headers.

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


690 KD Chart 2 Class Documentation

• QList< Legend ∗ > allLegends ()


Returns a list with all legends.

• BarDiagram ∗ barDiagram ()
If the current diagram is a BarDiagram, it is returnd; otherwise 0 is returned.

• AbstractCoordinatePlane ∗ coordinatePlane ()
Returns a pointer to the current coordinate plane.

• AbstractDiagram ∗ diagram ()
Returns a pointer to the current diagram.

• HeaderFooter ∗ firstHeaderFooter ()
Returns the first of all headers.

• int globalLeadingBottom () const


Returns the bottom leading (border).

• int globalLeadingLeft () const


Returns the left leading (border).

• int globalLeadingRight () const


Returns the right leading (border).

• int globalLeadingTop () const


Returns the top leading (border).

• Legend ∗ legend ()
Returns the first of all legends.

• LineDiagram ∗ lineDiagram ()
If the current diagram is a LineDiagram, it is returnd; otherwise 0 is returned.

• PieDiagram ∗ pieDiagram ()
If the current diagram is a PieDiagram, it is returnd; otherwise 0 is returned.

• PolarDiagram ∗ polarDiagram ()
If the current diagram is a PolarDiagram, it is returnd; otherwise 0 is returned.

• void replaceHeaderFooter (HeaderFooter ∗header, HeaderFooter ∗oldHeader=0)


Replaces the old header (or footer, resp.), or appends the new header or footer, it there is none yet.

• void replaceLegend (Legend ∗legend, Legend ∗oldLegend=0)


• void resetData ()
Resets all data.

• RingDiagram ∗ ringDiagram ()
If the current diagram is a RingDiagram, it is returnd; otherwise 0 is returned.

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.61 KDChart::Widget Class Reference 691

• void setDataset (int column, const QVector< QPair< double, double > > &data, const QString
&title=QString())
Sets the data in the given column using a QVector of QPairs of double.

• void setDataset (int column, const QVector< double > &data, const QString &title=QString())
Sets the data in the given column using a QVector of double.

• void setGlobalLeadingBottom (int leading)


Sets the bottom leading (border).

• void setGlobalLeadingLeft (int leading)


Sets the left leading (border).

• void setGlobalLeadingRight (int leading)


Sets the right leading (border).

• void setGlobalLeadingTop (int leading)


Sets the top leading (border).

• void setSubType (SubType subType)


Sets the type of the chart without changing the main type.

• SubType subType () const


Returns the sub-type of the chart.

• void takeHeaderFooter (HeaderFooter ∗header)


Remove the header (or footer, resp.) from the widget, without deleting it.

• void takeLegend (Legend ∗legend)


• ChartType type () const
Returns the type of the chart.

• Widget (QWidget ∗parent=0)


Standard Qt-style Constructor.

• ∼Widget ()
Destructor.

Public Attributes

• public int int int bottom


• public Q_SLOTS: void setGlobalLeading( int left
• public int int right
• public SubType subType = Normal )
• public int top

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


692 KD Chart 2 Class Documentation

6.61.2 Member Enumeration Documentation

6.61.2.1 enum KDChart::Widget::ChartType

Enumeration values:
NoType
Bar
Line
Pie
Ring
Polar

Definition at line 199 of file KDChartWidget.h.

199 { NoType, Bar, Line, Pie, Ring, Polar };

6.61.2.2 enum KDChart::Widget::SubType

Sub type values, matching the values defines for the respective Diagram classes.

Enumeration values:
Normal
Stacked
Percent
Rows

Definition at line 205 of file KDChartWidget.h.

205 { Normal, Stacked, Percent, Rows };

6.61.3 Constructor & Destructor Documentation

6.61.3.1 Widget::Widget (QWidget ∗ parent = 0) [explicit]

Standard Qt-style Constructor.


Creates a new widget with all data initialized empty.

Parameters:
parent the widget parent; passed on to QWidget

Definition at line 82 of file KDChartWidget.cpp.


References Line.

82 :
83 QWidget(parent), _d( new Private( this ) )
84 {
85 // as default we have a cartesian coordinate plane ...
86 // ... and a line diagram
87 setType( Line );
88 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.61 KDChart::Widget Class Reference 693

6.61.3.2 Widget::∼Widget ()

Destructor.
Definition at line 93 of file KDChartWidget.cpp.

94 {
95 delete _d; _d = 0;
96 }

6.61.4 Member Function Documentation

6.61.4.1 void Widget::addHeaderFooter (HeaderFooter ∗ header)

Adds an existing header / footer object.

See also:
replaceHeaderFooter, takeHeaderFooter

Definition at line 262 of file KDChartWidget.cpp.


References d, and KDChart::HeaderFooter::setParent().

263 {
264 header->setParent( &d->m_chart );
265 d->m_chart.addHeaderFooter( header ); // we need this explicit call !
266 }

6.61.4.2 void Widget::addHeaderFooter (const QString & text, HeaderFooter::HeaderFooterType


type, Position position)

Adds a new header/footer with the given text to the position.


Definition at line 248 of file KDChartWidget.cpp.
References d, KDChart::HeaderFooter::setPosition(), KDChart::TextLayoutItem::setText(), and
KDChart::HeaderFooter::setType().

251 {
252 HeaderFooter* newHeader = new HeaderFooter( &d->m_chart );
253 newHeader->setType( type );
254 newHeader->setPosition( position );
255 newHeader->setText( text );
256 d->m_chart.addHeaderFooter( newHeader ); // we need this explicit call !
257 }

6.61.4.3 void Widget::addLegend (Legend ∗ legend)

Adds a new, already existing, legend.


Definition at line 308 of file KDChartWidget.cpp.
References d, diagram(), and KDChart::Legend::setDiagram().

309 {
310 legend->setDiagram( diagram() );
311 legend->setParent( &d->m_chart );
312 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


694 KD Chart 2 Class Documentation

6.61.4.4 void Widget::addLegend (Position position)

Adds an empty legend on the given position.


Definition at line 298 of file KDChartWidget.cpp.
References d, diagram(), and KDChart::Legend::setPosition().

299 {
300 Legend* legend = new Legend( diagram(), &d->m_chart );
301 legend->setPosition( position );
302 d->m_chart.addLegend( legend );
303 }

6.61.4.5 QList< KDChart::HeaderFooter ∗ > Widget::allHeadersFooters ()

Returns a list with all headers.


Definition at line 240 of file KDChartWidget.cpp.
References d.

241 {
242 return d->m_chart.headerFooters();
243 }

6.61.4.6 QList< KDChart::Legend ∗ > Widget::allLegends ()

Returns a list with all legends.


Definition at line 290 of file KDChartWidget.cpp.
References d.

291 {
292 return d->m_chart.legends();
293 }

6.61.4.7 BarDiagram ∗ Widget::barDiagram ()

If the current diagram is a BarDiagram, it is returnd; otherwise 0 is returned.


This function provides type-safe casting.
Definition at line 334 of file KDChartWidget.cpp.
References diagram().

335 {
336 return dynamic_cast<BarDiagram*>( diagram() );
337 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.61 KDChart::Widget Class Reference 695

6.61.4.8 AbstractCoordinatePlane ∗ Widget::coordinatePlane ()

Returns a pointer to the current coordinate plane.


Definition at line 355 of file KDChartWidget.cpp.
References d.
Referenced by diagram().

356 {
357 return d->m_chart.coordinatePlane();
358 }

6.61.4.9 AbstractDiagram ∗ Widget::diagram ()

Returns a pointer to the current diagram.


Definition at line 326 of file KDChartWidget.cpp.
References coordinatePlane(), and KDChart::AbstractCoordinatePlane::diagram().
Referenced by addLegend(), barDiagram(), lineDiagram(), pieDiagram(), polarDiagram(), replace-
Legend(), ringDiagram(), and setSubType().

327 {
328 if ( coordinatePlane() == 0 )
329 qDebug() << "diagram(): coordinatePlane() was NULL";
330
331 return coordinatePlane()->diagram();
332 }

6.61.4.10 KDChart::HeaderFooter ∗ Widget::firstHeaderFooter ()

Returns the first of all headers.


Definition at line 232 of file KDChartWidget.cpp.
References d.

233 {
234 return d->m_chart.headerFooter();
235 }

6.61.4.11 int Widget::globalLeadingBottom () const

Returns the bottom leading (border).


Definition at line 224 of file KDChartWidget.cpp.
References d.

225 {
226 return d->m_chart.globalLeadingBottom();
227 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


696 KD Chart 2 Class Documentation

6.61.4.12 int Widget::globalLeadingLeft () const

Returns the left leading (border).


Definition at line 176 of file KDChartWidget.cpp.
References d.

177 {
178 return d->m_chart.globalLeadingLeft();
179 }

6.61.4.13 int Widget::globalLeadingRight () const

Returns the right leading (border).


Definition at line 208 of file KDChartWidget.cpp.
References d.

209 {
210 return d->m_chart.globalLeadingRight();
211 }

6.61.4.14 int Widget::globalLeadingTop () const

Returns the top leading (border).


Definition at line 192 of file KDChartWidget.cpp.
References d.

193 {
194 return d->m_chart.globalLeadingTop();
195 }

6.61.4.15 KDChart::Legend ∗ Widget::legend ()

Returns the first of all legends.


Definition at line 282 of file KDChartWidget.cpp.
References d.

283 {
284 return d->m_chart.legend();
285 }

6.61.4.16 LineDiagram ∗ Widget::lineDiagram ()

If the current diagram is a LineDiagram, it is returnd; otherwise 0 is returned.


This function provides type-safe casting.
Definition at line 338 of file KDChartWidget.cpp.
References diagram().

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.61 KDChart::Widget Class Reference 697

339 {
340 return dynamic_cast<LineDiagram*>( diagram() );
341 }

6.61.4.17 PieDiagram ∗ Widget::pieDiagram ()

If the current diagram is a PieDiagram, it is returnd; otherwise 0 is returned.


This function provides type-safe casting.
Definition at line 342 of file KDChartWidget.cpp.
References diagram().

343 {
344 return dynamic_cast<PieDiagram*>( diagram() );
345 }

6.61.4.18 PolarDiagram ∗ Widget::polarDiagram ()

If the current diagram is a PolarDiagram, it is returnd; otherwise 0 is returned.


This function provides type-safe casting.
Definition at line 350 of file KDChartWidget.cpp.
References diagram().

351 {
352 return dynamic_cast<PolarDiagram*>( diagram() );
353 }

6.61.4.19 void Widget::replaceHeaderFooter (HeaderFooter ∗ header, HeaderFooter ∗ oldHeader


= 0)

Replaces the old header (or footer, resp.), or appends the new header or footer, it there is none yet.

Parameters:
headerFooter The header or footer to be used instead of the old one. This parameter must not be zero,
or the method will do nothing.
oldHeaderFooter The header or footer to be removed by the new one. This header or footer will be
deleted automatically. If the parameter is omitted, the very first header or footer will be replaced.
In case, there was no header and no footer yet, the new header or footer will just be added.

Note:
If you want to re-use the old header or footer, call takeHeaderFooter and addHeaderFooter, instead of
using replaceHeaderFooter.

See also:
addHeaderFooter, takeHeaderFooter

Definition at line 268 of file KDChartWidget.cpp.


References d, and KDChart::HeaderFooter::setParent().

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


698 KD Chart 2 Class Documentation

269 {
270 header->setParent( &d->m_chart );
271 d->m_chart.replaceHeaderFooter( header, oldHeader );
272 }

6.61.4.20 void Widget::replaceLegend (Legend ∗ legend, Legend ∗ oldLegend = 0)

Definition at line 314 of file KDChartWidget.cpp.


References d, diagram(), and KDChart::Legend::setDiagram().

315 {
316 legend->setDiagram( diagram() );
317 legend->setParent( &d->m_chart );
318 d->m_chart.replaceLegend( legend, oldLegend );
319 }

6.61.4.21 void Widget::resetData ()

Resets all data.


Definition at line 151 of file KDChartWidget.cpp.
References d.

152 {
153 d->m_model.clear();
154 d->usedDatasetWidth = 0;
155 }

6.61.4.22 RingDiagram ∗ Widget::ringDiagram ()

If the current diagram is a RingDiagram, it is returnd; otherwise 0 is returned.


This function provides type-safe casting.
Definition at line 346 of file KDChartWidget.cpp.
References diagram().

347 {
348 return dynamic_cast<RingDiagram*>( diagram() );
349 }

6.61.4.23 void Widget::setDataset (int column, const QVector< QPair< double, double > > &
data, const QString & title = QString())

Sets the data in the given column using a QVector of QPairs of double.
Definition at line 127 of file KDChartWidget.cpp.
References d.

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.61 KDChart::Widget Class Reference 699

128 {
129 if ( ! checkDatasetWidth( 2 ))
130 return;
131
132 QStandardItemModel & model = d->m_model;
133
134 justifyModelSize( data.size(), (column + 1) * 2 );
135
136 for( int i = 0; i < data.size(); ++i )
137 {
138 QModelIndex index = model.index( i, column * 2 );
139 model.setData( index, QVariant( data[i].first ), Qt::DisplayRole );
140
141 index = model.index( i, column * 2 + 1 );
142 model.setData( index, QVariant( data[i].second ), Qt::DisplayRole );
143 }
144 if ( ! title.isEmpty() )
145 model.setHeaderData( column * 2, Qt::Horizontal, QVariant( title ) );
146 }

6.61.4.24 void Widget::setDataset (int column, const QVector< double > & data, const QString &
title = QString())

Sets the data in the given column using a QVector of double.


Definition at line 105 of file KDChartWidget.cpp.
References d.

106 {
107 if ( ! checkDatasetWidth( 1 ) )
108 return;
109
110 QStandardItemModel & model = d->m_model;
111
112 justifyModelSize( data.size(), column + 1 );
113
114 for( int i = 0; i < data.size(); ++i )
115 {
116 const QModelIndex index = model.index( i, column );
117 model.setData( index, QVariant( data[i] ), Qt::DisplayRole );
118 }
119 if ( ! title.isEmpty() )
120 model.setHeaderData( column, Qt::Horizontal, QVariant( title ) );
121 }

6.61.4.25 void Widget::setGlobalLeadingBottom (int leading)

Sets the bottom leading (border).


Definition at line 216 of file KDChartWidget.cpp.
References d.

217 {
218 d->m_chart.setGlobalLeadingBottom( leading );
219 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


700 KD Chart 2 Class Documentation

6.61.4.26 void Widget::setGlobalLeadingLeft (int leading)

Sets the left leading (border).


Definition at line 168 of file KDChartWidget.cpp.
References d.

169 {
170 d->m_chart.setGlobalLeadingLeft( leading );
171 }

6.61.4.27 void Widget::setGlobalLeadingRight (int leading)

Sets the right leading (border).


Definition at line 200 of file KDChartWidget.cpp.
References d.

201 {
202 d->m_chart.setGlobalLeadingRight( leading );
203 }

6.61.4.28 void Widget::setGlobalLeadingTop (int leading)

Sets the top leading (border).


Definition at line 184 of file KDChartWidget.cpp.
References d.

185 {
186 d->m_chart.setGlobalLeadingTop( leading );
187 }

6.61.4.29 void Widget::setSubType (SubType subType)

Sets the type of the chart without changing the main type.
Make sure to use a sub-type that matches the main type, so e.g. setting sub-type Rows makes sense for Bar
charts only, and it will be ignored for all other chart types.

See also:
KDChartBarDiagram::BarType, KDChartLineDiagram::LineType
KDChartPieDiagram::PieType, KDChartRingDiagram::RingType
KDChartPolarDiagram::PolarType

Definition at line 435 of file KDChartWidget.cpp.


References diagram(), and SET_SUB_TYPE.

436 {
437 BarDiagram* barDia = qobject_cast< BarDiagram* >( diagram() );

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.61 KDChart::Widget Class Reference 701

438 LineDiagram* lineDia = qobject_cast< LineDiagram* >( diagram() );


439
440 //FIXME(khz): Add the impl for these chart types - or remove them from here:
441 // PieDiagram* pieDia = qobject_cast< PieDiagram* >( diagram() );
442 // PolarDiagram* polarDia = qobject_cast< PolarDiagram* >( diagram() );
443 // RingDiagram* ringDia = qobject_cast< RingDiagram* >( diagram() );
444
445 #define SET_SUB_TYPE(DIAGRAM, SUBTYPE) \
446 { \
447 if( DIAGRAM ) \
448 DIAGRAM->setType( SUBTYPE ); \
449 }
450 switch ( subType )
451 {
452 case Normal:
453 SET_SUB_TYPE( barDia, BarDiagram::Normal );
454 SET_SUB_TYPE( lineDia, LineDiagram::Normal );
455 break;
456 case Stacked:
457 SET_SUB_TYPE( barDia, BarDiagram::Stacked );
458 SET_SUB_TYPE( lineDia, LineDiagram::Stacked );
459 break;
460 case Percent:
461 SET_SUB_TYPE( barDia, BarDiagram::Percent );
462 SET_SUB_TYPE( lineDia, LineDiagram::Percent );
463 break;
464 case Rows:
465 SET_SUB_TYPE( barDia, BarDiagram::Rows );
466 break;
467 default:
468 Q_ASSERT_X ( false,
469 "Widget::setSubType", "Sub-type not supported!" );
470 break;
471 }
472 // coordinatePlane()->show();
473 }

6.61.4.30 SubType KDChart::Widget::subType () const

Returns the sub-type of the chart.

6.61.4.31 void Widget::takeHeaderFooter (HeaderFooter ∗ header)

Remove the header (or footer, resp.) from the widget, without deleting it.
The chart no longer owns the header or footer, so it is the caller’s responsibility to delete the header or
footer.

See also:
addHeaderFooter, replaceHeaderFooter

Definition at line 274 of file KDChartWidget.cpp.


References d.

275 {
276 d->m_chart.takeHeaderFooter( header );
277 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


702 KD Chart 2 Class Documentation

6.61.4.32 void Widget::takeLegend (Legend ∗ legend)

Definition at line 321 of file KDChartWidget.cpp.


References d.

322 {
323 d->m_chart.takeLegend( legend );
324 }

6.61.4.33 Widget::ChartType Widget::type () const

Returns the type of the chart.


Definition at line 478 of file KDChartWidget.cpp.
References Bar, Line, NoType, Pie, Polar, and Ring.

479 {
480 // PENDING(christoph) save the type out-of-band:
481 AbstractDiagram * const dia = const_cast<Widget*>( this )->diagram();
482 if ( qobject_cast< BarDiagram* >( dia ) )
483 return Bar;
484 else if ( qobject_cast< LineDiagram* >( dia ) )
485 return Line;
486 else if( qobject_cast< PieDiagram* >( dia ) )
487 return Pie;
488 else if( qobject_cast< PolarDiagram* >( dia ) )
489 return Polar;
490 else if( qobject_cast< RingDiagram* >( dia ) )
491 return Ring;
492 else
493 return NoType;
494 }

6.61.5 Member Data Documentation

6.61.5.1 public int int int KDChart::Widget::bottom

Definition at line 92 of file KDChartWidget.h.

6.61.5.2 public KDChart::Widget::Q_SLOTS

Definition at line 212 of file KDChartWidget.h.

6.61.5.3 public int int KDChart::Widget::right

Definition at line 92 of file KDChartWidget.h.

6.61.5.4 Widget::SubType Widget::subType = Normal )

Definition at line 496 of file KDChartWidget.cpp.

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.61 KDChart::Widget Class Reference 703

497 {
498 // PENDING(christoph) save the type out-of-band:
499 Widget::SubType retVal = Normal;
500
501 AbstractDiagram * const dia = const_cast<Widget*>( this )->diagram();
502 BarDiagram* barDia = qobject_cast< BarDiagram* >( dia );
503 LineDiagram* lineDia = qobject_cast< LineDiagram* >( dia );
504
505 //FIXME(khz): Add the impl for these chart types - or remove them from here:
506 // PieDiagram* pieDia = qobject_cast< PieDiagram* >( diagram() );
507 // PolarDiagram* polarDia = qobject_cast< PolarDiagram* >( diagram() );
508 // RingDiagram* ringDia = qobject_cast< RingDiagram* >( diagram() );
509
510 #define TEST_SUB_TYPE(DIAGRAM, INTERNALSUBTYPE, SUBTYPE) \
511 { \
512 if( DIAGRAM && DIAGRAM->type() == INTERNALSUBTYPE ) \
513 retVal = SUBTYPE; \
514 }
515 const Widget::ChartType mainType = type();
516 switch ( mainType )
517 {
518 case Bar:
519 TEST_SUB_TYPE( barDia, BarDiagram::Normal, Normal );
520 TEST_SUB_TYPE( barDia, BarDiagram::Stacked, Stacked );
521 TEST_SUB_TYPE( barDia, BarDiagram::Percent, Percent );
522 TEST_SUB_TYPE( barDia, BarDiagram::Rows, Rows );
523 break;
524 case Line:
525 TEST_SUB_TYPE( lineDia, LineDiagram::Normal, Normal );
526 TEST_SUB_TYPE( lineDia, LineDiagram::Stacked, Stacked );
527 TEST_SUB_TYPE( lineDia, LineDiagram::Percent, Percent );
528 break;
529 case Pie:
530 // no impl. yet
531 break;
532 case Polar:
533 // no impl. yet
534 break;
535 case Ring:
536 // no impl. yet
537 break;
538 default:
539 Q_ASSERT_X ( false,
540 "Widget::subType", "Chart type not supported!" );
541 break;
542 }
543 return retVal;
544 }

6.61.5.5 public int KDChart::Widget::top

Definition at line 92 of file KDChartWidget.h.


The documentation for this class was generated from the following files:

• KDChartWidget.h
• KDChartWidget.cpp

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


704 KD Chart 2 Class Documentation

6.62 KDChart::ZoomParameters Class Reference


#include <KDChartZoomParameters.h>
Collaboration diagram for KDChart::ZoomParameters:

Public Member Functions


• ZoomParameters ()

Public Attributes
• double xCenter
• double xFactor
• double yCenter
• double yFactor

6.62.1 Constructor & Destructor Documentation

6.62.1.1 KDChart::ZoomParameters::ZoomParameters ()

Definition at line 7 of file KDChartZoomParameters.h.


References xCenter, xFactor, yCenter, and yFactor.

8 : xFactor( 1.0 ),
9 yFactor( 1.0 ),
10 xCenter( 0.5 ),
11 yCenter( 0.5)
12 {
13 }

6.62.2 Member Data Documentation

6.62.2.1 double KDChart::ZoomParameters::xCenter

Definition at line 18 of file KDChartZoomParameters.h.


Referenced by ZoomParameters().

6.62.2.2 double KDChart::ZoomParameters::xFactor

Definition at line 15 of file KDChartZoomParameters.h.


Referenced by ZoomParameters().

6.62.2.3 double KDChart::ZoomParameters::yCenter

Definition at line 19 of file KDChartZoomParameters.h.


Referenced by ZoomParameters().

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


6.62 KDChart::ZoomParameters Class Reference 705

6.62.2.4 double KDChart::ZoomParameters::yFactor

Definition at line 16 of file KDChartZoomParameters.h.


Referenced by ZoomParameters().
The documentation for this class was generated from the following file:

• KDChartZoomParameters.h

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


706 KD Chart 2 Class Documentation

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


Chapter 7

KD Chart 2 File Documentation

7.1 KDChartAbstractArea.cpp File Reference


#include "KDChartAbstractArea.h"
#include "KDChartAbstractArea_p.h"
#include <qglobal.h>
#include <QPainter>
#include <QRect>
#include <KDABLibFakes>
Include dependency graph for KDChartAbstractArea.cpp:
708 KD Chart 2 File Documentation

7.2 KDChartAbstractArea.h File Reference


#include <QObject>
#include "KDChartGlobal.h"
#include "KDChartAbstractAreaBase.h"
#include "KDChartLayoutItems.h"
Include dependency graph for KDChartAbstractArea.h:
This graph shows which files directly or indirectly include this file:

Namespaces
• namespace KDChart

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


7.3 KDChartAbstractAreaBase.cpp File Reference 709

7.3 KDChartAbstractAreaBase.cpp File Reference


#include "KDChartAbstractAreaBase.h"
#include "KDChartAbstractAreaBase_p.h"
#include <KDChartBackgroundAttributes.h>
#include <KDChartFrameAttributes.h>
#include <KDChartTextAttributes.h>
#include "KDChartPainterSaver_p.h"
#include <QPainter>
#include <KDABLibFakes>
Include dependency graph for KDChartAbstractAreaBase.cpp:

Defines
• #define attributes d → frameAttributes
• #define attributes d → backgroundAttributes
• #define d d_func()

7.3.1 Define Documentation

7.3.1.1 #define attributes d → frameAttributes

7.3.1.2 #define attributes d → backgroundAttributes

Referenced by KDChart::AbstractAreaBase::paintBackground(), KDChart::AbstractAreaBase::paint-


Frame(), and KDChart::TextLayoutItem::TextLayoutItem().

7.3.1.3 #define d d_func()

Definition at line 73 of file KDChartAbstractAreaBase.cpp.


Referenced by KDChart::AbstractCoordinatePlane::AbstractCoordinatePlane(), KDChart::Abstract-
ThreeDAttributes::AbstractThreeDAttributes(), KDChart::AbstractCartesianDiagram::addAxis(),
KDChart::Chart::addCoordinatePlane(), KDChart::Legend::addDiagram(), KDChart::Abstract-
CoordinatePlane::addDiagram(), KDChart::Widget::addHeaderFooter(), KDChart::Chart::add-
HeaderFooter(), KDChart::Widget::addLegend(), KDChart::Chart::addLegend(), KD-
Chart::Legend::alignment(), KDChart::Widget::allHeadersFooters(), KDChart::Widget::all-
Legends(), KDChart::AbstractDiagram::allowOverlappingDataValueTexts(), KDChart::ThreeDBar-
Attributes::angle(), KDChart::PolarCoordinatePlane::angleUnit(), KDChart::AbstractDiagram::anti-
Aliasing(), KDChart::AbstractDiagram::attributesModel(), KDChart::AbstractDiagram::attributes-
ModelRootIndex(), KDChart::AbstractCartesianDiagram::axes(), KDChart::CartesianCoordinate-
Plane::axesCalcModeX(), KDChart::CartesianCoordinatePlane::axesCalcModeY(), KDChart::Abstract-
AreaBase::backgroundAttributes(), KDChart::BarDiagram::barAttributes(), KDChart::Legend::brush(),
KDChart::Legend::buildLegend(), KDChart::LineDiagram::calculateDataBoundaries(), KDChart::Bar-
Diagram::calculateDataBoundaries(), KDChart::CartesianCoordinatePlane::calculateRawData-
BoundingRect(), KDChart::RingDiagram::clone(), KDChart::PolarDiagram::clone(), KDChart::Pie-
Diagram::clone(), KDChart::LineDiagram::clone(), KDChart::Legend::clone(), KDChart::Header-
Footer::clone(), KDChart::BarDiagram::clone(), KDChart::AbstractAxis::connectSignals(),

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


710 KD Chart 2 File Documentation

KDChart::Widget::coordinatePlane(), KDChart::Chart::coordinatePlane(), KDChart::Abstract-


Diagram::coordinatePlane(), KDChart::AbstractAxis::coordinatePlane(), KDChart::Chart::coordinate-
Planes(), KDChart::AbstractAxis::createObserver(), KDChart::AbstractDiagram::dataBoundaries(),
KDChart::AbstractDiagram::dataChanged(), KDChart::Legend::datasetCount(), KDChart::Abstract-
Diagram::datasetDimension(), KDChart::AbstractAxis::deleteObserver(), KDChart::Abstract-
ThreeDAttributes::depth(), KDChart::Legend::diagram(), KDChart::AbstractCoordinate-
Plane::diagram(), KDChart::AbstractAxis::diagram(), KDChart::Legend::diagrams(), KDChart::Abstract-
CoordinatePlane::diagrams(), KDChart::CartesianCoordinatePlane::doesIsometricScaling(),
KDChart::AbstractDiagram::doItemsLayout(), KDChart::PieAttributes::explode(), KDChart::Pie-
Attributes::explodeFactor(), KDChart::Widget::firstHeaderFooter(), KDChart::AbstractAreaBase::frame-
Attributes(), KDChart::CartesianAxis::geometry(), KDChart::AbstractCoordinatePlane::geometry(),
KDChart::AbstractCoordinatePlane::globalGridAttributes(), KDChart::Widget::globalLeading-
Bottom(), KDChart::Chart::globalLeadingBottom(), KDChart::Widget::globalLeadingLeft(),
KDChart::Chart::globalLeadingLeft(), KDChart::Widget::globalLeadingRight(), KDChart::Chart::global-
LeadingRight(), KDChart::Widget::globalLeadingTop(), KDChart::Chart::globalLeadingTop(),
KDChart::AbstractPieDiagram::granularity(), KDChart::PolarCoordinatePlane::gridAttributes(),
KDChart::CartesianCoordinatePlane::gridAttributes(), KDChart::AbstractCoordinatePlane::grid-
DimensionsList(), KDChart::CartesianAxis::hasDefaultTitleTextAttributes(), KDChart::PolarCoordinate-
Plane::hasOwnGridAttributes(), KDChart::CartesianCoordinatePlane::hasOwnGridAttributes(),
KDChart::Chart::headerFooter(), KDChart::Chart::headerFooters(), KDChart::CartesianCoordinate-
Plane::horizontalRange(), KDChart::AbstractAreaBase::innerRect(), KDChart::AbstractThree-
DAttributes::isEnabled(), KDChart::AbstractAxis::labels(), KDChart::PolarCoordinatePlane::layout-
Diagrams(), KDChart::CartesianCoordinatePlane::layoutDiagrams(), KDChart::CartesianAxis::layout-
Planes(), KDChart::Widget::legend(), KDChart::Legend::Legend(), KDChart::Chart::legend(), KD-
Chart::Chart::legends(), KDChart::LineDiagram::lineAttributes(), KDChart::ThreeDLineAttributes::line-
XRotation(), KDChart::ThreeDLineAttributes::lineYRotation(), KDChart::Legend::marker-
Attributes(), KDChart::CartesianAxis::maximumSize(), KDChart::AbstractCoordinatePlane::maximum-
Size(), KDChart::LineDiagram::numberOfAbscissaSegments(), KDChart::BarDiagram::number-
OfAbscissaSegments(), KDChart::LineDiagram::numberOfOrdinateSegments(), KDChart::Bar-
Diagram::numberOfOrdinateSegments(), KDChart::AbstractAxis::observedBy(), KDChart::Three-
DPieAttributes::operator=(), KDChart::ThreeDLineAttributes::operator=(), KDChart::Three-
DBarAttributes::operator=(), KDChart::PieAttributes::operator=(), KDChart::AbstractThree-
DAttributes::operator=(), KDChart::Legend::orientation(), KDChart::PolarCoordinatePlane::paint(),
KDChart::PieDiagram::paint(), KDChart::LineDiagram::paint(), KDChart::Legend::paint(),
KDChart::Chart::paint(), KDChart::CartesianCoordinatePlane::paint(), KDChart::Cartesian-
Axis::paint(), KDChart::BarDiagram::paint(), KDChart::AbstractAreaBase::paintBackground(),
KDChart::CartesianAxis::paintCtx(), KDChart::AbstractAreaBase::paintFrame(), KDChart::Abstract-
CoordinatePlane::parent(), KDChart::Legend::pen(), KDChart::AbstractDiagram::percentMode(),
KDChart::PieAttributes::PieAttributes(), KDChart::AbstractPieDiagram::pieAttributes(), KD-
Chart::Legend::position(), KDChart::HeaderFooter::position(), KDChart::CartesianAxis::position(),
KDChart::Legend::referenceArea(), KDChart::AbstractCoordinatePlane::referenceCoordinate-
Plane(), KDChart::AbstractCartesianDiagram::referenceDiagram(), KDChart::Abstract-
CartesianDiagram::referenceDiagramOffset(), KDChart::RingDiagram::relativeThickness(),
KDChart::Legend::removeDiagram(), KDChart::Legend::removeDiagrams(), KDChart::Chart::replace-
CoordinatePlane(), KDChart::Legend::replaceDiagram(), KDChart::AbstractCoordinatePlane::replace-
Diagram(), KDChart::Widget::replaceHeaderFooter(), KDChart::Chart::replaceHeaderFooter(),
KDChart::Widget::replaceLegend(), KDChart::Chart::replaceLegend(), KDChart::Widget::resetData(),
KDChart::Legend::resetTexts(), KDChart::CartesianAxis::resetTitleTextAttributes(), KDChart::Polar-
CoordinatePlane::resizeEvent(), KDChart::Chart::resizeEvent(), KDChart::PolarDiagram::rotate-
CircularLabels(), KDChart::Legend::setAlignment(), KDChart::AbstractDiagram::setAllowOverlapping-
DataValueTexts(), KDChart::ThreeDBarAttributes::setAngle(), KDChart::AbstractDiagram::setAnti-
Aliasing(), KDChart::AbstractDiagram::setAttributesModel(), KDChart::AbstractDiagram::setAttributes-
ModelRootIndex(), KDChart::CartesianCoordinatePlane::setAxesCalcModes(), KDChart::Cartesian-
CoordinatePlane::setAxesCalcModeX(), KDChart::CartesianCoordinatePlane::setAxesCalcModeY(),

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


7.3 KDChartAbstractAreaBase.cpp File Reference 711

KDChart::AbstractAreaBase::setBackgroundAttributes(), KDChart::BarDiagram::setBarAttributes(),
KDChart::Legend::setBrush(), KDChart::Legend::setBrushesFromDiagram(), KDChart::Legend::set-
Color(), KDChart::AbstractDiagram::setCoordinatePlane(), KDChart::AbstractDiagram::set-
DataBoundariesDirty(), KDChart::Widget::setDataset(), KDChart::AbstractDiagram::setDataset-
Dimension(), KDChart::AbstractDiagram::setDataValueAttributes(), KDChart::AbstractThree-
DAttributes::setDepth(), KDChart::AbstractThreeDAttributes::setEnabled(), KDChart::PieAttributes::set-
Explode(), KDChart::PieAttributes::setExplodeFactor(), KDChart::AbstractAreaBase::setFrame-
Attributes(), KDChart::CartesianAxis::setGeometry(), KDChart::AbstractCoordinatePlane::set-
Geometry(), KDChart::AbstractCoordinatePlane::setGlobalGridAttributes(), KDChart::Chart::set-
GlobalLeading(), KDChart::Widget::setGlobalLeadingBottom(), KDChart::Chart::setGlobal-
LeadingBottom(), KDChart::Widget::setGlobalLeadingLeft(), KDChart::Chart::setGlobalLeading-
Left(), KDChart::Widget::setGlobalLeadingRight(), KDChart::Chart::setGlobalLeadingRight(),
KDChart::Widget::setGlobalLeadingTop(), KDChart::Chart::setGlobalLeadingTop(), KDChart::Abstract-
PieDiagram::setGranularity(), KDChart::PolarCoordinatePlane::setGridAttributes(), KDChart::Cartesian-
CoordinatePlane::setGridAttributes(), KDChart::CartesianCoordinatePlane::setHorizontalRange(),
KDChart::CartesianCoordinatePlane::setIsometricScaling(), KDChart::AbstractAxis::setLabels(),
KDChart::LineDiagram::setLineAttributes(), KDChart::ThreeDLineAttributes::setLineXRotation(),
KDChart::ThreeDLineAttributes::setLineYRotation(), KDChart::Legend::setMarkerAttributes(),
KDChart::AbstractDiagram::setModel(), KDChart::Legend::setNeedRebuild(), KDChart::Legend::set-
Orientation(), KDChart::AbstractCoordinatePlane::setParent(), KDChart::Legend::setPen(),
KDChart::AbstractDiagram::setPercentMode(), KDChart::AbstractPieDiagram::setPieAttributes(),
KDChart::Legend::setPosition(), KDChart::HeaderFooter::setPosition(), KDChart::CartesianAxis::set-
Position(), KDChart::Legend::setReferenceArea(), KDChart::AbstractCoordinatePlane::setReference-
CoordinatePlane(), KDChart::AbstractCartesianDiagram::setReferenceDiagram(), KDChart::Ring-
Diagram::setRelativeThickness(), KDChart::AbstractDiagram::setRootIndex(), KDChart::Polar-
Diagram::setRotateCircularLabels(), KDChart::AbstractAxis::setShortLabels(), KDChart::Polar-
Diagram::setShowDelimitersAtPosition(), KDChart::PolarDiagram::setShowLabelsAtPosition(),
KDChart::Legend::setShowLines(), KDChart::Legend::setSpacing(), KDChart::AbstractPieDiagram::set-
StartPosition(), KDChart::Legend::setText(), KDChart::Legend::setTextAttributes(), KDChart::Abstract-
Axis::setTextAttributes(), KDChart::BarDiagram::setThreeDBarAttributes(), KDChart::Line-
Diagram::setThreeDLineAttributes(), KDChart::AbstractPieDiagram::setThreeDPieAttributes(),
KDChart::Legend::setTitleText(), KDChart::CartesianAxis::setTitleText(), KDChart::Legend::set-
TitleTextAttributes(), KDChart::CartesianAxis::setTitleTextAttributes(), KDChart::LineDiagram::set-
Type(), KDChart::HeaderFooter::setType(), KDChart::BarDiagram::setType(), KDChart::Three-
DPieAttributes::setUseShadowColors(), KDChart::ThreeDBarAttributes::setUseShadowColors(),
KDChart::CartesianCoordinatePlane::setVerticalRange(), KDChart::PolarDiagram::setZeroDegree-
Position(), KDChart::PolarCoordinatePlane::setZoomCenter(), KDChart::CartesianCoordinate-
Plane::setZoomCenter(), KDChart::PolarCoordinatePlane::setZoomFactorX(), KDChart::Cartesian-
CoordinatePlane::setZoomFactorX(), KDChart::PolarCoordinatePlane::setZoomFactorY(),
KDChart::CartesianCoordinatePlane::setZoomFactorY(), KDChart::AbstractAxis::shortLabels(),
KDChart::PolarDiagram::showDelimitersAtPosition(), KDChart::PolarDiagram::showLabelsAt-
Position(), KDChart::Legend::showLines(), KDChart::Legend::spacing(), KDChart::AbstractPie-
Diagram::startPosition(), KDChart::AbstractCartesianDiagram::takeAxis(), KDChart::Chart::take-
CoordinatePlane(), KDChart::AbstractCoordinatePlane::takeDiagram(), KDChart::Widget::takeHeader-
Footer(), KDChart::Chart::takeHeaderFooter(), KDChart::Widget::takeLegend(), KDChart::Chart::take-
Legend(), KDChart::Legend::text(), KDChart::Legend::textAttributes(), KDChart::AbstractAxis::text-
Attributes(), KDChart::ThreeDBarAttributes::ThreeDBarAttributes(), KDChart::BarDiagram::three-
DBarAttributes(), KDChart::LineDiagram::threeDItemDepth(), KDChart::BarDiagram::threeDItem-
Depth(), KDChart::ThreeDLineAttributes::ThreeDLineAttributes(), KDChart::LineDiagram::three-
DLineAttributes(), KDChart::ThreeDPieAttributes::ThreeDPieAttributes(), KDChart::AbstractPie-
Diagram::threeDPieAttributes(), KDChart::Legend::titleText(), KDChart::CartesianAxis::titleText(),
KDChart::Legend::titleTextAttributes(), KDChart::CartesianAxis::titleTextAttributes(), KDChart::Polar-
CoordinatePlane::translate(), KDChart::CartesianCoordinatePlane::translate(), KDChart::Polar-
CoordinatePlane::translatePolar(), KDChart::LineDiagram::type(), KDChart::HeaderFooter::type(),

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


712 KD Chart 2 File Documentation

KDChart::BarDiagram::type(), KDChart::AbstractDiagram::update(), KDChart::AbstractDiagram::use-


DefaultColors(), KDChart::AbstractDiagram::useRainbowColors(), KDChart::ThreeDPieAttributes::use-
ShadowColors(), KDChart::ThreeDBarAttributes::useShadowColors(), KDChart::AbstractDiagram::use-
SubduedColors(), KDChart::AbstractThreeDAttributes::validDepth(), KDChart::AbstractDiagram::value-
ForCell(), KDChart::LineDiagram::valueForCellTesting(), KDChart::CartesianCoordinatePlane::vertical-
Range(), KDChart::PolarDiagram::zeroDegreePosition(), KDChart::PolarCoordinatePlane::zoomCenter(),
KDChart::CartesianCoordinatePlane::zoomCenter(), KDChart::PolarCoordinatePlane::zoomFactor-
X(), KDChart::CartesianCoordinatePlane::zoomFactorX(), KDChart::PolarCoordinatePlane::zoom-
FactorY(), KDChart::CartesianCoordinatePlane::zoomFactorY(), KDChart::AbstractAxis::∼Abstract-
Axis(), KDChart::AbstractCartesianDiagram::∼AbstractCartesianDiagram(), and KDChart::Cartesian-
Axis::∼CartesianAxis().

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


7.4 KDChartAbstractAreaBase.h File Reference 713

7.4 KDChartAbstractAreaBase.h File Reference


#include <QPointF>
#include <QSizeF>
#include <QRectF>
#include "KDChartGlobal.h"
#include "KDChartLayoutItems.h"
#include "KDChartRelativePosition.h"
Include dependency graph for KDChartAbstractAreaBase.h:
This graph shows which files directly or indirectly include this file:

Namespaces
• namespace KDChart

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


714 KD Chart 2 File Documentation

7.5 KDChartAbstractAreaWidget.cpp File Reference


#include "KDChartAbstractAreaWidget.h"
#include "KDChartAbstractAreaWidget_p.h"
#include <KDABLibFakes>
Include dependency graph for KDChartAbstractAreaWidget.cpp:

Defines
• #define d d_func()

7.5.1 Define Documentation

7.5.1.1 #define d d_func()

Definition at line 63 of file KDChartAbstractAreaWidget.cpp.

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


7.6 KDChartAbstractAreaWidget.h File Reference 715

7.6 KDChartAbstractAreaWidget.h File Reference


#include <QWidget>
#include <QPaintEvent>
#include <QPainter>
#include <QRect>
#include "KDChartAbstractAreaBase.h"
Include dependency graph for KDChartAbstractAreaWidget.h:
This graph shows which files directly or indirectly include this file:

Namespaces
• namespace KDChart

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


716 KD Chart 2 File Documentation

7.7 KDChartAbstractAxis.cpp File Reference


#include "KDChartAbstractAxis.h"
#include "KDChartAbstractAxis_p.h"
#include <QDebug>
#include <KDChartAbstractDiagram.h>
#include "KDChartAbstractCartesianDiagram.h"
#include "KDChartEnums.h"
#include "KDChartMeasure.h"
#include <KDABLibFakes>
Include dependency graph for KDChartAbstractAxis.cpp:

Defines
• #define d d_func()

7.7.1 Define Documentation

7.7.1.1 #define d d_func()

Definition at line 39 of file KDChartAbstractAxis.cpp.

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


7.8 KDChartAbstractAxis.h File Reference 717

7.8 KDChartAbstractAxis.h File Reference


#include <QRectF>
#include "kdchart_export.h"
#include "KDChartGlobal.h"
#include "KDChartAbstractArea.h"
#include "KDChartTextAttributes.h"
Include dependency graph for KDChartAbstractAxis.h:
This graph shows which files directly or indirectly include this file:

Namespaces
• namespace KDChart

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


718 KD Chart 2 File Documentation

7.9 KDChartAbstractCartesianDiagram.cpp File Reference


#include "KDChartAbstractCartesianDiagram.h"
#include "KDChartAbstractCartesianDiagram_p.h"
#include "KDChartPaintContext.h"
#include <QDebug>
#include <QPainter>
#include <KDABLibFakes>
Include dependency graph for KDChartAbstractCartesianDiagram.cpp:

Defines
• #define d d_func()

7.9.1 Define Documentation

7.9.1.1 #define d d_func()

Definition at line 51 of file KDChartAbstractCartesianDiagram.cpp.

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


7.10 KDChartAbstractCartesianDiagram.h File Reference 719

7.10 KDChartAbstractCartesianDiagram.h File Reference


#include "KDChartCartesianCoordinatePlane.h"
#include "KDChartAbstractDiagram.h"
#include "KDChartCartesianAxis.h"
Include dependency graph for KDChartAbstractCartesianDiagram.h:
This graph shows which files directly or indirectly include this file:

Namespaces
• namespace KDChart

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


720 KD Chart 2 File Documentation

7.11 KDChartAbstractCoordinatePlane.cpp File Reference


#include <QGridLayout>
#include "KDChartChart.h"
#include "KDChartAbstractCoordinatePlane.h"
#include "KDChartAbstractCoordinatePlane_p.h"
#include "KDChartGridAttributes.h"
#include <KDABLibFakes>
Include dependency graph for KDChartAbstractCoordinatePlane.cpp:

Defines
• #define d d_func()

7.11.1 Define Documentation

7.11.1.1 #define d d_func()

Definition at line 39 of file KDChartAbstractCoordinatePlane.cpp.

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


7.12 KDChartAbstractCoordinatePlane.h File Reference 721

7.12 KDChartAbstractCoordinatePlane.h File Reference


#include <QObject>
#include <QList>
#include "KDChartAbstractArea.h"
#include "KDChartAbstractDiagram.h"
#include "KDChartEnums.h"
Include dependency graph for KDChartAbstractCoordinatePlane.h:
This graph shows which files directly or indirectly include this file:

Namespaces
• namespace KDChart

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


722 KD Chart 2 File Documentation

7.13 KDChartAbstractDiagram.cpp File Reference


#include <QPainter>
#include <QDebug>
#include <QAbstractProxyModel>
#include <QStandardItemModel>
#include <QSizeF>
#include "KDChartAbstractCoordinatePlane.h"
#include "KDChartChart.h"
#include "KDChartDataValueAttributes.h"
#include "KDChartTextAttributes.h"
#include "KDChartMarkerAttributes.h"
#include "KDChartAbstractDiagram.h"
#include "KDChartAbstractDiagram_p.h"
#include "KDChartAttributesModel.h"
#include "KDChartAbstractThreeDAttributes.h"
#include "KDChartThreeDLineAttributes.h"
#include "KDChartPainterSaver_p.h"
#include <KDABLibFakes>
#include "KDChartAbstractDiagram.moc"
Include dependency graph for KDChartAbstractDiagram.cpp:

Namespaces
• namespace KDChart

Defines
• #define d d_func()

7.13.1 Define Documentation

7.13.1.1 #define d d_func()

Definition at line 107 of file KDChartAbstractDiagram.cpp.

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


7.14 KDChartAbstractDiagram.h File Reference 723

7.14 KDChartAbstractDiagram.h File Reference


#include <QList>
#include <QRectF>
#include <QAbstractItemView>
#include "KDChartGlobal.h"
#include "KDChartMarkerAttributes.h"
Include dependency graph for KDChartAbstractDiagram.h:
This graph shows which files directly or indirectly include this file:

Namespaces
• namespace KDChart

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


724 KD Chart 2 File Documentation

7.15 KDChartAbstractPieDiagram.cpp File Reference


#include <QMap>
#include "KDChartAbstractPieDiagram.h"
#include "KDChartAbstractPieDiagram_p.h"
#include "KDChartAttributesModel.h"
#include "KDChartPieAttributes.h"
#include "KDChartThreeDPieAttributes.h"
#include <KDABLibFakes>
Include dependency graph for KDChartAbstractPieDiagram.cpp:

Defines
• #define d d_func()

7.15.1 Define Documentation

7.15.1.1 #define d d_func()

Definition at line 63 of file KDChartAbstractPieDiagram.cpp.

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


7.16 KDChartAbstractPieDiagram.h File Reference 725

7.16 KDChartAbstractPieDiagram.h File Reference


#include "KDChartAbstractPolarDiagram.h"
Include dependency graph for KDChartAbstractPieDiagram.h:
This graph shows which files directly or indirectly include this file:

Namespaces
• namespace KDChart

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


726 KD Chart 2 File Documentation

7.17 KDChartAbstractPolarDiagram.cpp File Reference


#include "KDChartAbstractPolarDiagram.h"
#include "KDChartAbstractPolarDiagram_p.h"
#include <KDABLibFakes>
Include dependency graph for KDChartAbstractPolarDiagram.cpp:

Defines
• #define d d_func()

7.17.1 Define Documentation

7.17.1.1 #define d d_func()

Definition at line 44 of file KDChartAbstractPolarDiagram.cpp.

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


7.18 KDChartAbstractPolarDiagram.h File Reference 727

7.18 KDChartAbstractPolarDiagram.h File Reference


#include "KDChartPolarCoordinatePlane.h"
#include "KDChartAbstractDiagram.h"
Include dependency graph for KDChartAbstractPolarDiagram.h:
This graph shows which files directly or indirectly include this file:

Namespaces
• namespace KDChart

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


728 KD Chart 2 File Documentation

7.19 KDChartAbstractProxyModel.cpp File Reference


#include "KDChartAbstractProxyModel.h"
#include <QDebug>
#include <KDABLibFakes>
Include dependency graph for KDChartAbstractProxyModel.cpp:

Namespaces
• namespace KDChart

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


7.20 KDChartAbstractProxyModel.h File Reference 729

7.20 KDChartAbstractProxyModel.h File Reference


#include <QAbstractProxyModel>
#include "KDChartGlobal.h"
Include dependency graph for KDChartAbstractProxyModel.h:
This graph shows which files directly or indirectly include this file:

Namespaces
• namespace KDChart

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


730 KD Chart 2 File Documentation

7.21 KDChartAbstractThreeDAttributes.cpp File Reference


#include "KDChartAbstractThreeDAttributes.h"
#include "KDChartAbstractThreeDAttributes_p.h"
#include <QDebug>
#include <KDABLibFakes>
Include dependency graph for KDChartAbstractThreeDAttributes.cpp:

Defines
• #define d d_func()

Functions
• QDebug operator<< (QDebug dbg, const KDChart::AbstractThreeDAttributes &a)

7.21.1 Define Documentation

7.21.1.1 #define d d_func()

Definition at line 33 of file KDChartAbstractThreeDAttributes.cpp.

7.21.2 Function Documentation

7.21.2.1 QDebug operator<< (QDebug dbg, const KDChart::AbstractThreeDAttributes & a)

Definition at line 116 of file KDChartAbstractThreeDAttributes.cpp.

117 {
118 dbg << "enabled="<<a.isEnabled()
119 << "depth="<<a.depth();
120 return dbg;
121 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


7.22 KDChartAbstractThreeDAttributes.h File Reference 731

7.22 KDChartAbstractThreeDAttributes.h File Reference


#include <QMetaType>
#include "KDChartGlobal.h"
Include dependency graph for KDChartAbstractThreeDAttributes.h:
This graph shows which files directly or indirectly include this file:

Namespaces
• namespace KDChart

Functions
• KDCHART_EXPORT QDebug operator<< (QDebug, const KDChart::AbstractThreeDAttributes
&)

7.22.1 Function Documentation

7.22.1.1 KDCHART_EXPORT QDebug operator<< (QDebug, const


KDChart::AbstractThreeDAttributes &)

Definition at line 116 of file KDChartAbstractThreeDAttributes.cpp.


References KDChart::AbstractThreeDAttributes::depth(), and KDChart::AbstractThreeDAttributes::is-
Enabled().

117 {
118 dbg << "enabled="<<a.isEnabled()
119 << "depth="<<a.depth();
120 return dbg;
121 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


732 KD Chart 2 File Documentation

7.23 KDChartAttributesModel.cpp File Reference


#include <QDebug>
#include <QPen>
#include <QPointer>
#include "KDChartAttributesModel.h"
#include "KDChartPalette.h"
#include "KDChartDataValueAttributes.h"
#include "KDChartGlobal.h"
#include <KDABLibFakes>
Include dependency graph for KDChartAttributesModel.cpp:

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


7.24 KDChartAttributesModel.h File Reference 733

7.24 KDChartAttributesModel.h File Reference


#include "KDChartAbstractProxyModel.h"
#include <QMap>
#include <QVariant>
#include "KDChartGlobal.h"
Include dependency graph for KDChartAttributesModel.h:
This graph shows which files directly or indirectly include this file:

Namespaces
• namespace KDChart

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


734 KD Chart 2 File Documentation

7.25 KDChartBackgroundAttributes.cpp File Reference


#include "KDChartBackgroundAttributes.h"
#include <QPixmap>
#include <KDABLibFakes>
Include dependency graph for KDChartBackgroundAttributes.cpp:

Defines
• #define d d_func()

Functions
• QDebug operator<< (QDebug dbg, const KDChart::BackgroundAttributes &ba)

7.25.1 Define Documentation

7.25.1.1 #define d d_func()

Definition at line 31 of file KDChartBackgroundAttributes.cpp.

7.25.2 Function Documentation

7.25.2.1 QDebug operator<< (QDebug dbg, const KDChart::BackgroundAttributes & ba)

Definition at line 134 of file KDChartBackgroundAttributes.cpp.

135 {
136 dbg << "KDChart::BackgroundAttributes("
137 << "visible="<<ba.isVisible()
138 << "brush="<<ba.brush()
139 << "pixmapmode="<<ba.pixmapMode()
140 << "pixmap="<<ba.pixmap()
141 << ")";
142 return dbg;
143 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


7.26 KDChartBackgroundAttributes.h File Reference 735

7.26 KDChartBackgroundAttributes.h File Reference


#include <QDebug>
#include <QMetaType>
#include <QBrush>
#include "KDChartGlobal.h"
Include dependency graph for KDChartBackgroundAttributes.h:
This graph shows which files directly or indirectly include this file:

Namespaces
• namespace KDChart

Functions
• KDCHART_EXPORT QDebug operator<< (QDebug, const KDChart::BackgroundAttributes &)
• Q_DECLARE_TYPEINFO (KDChart::BackgroundAttributes, Q_MOVABLE_TYPE)

7.26.1 Function Documentation

7.26.1.1 KDCHART_EXPORT QDebug operator<< (QDebug, const


KDChart::BackgroundAttributes &)

Definition at line 134 of file KDChartBackgroundAttributes.cpp.


References KDChart::BackgroundAttributes::brush(), KDChart::BackgroundAttributes::isVisible(),
KDChart::BackgroundAttributes::pixmap(), and KDChart::BackgroundAttributes::pixmapMode().

135 {
136 dbg << "KDChart::BackgroundAttributes("
137 << "visible="<<ba.isVisible()
138 << "brush="<<ba.brush()
139 << "pixmapmode="<<ba.pixmapMode()
140 << "pixmap="<<ba.pixmap()
141 << ")";
142 return dbg;
143 }

7.26.1.2 Q_DECLARE_TYPEINFO (KDChart::BackgroundAttributes, Q_MOVABLE_TYPE)

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


736 KD Chart 2 File Documentation

7.27 KDChartBarAttributes.cpp File Reference


#include "KDChartBarAttributes.h"
#include <qglobal.h>
#include <KDABLibFakes>
Include dependency graph for KDChartBarAttributes.cpp:

Defines
• #define d d_func()

7.27.1 Define Documentation

7.27.1.1 #define d d_func()

Definition at line 31 of file KDChartBarAttributes.cpp.

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


7.28 KDChartBarAttributes.h File Reference 737

7.28 KDChartBarAttributes.h File Reference


#include <QMetaType>
#include "KDChartGlobal.h"
Include dependency graph for KDChartBarAttributes.h:
This graph shows which files directly or indirectly include this file:

Namespaces
• namespace KDChart

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


738 KD Chart 2 File Documentation

7.29 KDChartBarDiagram.cpp File Reference


#include <QPainter>
#include <QDebug>
#include "KDChartBarDiagram.h"
#include "KDChartBarDiagram_p.h"
#include "KDChartThreeDBarAttributes.h"
#include "KDChartAttributesModel.h"
#include "KDChartPaintContext.h"
#include "KDChartPainterSaver_p.h"
#include "KDChartAbstractGrid.h"
#include <KDABLibFakes>
Include dependency graph for KDChartBarDiagram.cpp:

Defines
• #define d d_func()

7.29.1 Define Documentation

7.29.1.1 #define d d_func()

Definition at line 50 of file KDChartBarDiagram.cpp.

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


7.30 KDChartBarDiagram.h File Reference 739

7.30 KDChartBarDiagram.h File Reference


#include "KDChartAbstractCartesianDiagram.h"
#include "KDChartBarAttributes.h"
#include "KDChartThreeDBarAttributes.h"
Include dependency graph for KDChartBarDiagram.h:
This graph shows which files directly or indirectly include this file:

Namespaces
• namespace KDChart

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


740 KD Chart 2 File Documentation

7.31 KDChartCartesianAxis.cpp File Reference


#include <cmath>
#include <QtDebug>
#include <QPainter>
#include <QPen>
#include <QBrush>
#include <QApplication>
#include "KDChartPaintContext.h"
#include "KDChartChart.h"
#include "KDChartCartesianAxis.h"
#include "KDChartCartesianAxis_p.h"
#include "KDChartAbstractCartesianDiagram.h"
#include "KDChartPainterSaver_p.h"
#include "KDChartLayoutItems.h"
#include <KDABLibFakes>
Include dependency graph for KDChartCartesianAxis.cpp:

Defines
• #define d (d_func())
• #define ptr (context → painter())

7.31.1 Define Documentation

7.31.1.1 #define d (d_func())

Definition at line 47 of file KDChartCartesianAxis.cpp.

7.31.1.2 #define ptr (context → painter())

Definition at line 192 of file KDChartCartesianAxis.cpp.


Referenced by KDChart::CartesianAxis::paintCtx().

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


7.32 KDChartCartesianAxis.h File Reference 741

7.32 KDChartCartesianAxis.h File Reference


#include <QList>
#include "KDChartAbstractAxis.h"
Include dependency graph for KDChartCartesianAxis.h:
This graph shows which files directly or indirectly include this file:

Namespaces
• namespace KDChart

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


742 KD Chart 2 File Documentation

7.33 KDChartCartesianCoordinatePlane.cpp File Reference


#include <QFont>
#include <QList>
#include <QtDebug>
#include <QPainter>
#include <QApplication>
#include "KDChartAbstractDiagram.h"
#include "KDChartAbstractCartesianDiagram.h"
#include "KDChartCartesianCoordinatePlane.h"
#include "KDChartCartesianCoordinatePlane_p.h"
#include "CartesianCoordinateTransformation.h"
#include "KDChartGridAttributes.h"
#include "KDChartPaintContext.h"
#include "KDChartPainterSaver_p.h"
#include <KDABLibFakes>
Include dependency graph for KDChartCartesianCoordinatePlane.cpp:

Defines
• #define d d_func()

7.33.1 Define Documentation

7.33.1.1 #define d d_func()

Definition at line 46 of file KDChartCartesianCoordinatePlane.cpp.

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


7.34 KDChartCartesianCoordinatePlane.h File Reference 743

7.34 KDChartCartesianCoordinatePlane.h File Reference


#include "KDChartAbstractCoordinatePlane.h"
Include dependency graph for KDChartCartesianCoordinatePlane.h:
This graph shows which files directly or indirectly include this file:

Namespaces
• namespace KDChart

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


744 KD Chart 2 File Documentation

7.35 KDChartChart.cpp File Reference


#include <QList>
#include <QtDebug>
#include <QGridLayout>
#include <QLabel>
#include <QHash>
#include <QPainter>
#include <QPaintEvent>
#include <QLayoutItem>
#include <QPushButton>
#include "KDChartChart.h"
#include "KDChartChart_p.h"
#include "KDChartCartesianCoordinatePlane.h"
#include "KDChartAbstractCartesianDiagram.h"
#include "KDChartHeaderFooter.h"
#include "KDChartEnums.h"
#include "KDChartLegend.h"
#include "KDChartLayoutItems.h"
#include <KDABLibFakes>
Include dependency graph for KDChartChart.cpp:

Defines

• #define ADD_VBOX_WITH_LEGENDS(row, column, align)


• #define d d_func()

Functions

• QHBoxLayout ∗ findOrCreateHBoxLayoutByObjectName (QLayout ∗parentLayout, const char


∗name)
• template<typename T> T ∗ findOrCreateLayoutByObjectName (QLayout ∗parentLayout, const
char ∗name)
• QVBoxLayout ∗ findOrCreateVBoxLayoutByObjectName (QLayout ∗parentLayout, const char
∗name)

7.35.1 Define Documentation

7.35.1.1 #define ADD_VBOX_WITH_LEGENDS(row, column, align)

Value:

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


7.35 KDChartChart.cpp File Reference 745

{ \
QVBoxLayout* innerLayout = new QVBoxLayout(); \
for (int i = 0; i < count; ++i) { \
legend = list.at(i); \
if( legend->alignment() == ( align ) ) \
innerLayout->addWidget( legend, 0, Qt::AlignLeft ); \
} \
gridLayout->addLayout( innerLayout, row, column, ( align ) ); \
}

7.35.1.2 #define d d_func()

Definition at line 566 of file KDChartChart.cpp.

7.35.2 Function Documentation

7.35.2.1 QHBoxLayout∗ findOrCreateHBoxLayoutByObjectName (QLayout ∗ parentLayout,


const char ∗ name) [static]

Definition at line 359 of file KDChartChart.cpp.

360 {
361 return findOrCreateLayoutByObjectName<QHBoxLayout>( parentLayout, name );
362 }

7.35.2.2 template<typename T> T∗ findOrCreateLayoutByObjectName (QLayout ∗


parentLayout, const char ∗ name) [static]

Definition at line 344 of file KDChartChart.cpp.

345 {
346 T *box = qFindChild<T*>( parentLayout, QString::fromLatin1( name ) );
347 if ( !box ) {
348 box = new T();
349 box->setObjectName( QString::fromLatin1( name ) );
350 }
351 return box;
352 }

7.35.2.3 QVBoxLayout∗ findOrCreateVBoxLayoutByObjectName (QLayout ∗ parentLayout,


const char ∗ name) [static]

Definition at line 354 of file KDChartChart.cpp.

355 {
356 return findOrCreateLayoutByObjectName<QVBoxLayout>( parentLayout, name );
357 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


746 KD Chart 2 File Documentation

7.36 KDChartChart.h File Reference


#include <QWidget>
#include "kdchart_export.h"
#include "KDChartGlobal.h"
Include dependency graph for KDChartChart.h:
This graph shows which files directly or indirectly include this file:

Namespaces
• namespace KDChart

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


7.37 KDChartDatasetProxyModel.cpp File Reference 747

7.37 KDChartDatasetProxyModel.cpp File Reference


#include <QtDebug>
#include "KDChartDatasetProxyModel.h"
#include <KDABLibFakes>
Include dependency graph for KDChartDatasetProxyModel.cpp:

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


748 KD Chart 2 File Documentation

7.38 KDChartDatasetProxyModel.h File Reference


#include <QVector>
#include <QSortFilterProxyModel>
#include "kdchart_export.h"
Include dependency graph for KDChartDatasetProxyModel.h:
This graph shows which files directly or indirectly include this file:

Namespaces
• namespace KDChart

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


7.39 KDChartDatasetSelector.cpp File Reference 749

7.39 KDChartDatasetSelector.cpp File Reference


#include <QtDebug>
#include "KDChartDatasetSelector.h"
#include "ui_KDChartDatasetSelector.h"
#include <KDABLibFakes>
Include dependency graph for KDChartDatasetSelector.cpp:

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


750 KD Chart 2 File Documentation

7.40 KDChartDatasetSelector.h File Reference


#include <QFrame>
#include "KDChartDatasetProxyModel.h"
Include dependency graph for KDChartDatasetSelector.h:
This graph shows which files directly or indirectly include this file:

Namespaces
• namespace KDChart
• namespace Ui

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


7.41 KDChartDataValueAttributes.cpp File Reference 751

7.41 KDChartDataValueAttributes.cpp File Reference


#include <QVariant>
#include <QDebug>
#include "KDChartDataValueAttributes.h"
#include "KDChartRelativePosition.h"
#include <KDChartTextAttributes.h>
#include <KDChartFrameAttributes.h>
#include <KDChartBackgroundAttributes.h>
#include <KDChartMarkerAttributes.h>
#include <KDABLibFakes>
Include dependency graph for KDChartDataValueAttributes.cpp:

Defines
• #define d d_func()
• #define KDCHART_DATA_VALUE_AUTO_DIGITS 4

Functions
• QDebug operator<< (QDebug dbg, const KDChart::DataValueAttributes &val)

7.41.1 Define Documentation

7.41.1.1 #define d d_func()

Definition at line 42 of file KDChartDataValueAttributes.cpp.

7.41.1.2 #define KDCHART_DATA_VALUE_AUTO_DIGITS 4

Definition at line 39 of file KDChartDataValueAttributes.cpp.

7.41.2 Function Documentation

7.41.2.1 QDebug operator<< (QDebug dbg, const KDChart::DataValueAttributes & val)

Definition at line 269 of file KDChartDataValueAttributes.cpp.

270 {
271 dbg << "RelativePosition DataValueAttributes("
272 << "visible="<<val.isVisible()
273 << "textattributes="<<val.textAttributes()
274 << "frameattributes="<<val.frameAttributes()
275 << "backgroundattributes="<<val.backgroundAttributes()
276 << "decimaldigits="<<val.decimalDigits()
277 << "poweroftendivisor="<<val.powerOfTenDivisor()
278 << "showinfinite="<<val.showInfinite()

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


752 KD Chart 2 File Documentation

279 << "negativerelativeposition="<<val.negativePosition()


280 << "positiverelativeposition="<<val.positivePosition()
281 <<")";
282 return dbg;
283 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


7.42 KDChartDataValueAttributes.h File Reference 753

7.42 KDChartDataValueAttributes.h File Reference


#include <Qt>
#include <QMetaType>
#include "KDChartGlobal.h"
#include "KDChartEnums.h"
#include "KDChartRelativePosition.h"
Include dependency graph for KDChartDataValueAttributes.h:
This graph shows which files directly or indirectly include this file:

Namespaces
• namespace KDChart

Functions
• KDCHART_EXPORT QDebug operator<< (QDebug, const KDChart::DataValueAttributes &)
• Q_DECLARE_TYPEINFO (KDChart::DataValueAttributes, Q_MOVABLE_TYPE)

7.42.1 Function Documentation

7.42.1.1 KDCHART_EXPORT QDebug operator<< (QDebug, const


KDChart::DataValueAttributes &)

Definition at line 269 of file KDChartDataValueAttributes.cpp.


References KDChart::DataValueAttributes::backgroundAttributes(), KDChart::DataValue-
Attributes::decimalDigits(), KDChart::DataValueAttributes::frameAttributes(), KDChart::DataValue-
Attributes::isVisible(), KDChart::DataValueAttributes::negativePosition(), KDChart::DataValue-
Attributes::positivePosition(), KDChart::DataValueAttributes::powerOfTenDivisor(), KDChart::Data-
ValueAttributes::showInfinite(), and KDChart::DataValueAttributes::textAttributes().

270 {
271 dbg << "RelativePosition DataValueAttributes("
272 << "visible="<<val.isVisible()
273 << "textattributes="<<val.textAttributes()
274 << "frameattributes="<<val.frameAttributes()
275 << "backgroundattributes="<<val.backgroundAttributes()
276 << "decimaldigits="<<val.decimalDigits()
277 << "poweroftendivisor="<<val.powerOfTenDivisor()
278 << "showinfinite="<<val.showInfinite()
279 << "negativerelativeposition="<<val.negativePosition()
280 << "positiverelativeposition="<<val.positivePosition()
281 <<")";
282 return dbg;
283 }

7.42.1.2 Q_DECLARE_TYPEINFO (KDChart::DataValueAttributes, Q_MOVABLE_TYPE)

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


754 KD Chart 2 File Documentation

7.43 KDChartDiagramObserver.cpp File Reference


#include <KDChartAbstractDiagram.h>
#include <KDChartDiagramObserver.h>
#include <KDChartAttributesModel.h>
#include <KDABLibFakes>
#include <QDebug>
Include dependency graph for KDChartDiagramObserver.cpp:

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


7.44 KDChartDiagramObserver.h File Reference 755

7.44 KDChartDiagramObserver.h File Reference


#include "KDChartGlobal.h"
#include <QObject>
#include <QPointer>
Include dependency graph for KDChartDiagramObserver.h:
This graph shows which files directly or indirectly include this file:

Namespaces
• namespace KDChart

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


756 KD Chart 2 File Documentation

7.45 KDChartEnums.h File Reference

7.45.1 Detailed Description

Definition of global enums.


Definition in file KDChartEnums.h.
#include "KDChartGlobal.h"
#include <QRectF>
#include <QObject>
#include <QVector>
Include dependency graph for KDChartEnums.h:
This graph shows which files directly or indirectly include this file:

Classes
• class KDChartEnums
Project global class providing some enums needed both by KDChartParams and by KDChartCustomBox.

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


7.46 KDChartFrameAttributes.cpp File Reference 757

7.46 KDChartFrameAttributes.cpp File Reference


#include "KDChartFrameAttributes.h"
#include <KDABLibFakes>
Include dependency graph for KDChartFrameAttributes.cpp:

Defines
• #define d d_func()

Functions
• QDebug operator<< (QDebug dbg, const KDChart::FrameAttributes &fa)

7.46.1 Define Documentation

7.46.1.1 #define d d_func()

Definition at line 30 of file KDChartFrameAttributes.cpp.

7.46.2 Function Documentation

7.46.2.1 QDebug operator<< (QDebug dbg, const KDChart::FrameAttributes & fa)

Definition at line 119 of file KDChartFrameAttributes.cpp.

120 {
121 dbg << "KDChart::FrameAttributes("
122 << "visible="<<fa.isVisible()
123 << "pen="<<fa.pen()
124 << "padding="<<fa.padding()
125 << ")";
126 return dbg;
127 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


758 KD Chart 2 File Documentation

7.47 KDChartFrameAttributes.h File Reference


#include <QDebug>
#include <QMetaType>
#include <QPen>
#include "KDChartGlobal.h"
Include dependency graph for KDChartFrameAttributes.h:
This graph shows which files directly or indirectly include this file:

Namespaces
• namespace KDChart

Functions
• KDCHART_EXPORT QDebug operator<< (QDebug, const KDChart::FrameAttributes &)
• Q_DECLARE_TYPEINFO (KDChart::FrameAttributes, Q_MOVABLE_TYPE)

7.47.1 Function Documentation

7.47.1.1 KDCHART_EXPORT QDebug operator<< (QDebug, const KDChart::FrameAttributes


&)

Definition at line 119 of file KDChartFrameAttributes.cpp.


References KDChart::FrameAttributes::isVisible(), KDChart::FrameAttributes::padding(), and
KDChart::FrameAttributes::pen().

120 {
121 dbg << "KDChart::FrameAttributes("
122 << "visible="<<fa.isVisible()
123 << "pen="<<fa.pen()
124 << "padding="<<fa.padding()
125 << ")";
126 return dbg;
127 }

7.47.1.2 Q_DECLARE_TYPEINFO (KDChart::FrameAttributes, Q_MOVABLE_TYPE)

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


7.48 KDChartGlobal.h File Reference 759

7.48 KDChartGlobal.h File Reference


#include <qglobal.h>
#include "kdchart_export.h"
#include <QtAlgorithms>
#include <algorithm>
#include <Qt>
Include dependency graph for KDChartGlobal.h:
This graph shows which files directly or indirectly include this file:

Namespaces
• namespace KDChart

Defines
• #define KDAB_SET_OBJECT_NAME(x) __kdab__dereference_for_methodcall( x ).setObject-
Name( QLatin1String( #x ) )
• #define KDCHART_DECLARE_DERIVED_DIAGRAM(X, PLANE)
• #define KDCHART_DECLARE_PRIVATE_BASE_POLYMORPHIC(X)
• #define KDCHART_DECLARE_PRIVATE_BASE_POLYMORPHIC_QWIDGET(X)
• #define KDCHART_DECLARE_PRIVATE_BASE_VALUE(X)
• #define KDCHART_DECLARE_PRIVATE_DERIVED(X)
• #define KDCHART_DECLARE_PRIVATE_DERIVED_PARENT(X, ParentType)
• #define KDCHART_DECLARE_PRIVATE_DERIVED_QWIDGET(X) KDCHART_DECLARE_-
PRIVATE_DERIVED_PARENT( X, QWidget∗ )
• #define KDCHART_DECLARE_SWAP_BASE(X)
• #define KDCHART_DECLARE_SWAP_DERIVED(X) void swap( X& other ) { doSwap( other ); }
• #define KDCHART_DECLARE_SWAP_SPECIALISATION(X)
• #define KDCHART_DECLARE_SWAP_SPECIALISATION_DERIVED(X) KDCHART_-
DECLARE_SWAP_SPECIALISATION( X )
• #define KDCHART_DERIVED_PRIVATE_FOOTER(CLASS, PARENT)
• #define KDCHART_IMPL_DERIVED_DIAGRAM(CLASS, PARENT, PLANE)
• #define KDCHART_IMPL_DERIVED_PLANE(CLASS, BASEPLANE)

Functions
• template<typename T> T & __kdab__dereference_for_methodcall (T ∗o)
• template<typename T> T & __kdab__dereference_for_methodcall (T &o)

7.48.1 Define Documentation

7.48.1.1 #define KDAB_SET_OBJECT_NAME(x) __kdab__dereference_for_methodcall( x


).setObjectName( QLatin1String( #x ) )

Definition at line 46 of file KDChartGlobal.h.

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


760 KD Chart 2 File Documentation

7.48.1.2 #define KDCHART_DECLARE_DERIVED_DIAGRAM(X, PLANE)

Value:

protected: \
class Private; \
inline Private * d_func(); \
inline const Private * d_func() const; \
explicit inline X( Private * ); \
explicit inline X( Private *, QWidget *, PLANE * ); \
private: \
void init();

Definition at line 172 of file KDChartGlobal.h.

7.48.1.3 #define KDCHART_DECLARE_PRIVATE_BASE_POLYMORPHIC(X)

Value:

protected: \
class Private; \
Private * d_func() { return _d; } \
const Private * d_func() const { return _d; } \
explicit inline X( Private * ); \
private: \
void init(); \
Private * _d;

Definition at line 116 of file KDChartGlobal.h.

7.48.1.4 #define KDCHART_DECLARE_PRIVATE_BASE_POLYMORPHIC_QWIDGET(X)

Value:

protected: \
class Private; \
Private * d_func() { return _d; } \
const Private * d_func() const { return _d; } \
explicit inline X( Private *, QWidget* ); \
private: \
void init(); \
Private * _d;

Definition at line 139 of file KDChartGlobal.h.

7.48.1.5 #define KDCHART_DECLARE_PRIVATE_BASE_VALUE(X)

Value:

public: \
inline void swap( X & other ) { qSwap( _d, other._d ); } \
protected: \
class Private; \
Private * d_func() { return _d; } \
const Private * d_func() const { return _d; } \
private: \
void init(); \
Private * _d;

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


7.48 KDChartGlobal.h File Reference 761

Definition at line 93 of file KDChartGlobal.h.

7.48.1.6 #define KDCHART_DECLARE_PRIVATE_DERIVED(X)

Value:

protected: \
class Private; \
inline Private * d_func(); \
inline const Private * d_func() const; \
explicit inline X( Private * ); \
private: \
void init();

Definition at line 59 of file KDChartGlobal.h.

7.48.1.7 #define KDCHART_DECLARE_PRIVATE_DERIVED_PARENT(X, ParentType)

Value:

protected: \
class Private; \
inline Private * d_func(); \
inline const Private * d_func() const; \
explicit inline X( Private *, ParentType ); \
private: \
void init();

Definition at line 80 of file KDChartGlobal.h.

7.48.1.8 #define KDCHART_DECLARE_PRIVATE_DERIVED_QWIDGET(X)


KDCHART_DECLARE_PRIVATE_DERIVED_PARENT( X, QWidget∗ )

Definition at line 90 of file KDChartGlobal.h.

7.48.1.9 #define KDCHART_DECLARE_SWAP_BASE(X)

Value:

protected: \
void doSwap( X& other ) \
{ qSwap( _d, other._d); }

Definition at line 223 of file KDChartGlobal.h.

7.48.1.10 #define KDCHART_DECLARE_SWAP_DERIVED(X) void swap( X& other ) {


doSwap( other ); }

Definition at line 228 of file KDChartGlobal.h.

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


762 KD Chart 2 File Documentation

7.48.1.11 #define KDCHART_DECLARE_SWAP_SPECIALISATION(X)

Value:

template <> inline void qSwap<X>( X & lhs, X & rhs ) \


{ lhs.swap( rhs ); } \
namespace std { \
template <> inline void swap<X>( X & lhs, X & rhs ) \
{ lhs.swap( rhs ); } \
}

Definition at line 207 of file KDChartGlobal.h.

7.48.1.12 #define KDCHART_DECLARE_SWAP_SPECIALISATION_DERIVED(X)


KDCHART_DECLARE_SWAP_SPECIALISATION( X )

Definition at line 220 of file KDChartGlobal.h.

7.48.1.13 #define KDCHART_DERIVED_PRIVATE_FOOTER(CLASS, PARENT)

Value:

inline CLASS::CLASS( Private * p ) \


: PARENT( p ) { init(); } \
inline CLASS::Private * CLASS::d_func() \
{ return static_cast<Private*>( PARENT::d_func() ); } \
inline const CLASS::Private * CLASS::d_func() const \
{ return static_cast<const Private*>( PARENT::d_func() ); }

Definition at line 151 of file KDChartGlobal.h.

7.48.1.14 #define KDCHART_IMPL_DERIVED_DIAGRAM(CLASS, PARENT, PLANE)

Value:

inline CLASS::CLASS( Private * p ) \


: PARENT( p ) { init(); } \
inline CLASS::CLASS( \
Private * p, QWidget* parent, PLANE * plane ) \
: PARENT( p, parent, plane ) { init(); } \
inline CLASS::Private * CLASS::d_func() \
{ return static_cast<Private *>( PARENT::d_func() ); } \
inline const CLASS::Private * CLASS::d_func() const \
{ return static_cast<const Private *>( PARENT::d_func() ); }

Definition at line 183 of file KDChartGlobal.h.

7.48.1.15 #define KDCHART_IMPL_DERIVED_PLANE(CLASS, BASEPLANE)

Value:

inline CLASS::CLASS( Private * p, Chart* parent ) \


: BASEPLANE( p, parent ) { init(); } \
inline CLASS::Private * CLASS::d_func() \
{ return static_cast<Private *>( BASEPLANE::d_func() ); } \
inline const CLASS::Private * CLASS::d_func() const \
{ return static_cast<const Private *>( BASEPLANE::d_func() ); }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


7.48 KDChartGlobal.h File Reference 763

Definition at line 195 of file KDChartGlobal.h.

7.48.2 Function Documentation

7.48.2.1 template<typename T> T& __kdab__dereference_for_methodcall (T ∗ o)

Definition at line 42 of file KDChartGlobal.h.

42 {
43 return *o;
44 }

7.48.2.2 template<typename T> T& __kdab__dereference_for_methodcall (T & o)

Definition at line 37 of file KDChartGlobal.h.

37 {
38 return o;
39 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


764 KD Chart 2 File Documentation

7.49 KDChartGridAttributes.cpp File Reference


#include "KDChartGridAttributes.h"
#include <QPen>
#include <QDebug>
#include <KDABLibFakes>
Include dependency graph for KDChartGridAttributes.cpp:

Defines
• #define d d_func()

Functions
• QDebug operator<< (QDebug dbg, const KDChart::GridAttributes &a)

7.49.1 Define Documentation

7.49.1.1 #define d d_func()

Definition at line 33 of file KDChartGridAttributes.cpp.

7.49.2 Function Documentation

7.49.2.1 QDebug operator<< (QDebug dbg, const KDChart::GridAttributes & a)

Definition at line 260 of file KDChartGridAttributes.cpp.

261 {
262 dbg << "KDChart::GridAttributes("
263 << "visible="<<a.isGridVisible()
264 << "subVisible="<<a.isSubGridVisible()
265 // KDChartEnums::GranularitySequence sequence;
266 << "stepWidth=" << a.gridStepWidth()
267 << "subStepWidth=" << a.gridSubStepWidth()
268 << "pen="<<a.gridPen()
269 << "subPen="<<a.subGridPen()
270 << "zeroPen="<<a.zeroLinePen()
271 << ")";
272 return dbg;
273 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


7.50 KDChartGridAttributes.h File Reference 765

7.50 KDChartGridAttributes.h File Reference


#include <QMetaType>
#include "KDChartGlobal.h"
#include "KDChartEnums.h"
Include dependency graph for KDChartGridAttributes.h:
This graph shows which files directly or indirectly include this file:

Namespaces
• namespace KDChart

Functions
• KDCHART_EXPORT QDebug operator<< (QDebug, const KDChart::GridAttributes &)
• Q_DECLARE_TYPEINFO (KDChart::GridAttributes, Q_MOVABLE_TYPE)

7.50.1 Function Documentation

7.50.1.1 KDCHART_EXPORT QDebug operator<< (QDebug, const KDChart::GridAttributes


&)

Definition at line 260 of file KDChartGridAttributes.cpp.


References KDChart::GridAttributes::gridPen(), KDChart::GridAttributes::gridStepWidth(),
KDChart::GridAttributes::gridSubStepWidth(), KDChart::GridAttributes::isGridVisible(),
KDChart::GridAttributes::isSubGridVisible(), KDChart::GridAttributes::subGridPen(), and
KDChart::GridAttributes::zeroLinePen().

261 {
262 dbg << "KDChart::GridAttributes("
263 << "visible="<<a.isGridVisible()
264 << "subVisible="<<a.isSubGridVisible()
265 // KDChartEnums::GranularitySequence sequence;
266 << "stepWidth=" << a.gridStepWidth()
267 << "subStepWidth=" << a.gridSubStepWidth()
268 << "pen="<<a.gridPen()
269 << "subPen="<<a.subGridPen()
270 << "zeroPen="<<a.zeroLinePen()
271 << ")";
272 return dbg;
273 }

7.50.1.2 Q_DECLARE_TYPEINFO (KDChart::GridAttributes, Q_MOVABLE_TYPE)

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


766 KD Chart 2 File Documentation

7.51 KDChartHeaderFooter.cpp File Reference


#include "KDChartChart.h"
#include "KDChartHeaderFooter.h"
#include "KDChartHeaderFooter_p.h"
#include <KDChartTextAttributes.h>
#include <QFont>
#include <QPainter>
#include <QAbstractTextDocumentLayout>
#include <QTextDocumentFragment>
#include <QTextBlock>
#include <QtDebug>
#include <QLabel>
#include "KDTextDocument.h"
#include <KDABLibFakes>
Include dependency graph for KDChartHeaderFooter.cpp:

Defines
• #define d d_func()

7.51.1 Define Documentation

7.51.1.1 #define d d_func()

Definition at line 53 of file KDChartHeaderFooter.cpp.

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


7.52 KDChartHeaderFooter.h File Reference 767

7.52 KDChartHeaderFooter.h File Reference


#include "KDChartTextArea.h"
#include "KDChartPosition.h"
Include dependency graph for KDChartHeaderFooter.h:
This graph shows which files directly or indirectly include this file:

Namespaces
• namespace KDChart

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


768 KD Chart 2 File Documentation

7.53 KDChartLayoutItems.cpp File Reference


#include "KDChartLayoutItems.h"
#include "KDTextDocument.h"
#include "KDChartAbstractDiagram.h"
#include "KDChartPaintContext.h"
#include "KDChartPainterSaver_p.h"
#include <QTextCursor>
#include <QTextBlockFormat>
#include <QTextDocumentFragment>
#include <QAbstractTextDocumentLayout>
#include <QLayout>
#include <QPainter>
#include <QDebug>
#include <QCoreApplication>
#include <QApplication>
#include <QStyle>
#include <KDABLibFakes>
#include <math.h>
Include dependency graph for KDChartLayoutItems.cpp:

Defines
• #define PI 3.141592653589793

7.53.1 Define Documentation

7.53.1.1 #define PI 3.141592653589793

Definition at line 46 of file KDChartLayoutItems.cpp.


Referenced by KDChart::TextLayoutItem::intersects().

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


7.54 KDChartLayoutItems.h File Reference 769

7.54 KDChartLayoutItems.h File Reference


#include <QBrush>
#include <QFont>
#include <QFontMetricsF>
#include <QLayout>
#include <QLayoutItem>
#include <QPen>
#include "KDChartTextAttributes.h"
#include "KDChartMarkerAttributes.h"
Include dependency graph for KDChartLayoutItems.h:
This graph shows which files directly or indirectly include this file:

Namespaces
• namespace KDChart

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


770 KD Chart 2 File Documentation

7.55 KDChartLegend.cpp File Reference


#include "KDChartLegend.h"
#include "KDChartLegend_p.h"
#include <KDChartTextAttributes.h>
#include <KDChartMarkerAttributes.h>
#include <QFont>
#include <QPainter>
#include <QTextTableCell>
#include <QTextCursor>
#include <QTextCharFormat>
#include <QTextDocumentFragment>
#include <QTimer>
#include <QAbstractTextDocumentLayout>
#include <QtDebug>
#include <QLabel>
#include <KDChartAbstractDiagram.h>
#include "KDTextDocument.h"
#include <KDChartDiagramObserver.h>
#include <QGridLayout>
#include "KDChartLayoutItems.h"
#include <KDABLibFakes>
Include dependency graph for KDChartLegend.cpp:

Defines
• #define d d_func()

7.55.1 Define Documentation

7.55.1.1 #define d d_func()

Definition at line 72 of file KDChartLegend.cpp.

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


7.56 KDChartLegend.h File Reference 771

7.56 KDChartLegend.h File Reference


#include "KDChartAbstractAreaWidget.h"
#include "KDChartPosition.h"
#include "KDChartMarkerAttributes.h"
Include dependency graph for KDChartLegend.h:
This graph shows which files directly or indirectly include this file:

Namespaces
• namespace KDChart

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


772 KD Chart 2 File Documentation

7.57 KDChartLineAttributes.cpp File Reference


#include "KDChartLineAttributes.h"
#include <QDebug>
#include <KDABLibFakes>
Include dependency graph for KDChartLineAttributes.cpp:

Defines
• #define d d_func()

Functions
• QDebug operator<< (QDebug dbg, const KDChart::LineAttributes &a)

7.57.1 Define Documentation

7.57.1.1 #define d d_func()

Definition at line 31 of file KDChartLineAttributes.cpp.

7.57.2 Function Documentation

7.57.2.1 QDebug operator<< (QDebug dbg, const KDChart::LineAttributes & a)

Definition at line 123 of file KDChartLineAttributes.cpp.

124 {
125 dbg << "KDChart::LineAttributes("
126 // MissingValuesPolicy missingValuesPolicy;
127 << "bool="<<a.displayArea()
128 << "transparency="<<a.transparency()
129 << ")";
130 return dbg;
131
132 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


7.58 KDChartLineAttributes.h File Reference 773

7.58 KDChartLineAttributes.h File Reference


#include <QMetaType>
#include "KDChartGlobal.h"
Include dependency graph for KDChartLineAttributes.h:
This graph shows which files directly or indirectly include this file:

Namespaces
• namespace KDChart

Functions
• KDCHART_EXPORT QDebug operator<< (QDebug, const KDChart::LineAttributes &)
• Q_DECLARE_TYPEINFO (KDChart::LineAttributes, Q_MOVABLE_TYPE)

7.58.1 Function Documentation

7.58.1.1 KDCHART_EXPORT QDebug operator<< (QDebug, const KDChart::LineAttributes


&)

Definition at line 123 of file KDChartLineAttributes.cpp.


References KDChart::LineAttributes::displayArea(), and KDChart::LineAttributes::transparency().

124 {
125 dbg << "KDChart::LineAttributes("
126 // MissingValuesPolicy missingValuesPolicy;
127 << "bool="<<a.displayArea()
128 << "transparency="<<a.transparency()
129 << ")";
130 return dbg;
131
132 }

7.58.1.2 Q_DECLARE_TYPEINFO (KDChart::LineAttributes, Q_MOVABLE_TYPE)

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


774 KD Chart 2 File Documentation

7.59 KDChartLineDiagram.cpp File Reference


#include <QDebug>
#include <QPainter>
#include <QString>
#include <QPen>
#include <QVector>
#include "KDChartLineDiagram.h"
#include "KDChartLineDiagram_p.h"
#include "KDChartPaintContext.h"
#include "KDChartPalette.h"
#include "KDChartTextAttributes.h"
#include "KDChartThreeDLineAttributes.h"
#include "KDChartAttributesModel.h"
#include "KDChartPainterSaver_p.h"
#include "KDChartAbstractGrid.h"
#include "KDChartDataValueAttributes.h"
#include <KDABLibFakes>
Include dependency graph for KDChartLineDiagram.cpp:

Defines
• #define d d_func()

7.59.1 Define Documentation

7.59.1.1 #define d d_func()

Definition at line 56 of file KDChartLineDiagram.cpp.

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


7.60 KDChartLineDiagram.h File Reference 775

7.60 KDChartLineDiagram.h File Reference


#include "KDChartAbstractCartesianDiagram.h"
#include "KDChartLineAttributes.h"
Include dependency graph for KDChartLineDiagram.h:
This graph shows which files directly or indirectly include this file:

Namespaces
• namespace KDChart

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


776 KD Chart 2 File Documentation

7.61 KDChartMarkerAttributes.cpp File Reference


#include "KDChartMarkerAttributes.h"
#include <QColor>
#include <QMap>
#include <QPen>
#include <QSizeF>
#include <QDebug>
#include <qglobal.h>
#include <KDABLibFakes>
Include dependency graph for KDChartMarkerAttributes.cpp:

Defines
• #define d d_func()

Functions
• QDebug operator<< (QDebug dbg, const MarkerAttributes &ma)

7.61.1 Define Documentation

7.61.1.1 #define d d_func()

Definition at line 85 of file KDChartMarkerAttributes.cpp.

7.61.2 Function Documentation

7.61.2.1 QDebug operator<< (QDebug dbg, const MarkerAttributes & ma)

Definition at line 162 of file KDChartMarkerAttributes.cpp.


References KDChart::MarkerAttributes::isVisible(), KDChart::MarkerAttributes::markerColor(),
KDChart::MarkerAttributes::markerStyle(), KDChart::MarkerAttributes::markerStylesMap(), and
KDChart::MarkerAttributes::pen().

162 {
163 return dbg << "KDChart::MarkerAttributes("
164 << "visible=" << ma.isVisible()
165 << "markerStylesMap=" << ma.markerStylesMap()
166 << "markerStyle=" << ma.markerStyle()
167 << "markerColor=" << ma.markerColor()
168 << "pen=" << ma.pen()
169 << ")";
170 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


7.62 KDChartMarkerAttributes.h File Reference 777

7.62 KDChartMarkerAttributes.h File Reference


#include <QMetaType>
#include "KDChartGlobal.h"
Include dependency graph for KDChartMarkerAttributes.h:
This graph shows which files directly or indirectly include this file:

Namespaces
• namespace KDChart

Functions
• KDCHART_EXPORT QDebug operator<< (QDebug, const KDChart::MarkerAttributes &)
• Q_DECLARE_TYPEINFO (KDChart::MarkerAttributes, Q_MOVABLE_TYPE)

7.62.1 Function Documentation

7.62.1.1 KDCHART_EXPORT QDebug operator<< (QDebug, const


KDChart::MarkerAttributes &)

7.62.1.2 Q_DECLARE_TYPEINFO (KDChart::MarkerAttributes, Q_MOVABLE_TYPE)

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


778 KD Chart 2 File Documentation

7.63 KDChartMeasure.cpp File Reference


#include <QWidget>
#include "KDChartMeasure.h"
#include <QtXml/QDomDocumentFragment>
#include <KDChartAbstractArea.h>
#include <KDChartTextAttributes.h>
#include <KDChartFrameAttributes.h>
#include <KDChartBackgroundAttributes.h>
#include <KDABLibFakes>
Include dependency graph for KDChartMeasure.cpp:

Namespaces
• namespace KDChart

Functions
• QDebug operator<< (QDebug dbg, const KDChart::Measure &m)

7.63.1 Function Documentation

7.63.1.1 QDebug operator<< (QDebug dbg, const KDChart::Measure & m)

Definition at line 158 of file KDChartMeasure.cpp.

159 {
160 dbg << "KDChart::Measure("
161 << "value="<<m.value()
162 << "calculationmode="<<m.calculationMode()
163 << "referencearea="<<m.referenceArea()
164 << "referenceorientation="<<m.referenceOrientation()
165 << ")";
166 return dbg;
167 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


7.64 KDChartMeasure.h File Reference 779

7.64 KDChartMeasure.h File Reference


#include <QDebug>
#include <Qt>
#include "KDChartGlobal.h"
#include "KDChartEnums.h"
Include dependency graph for KDChartMeasure.h:
This graph shows which files directly or indirectly include this file:

Namespaces
• namespace KDChart

Functions
• KDCHART_EXPORT QDebug operator<< (QDebug, const KDChart::Measure &)

7.64.1 Function Documentation

7.64.1.1 KDCHART_EXPORT QDebug operator<< (QDebug, const KDChart::Measure &)

Definition at line 158 of file KDChartMeasure.cpp.


References KDChart::Measure::calculationMode(), KDChart::Measure::referenceArea(),
KDChart::Measure::referenceOrientation(), and KDChart::Measure::value().

159 {
160 dbg << "KDChart::Measure("
161 << "value="<<m.value()
162 << "calculationmode="<<m.calculationMode()
163 << "referencearea="<<m.referenceArea()
164 << "referenceorientation="<<m.referenceOrientation()
165 << ")";
166 return dbg;
167 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


780 KD Chart 2 File Documentation

7.65 KDChartPaintContext.cpp File Reference


#include <QRectF>
#include <QPainter>
#include "KDChartPaintContext.h"
#include "KDChartAbstractCoordinatePlane.h"
#include <KDABLibFakes>
Include dependency graph for KDChartPaintContext.cpp:

Defines
• #define d (d_func())

7.65.1 Define Documentation

7.65.1.1 #define d (d_func())

Definition at line 36 of file KDChartPaintContext.cpp.

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


7.66 KDChartPaintContext.h File Reference 781

7.66 KDChartPaintContext.h File Reference


#include <QRectF>
#include "KDChartGlobal.h"
Include dependency graph for KDChartPaintContext.h:
This graph shows which files directly or indirectly include this file:

Namespaces
• namespace KDChart

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


782 KD Chart 2 File Documentation

7.67 KDChartPalette.cpp File Reference


#include "KDChartPalette.h"
#include <QBrush>
#include <QVector>
#include <KDABLibFakes>
Include dependency graph for KDChartPalette.cpp:

Defines
• #define d d_func()

Functions
• Palette makeDefaultPalette ()
• Palette makeRainbowPalette ()
• Palette makeSubduedPalette ()

7.67.1 Define Documentation

7.67.1.1 #define d d_func()

Definition at line 103 of file KDChartPalette.cpp.

7.67.2 Function Documentation

7.67.2.1 Palette makeDefaultPalette () [static]

Definition at line 40 of file KDChartPalette.cpp.


References KDChart::Palette::addBrush().

40 {
41 Palette p;
42
43 p.addBrush( Qt::red );
44 p.addBrush( Qt::green );
45 p.addBrush( Qt::blue );
46 p.addBrush( Qt::cyan );
47 p.addBrush( Qt::magenta );
48 p.addBrush( Qt::yellow );
49 p.addBrush( Qt::darkRed );
50 p.addBrush( Qt::darkGreen );
51 p.addBrush( Qt::darkBlue );
52 p.addBrush( Qt::darkCyan );
53 p.addBrush( Qt::darkMagenta );
54 p.addBrush( Qt::darkYellow );
55
56 return p;
57 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


7.67 KDChartPalette.cpp File Reference 783

7.67.2.2 Palette makeRainbowPalette () [static]

Definition at line 84 of file KDChartPalette.cpp.


References KDChart::Palette::addBrush(), and KDChart::Palette::getBrush().

84 {
85 Palette p;
86
87 p.addBrush( QColor(255, 0,196) );
88 p.addBrush( QColor(255, 0, 96) );
89 p.addBrush( QColor(255, 128,64) );
90 p.addBrush( Qt::yellow );
91 p.addBrush( Qt::green );
92 p.addBrush( Qt::cyan );
93 p.addBrush( QColor( 96, 96,255) );
94 p.addBrush( QColor(160, 0,255) );
95 for( int i = 8 ; i < 16 ; ++i )
96 p.addBrush( p.getBrush(i-8).color().light(), i );
97
98 return p;
99 }

7.67.2.3 Palette makeSubduedPalette () [static]

Definition at line 59 of file KDChartPalette.cpp.


References KDChart::Palette::addBrush().

59 {
60 Palette p;
61
62 p.addBrush( QColor( 0xe0,0x7f,0x70 ) );
63 p.addBrush( QColor( 0xe2,0xa5,0x6f ) );
64 p.addBrush( QColor( 0xe0,0xc9,0x70 ) );
65 p.addBrush( QColor( 0xd1,0xe0,0x70 ) );
66 p.addBrush( QColor( 0xac,0xe0,0x70 ) );
67 p.addBrush( QColor( 0x86,0xe0,0x70 ) );
68 p.addBrush( QColor( 0x70,0xe0,0x7f ) );
69 p.addBrush( QColor( 0x70,0xe0,0xa4 ) );
70 p.addBrush( QColor( 0x70,0xe0,0xc9 ) );
71 p.addBrush( QColor( 0x70,0xd1,0xe0 ) );
72 p.addBrush( QColor( 0x70,0xac,0xe0 ) );
73 p.addBrush( QColor( 0x70,0x86,0xe0 ) );
74 p.addBrush( QColor( 0x7f,0x70,0xe0 ) );
75 p.addBrush( QColor( 0xa4,0x70,0xe0 ) );
76 p.addBrush( QColor( 0xc9,0x70,0xe0 ) );
77 p.addBrush( QColor( 0xe0,0x70,0xd1 ) );
78 p.addBrush( QColor( 0xe0,0x70,0xac ) );
79 p.addBrush( QColor( 0xe0,0x70,0x86 ) );
80
81 return p;
82 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


784 KD Chart 2 File Documentation

7.68 KDChartPalette.h File Reference


#include <QObject>
#include <QBrush>
#include "KDChartGlobal.h"
Include dependency graph for KDChartPalette.h:
This graph shows which files directly or indirectly include this file:

Namespaces
• namespace KDChart

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


7.69 KDChartPieAttributes.cpp File Reference 785

7.69 KDChartPieAttributes.cpp File Reference


#include "KDChartPieAttributes.h"
#include "KDChartPieAttributes_p.h"
#include <QDebug>
#include <KDABLibFakes>
Include dependency graph for KDChartPieAttributes.cpp:

Defines
• #define d d_func()

Functions
• QDebug operator<< (QDebug dbg, const KDChart::PieAttributes &a)

7.69.1 Define Documentation

7.69.1.1 #define d d_func()

Definition at line 33 of file KDChartPieAttributes.cpp.

7.69.2 Function Documentation

7.69.2.1 QDebug operator<< (QDebug dbg, const KDChart::PieAttributes & a)

Definition at line 106 of file KDChartPieAttributes.cpp.

107 {
108 dbg << "KDChart::PieAttributes(";
109 dbg << "explodeFactor="<< a.explodeFactor() << ")";
110 return dbg;
111 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


786 KD Chart 2 File Documentation

7.70 KDChartPieAttributes.h File Reference


#include <QMetaType>
#include "KDChartAbstractThreeDAttributes.h"
#include "KDChartGlobal.h"
Include dependency graph for KDChartPieAttributes.h:
This graph shows which files directly or indirectly include this file:

Namespaces
• namespace KDChart

Functions
• KDCHART_EXPORT QDebug operator<< (QDebug, const KDChart::PieAttributes &)
• Q_DECLARE_TYPEINFO (KDChart::PieAttributes, Q_MOVABLE_TYPE)

7.70.1 Function Documentation

7.70.1.1 KDCHART_EXPORT QDebug operator<< (QDebug, const KDChart::PieAttributes &)

Definition at line 106 of file KDChartPieAttributes.cpp.


References KDChart::PieAttributes::explodeFactor().

107 {
108 dbg << "KDChart::PieAttributes(";
109 dbg << "explodeFactor="<< a.explodeFactor() << ")";
110 return dbg;
111 }

7.70.1.2 Q_DECLARE_TYPEINFO (KDChart::PieAttributes, Q_MOVABLE_TYPE)

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


7.71 KDChartPieDiagram.cpp File Reference 787

7.71 KDChartPieDiagram.cpp File Reference


#include <QDebug>
#include <QPainter>
#include <QStack>
#include "KDChartAttributesModel.h"
#include "KDChartPaintContext.h"
#include "KDChartPieDiagram.h"
#include "KDChartPieDiagram_p.h"
#include "KDChartPieAttributes.h"
#include "KDChartThreeDPieAttributes.h"
#include "KDChartPainterSaver_p.h"
#include "KDChartDataValueAttributes.h"
#include <KDABLibFakes>
Include dependency graph for KDChartPieDiagram.cpp:

Defines
• #define d d_func()

Functions
• QRectF buildReferenceRect (const PolarCoordinatePlane ∗plane)

7.71.1 Define Documentation

7.71.1.1 #define d d_func()

Definition at line 50 of file KDChartPieDiagram.cpp.

7.71.2 Function Documentation

7.71.2.1 QRectF buildReferenceRect (const PolarCoordinatePlane ∗ plane) [static]

Definition at line 113 of file KDChartPieDiagram.cpp.


References KDChart::PolarCoordinatePlane::translate().
Referenced by KDChart::PieDiagram::paint().

114 {
115 QRectF contentsRect;
116 //qDebug() << "..........................................";
117 QPointF referencePointAtTop = plane->translate( QPointF( 1, 0 ) );
118 QPointF temp = plane->translate( QPointF( 0, 0 ) ) - referencePointAtTop;
119 const double offset = temp.y();
120 referencePointAtTop.setX( referencePointAtTop.x() - offset );

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


788 KD Chart 2 File Documentation

121 contentsRect.setTopLeft( referencePointAtTop );


122 contentsRect.setBottomRight( referencePointAtTop + QPointF( 2*offset, 2*offset) );
123 //qDebug() << contentsRect;
124 return contentsRect;
125 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


7.72 KDChartPieDiagram.h File Reference 789

7.72 KDChartPieDiagram.h File Reference


#include "KDChartAbstractPieDiagram.h"
Include dependency graph for KDChartPieDiagram.h:
This graph shows which files directly or indirectly include this file:

Namespaces
• namespace KDChart

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


790 KD Chart 2 File Documentation

7.73 KDChartPolarCoordinatePlane.cpp File Reference


#include <math.h>
#include <QFont>
#include <QList>
#include <QtDebug>
#include <QPainter>
#include "KDChartChart.h"
#include "KDChartPaintContext.h"
#include "KDChartAbstractDiagram.h"
#include "KDChartAbstractPolarDiagram.h"
#include "KDChartPolarCoordinatePlane.h"
#include "KDChartPolarCoordinatePlane_p.h"
#include "KDChartPainterSaver_p.h"
#include <KDABLibFakes>
Include dependency graph for KDChartPolarCoordinatePlane.cpp:

Defines
• #define d d_func()

7.73.1 Define Documentation

7.73.1.1 #define d d_func()

Definition at line 45 of file KDChartPolarCoordinatePlane.cpp.

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


7.74 KDChartPolarCoordinatePlane.h File Reference 791

7.74 KDChartPolarCoordinatePlane.h File Reference


#include "KDChartAbstractCoordinatePlane.h"
Include dependency graph for KDChartPolarCoordinatePlane.h:
This graph shows which files directly or indirectly include this file:

Namespaces
• namespace KDChart

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


792 KD Chart 2 File Documentation

7.75 KDChartPolarDiagram.cpp File Reference


#include <QPainter>
#include "KDChartAttributesModel.h"
#include "KDChartPaintContext.h"
#include "KDChartPolarDiagram.h"
#include "KDChartPolarDiagram_p.h"
#include "KDChartPainterSaver_p.h"
#include "KDChartDataValueAttributes.h"
#include <KDABLibFakes>
Include dependency graph for KDChartPolarDiagram.cpp:

Defines
• #define d d_func()

7.75.1 Define Documentation

7.75.1.1 #define d d_func()

Definition at line 47 of file KDChartPolarDiagram.cpp.

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


7.76 KDChartPolarDiagram.h File Reference 793

7.76 KDChartPolarDiagram.h File Reference


#include "KDChartPosition.h"
#include "KDChartAbstractPolarDiagram.h"
Include dependency graph for KDChartPolarDiagram.h:
This graph shows which files directly or indirectly include this file:

Namespaces
• namespace KDChart

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


794 KD Chart 2 File Documentation

7.77 KDChartPosition.cpp File Reference

#include <KDChartPosition.h>
#include <KDChartEnums.h>
#include <QString>
#include <QStringList>
#include <QList>
#include <QByteArray>
#include <KDABLibFakes>
#include <cassert>
Include dependency graph for KDChartPosition.cpp:

Functions

• QDebug operator<< (QDebug dbg, const KDChart::Position &p)

Variables

• int maxPositionValue = 9
• Position staticPositionCenter = Position( KDChartEnums::PositionCenter )
• Position staticPositionEast = Position( KDChartEnums::PositionEast )
• const char ∗ staticPositionNames [ ]
• Position staticPositionNorth = Position( KDChartEnums::PositionNorth )
• Position staticPositionNorthEast = Position( KDChartEnums::PositionNorthEast )
• Position staticPositionNorthWest = Position( KDChartEnums::PositionNorthWest )
• Position staticPositionSouth = Position( KDChartEnums::PositionSouth )
• Position staticPositionSouthEast = Position( KDChartEnums::PositionSouthEast )
• Position staticPositionSouthWest = Position( KDChartEnums::PositionSouthWest )
• Position staticPositionUnknown = Position( KDChartEnums::PositionUnknown )
• Position staticPositionWest = Position( KDChartEnums::PositionWest )

7.77.1 Function Documentation

7.77.1.1 QDebug operator<< (QDebug dbg, const KDChart::Position & p)

Definition at line 247 of file KDChartPosition.cpp.

248 {
249 dbg << "KDChart::Position("
250 << p.name() << ")";
251 return dbg;
252 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


7.77 KDChartPosition.cpp File Reference 795

7.77.2 Variable Documentation

7.77.2.1 int maxPositionValue = 9 [static]

Definition at line 78 of file KDChartPosition.cpp.


Referenced by KDChart::Position::fromName(), KDChart::Position::names(), and
KDChart::Position::printableNames().

7.77.2.2 Position staticPositionCenter = Position( KDChartEnums::PositionCenter ) [static]

Definition at line 68 of file KDChartPosition.cpp.

7.77.2.3 Position staticPositionEast = Position( KDChartEnums::PositionEast ) [static]

Definition at line 72 of file KDChartPosition.cpp.

7.77.2.4 const char∗ staticPositionNames[ ] [static]

Initial value:

{
QT_TRANSLATE_NOOP("Position","Unknown Position"),
QT_TRANSLATE_NOOP("Position","Center"),
QT_TRANSLATE_NOOP("Position","NorthWest"),
QT_TRANSLATE_NOOP("Position","North"),
QT_TRANSLATE_NOOP("Position","NorthEast"),
QT_TRANSLATE_NOOP("Position","East"),
QT_TRANSLATE_NOOP("Position","SouthEast"),
QT_TRANSLATE_NOOP("Position","South"),
QT_TRANSLATE_NOOP("Position","SouthWest"),

Definition at line 49 of file KDChartPosition.cpp.


Referenced by KDChart::Position::fromName(), KDChart::Position::name(), KDChart::Position::names(),
and KDChart::Position::printableName().

7.77.2.5 Position staticPositionNorth = Position( KDChartEnums::PositionNorth ) [static]

Definition at line 70 of file KDChartPosition.cpp.

7.77.2.6 Position staticPositionNorthEast = Position( KDChartEnums::PositionNorthEast )


[static]

Definition at line 71 of file KDChartPosition.cpp.

7.77.2.7 Position staticPositionNorthWest = Position( KDChartEnums::PositionNorthWest )


[static]

Definition at line 69 of file KDChartPosition.cpp.

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


796 KD Chart 2 File Documentation

7.77.2.8 Position staticPositionSouth = Position( KDChartEnums::PositionSouth ) [static]

Definition at line 74 of file KDChartPosition.cpp.

7.77.2.9 Position staticPositionSouthEast = Position( KDChartEnums::PositionSouthEast )


[static]

Definition at line 73 of file KDChartPosition.cpp.

7.77.2.10 Position staticPositionSouthWest = Position( KDChartEnums::PositionSouthWest )


[static]

Definition at line 75 of file KDChartPosition.cpp.

7.77.2.11 Position staticPositionUnknown = Position( KDChartEnums::PositionUnknown )


[static]

Definition at line 67 of file KDChartPosition.cpp.

7.77.2.12 Position staticPositionWest = Position( KDChartEnums::PositionWest ) [static]

Definition at line 76 of file KDChartPosition.cpp.

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


7.78 KDChartPosition.h File Reference 797

7.78 KDChartPosition.h File Reference


#include <QDebug>
#include <Qt>
#include <QMetaType>
#include <QCoreApplication>
#include "KDChartGlobal.h"
#include "KDChartEnums.h"
Include dependency graph for KDChartPosition.h:
This graph shows which files directly or indirectly include this file:

Namespaces
• namespace KDChart

Functions
• KDCHART_EXPORT QDebug operator<< (QDebug, const KDChart::Position &)
• Q_DECLARE_TYPEINFO (KDChart::Position, Q_MOVABLE_TYPE)

7.78.1 Function Documentation

7.78.1.1 KDCHART_EXPORT QDebug operator<< (QDebug, const KDChart::Position &)

Definition at line 247 of file KDChartPosition.cpp.


References KDChart::Position::name().

248 {
249 dbg << "KDChart::Position("
250 << p.name() << ")";
251 return dbg;
252 }

7.78.1.2 Q_DECLARE_TYPEINFO (KDChart::Position, Q_MOVABLE_TYPE)

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


798 KD Chart 2 File Documentation

7.79 KDChartRelativePosition.cpp File Reference


#include "KDChartRelativePosition.h"
#include "KDChartEnums.h"
#include "KDChartMeasure.h"
#include "KDChartPosition.h"
#include <KDABLibFakes>
Include dependency graph for KDChartRelativePosition.cpp:

Defines
• #define d d_func()

Functions
• QDebug operator<< (QDebug dbg, const KDChart::RelativePosition &rp)

7.79.1 Define Documentation

7.79.1.1 #define d d_func()

Definition at line 84 of file KDChartRelativePosition.cpp.

7.79.2 Function Documentation

7.79.2.1 QDebug operator<< (QDebug dbg, const KDChart::RelativePosition & rp)

Definition at line 148 of file KDChartRelativePosition.cpp.

149 {
150 dbg << "KDChart::RelativePosition("
151 << "referencearea="<<rp.referenceArea()
152 << "referenceposition="<<rp.referencePosition()
153 << "alignment="<<rp.alignment()
154 << "horizontalpadding="<<rp.horizontalPadding()
155 << "verticalpadding="<<rp.verticalPadding()
156 << "rotation="<<rp.rotation()
157 << ")";
158 return dbg;
159 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


7.80 KDChartRelativePosition.h File Reference 799

7.80 KDChartRelativePosition.h File Reference


#include <QDebug>
#include <QMetaType>
#include <Qt>
#include "KDChartGlobal.h"
Include dependency graph for KDChartRelativePosition.h:
This graph shows which files directly or indirectly include this file:

Namespaces
• namespace KDChart

Functions
• KDCHART_EXPORT QDebug operator<< (QDebug, const KDChart::RelativePosition &)
• Q_DECLARE_TYPEINFO (KDChart::RelativePosition, Q_MOVABLE_TYPE)

7.80.1 Function Documentation

7.80.1.1 KDCHART_EXPORT QDebug operator<< (QDebug, const KDChart::RelativePosition


&)

Definition at line 148 of file KDChartRelativePosition.cpp.


References KDChart::RelativePosition::alignment(), KDChart::RelativePosition::horizontalPadding(),
KDChart::RelativePosition::referenceArea(), KDChart::RelativePosition::referencePosition(),
KDChart::RelativePosition::rotation(), and KDChart::RelativePosition::verticalPadding().

149 {
150 dbg << "KDChart::RelativePosition("
151 << "referencearea="<<rp.referenceArea()
152 << "referenceposition="<<rp.referencePosition()
153 << "alignment="<<rp.alignment()
154 << "horizontalpadding="<<rp.horizontalPadding()
155 << "verticalpadding="<<rp.verticalPadding()
156 << "rotation="<<rp.rotation()
157 << ")";
158 return dbg;
159 }

7.80.1.2 Q_DECLARE_TYPEINFO (KDChart::RelativePosition, Q_MOVABLE_TYPE)

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


800 KD Chart 2 File Documentation

7.81 KDChartRingDiagram.cpp File Reference


#include <QPainter>
#include "KDChartAttributesModel.h"
#include "KDChartPaintContext.h"
#include "KDChartRingDiagram.h"
#include "KDChartRingDiagram_p.h"
#include "KDChartPainterSaver_p.h"
#include "KDChartPieAttributes.h"
#include "KDChartThreeDPieAttributes.h"
#include "KDChartDataValueAttributes.h"
#include <KDABLibFakes>
Include dependency graph for KDChartRingDiagram.cpp:

Defines
• #define d d_func()

7.81.1 Define Documentation

7.81.1.1 #define d d_func()

Definition at line 48 of file KDChartRingDiagram.cpp.

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


7.82 KDChartRingDiagram.h File Reference 801

7.82 KDChartRingDiagram.h File Reference


#include "KDChartAbstractPieDiagram.h"
Include dependency graph for KDChartRingDiagram.h:
This graph shows which files directly or indirectly include this file:

Namespaces
• namespace KDChart

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


802 KD Chart 2 File Documentation

7.83 KDChartTextArea.cpp File Reference


#include "KDChartTextArea.h"
#include "KDChartTextArea_p.h"
#include <qglobal.h>
#include <QPainter>
#include <QRect>
#include <KDABLibFakes>
Include dependency graph for KDChartTextArea.cpp:

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


7.84 KDChartTextArea.h File Reference 803

7.84 KDChartTextArea.h File Reference


#include <QObject>
#include "KDChartGlobal.h"
#include "KDChartAbstractAreaBase.h"
#include "KDChartLayoutItems.h"
Include dependency graph for KDChartTextArea.h:
This graph shows which files directly or indirectly include this file:

Namespaces
• namespace KDChart

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


804 KD Chart 2 File Documentation

7.85 KDChartTextAttributes.cpp File Reference


#include "KDChartTextAttributes.h"
#include <QFont>
#include <QPen>
#include <qglobal.h>
#include <QApplication>
#include <KDABLibFakes>
Include dependency graph for KDChartTextAttributes.cpp:

Defines
• #define d d_func()

Functions
• QDebug operator<< (QDebug dbg, const KDChart::TextAttributes &ta)

7.85.1 Define Documentation

7.85.1.1 #define d d_func()

Definition at line 34 of file KDChartTextAttributes.cpp.

7.85.2 Function Documentation

7.85.2.1 QDebug operator<< (QDebug dbg, const KDChart::TextAttributes & ta)

Definition at line 192 of file KDChartTextAttributes.cpp.

193 {
194 dbg << "KDChart::TextAttributes("
195 << "visible="<<ta.isVisible()
196 << "font="<<ta.font().toString() /* What? No QDebug for QFont? */
197 << "fontsize="<<ta.fontSize()
198 << "minimalfontsize="<<ta.minimalFontSize()
199 << "autorotate="<<ta.autoRotate()
200 << "autoshrink="<<ta.autoShrink()
201 << "rotation="<<ta.rotation()
202 << "pen="<<ta.pen()
203 << ")";
204 return dbg;
205 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


7.86 KDChartTextAttributes.h File Reference 805

7.86 KDChartTextAttributes.h File Reference


#include <QDebug>
#include <QMetaType>
#include "KDChartGlobal.h"
#include "KDChartMeasure.h"
Include dependency graph for KDChartTextAttributes.h:
This graph shows which files directly or indirectly include this file:

Namespaces
• namespace KDChart

Functions
• KDCHART_EXPORT QDebug operator<< (QDebug, const KDChart::TextAttributes &)
• Q_DECLARE_TYPEINFO (KDChart::TextAttributes, Q_MOVABLE_TYPE)

7.86.1 Function Documentation

7.86.1.1 KDCHART_EXPORT QDebug operator<< (QDebug, const KDChart::TextAttributes


&)

Definition at line 192 of file KDChartTextAttributes.cpp.


References KDChart::TextAttributes::autoRotate(), KDChart::TextAttributes::autoShrink(),
KDChart::TextAttributes::font(), KDChart::TextAttributes::fontSize(), KDChart::TextAttributes::is-
Visible(), KDChart::TextAttributes::minimalFontSize(), KDChart::TextAttributes::pen(), and
KDChart::TextAttributes::rotation().

193 {
194 dbg << "KDChart::TextAttributes("
195 << "visible="<<ta.isVisible()
196 << "font="<<ta.font().toString() /* What? No QDebug for QFont? */
197 << "fontsize="<<ta.fontSize()
198 << "minimalfontsize="<<ta.minimalFontSize()
199 << "autorotate="<<ta.autoRotate()
200 << "autoshrink="<<ta.autoShrink()
201 << "rotation="<<ta.rotation()
202 << "pen="<<ta.pen()
203 << ")";
204 return dbg;
205 }

7.86.1.2 Q_DECLARE_TYPEINFO (KDChart::TextAttributes, Q_MOVABLE_TYPE)

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


806 KD Chart 2 File Documentation

7.87 KDChartThreeDBarAttributes.cpp File Reference


#include "KDChartThreeDBarAttributes.h"
#include "KDChartThreeDBarAttributes_p.h"
#include <QDebug>
#include <KDABLibFakes>
Include dependency graph for KDChartThreeDBarAttributes.cpp:

Defines
• #define d d_func()

Functions
• QDebug operator<< (QDebug dbg, const KDChart::ThreeDBarAttributes &a)

7.87.1 Define Documentation

7.87.1.1 #define d d_func()

Definition at line 33 of file KDChartThreeDBarAttributes.cpp.

7.87.2 Function Documentation

7.87.2.1 QDebug operator<< (QDebug dbg, const KDChart::ThreeDBarAttributes & a)

Definition at line 105 of file KDChartThreeDBarAttributes.cpp.

106 {
107 dbg << "KDChart::ThreeDBarAttributes(";
108 dbg = operator <<( dbg, static_cast<const AbstractThreeDAttributes&>(a) );
109 dbg << "useShadowColors="<< a.useShadowColors()
110 << "angle=" << a.angle() << ")";
111 return dbg;
112 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


7.88 KDChartThreeDBarAttributes.h File Reference 807

7.88 KDChartThreeDBarAttributes.h File Reference


#include <QMetaType>
#include "KDChartAbstractThreeDAttributes.h"
#include "KDChartGlobal.h"
Include dependency graph for KDChartThreeDBarAttributes.h:
This graph shows which files directly or indirectly include this file:

Namespaces
• namespace KDChart

Functions
• KDCHART_EXPORT QDebug operator<< (QDebug, const KDChart::ThreeDBarAttributes &)
• Q_DECLARE_TYPEINFO (KDChart::ThreeDBarAttributes, Q_MOVABLE_TYPE)

7.88.1 Function Documentation

7.88.1.1 KDCHART_EXPORT QDebug operator<< (QDebug, const


KDChart::ThreeDBarAttributes &)

Definition at line 105 of file KDChartThreeDBarAttributes.cpp.


References KDChart::ThreeDBarAttributes::angle(), and KDChart::ThreeDBarAttributes::useShadow-
Colors().

106 {
107 dbg << "KDChart::ThreeDBarAttributes(";
108 dbg = operator <<( dbg, static_cast<const AbstractThreeDAttributes&>(a) );
109 dbg << "useShadowColors="<< a.useShadowColors()
110 << "angle=" << a.angle() << ")";
111 return dbg;
112 }

7.88.1.2 Q_DECLARE_TYPEINFO (KDChart::ThreeDBarAttributes, Q_MOVABLE_TYPE)

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


808 KD Chart 2 File Documentation

7.89 KDChartThreeDLineAttributes.cpp File Reference


#include "KDChartThreeDLineAttributes.h"
#include "KDChartThreeDLineAttributes_p.h"
#include <QDebug>
#include <KDABLibFakes>
Include dependency graph for KDChartThreeDLineAttributes.cpp:

Defines
• #define d d_func()

Functions
• QDebug operator<< (QDebug dbg, const KDChart::ThreeDLineAttributes &a)

7.89.1 Define Documentation

7.89.1.1 #define d d_func()

Definition at line 33 of file KDChartThreeDLineAttributes.cpp.

7.89.2 Function Documentation

7.89.2.1 QDebug operator<< (QDebug dbg, const KDChart::ThreeDLineAttributes & a)

Definition at line 106 of file KDChartThreeDLineAttributes.cpp.

107 {
108 dbg << "KDChart::ThreeDLineAttributes(";
109 dbg = operator <<( dbg, static_cast<const AbstractThreeDAttributes&>(a) );
110 dbg << " lineXRotation="<< a.lineXRotation()
111 << " lineYRotation="<< a.lineYRotation()
112 << ")";
113 return dbg;
114 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


7.90 KDChartThreeDLineAttributes.h File Reference 809

7.90 KDChartThreeDLineAttributes.h File Reference


#include <QMetaType>
#include "KDChartAbstractThreeDAttributes.h"
#include "KDChartGlobal.h"
Include dependency graph for KDChartThreeDLineAttributes.h:
This graph shows which files directly or indirectly include this file:

Namespaces
• namespace KDChart

Functions
• KDCHART_EXPORT QDebug operator<< (QDebug, const KDChart::ThreeDLineAttributes &)
• Q_DECLARE_TYPEINFO (KDChart::ThreeDLineAttributes, Q_MOVABLE_TYPE)

7.90.1 Function Documentation

7.90.1.1 KDCHART_EXPORT QDebug operator<< (QDebug, const


KDChart::ThreeDLineAttributes &)

Definition at line 106 of file KDChartThreeDLineAttributes.cpp.


References KDChart::ThreeDLineAttributes::lineXRotation(), and KDChart::ThreeDLineAttributes::line-
YRotation().

107 {
108 dbg << "KDChart::ThreeDLineAttributes(";
109 dbg = operator <<( dbg, static_cast<const AbstractThreeDAttributes&>(a) );
110 dbg << " lineXRotation="<< a.lineXRotation()
111 << " lineYRotation="<< a.lineYRotation()
112 << ")";
113 return dbg;
114 }

7.90.1.2 Q_DECLARE_TYPEINFO (KDChart::ThreeDLineAttributes, Q_MOVABLE_TYPE)

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


810 KD Chart 2 File Documentation

7.91 KDChartThreeDPieAttributes.cpp File Reference


#include "KDChartThreeDPieAttributes.h"
#include "KDChartThreeDPieAttributes_p.h"
#include <QDebug>
#include <KDABLibFakes>
Include dependency graph for KDChartThreeDPieAttributes.cpp:

Defines
• #define d d_func()

Functions
• QDebug operator<< (QDebug dbg, const KDChart::ThreeDPieAttributes &a)

7.91.1 Define Documentation

7.91.1.1 #define d d_func()

Definition at line 33 of file KDChartThreeDPieAttributes.cpp.

7.91.2 Function Documentation

7.91.2.1 QDebug operator<< (QDebug dbg, const KDChart::ThreeDPieAttributes & a)

Definition at line 92 of file KDChartThreeDPieAttributes.cpp.


References KDChart::ThreeDPieAttributes::useShadowColors().

93 {
94 dbg << "KDChart::ThreeDPieAttributes(";
95 dbg = operator <<( dbg, static_cast<const AbstractThreeDAttributes&>(a) );
96 dbg << "useShadowColors="<< a.useShadowColors() << ")";
97 return dbg;
98 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


7.92 KDChartThreeDPieAttributes.h File Reference 811

7.92 KDChartThreeDPieAttributes.h File Reference


#include <QMetaType>
#include "KDChartAbstractThreeDAttributes.h"
#include "KDChartGlobal.h"
Include dependency graph for KDChartThreeDPieAttributes.h:
This graph shows which files directly or indirectly include this file:

Namespaces
• namespace KDChart

Functions
• KDCHART_EXPORT QDebug operator<< (QDebug, const KDChart::ThreeDPieAttributes &)
• Q_DECLARE_TYPEINFO (KDChart::ThreeDPieAttributes, Q_MOVABLE_TYPE)

7.92.1 Function Documentation

7.92.1.1 KDCHART_EXPORT QDebug operator<< (QDebug, const


KDChart::ThreeDPieAttributes &)

Definition at line 92 of file KDChartThreeDPieAttributes.cpp.


References KDChart::ThreeDPieAttributes::useShadowColors().

93 {
94 dbg << "KDChart::ThreeDPieAttributes(";
95 dbg = operator <<( dbg, static_cast<const AbstractThreeDAttributes&>(a) );
96 dbg << "useShadowColors="<< a.useShadowColors() << ")";
97 return dbg;
98 }

7.92.1.2 Q_DECLARE_TYPEINFO (KDChart::ThreeDPieAttributes, Q_MOVABLE_TYPE)

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


812 KD Chart 2 File Documentation

7.93 KDChartWidget.cpp File Reference


#include <KDChartWidget.h>
#include <KDChartWidget_p.h>
#include <KDChartAbstractDiagram.h>
#include <KDChartBarDiagram.h>
#include <KDChartCartesianCoordinatePlane.h>
#include <KDChartChart.h>
#include <KDChartAbstractCoordinatePlane.h>
#include <KDChartLineDiagram.h>
#include <KDChartPieDiagram.h>
#include <KDChartPolarCoordinatePlane.h>
#include <KDChartPolarDiagram.h>
#include <KDChartRingDiagram.h>
#include <KDChartLegend.h>
#include <QDebug>
#include <KDABLibFakes>
Include dependency graph for KDChartWidget.cpp:

Defines
• #define d d_func()
• #define SET_SUB_TYPE(DIAGRAM, SUBTYPE)
• #define TEST_SUB_TYPE(DIAGRAM, INTERNALSUBTYPE, SUBTYPE)

Functions
• bool isCartesian (KDChart::Widget::ChartType type)
• bool isPolar (KDChart::Widget::ChartType type)

7.93.1 Define Documentation

7.93.1.1 #define d d_func()

Definition at line 49 of file KDChartWidget.cpp.

7.93.1.2 #define SET_SUB_TYPE(DIAGRAM, SUBTYPE)

Value:

{ \
if( DIAGRAM ) \
DIAGRAM->setType( SUBTYPE ); \
}

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


7.93 KDChartWidget.cpp File Reference 813

Referenced by KDChart::Widget::setSubType().

7.93.1.3 #define TEST_SUB_TYPE(DIAGRAM, INTERNALSUBTYPE, SUBTYPE)

Value:

{ \
if( DIAGRAM && DIAGRAM->type() == INTERNALSUBTYPE ) \
retVal = SUBTYPE; \
}

7.93.2 Function Documentation

7.93.2.1 bool isCartesian (KDChart::Widget::ChartType type) [static]

Definition at line 360 of file KDChartWidget.cpp.

361 {
362 return (type == KDChart::Widget::Bar || type == KDChart::Widget::Line);
363 }

7.93.2.2 bool isPolar (KDChart::Widget::ChartType type) [static]

Definition at line 365 of file KDChartWidget.cpp.

366 {
367 return (type == KDChart::Widget::Pie
368 || type == KDChart::Widget::Ring
369 || type == KDChart::Widget::Polar );
370 }

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


814 KD Chart 2 File Documentation

7.94 KDChartWidget.h File Reference


#include "KDChartGlobal.h"
#include <QWidget>
#include "KDChartEnums.h"
#include "KDChartHeaderFooter.h"
Include dependency graph for KDChartWidget.h:
This graph shows which files directly or indirectly include this file:

Namespaces
• namespace KDChart

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


7.95 KDChartZoomParameters.h File Reference 815

7.95 KDChartZoomParameters.h File Reference

Namespaces
• namespace KDChart

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


816 KD Chart 2 File Documentation

7.96 KDTextDocument.cpp File Reference


#include "KDTextDocument.h"
#include <QRect>
#include <QAbstractTextDocumentLayout>
#include <QtDebug>
#include <QTextBlock>
#include <KDABLibFakes>
Include dependency graph for KDTextDocument.cpp:

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


7.97 KDTextDocument.h File Reference 817

7.97 KDTextDocument.h File Reference


#include <QTextDocument>
#include <QSize>
Include dependency graph for KDTextDocument.h:
This graph shows which files directly or indirectly include this file:

Classes
• class KDTextDocument

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


Index

∼AbstractArea KDTextDocument, 400


KDChart::AbstractArea, 30 ∼Legend
∼AbstractAreaBase KDChart::Legend, 405
KDChart::AbstractAreaBase, 38 ∼LineAttributes
∼AbstractAreaWidget KDChart::LineAttributes, 429
KDChart::AbstractAreaWidget, 44 ∼LineDiagram
∼AbstractAxis KDChart::LineDiagram, 436
KDChart::AbstractAxis, 52 ∼MarkerAttributes
∼AbstractCartesianDiagram KDChart::MarkerAttributes, 474
KDChart::AbstractCartesianDiagram, 67 ∼Palette
∼AbstractCoordinatePlane KDChart::Palette, 489
KDChart::AbstractCoordinatePlane, 96 ∼PieAttributes
∼AbstractDiagram KDChart::PieAttributes, 491
KDChart::AbstractDiagram, 118 ∼PieDiagram
∼AbstractPieDiagram KDChart::PieDiagram, 498
KDChart::AbstractPieDiagram, 148 ∼PolarCoordinatePlane
∼AbstractPolarDiagram KDChart::PolarCoordinatePlane, 533
KDChart::AbstractPolarDiagram, 180 ∼PolarDiagram
∼AbstractThreeDAttributes KDChart::PolarDiagram, 561
KDChart::AbstractThreeDAttributes, 206 ∼RelativePosition
∼AttributesModel KDChart::RelativePosition, 606
KDChart::AttributesModel, 210 ∼RingDiagram
∼BackgroundAttributes KDChart::RingDiagram, 612
KDChart::BackgroundAttributes, 220 ∼TextArea
∼BarAttributes KDChart::TextArea, 644
KDChart::BarAttributes, 222 ∼TextAttributes
∼BarDiagram KDChart::TextAttributes, 657
KDChart::BarDiagram, 230 ∼ThreeDBarAttributes
∼CartesianAxis KDChart::ThreeDBarAttributes, 670
KDChart::CartesianAxis, 268 ∼ThreeDLineAttributes
∼CartesianCoordinatePlane KDChart::ThreeDLineAttributes, 675
KDChart::CartesianCoordinatePlane, 298 ∼ThreeDPieAttributes
∼Chart KDChart::ThreeDPieAttributes, 680
KDChart::Chart, 328 ∼Widget
∼DataValueAttributes KDChart::Widget, 692
KDChart::DataValueAttributes, 356 __kdab__dereference_for_methodcall
∼DiagramObserver KDChartGlobal.h, 763
KDChart::DiagramObserver, 362 __pad0__
∼FrameAttributes KDChart::AbstractArea, 36
KDChart::FrameAttributes, 364 KDChart::AbstractAreaWidget, 49
∼GridAttributes KDChart::AbstractAxis, 62
KDChart::GridAttributes, 366 KDChart::AbstractCartesianDiagram, 92
∼HeaderFooter KDChart::AbstractCoordinatePlane, 113
KDChart::HeaderFooter, 371 KDChart::AbstractDiagram, 140
∼KDTextDocument KDChart::AbstractPieDiagram, 175
INDEX 819

KDChart::AbstractPolarDiagram, 203 addDiagram


KDChart::AttributesModel, 218 KDChart::AbstractCoordinatePlane, 96
KDChart::BarDiagram, 264 KDChart::CartesianCoordinatePlane, 298
KDChart::CartesianAxis, 293 KDChart::Legend, 405
KDChart::CartesianCoordinatePlane, 325 KDChart::PolarCoordinatePlane, 534
KDChart::Chart, 341 addHeaderFooter
KDChart::DatasetSelectorWidget, 354 KDChart::Chart, 329
KDChart::DiagramObserver, 363 KDChart::Widget, 693
KDChart::HeaderFooter, 384 addLegend
KDChart::Legend, 427 KDChart::Chart, 329
KDChart::LineDiagram, 472 KDChart::Widget, 693
KDChart::Palette, 490 alignment
KDChart::PieDiagram, 529 KDChart::Legend, 406
KDChart::PolarCoordinatePlane, 555 KDChart::RelativePosition, 606
KDChart::PolarDiagram, 588 alignToReferencePoint
KDChart::RingDiagram, 641 KDChart::AbstractArea, 31
KDChart::TextArea, 655 KDChart::AbstractAreaBase, 39
KDChart::AbstractAreaWidget, 44
AbstractArea KDChart::AbstractAxis, 52
KDChart::AbstractArea, 30 KDChart::AbstractCoordinatePlane, 97
AbstractAreaBase KDChart::CartesianAxis, 269
KDChart::AbstractAreaBase, 38 KDChart::CartesianCoordinatePlane, 298
AbstractAreaWidget KDChart::HeaderFooter, 371
KDChart::AbstractAreaWidget, 44 KDChart::Legend, 406
AbstractAxis KDChart::PolarCoordinatePlane, 534
KDChart::AbstractAxis, 52 KDChart::TextArea, 644
AbstractCartesianDiagram allHeadersFooters
KDChart::AbstractCartesianDiagram, 67 KDChart::Widget, 694
AbstractCoordinatePlane allLegends
KDChart::AbstractCoordinatePlane, 96 KDChart::Widget, 694
AbstractDiagram allowOverlappingDataValueTexts
KDChart::AbstractDiagram, 118 KDChart::AbstractCartesianDiagram, 68
AbstractDiagramList KDChart::AbstractDiagram, 118
KDChart, 18 KDChart::AbstractPieDiagram, 148
AbstractLayoutItem KDChart::AbstractPolarDiagram, 180
KDChart::AbstractLayoutItem, 141 KDChart::BarDiagram, 231
AbstractPieDiagram KDChart::LineDiagram, 437
KDChart::AbstractPieDiagram, 148 KDChart::PieDiagram, 499
AbstractPolarDiagram KDChart::PolarDiagram, 561
KDChart::AbstractPolarDiagram, 180 KDChart::RingDiagram, 613
AbstractProxyModel angle
KDChart::AbstractProxyModel, 204 KDChart::ThreeDBarAttributes, 671
AbstractThreeDAttributes angleUnit
KDChart::AbstractThreeDAttributes, 206 KDChart::PolarCoordinatePlane, 534
ADD_VBOX_WITH_LEGENDS antiAliasing
KDChartChart.cpp, 744 KDChart::AbstractCartesianDiagram, 68
addAxis KDChart::AbstractDiagram, 118
KDChart::AbstractCartesianDiagram, 67 KDChart::AbstractPieDiagram, 149
KDChart::BarDiagram, 230 KDChart::AbstractPolarDiagram, 180
KDChart::LineDiagram, 436 KDChart::BarDiagram, 231
addBrush KDChart::LineDiagram, 437
KDChart::Palette, 489 KDChart::PieDiagram, 499
addCoordinatePlane KDChart::PolarDiagram, 562
KDChart::Chart, 328 KDChart::RingDiagram, 613

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


820 INDEX

areaGeometry axesCalcModeY
KDChart::AbstractArea, 31 KDChart::CartesianCoordinatePlane, 299
KDChart::AbstractAreaBase, 39
KDChart::AbstractAreaWidget, 44 BackgroundAttributes, 11
KDChart::AbstractAxis, 52 KDChart::BackgroundAttributes, 220
KDChart::AbstractCoordinatePlane, 97 backgroundAttributes
KDChart::CartesianAxis, 269 KDChart::AbstractArea, 31
KDChart::CartesianCoordinatePlane, 299 KDChart::AbstractAreaBase, 39
KDChart::HeaderFooter, 372 KDChart::AbstractAreaWidget, 44
KDChart::Legend, 406 KDChart::AbstractAxis, 52
KDChart::PolarCoordinatePlane, 535 KDChart::AbstractCoordinatePlane, 97
KDChart::TextArea, 644 KDChart::CartesianAxis, 269
attributes KDChart::CartesianCoordinatePlane, 299
KDChartAbstractAreaBase.cpp, 709 KDChart::DataValueAttributes, 356
AttributesModel KDChart::HeaderFooter, 372
KDChart::AttributesModel, 210 KDChart::Legend, 406
attributesModel KDChart::PolarCoordinatePlane, 535
KDChart::AbstractCartesianDiagram, 68 KDChart::TextArea, 645
KDChart::AbstractDiagram, 119 BackgroundPixmapMode
KDChart::AbstractPieDiagram, 149 KDChart::BackgroundAttributes, 219
KDChart::AbstractPolarDiagram, 180 BackgroundPixmapModeCentered
KDChart::BarDiagram, 231 KDChart::BackgroundAttributes, 219
KDChart::LineDiagram, 437 BackgroundPixmapModeNone
KDChart::PieDiagram, 499 KDChart::BackgroundAttributes, 219
KDChart::PolarDiagram, 562 BackgroundPixmapModeScaled
KDChart::RingDiagram, 613 KDChart::BackgroundAttributes, 219
attributesModelRootIndex BackgroundPixmapModeStretched
KDChart::AbstractCartesianDiagram, 69 KDChart::BackgroundAttributes, 219
KDChart::AbstractDiagram, 119 Bar
KDChart::AbstractPieDiagram, 149 KDChart::Widget, 692
KDChart::AbstractPolarDiagram, 181 BarAttributes, 12
KDChart::BarDiagram, 232 KDChart::BarAttributes, 222
KDChart::LineDiagram, 438 barAttributes
KDChart::PieDiagram, 500 KDChart::BarDiagram, 232, 233
KDChart::PolarDiagram, 562 BarAttributesRole
KDChart::RingDiagram, 613 KDChart, 19
autoReferenceArea BarDiagram
KDChart::HeaderFooter, 372 KDChart::BarDiagram, 230
KDChart::TextArea, 644 barDiagram
KDChart::TextLayoutItem, 663 KDChart::Widget, 694
autoRotate barGapFactor
KDChart::TextAttributes, 657 KDChart::BarAttributes, 222
autoShrink BarType
KDChart::TextAttributes, 657 KDChart::BarDiagram, 230
axes Bottom
KDChart::AbstractCartesianDiagram, 69 KDChart::CartesianAxis, 268
KDChart::BarDiagram, 232 bottom
KDChart::LineDiagram, 438 KDChart::Widget, 702
AxesCalcMode brush
KDChart::AbstractCoordinatePlane, 96 KDChart::AbstractCartesianDiagram, 69,
KDChart::CartesianCoordinatePlane, 297 70
KDChart::PolarCoordinatePlane, 533 KDChart::AbstractDiagram, 119, 120
axesCalcModeX KDChart::AbstractPieDiagram, 150
KDChart::CartesianCoordinatePlane, 299 KDChart::AbstractPolarDiagram, 181, 182

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


INDEX 821

KDChart::BackgroundAttributes, 220 KDChart::HeaderFooter, 372


KDChart::BarDiagram, 233 KDChart::Legend, 409
KDChart::Legend, 406 KDChart::LineDiagram, 442
KDChart::LineDiagram, 438, 439 KDChart::PieDiagram, 502
KDChart::PieDiagram, 500 KDChart::PolarDiagram, 564
KDChart::PolarDiagram, 563 KDChart::RingDiagram, 615
KDChart::RingDiagram, 614 columnConfig
buildLegend KDChart::DatasetSelectorWidget, 354
KDChart::Legend, 407 columnCount
buildReferenceRect KDChart::AbstractPieDiagram, 151
KDChartPieDiagram.cpp, 787 KDChart::AbstractPolarDiagram, 183
KDChart::AttributesModel, 211
calcMode KDChart::PieDiagram, 502
KDChart::DataDimension, 344 KDChart::PolarDiagram, 565
calculateDataBoundaries KDChart::RingDiagram, 616
KDChart::AbstractCartesianDiagram, 70 columnToIndex
KDChart::AbstractDiagram, 120 KDChart::AbstractCartesianDiagram, 71
KDChart::AbstractPieDiagram, 150 KDChart::AbstractDiagram, 121
KDChart::AbstractPolarDiagram, 182 KDChart::AbstractPieDiagram, 151
KDChart::BarDiagram, 234 KDChart::AbstractPolarDiagram, 183
KDChart::LineDiagram, 439 KDChart::BarDiagram, 237
KDChart::PieDiagram, 501 KDChart::LineDiagram, 442
KDChart::PolarDiagram, 563 KDChart::PieDiagram, 502
KDChart::RingDiagram, 615 KDChart::PolarDiagram, 565
calculatedValue KDChart::RingDiagram, 616
KDChart::Measure, 482 connectSignals
calculateRawDataBoundingRect KDChart::AbstractAxis, 53
KDChart::CartesianCoordinatePlane, 300 KDChart::CartesianAxis, 269
calculationMode ConstAbstractDiagramList
KDChart::Measure, 483 KDChart, 18
CartesianAxis coordinatePlane
KDChart::CartesianAxis, 268 KDChart::AbstractAxis, 53
CartesianAxisList KDChart::AbstractCartesianDiagram, 71
KDChart, 18 KDChart::AbstractDiagram, 121
CartesianCoordinatePlane KDChart::AbstractPieDiagram, 151
KDChart::CartesianCoordinatePlane, 298 KDChart::AbstractPolarDiagram, 183
Center KDChart::BarDiagram, 237
KDChart::Position, 596 KDChart::CartesianAxis, 270
Chart KDChart::Chart, 330
KDChart::Chart, 328 KDChart::LineDiagram, 442
ChartType KDChart::PaintContext, 486
KDChart::Widget, 692 KDChart::PieDiagram, 502
checkInvariants KDChart::PolarDiagram, 565
KDChart::AbstractCartesianDiagram, 70 KDChart::RingDiagram, 616
KDChart::AbstractDiagram, 120 KDChart::Widget, 694
KDChart::AbstractPieDiagram, 151 CoordinatePlaneList
KDChart::AbstractPolarDiagram, 182 KDChart, 18
KDChart::BarDiagram, 236 coordinatePlanes
KDChart::LineDiagram, 441 KDChart::Chart, 330
KDChart::PieDiagram, 501 CoordinateTransformationList
KDChart::PolarDiagram, 564 KDChart::PolarCoordinatePlane, 533
KDChart::RingDiagram, 615 createObserver
clone KDChart::AbstractAxis, 53
KDChart::BarDiagram, 236 KDChart::CartesianAxis, 270

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


822 INDEX

d KDChart::AbstractCartesianDiagram, 72
KDChartAbstractAreaBase.cpp, 709 KDChart::AbstractDiagram, 122
KDChartAbstractAreaWidget.cpp, 714 KDChart::AbstractPieDiagram, 152
KDChartAbstractAxis.cpp, 716 KDChart::AbstractPolarDiagram, 184
KDChartAbstractCartesianDiagram.cpp, KDChart::BarDiagram, 238
718 KDChart::LineDiagram, 443
KDChartAbstractCoordinatePlane.cpp, 720 KDChart::PieDiagram, 503
KDChartAbstractDiagram.cpp, 722 KDChart::PolarDiagram, 566
KDChartAbstractPieDiagram.cpp, 724 KDChart::RingDiagram, 617
KDChartAbstractPolarDiagram.cpp, 726 DataDimension
KDChartAbstractThreeDAttributes.cpp, KDChart::DataDimension, 342, 343
730 DataDimensionsList
KDChartBackgroundAttributes.cpp, 734 KDChart, 19
KDChartBarAttributes.cpp, 736 dataLabel
KDChartBarDiagram.cpp, 738 KDChart::DataValueAttributes, 356
KDChartCartesianAxis.cpp, 740 datasetBrushes
KDChartCartesianCoordinatePlane.cpp, KDChart::AbstractCartesianDiagram, 72
742 KDChart::AbstractDiagram, 122
KDChartChart.cpp, 745 KDChart::AbstractPieDiagram, 153
KDChartDataValueAttributes.cpp, 751 KDChart::AbstractPolarDiagram, 184
KDChartFrameAttributes.cpp, 757 KDChart::BarDiagram, 238
KDChartGridAttributes.cpp, 764 KDChart::LineDiagram, 443
KDChartHeaderFooter.cpp, 766 KDChart::PieDiagram, 503
KDChartLegend.cpp, 770 KDChart::PolarDiagram, 566
KDChartLineAttributes.cpp, 772 KDChart::RingDiagram, 617
KDChartLineDiagram.cpp, 774 DatasetBrushRole
KDChartMarkerAttributes.cpp, 776 KDChart, 19
KDChartPaintContext.cpp, 780 datasetCount
KDChartPalette.cpp, 782 KDChart::Legend, 410
KDChartPieAttributes.cpp, 785 DatasetDescriptionVector
KDChartPieDiagram.cpp, 787 KDChart, 19
KDChartPolarCoordinatePlane.cpp, 790 datasetDimension
KDChartPolarDiagram.cpp, 792 KDChart::AbstractCartesianDiagram, 72
KDChartRelativePosition.cpp, 798 KDChart::AbstractDiagram, 123
KDChartRingDiagram.cpp, 800 KDChart::AbstractPieDiagram, 153
KDChartTextAttributes.cpp, 804 KDChart::AbstractPolarDiagram, 185
KDChartThreeDBarAttributes.cpp, 806 KDChart::BarDiagram, 238
KDChartThreeDLineAttributes.cpp, 808 KDChart::LineDiagram, 444
KDChartThreeDPieAttributes.cpp, 810 KDChart::PieDiagram, 504
KDChartWidget.cpp, 812 KDChart::PolarDiagram, 567
data KDChart::RingDiagram, 618
KDChart::AttributesModel, 211, 212 datasetLabels
KDChart::DatasetProxyModel, 346 KDChart::AbstractCartesianDiagram, 73
dataBoundaries KDChart::AbstractDiagram, 123
KDChart::AbstractCartesianDiagram, 71 KDChart::AbstractPieDiagram, 154
KDChart::AbstractDiagram, 121 KDChart::AbstractPolarDiagram, 185
KDChart::AbstractPieDiagram, 152 KDChart::BarDiagram, 239
KDChart::AbstractPolarDiagram, 183 KDChart::LineDiagram, 444
KDChart::BarDiagram, 237 KDChart::PieDiagram, 504
KDChart::LineDiagram, 442 KDChart::PolarDiagram, 567
KDChart::PieDiagram, 503 KDChart::RingDiagram, 618
KDChart::PolarDiagram, 565 datasetMarkers
KDChart::RingDiagram, 616 KDChart::AbstractCartesianDiagram, 73
dataChanged KDChart::AbstractDiagram, 123

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


INDEX 823

KDChart::AbstractPieDiagram, 154 diagram


KDChart::AbstractPolarDiagram, 186 KDChart::AbstractAxis, 54
KDChart::BarDiagram, 239 KDChart::AbstractCoordinatePlane, 97
KDChart::LineDiagram, 445 KDChart::CartesianAxis, 270
KDChart::PieDiagram, 505 KDChart::CartesianCoordinatePlane, 300
KDChart::PolarDiagram, 568 KDChart::DiagramObserver, 362
KDChart::RingDiagram, 619 KDChart::Legend, 410
DatasetPenRole KDChart::PolarCoordinatePlane, 535
KDChart, 19 KDChart::Widget, 695
datasetPens diagramAttributesChanged
KDChart::AbstractCartesianDiagram, 74 KDChart::DiagramObserver, 362
KDChart::AbstractDiagram, 124 diagramDataChanged
KDChart::AbstractPieDiagram, 154 KDChart::DiagramObserver, 362
KDChart::AbstractPolarDiagram, 186 DiagramList
KDChart::BarDiagram, 240 KDChart, 19
KDChart::LineDiagram, 445 DiagramObserver
KDChart::PieDiagram, 505 KDChart::DiagramObserver, 361
KDChart::PolarDiagram, 568 diagrams
KDChart::RingDiagram, 619 KDChart::AbstractCoordinatePlane, 98
DatasetProxyModel KDChart::CartesianCoordinatePlane, 301
KDChart::DatasetProxyModel, 346 KDChart::Legend, 410
DatasetSelectorWidget KDChart::PolarCoordinatePlane, 535, 536
KDChart::DatasetSelectorWidget, 352 displayArea
DataValueAttributes, 13 KDChart::LineAttributes, 429
KDChart::DataValueAttributes, 356 DisplayRoles
dataValueAttributes KDChart, 19
KDChart::AbstractCartesianDiagram, 74, distance
75 KDChart::DataDimension, 343
KDChart::AbstractDiagram, 124, 125 doesIsometricScaling
KDChart::AbstractPieDiagram, 155, 156 KDChart::CartesianCoordinatePlane, 301
KDChart::AbstractPolarDiagram, 186, 187 doItemsLayout
KDChart::BarDiagram, 240, 241 KDChart::AbstractCartesianDiagram, 75
KDChart::LineDiagram, 445, 446 KDChart::AbstractDiagram, 125
KDChart::PieDiagram, 506 KDChart::AbstractPieDiagram, 156
KDChart::PolarDiagram, 568, 569 KDChart::AbstractPolarDiagram, 187
KDChart::RingDiagram, 619, 620 KDChart::BarDiagram, 241
DataValueLabelAttributesRole KDChart::LineDiagram, 446
KDChart, 19 KDChart::PieDiagram, 507
decimalDigits KDChart::PolarDiagram, 569
KDChart::DataValueAttributes, 356 KDChart::RingDiagram, 620
defaultAttributes drawingArea
KDChart::DataValueAttributes, 357 KDChart::CartesianCoordinatePlane, 302
defaultAttributesAsVariant drawSolidExcessArrows
KDChart::DataValueAttributes, 357 KDChart::BarAttributes, 222
defaultPalette
KDChart::Palette, 489 East
deleteObserver KDChart::Position, 596
KDChart::AbstractAxis, 54 end
KDChart::CartesianAxis, 270 KDChart::DataDimension, 344
depth ExcludeCenter
KDChart::AbstractThreeDAttributes, 207 KDChart::Position, 591
KDChart::ThreeDBarAttributes, 671 expandingDirections
KDChart::ThreeDLineAttributes, 676 KDChart::AbstractCoordinatePlane, 98
KDChart::ThreeDPieAttributes, 681 KDChart::CartesianAxis, 271

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


824 INDEX

KDChart::CartesianCoordinatePlane, 302 KDChart::TextArea, 645


KDChart::HeaderFooter, 372 fromName
KDChart::HorizontalLineLayoutItem, 386 KDChart::Position, 592
KDChart::MarkerLayoutItem, 477
KDChart::PolarCoordinatePlane, 536 geometry
KDChart::TextArea, 645 KDChart::AbstractAxis, 54
KDChart::TextLayoutItem, 663 KDChart::AbstractCoordinatePlane, 99
KDChart::VerticalLineLayoutItem, 685 KDChart::CartesianAxis, 271
explode KDChart::CartesianCoordinatePlane, 302
KDChart::PieAttributes, 492 KDChart::HeaderFooter, 373
explodeFactor KDChart::HorizontalLineLayoutItem, 386
KDChart::PieAttributes, 492 KDChart::MarkerLayoutItem, 477
KDChart::PolarCoordinatePlane, 537
filterAcceptsColumn KDChart::TextArea, 645
KDChart::DatasetProxyModel, 346 KDChart::TextLayoutItem, 663
filterAcceptsRow KDChart::VerticalLineLayoutItem, 685
KDChart::DatasetProxyModel, 347 getBrush
findOrCreateHBoxLayoutByObjectName KDChart::Palette, 489
KDChartChart.cpp, 745 getCellValues
findOrCreateLayoutByObjectName KDChart::LineDiagram, 447
KDChartChart.cpp, 745 getDataDimensionsList
findOrCreateVBoxLayoutByObjectName KDChart::AbstractCoordinatePlane, 99
KDChartChart.cpp, 745 KDChart::CartesianCoordinatePlane, 303
firstHeaderFooter KDChart::PolarCoordinatePlane, 537
KDChart::Widget, 695 globalGridAttributes
fixedBarWidth KDChart::AbstractCoordinatePlane, 99
KDChart::BarAttributes, 222 KDChart::CartesianCoordinatePlane, 304
fixedDataValueGap KDChart::PolarCoordinatePlane, 537
KDChart::BarAttributes, 222 globalLeadingBottom
fixedValueBlockGap KDChart::Chart, 330
KDChart::BarAttributes, 223 KDChart::Widget, 695
font globalLeadingLeft
KDChart::TextAttributes, 657 KDChart::Chart, 331
fontSize KDChart::Widget, 695
KDChart::TextAttributes, 657 globalLeadingRight
Footer KDChart::Chart, 331
KDChart::HeaderFooter, 371 KDChart::Widget, 696
forceRebuild globalLeadingTop
KDChart::AbstractAreaWidget, 44 KDChart::Chart, 331
KDChart::Legend, 411 KDChart::Widget, 696
FrameAttributes, 14 granularity
KDChart::FrameAttributes, 364 KDChart::AbstractPieDiagram, 156
frameAttributes KDChart::PieDiagram, 507
KDChart::AbstractArea, 31 KDChart::RingDiagram, 621
KDChart::AbstractAreaBase, 39 GranularitySequence
KDChart::AbstractAreaWidget, 45 KDChartEnums, 392
KDChart::AbstractAxis, 54 GranularitySequence_10_20
KDChart::AbstractCoordinatePlane, 99 KDChartEnums, 392
KDChart::CartesianAxis, 271 GranularitySequence_10_50
KDChart::CartesianCoordinatePlane, 302 KDChartEnums, 392
KDChart::DataValueAttributes, 357 GranularitySequence_25_50
KDChart::HeaderFooter, 373 KDChartEnums, 392
KDChart::Legend, 411 GranularitySequenceIrregular
KDChart::PolarCoordinatePlane, 536 KDChartEnums, 392

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


INDEX 825

granularitySequenceToString KDChart::PolarDiagram, 570


KDChartEnums, 396 KDChart::RingDiagram, 621
GridAttributes, 15 horizontalPadding
KDChart::GridAttributes, 366 KDChart::RelativePosition, 606
gridAttributes horizontalRange
KDChart::CartesianCoordinatePlane, 304 KDChart::CartesianCoordinatePlane, 306
KDChart::PolarCoordinatePlane, 537
gridDimensionsList IncludeCenter
KDChart::AbstractCoordinatePlane, 100 KDChart::Position, 591
KDChart::CartesianCoordinatePlane, 304 index
KDChart::PolarCoordinatePlane, 538 KDChart::AbstractProxyModel, 204
gridGranularitySequence KDChart::AttributesModel, 213
KDChart::GridAttributes, 366 KDChart::DatasetProxyModel, 348
gridPen indexAt
KDChart::GridAttributes, 366 KDChart::AbstractCartesianDiagram, 76
gridStepWidth KDChart::AbstractDiagram, 126
KDChart::GridAttributes, 366 KDChart::AbstractPieDiagram, 157
gridSubStepWidth KDChart::AbstractPolarDiagram, 188
KDChart::GridAttributes, 367 KDChart::BarDiagram, 241
groupGapFactor KDChart::LineDiagram, 447
KDChart::BarAttributes, 223 KDChart::PieDiagram, 507
KDChart::PolarDiagram, 570
hasAbsoluteFontSize KDChart::RingDiagram, 621
KDChart::TextAttributes, 657 initFrom
hasDefaultTitleTextAttributes KDChart::AttributesModel, 213
KDChart::CartesianAxis, 271 innerRect
hasOwnGridAttributes KDChart::AbstractArea, 31
KDChart::CartesianCoordinatePlane, 305 KDChart::AbstractAreaBase, 39
KDChart::PolarCoordinatePlane, 539 KDChart::AbstractAreaWidget, 45
Header KDChart::AbstractAxis, 54
KDChart::HeaderFooter, 371 KDChart::AbstractCoordinatePlane, 100
headerData KDChart::CartesianAxis, 272
KDChart::AttributesModel, 212 KDChart::CartesianCoordinatePlane, 306
KDChart::DatasetProxyModel, 347 KDChart::HeaderFooter, 373
HeaderFooter KDChart::Legend, 411
KDChart::HeaderFooter, 371 KDChart::PolarCoordinatePlane, 539
headerFooter KDChart::TextArea, 645
KDChart::Chart, 332 intersects
HeaderFooterList KDChart::HeaderFooter, 373, 374
KDChart, 19 KDChart::TextArea, 646, 647
headerFooters KDChart::TextLayoutItem, 663, 664
KDChart::Chart, 332 isAbscissa
HeaderFooterType KDChart::CartesianAxis, 272
KDChart::HeaderFooter, 371 isCalculated
HorizontalLineLayoutItem KDChart::DataDimension, 344
KDChart::HorizontalLineLayoutItem, 385 isCartesian
horizontalOffset KDChartWidget.cpp, 813
KDChart::AbstractCartesianDiagram, 75 isCorner
KDChart::AbstractDiagram, 125 KDChart::Position, 593
KDChart::AbstractPieDiagram, 156 isEastSide
KDChart::AbstractPolarDiagram, 188 KDChart::Position, 593
KDChart::BarDiagram, 241 isEmpty
KDChart::LineDiagram, 447 KDChart::AbstractCoordinatePlane, 101
KDChart::PieDiagram, 507 KDChart::CartesianAxis, 272

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


826 INDEX

KDChart::CartesianCoordinatePlane, 306 KDChart::BarDiagram, 242


KDChart::HeaderFooter, 374 KDChart::LineDiagram, 448
KDChart::HorizontalLineLayoutItem, 386 KDChart::PieDiagram, 508
KDChart::MarkerLayoutItem, 477 KDChart::PolarDiagram, 570
KDChart::PolarCoordinatePlane, 539 KDChart::RingDiagram, 622
KDChart::TextArea, 647
KDChart::TextLayoutItem, 664 KDAB_SET_OBJECT_NAME
KDChart::VerticalLineLayoutItem, 685 KDChartGlobal.h, 759
isEnabled KDChart, 16
KDChart::AbstractThreeDAttributes, 207 AbstractDiagramList, 18
KDChart::ThreeDBarAttributes, 671 BarAttributesRole, 19
KDChart::ThreeDLineAttributes, 676 CartesianAxisList, 18
KDChart::ThreeDPieAttributes, 681 ConstAbstractDiagramList, 18
isGridVisible CoordinatePlaneList, 18
KDChart::GridAttributes, 367 DataDimensionsList, 19
isIndexHidden DatasetBrushRole, 19
KDChart::AbstractCartesianDiagram, 76 DatasetDescriptionVector, 19
KDChart::AbstractDiagram, 126 DatasetPenRole, 19
KDChart::AbstractPieDiagram, 157 DataValueLabelAttributesRole, 19
KDChart::AbstractPolarDiagram, 188 DiagramList, 19
KDChart::BarDiagram, 242 DisplayRoles, 19
KDChart::LineDiagram, 448 HeaderFooterList, 19
KDChart::PieDiagram, 508 LegendList, 19
KDChart::PolarDiagram, 570 LineAttributesRole, 19
KDChart::RingDiagram, 621 PieAttributesRole, 20
isKnownAttributesRole ThreeDAttributesRole, 19
KDChart::AttributesModel, 214 ThreeDBarAttributesRole, 20
isNorthSide ThreeDLineAttributesRole, 19
KDChart::Position, 593 ThreeDPieAttributesRole, 20
isOrdinate KDChart::AbstractArea, 29
KDChart::CartesianAxis, 272 KDChart::AbstractArea
isPolar ∼AbstractArea, 30
KDChartWidget.cpp, 813 __pad0__, 36
isPole AbstractArea, 30
KDChart::Position, 593 alignToReferencePoint, 31
isSouthSide areaGeometry, 31
KDChart::Position, 594 backgroundAttributes, 31
isSubGridVisible frameAttributes, 31
KDChart::GridAttributes, 367 innerRect, 31
isValid mParent, 36
KDChart::Palette, 489 mParentLayout, 37
isVisible paint, 32
KDChart::BackgroundAttributes, 220 paintAll, 32
KDChart::DataValueAttributes, 357 paintBackground, 33
KDChart::FrameAttributes, 364 paintCtx, 33
KDChart::MarkerAttributes, 474 paintFrame, 34
KDChart::TextAttributes, 657 paintIntoRect, 34
isWestSide positionHasChanged, 35
KDChart::Position, 594 removeFromParentLayout, 35
itemRowLabels setBackgroundAttributes, 35
KDChart::AbstractCartesianDiagram, 76 setFrameAttributes, 35
KDChart::AbstractDiagram, 126 setParentLayout, 35
KDChart::AbstractPieDiagram, 157 setParentWidget, 36
KDChart::AbstractPolarDiagram, 188 sizeHintChanged, 36

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


INDEX 827

KDChart::AbstractAreaBase, 38 paint, 55
KDChart::AbstractAreaBase paintAll, 55
∼AbstractAreaBase, 38 paintBackground, 56
AbstractAreaBase, 38 paintCtx, 57
alignToReferencePoint, 39 paintFrame, 57
areaGeometry, 39 paintIntoRect, 58
backgroundAttributes, 39 positionHasChanged, 58
frameAttributes, 39 Q_SLOTS, 62
innerRect, 39 removeFromParentLayout, 58
paintBackground, 40 setBackgroundAttributes, 59
paintFrame, 41 setFrameAttributes, 59
positionHasChanged, 41 setGeometry, 59
setBackgroundAttributes, 41 setLabels, 59
setFrameAttributes, 42 setParentLayout, 60
KDChart::AbstractAreaWidget, 43 setParentWidget, 60
KDChart::AbstractAreaWidget setShortLabels, 60
∼AbstractAreaWidget, 44 setTextAttributes, 60
__pad0__, 49 shortLabels, 61
AbstractAreaWidget, 44 sizeHintChanged, 61
alignToReferencePoint, 44 textAttributes, 61
areaGeometry, 44 KDChart::AbstractCartesianDiagram, 63
backgroundAttributes, 44 KDChart::AbstractCartesianDiagram
forceRebuild, 44 ∼AbstractCartesianDiagram, 67
frameAttributes, 45 __pad0__, 92
innerRect, 45 AbstractCartesianDiagram, 67
paint, 45 addAxis, 67
paintAll, 46 allowOverlappingDataValueTexts, 68
paintBackground, 46 antiAliasing, 68
paintEvent, 47 attributesModel, 68
paintFrame, 47 attributesModelRootIndex, 69
paintIntoRect, 48 axes, 69
positionHasChanged, 48 brush, 69, 70
setBackgroundAttributes, 48 calculateDataBoundaries, 70
setFrameAttributes, 49 checkInvariants, 70
KDChart::AbstractAxis, 50 columnToIndex, 71
KDChart::AbstractAxis coordinatePlane, 71
∼AbstractAxis, 52 dataBoundaries, 71
__pad0__, 62 dataChanged, 72
AbstractAxis, 52 datasetBrushes, 72
alignToReferencePoint, 52 datasetDimension, 72
areaGeometry, 52 datasetLabels, 73
backgroundAttributes, 52 datasetMarkers, 73
connectSignals, 53 datasetPens, 74
coordinatePlane, 53 dataValueAttributes, 74, 75
createObserver, 53 doItemsLayout, 75
deleteObserver, 54 horizontalOffset, 75
diagram, 54 indexAt, 76
frameAttributes, 54 isIndexHidden, 76
geometry, 54 itemRowLabels, 76
innerRect, 54 layoutPlanes, 76
labels, 55 modelsChanged, 77
mParent, 62 moveCursor, 77
mParentLayout, 62 numberOfAbscissaSegments, 77
observedBy, 55 numberOfOrdinateSegments, 77

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


828 INDEX

paint, 77 getDataDimensionsList, 99
paintDataValueText, 77 globalGridAttributes, 99
paintDataValueTexts, 78 gridDimensionsList, 100
paintMarker, 78, 79 innerRect, 100
paintMarkers, 81 isEmpty, 101
pen, 81, 82 layoutDiagrams, 101
percentMode, 82 layoutPlanes, 101
propertiesChanged, 82 maximumSize, 101
referenceDiagram, 82 minimumSize, 102
referenceDiagramOffset, 83 minimumSizeHint, 102
resize, 83 mParent, 113
scrollTo, 83 mParentLayout, 113
setAllowOverlappingDataValueTexts, 83 needLayoutPlanes, 102
setAntiAliasing, 84 needRelayout, 102
setAttributesModel, 84 needUpdate, 102
setAttributesModelRootIndex, 85 paint, 102
setBrush, 85 paintAll, 103
setCoordinatePlane, 85 paintBackground, 103
setDataBoundariesDirty, 86 paintCtx, 104
setDatasetDimension, 86 paintFrame, 104
setDataValueAttributes, 87 paintIntoRect, 105
setModel, 88 parent, 105
setPen, 88 positionHasChanged, 106
setPercentMode, 89 propertiesChanged, 106
setReferenceDiagram, 89 Q_SLOTS, 113
setRootIndex, 89 referenceCoordinatePlane, 106
setSelection, 89 relayout, 106
takeAxis, 89 removeFromParentLayout, 107
threeDItemDepth, 90 replaceDiagram, 107
update, 90 setBackgroundAttributes, 108
useDefaultColors, 90 setFrameAttributes, 108
useRainbowColors, 90 setGeometry, 108
useSubduedColors, 91 setGlobalGridAttributes, 108
valueForCell, 91 setParent, 109
verticalOffset, 91 setParentLayout, 109
visualRect, 91 setParentWidget, 109
visualRegionForSelection, 92 setReferenceCoordinatePlane, 110
KDChart::AbstractCoordinatePlane, 93 setZoomCenter, 110
Linear, 96 setZoomFactorX, 110
Logarithmic, 96 setZoomFactorY, 110
KDChart::AbstractCoordinatePlane sizeHint, 111
∼AbstractCoordinatePlane, 96 sizeHintChanged, 111
__pad0__, 113 sizePolicy, 111
AbstractCoordinatePlane, 96 takeDiagram, 111
addDiagram, 96 translate, 112
alignToReferencePoint, 97 zoomCenter, 112
areaGeometry, 97 zoomFactorX, 112
AxesCalcMode, 96 zoomFactorY, 113
backgroundAttributes, 97 KDChart::AbstractDiagram, 114
diagram, 97 KDChart::AbstractDiagram
diagrams, 98 ∼AbstractDiagram, 118
expandingDirections, 98 __pad0__, 140
frameAttributes, 99 AbstractDiagram, 118
geometry, 99 allowOverlappingDataValueTexts, 118

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


INDEX 829

antiAliasing, 118 visualRegionForSelection, 140


attributesModel, 119 KDChart::AbstractLayoutItem, 141
attributesModelRootIndex, 119 KDChart::AbstractLayoutItem
brush, 119, 120 AbstractLayoutItem, 141
calculateDataBoundaries, 120 mParent, 143
checkInvariants, 120 mParentLayout, 143
columnToIndex, 121 paint, 141
coordinatePlane, 121 paintCtx, 141
dataBoundaries, 121 removeFromParentLayout, 142
dataChanged, 122 setParentLayout, 142
datasetBrushes, 122 setParentWidget, 142
datasetDimension, 123 sizeHintChanged, 142
datasetLabels, 123 KDChart::AbstractPieDiagram, 144
datasetMarkers, 123 KDChart::AbstractPieDiagram
datasetPens, 124 ∼AbstractPieDiagram, 148
dataValueAttributes, 124, 125 __pad0__, 175
doItemsLayout, 125 AbstractPieDiagram, 148
horizontalOffset, 125 allowOverlappingDataValueTexts, 148
indexAt, 126 antiAliasing, 149
isIndexHidden, 126 attributesModel, 149
itemRowLabels, 126 attributesModelRootIndex, 149
modelsChanged, 126 brush, 150
moveCursor, 126 calculateDataBoundaries, 150
paint, 127 checkInvariants, 151
paintDataValueText, 127 columnCount, 151
paintDataValueTexts, 128 columnToIndex, 151
paintMarker, 128 coordinatePlane, 151
paintMarkers, 130 dataBoundaries, 152
pen, 131 dataChanged, 152
percentMode, 131 datasetBrushes, 153
propertiesChanged, 132 datasetDimension, 153
resize, 132 datasetLabels, 154
scrollTo, 132 datasetMarkers, 154
setAllowOverlappingDataValueTexts, 132 datasetPens, 154
setAntiAliasing, 132 dataValueAttributes, 155, 156
setAttributesModel, 133 doItemsLayout, 156
setAttributesModelRootIndex, 133 granularity, 156
setBrush, 134 horizontalOffset, 156
setCoordinatePlane, 134 indexAt, 157
setDataBoundariesDirty, 135 isIndexHidden, 157
setDatasetDimension, 135 itemRowLabels, 157
setDataValueAttributes, 135, 136 modelsChanged, 157
setModel, 136 moveCursor, 157
setPen, 137 numberOfGridRings, 158
setPercentMode, 137 numberOfValuesPerDataset, 158
setRootIndex, 138 paint, 158
setSelection, 138 paintDataValueText, 158
update, 138 paintDataValueTexts, 159
useDefaultColors, 138 paintMarker, 159, 160
useRainbowColors, 138 paintMarkers, 162
useSubduedColors, 139 pen, 162
valueForCell, 139 percentMode, 163
verticalOffset, 139 pieAttributes, 163
visualRect, 139 polarCoordinatePlane, 164

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


830 INDEX

propertiesChanged, 164 dataValueAttributes, 186, 187


resize, 164 doItemsLayout, 187
scrollTo, 164 horizontalOffset, 188
setAllowOverlappingDataValueTexts, 164 indexAt, 188
setAntiAliasing, 165 isIndexHidden, 188
setAttributesModel, 165 itemRowLabels, 188
setAttributesModelRootIndex, 166 modelsChanged, 189
setBrush, 166 moveCursor, 189
setCoordinatePlane, 167 numberOfGridRings, 189
setDataBoundariesDirty, 167 numberOfValuesPerDataset, 189
setDatasetDimension, 167 paint, 189
setDataValueAttributes, 168 paintDataValueText, 189
setGranularity, 169 paintDataValueTexts, 190
setModel, 169 paintMarker, 191
setPen, 169, 170 paintMarkers, 193
setPercentMode, 170 pen, 193, 194
setPieAttributes, 170 percentMode, 194
setRootIndex, 171 polarCoordinatePlane, 194
setSelection, 171 propertiesChanged, 194
setStartPosition, 171 resize, 195
setThreeDPieAttributes, 171, 172 scrollTo, 195
startPosition, 172 setAllowOverlappingDataValueTexts, 195
threeDPieAttributes, 172, 173 setAntiAliasing, 195
update, 173 setAttributesModel, 196
useDefaultColors, 173 setAttributesModelRootIndex, 196
useRainbowColors, 173 setBrush, 196, 197
useSubduedColors, 174 setCoordinatePlane, 197
valueForCell, 174 setDataBoundariesDirty, 198
valueTotals, 174 setDatasetDimension, 198
verticalOffset, 174 setDataValueAttributes, 198, 199
visualRect, 174 setModel, 199
visualRegionForSelection, 175 setPen, 199, 200
KDChart::AbstractPolarDiagram, 176 setPercentMode, 200
KDChart::AbstractPolarDiagram setRootIndex, 200
∼AbstractPolarDiagram, 180 setSelection, 201
__pad0__, 203 update, 201
AbstractPolarDiagram, 180 useDefaultColors, 201
allowOverlappingDataValueTexts, 180 useRainbowColors, 201
antiAliasing, 180 useSubduedColors, 201
attributesModel, 180 valueForCell, 202
attributesModelRootIndex, 181 valueTotals, 202
brush, 181, 182 verticalOffset, 202
calculateDataBoundaries, 182 visualRect, 202
checkInvariants, 182 visualRegionForSelection, 203
columnCount, 183 KDChart::AbstractProxyModel, 204
columnToIndex, 183 KDChart::AbstractProxyModel
coordinatePlane, 183 AbstractProxyModel, 204
dataBoundaries, 183 index, 204
dataChanged, 184 mapFromSource, 204
datasetBrushes, 184 mapToSource, 205
datasetDimension, 185 parent, 205
datasetLabels, 185 KDChart::AbstractThreeDAttributes, 206
datasetMarkers, 186 KDChart::AbstractThreeDAttributes
datasetPens, 186 ∼AbstractThreeDAttributes, 206

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


INDEX 831

AbstractThreeDAttributes, 206 setVisible, 220


depth, 207 KDChart::BarAttributes, 222
isEnabled, 207 KDChart::BarAttributes
operator!=, 207 ∼BarAttributes, 222
operator=, 207 BarAttributes, 222
operator==, 207 barGapFactor, 222
setDepth, 208 drawSolidExcessArrows, 222
setEnabled, 208 fixedBarWidth, 222
validDepth, 208 fixedDataValueGap, 222
KDChart::AttributesModel, 209 fixedValueBlockGap, 223
PaletteTypeDefault, 210 groupGapFactor, 223
PaletteTypeRainbow, 210 operator!=, 223
PaletteTypeSubdued, 210 operator=, 223
KDChart::AttributesModel operator==, 223
∼AttributesModel, 210 setBarGapFactor, 223
__pad0__, 218 setDrawSolidExcessArrows, 223
AttributesModel, 210 setFixedBarWidth, 223
columnCount, 211 setFixedDataValueGap, 223
data, 211, 212 setFixedValueBlockGap, 223
headerData, 212 setGroupGapFactor, 223
index, 213 setUseFixedBarWidth, 223
initFrom, 213 setUseFixedDataValueGap, 223
isKnownAttributesRole, 214 setUseFixedValueBlockGap, 223
mapFromSource, 214 useFixedBarWidth, 223
mapToSource, 215 useFixedDataValueGap, 223
modelData, 215 useFixedValueBlockGap, 223
PaletteType, 210 KDChart::BarDiagram, 225
paletteType, 215 Normal, 230
parent, 215 Percent, 230
rowCount, 216 Rows, 230
setData, 216 Stacked, 230
setHeaderData, 216 KDChart::BarDiagram
setModelData, 217 ∼BarDiagram, 230
setPaletteType, 217 __pad0__, 264
setSourceModel, 217 addAxis, 230
KDChart::BackgroundAttributes, 219 allowOverlappingDataValueTexts, 231
BackgroundPixmapModeCentered, 219 antiAliasing, 231
BackgroundPixmapModeNone, 219 attributesModel, 231
BackgroundPixmapModeScaled, 219 attributesModelRootIndex, 232
BackgroundPixmapModeStretched, 219 axes, 232
KDChart::BackgroundAttributes barAttributes, 232, 233
∼BackgroundAttributes, 220 BarDiagram, 230
BackgroundAttributes, 220 BarType, 230
BackgroundPixmapMode, 219 brush, 233
brush, 220 calculateDataBoundaries, 234
isVisible, 220 checkInvariants, 236
operator!=, 220 clone, 236
operator=, 220 columnToIndex, 237
operator==, 220 coordinatePlane, 237
pixmap, 220 dataBoundaries, 237
pixmapMode, 220 dataChanged, 238
setBrush, 220 datasetBrushes, 238
setPixmap, 220 datasetDimension, 238
setPixmapMode, 220 datasetLabels, 239

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


832 INDEX

datasetMarkers, 239 visualRect, 264


datasetPens, 240 visualRegionForSelection, 264
dataValueAttributes, 240, 241 KDChart::CartesianAxis, 265
doItemsLayout, 241 Bottom, 268
horizontalOffset, 241 Left, 268
indexAt, 241 Right, 268
isIndexHidden, 242 Top, 268
itemRowLabels, 242 KDChart::CartesianAxis
layoutPlanes, 242 ∼CartesianAxis, 268
modelsChanged, 242 __pad0__, 293
moveCursor, 243 alignToReferencePoint, 269
numberOfAbscissaSegments, 243 areaGeometry, 269
numberOfOrdinateSegments, 243 backgroundAttributes, 269
paint, 243 CartesianAxis, 268
paintDataValueText, 247 connectSignals, 269
paintDataValueTexts, 248 coordinatePlane, 270
paintMarker, 248 createObserver, 270
paintMarkers, 250 deleteObserver, 270
pen, 250, 251 diagram, 270
percentMode, 251 expandingDirections, 271
propertiesChanged, 251 frameAttributes, 271
referenceDiagram, 252 geometry, 271
referenceDiagramOffset, 252 hasDefaultTitleTextAttributes, 271
resize, 252 innerRect, 272
resizeEvent, 252 isAbscissa, 272
scrollTo, 252 isEmpty, 272
setAllowOverlappingDataValueTexts, 253 isOrdinate, 272
setAntiAliasing, 253 labels, 273
setAttributesModel, 253 layoutPlanes, 273
setAttributesModelRootIndex, 254 maximumSize, 273
setBarAttributes, 254, 255 minimumSize, 275
setBrush, 255 mParent, 293
setCoordinatePlane, 255 mParentLayout, 293
setDataBoundariesDirty, 256 observedBy, 275
setDatasetDimension, 256 paint, 276
setDataValueAttributes, 257 paintAll, 276
setModel, 258 paintBackground, 277
setPen, 258 paintCtx, 278
setPercentMode, 259 paintFrame, 285
setReferenceDiagram, 259 paintIntoRect, 286
setRootIndex, 259 Position, 268
setSelection, 259 position, 286
setThreeDBarAttributes, 259, 260 positionHasChanged, 286
setType, 260 Q_SLOTS, 293
takeAxis, 261 removeFromParentLayout, 287
threeDBarAttributes, 261, 262 resetTitleTextAttributes, 287
threeDItemDepth, 262 setBackgroundAttributes, 287
type, 262 setFrameAttributes, 287
update, 263 setGeometry, 288
useDefaultColors, 263 setLabels, 288
useRainbowColors, 263 setParentLayout, 288
useSubduedColors, 263 setParentWidget, 288
valueForCell, 263 setPosition, 289
verticalOffset, 264 setShortLabels, 289

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


INDEX 833

setTextAttributes, 289 paintEvent, 312


setTitleText, 290 paintFrame, 312
setTitleTextAttributes, 290 paintIntoRect, 313
shortLabels, 290 parent, 313
sizeHint, 291 positionHasChanged, 313
sizeHintChanged, 291 propertiesChanged, 314
textAttributes, 291 Q_SLOTS, 325
tickLength, 291 referenceCoordinatePlane, 314
titleText, 292 relayout, 314
titleTextAttributes, 292 removeFromParentLayout, 314
KDChart::CartesianCoordinatePlane, 294 replaceDiagram, 315
Linear, 297 resetGridAttributes, 315
Logarithmic, 297 setAxesCalcModes, 316
KDChart::CartesianCoordinatePlane setAxesCalcModeX, 316
∼CartesianCoordinatePlane, 298 setAxesCalcModeY, 316
__pad0__, 325 setBackgroundAttributes, 317
addDiagram, 298 setFrameAttributes, 317
alignToReferencePoint, 298 setGeometry, 317
areaGeometry, 299 setGlobalGridAttributes, 318
AxesCalcMode, 297 setGridAttributes, 318
axesCalcModeX, 299 setHorizontalRange, 319
axesCalcModeY, 299 setIsometricScaling, 319
backgroundAttributes, 299 setParent, 319
calculateRawDataBoundingRect, 300 setParentLayout, 320
CartesianCoordinatePlane, 298 setParentWidget, 320
diagram, 300 setReferenceCoordinatePlane, 320
diagrams, 301 setVerticalRange, 320
doesIsometricScaling, 301 setZoomCenter, 321
drawingArea, 302 setZoomFactorX, 321
expandingDirections, 302 setZoomFactorY, 322
frameAttributes, 302 sizeHint, 322
geometry, 302 sizeHintChanged, 322
getDataDimensionsList, 303 sizePolicy, 322
globalGridAttributes, 304 takeDiagram, 323
gridAttributes, 304 translate, 323
gridDimensionsList, 304 verticalRange, 324
hasOwnGridAttributes, 305 zoomCenter, 324
horizontalRange, 306 zoomFactorX, 324
innerRect, 306 zoomFactorY, 324
isEmpty, 306 KDChart::Chart, 326
layoutDiagrams, 306 ∼Chart, 328
layoutPlanes, 308 __pad0__, 341
maximumSize, 308 addCoordinatePlane, 328
minimumSize, 308 addHeaderFooter, 329
minimumSizeHint, 309 addLegend, 329
mParent, 325 Chart, 328
mParentLayout, 325 coordinatePlane, 330
needLayoutPlanes, 309 coordinatePlanes, 330
needRelayout, 309 globalLeadingBottom, 330
needUpdate, 309 globalLeadingLeft, 331
paint, 309 globalLeadingRight, 331
paintAll, 310 globalLeadingTop, 331
paintBackground, 311 headerFooter, 332
paintCtx, 312 headerFooters, 332

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


834 INDEX

legend, 332 on_cbReverseRows_stateChanged, 353


legends, 333 on_groupBox_toggled, 353
paint, 333 on_sbColumnCount_valueChanged, 353
paintEvent, 335 on_sbRowCount_valueChanged, 353
replaceCoordinatePlane, 335 on_sbStartRow_valueChanged, 353
replaceHeaderFooter, 336 Q_SLOTS, 354
replaceLegend, 336 setSourceColumnCount, 354
resizeEvent, 337 KDChart::DataValueAttributes, 355
setCoordinatePlaneLayout, 337 KDChart::DataValueAttributes
setGlobalLeading, 337 ∼DataValueAttributes, 356
setGlobalLeadingBottom, 338 backgroundAttributes, 356
setGlobalLeadingLeft, 338 dataLabel, 356
setGlobalLeadingRight, 338 DataValueAttributes, 356
setGlobalLeadingTop, 339 decimalDigits, 356
takeCoordinatePlane, 339 defaultAttributes, 357
takeHeaderFooter, 340 defaultAttributesAsVariant, 357
takeLegend, 340 frameAttributes, 357
KDChart::DataDimension, 342 isVisible, 357
KDChart::DataDimension markerAttributes, 357
calcMode, 344 negativePosition, 357
DataDimension, 342, 343 operator!=, 357
distance, 343 operator=, 357
end, 344 operator==, 358
isCalculated, 344 positivePosition, 358
operator!=, 343 powerOfTenDivisor, 358
operator==, 343 prefix, 358
sequence, 344 setBackgroundAttributes, 358
start, 344 setDataLabel, 358
stepWidth, 344 setDecimalDigits, 358
subStepWidth, 344 setFrameAttributes, 358
KDChart::DatasetProxyModel, 345 setMarkerAttributes, 359
KDChart::DatasetProxyModel setNegativePosition, 359
data, 346 setPositivePosition, 359
DatasetProxyModel, 346 setPowerOfTenDivisor, 359
filterAcceptsColumn, 346 setPrefix, 359
filterAcceptsRow, 347 setShowInfinite, 359
headerData, 347 setSuffix, 359
index, 348 setTextAttributes, 359
mapFromSource, 348 setVisible, 360
mapToSource, 348 showInfinite, 360
parent, 349 suffix, 360
Q_SLOTS, 351 textAttributes, 360
setDatasetColumnDescriptionVector, 349 KDChart::DiagramObserver, 361
setDatasetDescriptionVectors, 349 KDChart::DiagramObserver
setDatasetRowDescriptionVector, 350 ∼DiagramObserver, 362
setSourceModel, 350 __pad0__, 363
setSourceRootIndex, 350 diagram, 362
KDChart::DatasetSelectorWidget, 352 diagramAttributesChanged, 362
KDChart::DatasetSelectorWidget diagramDataChanged, 362
__pad0__, 354 DiagramObserver, 361
columnConfig, 354 Q_SLOTS, 363
DatasetSelectorWidget, 352 slotAttributesChanged, 362
mappingDisabled, 352 slotDataChanged, 363
on_cbReverseColumns_stateChanged, 352 slotModelsChanged, 363

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


INDEX 835

KDChart::FrameAttributes, 364 isEmpty, 374


KDChart::FrameAttributes maximumSize, 375
∼FrameAttributes, 364 minimumSize, 375
FrameAttributes, 364 mParent, 384
isVisible, 364 mParentLayout, 384
operator!=, 364 paint, 375
operator=, 364 paintAll, 376
operator==, 364 paintBackground, 376
padding, 364 paintCtx, 377
pen, 364 paintFrame, 377
setPadding, 365 paintIntoRect, 378
setPen, 365 position, 378
setVisible, 365 positionChanged, 378
KDChart::GridAttributes, 366 positionHasChanged, 379
KDChart::GridAttributes realFont, 379
∼GridAttributes, 366 realFontSize, 379
GridAttributes, 366 removeFromParentLayout, 379
gridGranularitySequence, 366 setAutoReferenceArea, 379
gridPen, 366 setBackgroundAttributes, 380
gridStepWidth, 366 setFrameAttributes, 380
gridSubStepWidth, 367 setGeometry, 380
isGridVisible, 367 setParent, 380
isSubGridVisible, 367 setParentLayout, 381
operator!=, 367 setParentWidget, 381
operator=, 367 setPosition, 381
operator==, 367 setText, 381
setGridGranularitySequence, 367 setTextAttributes, 382
setGridPen, 367 setType, 382
setGridStepWidth, 367 sizeHint, 382
setGridSubStepWidth, 367 sizeHintChanged, 383
setGridVisible, 367 text, 383
setSubGridPen, 367 textAttributes, 383
setSubGridVisible, 367 type, 384
setZeroLinePen, 367 KDChart::HorizontalLineLayoutItem, 385
subGridPen, 367 KDChart::HorizontalLineLayoutItem
zeroLinePen, 367 expandingDirections, 386
KDChart::HeaderFooter, 369 geometry, 386
Footer, 371 HorizontalLineLayoutItem, 385
Header, 371 isEmpty, 386
KDChart::HeaderFooter maximumSize, 386
∼HeaderFooter, 371 minimumSize, 386
__pad0__, 384 mParent, 388
alignToReferencePoint, 371 mParentLayout, 388
areaGeometry, 372 paint, 386
autoReferenceArea, 372 paintCtx, 387
backgroundAttributes, 372 removeFromParentLayout, 387
clone, 372 setGeometry, 387
expandingDirections, 372 setParentLayout, 387
frameAttributes, 373 setParentWidget, 387
geometry, 373 sizeHint, 388
HeaderFooter, 371 sizeHintChanged, 388
HeaderFooterType, 371 KDChart::Legend, 402
innerRect, 373 ∼Legend, 405
intersects, 373, 374 __pad0__, 427

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


836 INDEX

addDiagram, 405 setTextAttributes, 425


alignment, 406 setTitleText, 425
alignToReferencePoint, 406 setTitleTextAttributes, 425
areaGeometry, 406 setVisible, 425
backgroundAttributes, 406 showLines, 426
brush, 406 spacing, 426
buildLegend, 407 text, 426
clone, 409 textAttributes, 426
datasetCount, 410 titleText, 427
diagram, 410 titleTextAttributes, 427
diagrams, 410 KDChart::LineAttributes, 428
forceRebuild, 411 MissingValuesAreBridged, 429
frameAttributes, 411 MissingValuesHideSegments, 429
innerRect, 411 MissingValuesPolicyIgnored, 429
Legend, 404 MissingValuesShownAsZero, 429
markerAttributes, 412 KDChart::LineAttributes
orientation, 412 ∼LineAttributes, 429
paint, 412 displayArea, 429
paintAll, 413 LineAttributes, 429
paintBackground, 414 MissingValuesPolicy, 428
paintEvent, 415 missingValuesPolicy, 429
paintFrame, 415 operator!=, 429
paintIntoRect, 415 operator=, 429
pen, 416 operator==, 429
position, 416 setDisplayArea, 429
positionHasChanged, 416 setMissingValuesPolicy, 429
propertiesChanged, 417 setTransparency, 429
Q_SLOTS, 427 transparency, 429
referenceArea, 417 KDChart::LineDiagram, 431
removeDiagram, 417 Normal, 436
removeDiagrams, 417 Percent, 436
replaceDiagram, 418 Stacked, 436
resetDiagram, 418 KDChart::LineDiagram
resetTexts, 418 ∼LineDiagram, 436
resizeEvent, 419 __pad0__, 472
setAlignment, 419 addAxis, 436
setBackgroundAttributes, 419 allowOverlappingDataValueTexts, 437
setBrush, 419 antiAliasing, 437
setBrushesFromDiagram, 420 attributesModel, 437
setColor, 420 attributesModelRootIndex, 438
setDefaultColors, 420 axes, 438
setDiagram, 421 brush, 438, 439
setFrameAttributes, 421 calculateDataBoundaries, 439
setMarkerAttributes, 421 checkInvariants, 441
setNeedRebuild, 421 clone, 442
setOrientation, 422 columnToIndex, 442
setPen, 422 coordinatePlane, 442
setPosition, 422 dataBoundaries, 442
setRainbowColors, 422 dataChanged, 443
setReferenceArea, 423 datasetBrushes, 443
setShowLines, 423 datasetDimension, 444
setSpacing, 423 datasetLabels, 444
setSubduedColors, 424 datasetMarkers, 445
setText, 425 datasetPens, 445

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


INDEX 837

dataValueAttributes, 445, 446 useSubduedColors, 471


doItemsLayout, 446 valueForCell, 471
getCellValues, 447 valueForCellTesting, 471
horizontalOffset, 447 verticalOffset, 472
indexAt, 447 visualRect, 472
isIndexHidden, 448 visualRegionForSelection, 472
itemRowLabels, 448 KDChart::MarkerAttributes, 473
layoutPlanes, 448 Marker1Pixel, 474
lineAttributes, 448, 449 Marker4Pixels, 474
LineDiagram, 436 MarkerCircle, 474
LineType, 436 MarkerCross, 474
modelsChanged, 449 MarkerDiamond, 474
moveCursor, 449 MarkerFastCross, 474
numberOfAbscissaSegments, 449 MarkerRing, 474
numberOfOrdinateSegments, 450 MarkerSquare, 474
paint, 450 KDChart::MarkerAttributes
paintDataValueText, 453 ∼MarkerAttributes, 474
paintDataValueTexts, 454 isVisible, 474
paintEvent, 455 MarkerAttributes, 474
paintMarker, 455 markerColor, 474
paintMarkers, 457 markerSize, 474
pen, 457, 458 MarkerStyle, 474
percentMode, 458 markerStyle, 474
propertiesChanged, 458 MarkerStylesMap, 473
referenceDiagram, 459 markerStylesMap, 474
referenceDiagramOffset, 459 operator!=, 475
resize, 459 operator=, 475
resizeEvent, 459 operator==, 475
scrollTo, 459 pen, 475
setAllowOverlappingDataValueTexts, 460 setMarkerColor, 475
setAntiAliasing, 460 setMarkerSize, 475
setAttributesModel, 460 setMarkerStyle, 475
setAttributesModelRootIndex, 461 setMarkerStylesMap, 475
setBrush, 461, 462 setPen, 475
setCoordinatePlane, 462 setVisible, 475
setDataBoundariesDirty, 462 KDChart::MarkerLayoutItem, 476
setDatasetDimension, 463 KDChart::MarkerLayoutItem
setDataValueAttributes, 463, 464 expandingDirections, 477
setLineAttributes, 464, 465 geometry, 477
setModel, 465 isEmpty, 477
setPen, 465, 466 MarkerLayoutItem, 476
setPercentMode, 466 maximumSize, 477
setReferenceDiagram, 466 minimumSize, 477
setRootIndex, 466 mParent, 480
setSelection, 467 mParentLayout, 480
setThreeDLineAttributes, 467 paint, 477
setType, 468 paintCtx, 478
takeAxis, 468 removeFromParentLayout, 478
threeDItemDepth, 469 setGeometry, 478
threeDLineAttributes, 469, 470 setParentLayout, 479
type, 470 setParentWidget, 479
update, 470 sizeHint, 479
useDefaultColors, 470 sizeHintChanged, 479
useRainbowColors, 470 KDChart::Measure, 481

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


838 INDEX

calculatedValue, 482 attributesModelRootIndex, 500


calculationMode, 483 brush, 500
Measure, 481, 482 calculateDataBoundaries, 501
operator!=, 483 checkInvariants, 501
operator=, 483 clone, 502
operator==, 484 columnCount, 502
referenceArea, 484 columnToIndex, 502
referenceOrientation, 484 coordinatePlane, 502
setCalculationMode, 484 dataBoundaries, 503
setReferenceArea, 484 dataChanged, 503
setReferenceOrientation, 485 datasetBrushes, 503
setRelativeMode, 485 datasetDimension, 504
setValue, 485 datasetLabels, 504
value, 485 datasetMarkers, 505
KDChart::PaintContext, 486 datasetPens, 505
KDChart::PaintContext dataValueAttributes, 506
coordinatePlane, 486 doItemsLayout, 507
PaintContext, 486 granularity, 507
painter, 486 horizontalOffset, 507
rectangle, 486 indexAt, 507
setCoordinatePlane, 486 isIndexHidden, 508
setPainter, 486 itemRowLabels, 508
setRectangle, 486 modelsChanged, 508
KDChart::Palette, 488 moveCursor, 508
∼Palette, 489 numberOfGridRings, 508
__pad0__, 490 numberOfValuesPerDataset, 509
addBrush, 489 paint, 509
defaultPalette, 489 paintDataValueText, 512
getBrush, 489 paintDataValueTexts, 513
isValid, 489 paintEvent, 513
operator=, 489 paintMarker, 513, 514
Palette, 489 paintMarkers, 515
rainbowPalette, 489 pen, 516
removeBrush, 489 percentMode, 517
size, 490 pieAttributes, 517
subduedPalette, 490 PieDiagram, 498
KDChart::PieAttributes, 491 polarCoordinatePlane, 518
KDChart::PieAttributes propertiesChanged, 518
∼PieAttributes, 491 resize, 518
explode, 492 resizeEvent, 518
explodeFactor, 492 scrollTo, 518
operator!=, 492 setAllowOverlappingDataValueTexts, 519
operator=, 492 setAntiAliasing, 519
operator==, 492 setAttributesModel, 519
PieAttributes, 491 setAttributesModelRootIndex, 520
setExplode, 493 setBrush, 520, 521
setExplodeFactor, 493 setCoordinatePlane, 521
KDChart::PieDiagram, 494 setDataBoundariesDirty, 521
KDChart::PieDiagram setDatasetDimension, 521
∼PieDiagram, 498 setDataValueAttributes, 522
__pad0__, 529 setGranularity, 523
allowOverlappingDataValueTexts, 499 setModel, 523
antiAliasing, 499 setPen, 524
attributesModel, 499 setPercentMode, 524

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


INDEX 839

setPieAttributes, 524, 525 paintCtx, 544


setRootIndex, 525 paintEvent, 544
setSelection, 525 paintFrame, 545
setStartPosition, 525 paintIntoRect, 545
setThreeDPieAttributes, 525, 526 parent, 545
startPosition, 526 PolarCoordinatePlane, 533
threeDPieAttributes, 526, 527 positionHasChanged, 546
update, 527 propertiesChanged, 546
useDefaultColors, 527 Q_SLOTS, 556
useRainbowColors, 528 referenceCoordinatePlane, 546
useSubduedColors, 528 relayout, 547
valueForCell, 528 removeFromParentLayout, 547
valueTotals, 528 replaceDiagram, 547
verticalOffset, 529 resetGridAttributes, 548
visualRect, 529 resizeEvent, 548
visualRegionForSelection, 529 setBackgroundAttributes, 548
KDChart::PolarCoordinatePlane, 530 setFrameAttributes, 549
Linear, 533 setGeometry, 549
Logarithmic, 533 setGlobalGridAttributes, 549
KDChart::PolarCoordinatePlane setGridAttributes, 550
∼PolarCoordinatePlane, 533 setParent, 550
__pad0__, 555 setParentLayout, 551
addDiagram, 534 setParentWidget, 551
alignToReferencePoint, 534 setReferenceCoordinatePlane, 551
angleUnit, 534 setZoomCenter, 551
areaGeometry, 535 setZoomFactorX, 552
AxesCalcMode, 533 setZoomFactorY, 552
backgroundAttributes, 535 sizeHint, 552
CoordinateTransformationList, 533 sizeHintChanged, 553
diagram, 535 sizePolicy, 553
diagrams, 535, 536 takeDiagram, 553
expandingDirections, 536 translate, 554
frameAttributes, 536 translatePolar, 554
geometry, 537 zoomCenter, 554
getDataDimensionsList, 537 zoomFactorX, 555
globalGridAttributes, 537 zoomFactorY, 555
gridAttributes, 537 KDChart::PolarDiagram, 557
gridDimensionsList, 538 KDChart::PolarDiagram
hasOwnGridAttributes, 539 ∼PolarDiagram, 561
innerRect, 539 __pad0__, 588
isEmpty, 539 allowOverlappingDataValueTexts, 561
layoutDiagrams, 540 antiAliasing, 562
layoutPlanes, 541 attributesModel, 562
maximumSize, 541 attributesModelRootIndex, 562
minimumSize, 541 brush, 563
minimumSizeHint, 541 calculateDataBoundaries, 563
mParent, 555 checkInvariants, 564
mParentLayout, 555 clone, 564
needLayoutPlanes, 542 columnCount, 565
needRelayout, 542 columnToIndex, 565
needUpdate, 542 coordinatePlane, 565
paint, 542 dataBoundaries, 565
paintAll, 543 dataChanged, 566
paintBackground, 543 datasetBrushes, 566

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


840 INDEX

datasetDimension, 567 valueForCell, 587


datasetLabels, 567 valueTotals, 587
datasetMarkers, 568 verticalOffset, 588
datasetPens, 568 visualRect, 588
dataValueAttributes, 568, 569 visualRegionForSelection, 588
doItemsLayout, 569 zeroDegreePosition, 588
horizontalOffset, 570 KDChart::Position, 590
indexAt, 570 Center, 596
isIndexHidden, 570 East, 596
itemRowLabels, 570 ExcludeCenter, 591
modelsChanged, 571 fromName, 592
moveCursor, 571 IncludeCenter, 591
numberOfGridRings, 571 isCorner, 593
numberOfValuesPerDataset, 571 isEastSide, 593
paint, 571 isNorthSide, 593
paintDataValueText, 572 isPole, 593
paintDataValueTexts, 573 isSouthSide, 594
paintEvent, 573 isWestSide, 594
paintMarker, 574 name, 594
paintMarkers, 576 names, 594
paintPolarMarkers, 576 North, 597
pen, 577 NorthEast, 597
percentMode, 577 NorthWest, 597
polarCoordinatePlane, 578 operator!=, 595
PolarDiagram, 561 operator==, 595
propertiesChanged, 578 Option, 591
resize, 578 Position, 592
resizeEvent, 578 printableName, 595
rotateCircularLabels, 578 printableNames, 596
scrollTo, 579 South, 597
setAllowOverlappingDataValueTexts, 579 SouthEast, 597
setAntiAliasing, 579 SouthWest, 597
setAttributesModel, 579 Unknown, 597
setAttributesModelRootIndex, 580 value, 596
setBrush, 580, 581 West, 597
setCoordinatePlane, 581 KDChart::RelativePosition, 606
setDataBoundariesDirty, 581 KDChart::RelativePosition
setDatasetDimension, 582 ∼RelativePosition, 606
setDataValueAttributes, 582, 583 alignment, 606
setModel, 583 horizontalPadding, 606
setPen, 583, 584 operator!=, 607
setPercentMode, 584 operator=, 607
setRootIndex, 584 operator==, 607
setRotateCircularLabels, 585 referenceArea, 607
setSelection, 585 referencePosition, 607
setShowDelimitersAtPosition, 585 RelativePosition, 606
setShowLabelsAtPosition, 585 rotation, 607
setZeroDegreePosition, 585 setAlignment, 607
showDelimitersAtPosition, 586 setHorizontalPadding, 607
showLabelsAtPosition, 586 setReferenceArea, 607
update, 586 setReferencePosition, 607
useDefaultColors, 586 setRotation, 607
useRainbowColors, 586 setVerticalPadding, 607
useSubduedColors, 587 verticalPadding, 607

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


INDEX 841

KDChart::RingDiagram, 608 setCoordinatePlane, 632


KDChart::RingDiagram setDataBoundariesDirty, 633
∼RingDiagram, 612 setDatasetDimension, 633
__pad0__, 641 setDataValueAttributes, 633, 634
allowOverlappingDataValueTexts, 613 setGranularity, 634
antiAliasing, 613 setModel, 635
attributesModel, 613 setPen, 635, 636
attributesModelRootIndex, 613 setPercentMode, 636
brush, 614 setPieAttributes, 636
calculateDataBoundaries, 615 setRelativeThickness, 636
checkInvariants, 615 setRootIndex, 637
clone, 615 setSelection, 637
columnCount, 616 setStartPosition, 637
columnToIndex, 616 setThreeDPieAttributes, 637, 638
coordinatePlane, 616 startPosition, 638
dataBoundaries, 616 threeDPieAttributes, 638, 639
dataChanged, 617 update, 639
datasetBrushes, 617 useDefaultColors, 639
datasetDimension, 618 useRainbowColors, 639
datasetLabels, 618 useSubduedColors, 640
datasetMarkers, 619 valueForCell, 640
datasetPens, 619 valueTotals, 640
dataValueAttributes, 619, 620 verticalOffset, 641
doItemsLayout, 620 visualRect, 641
granularity, 621 visualRegionForSelection, 641
horizontalOffset, 621 KDChart::TextArea, 642
indexAt, 621 KDChart::TextArea
isIndexHidden, 621 ∼TextArea, 644
itemRowLabels, 622 __pad0__, 655
modelsChanged, 622 alignToReferencePoint, 644
moveCursor, 622 areaGeometry, 644
numberOfGridRings, 622 autoReferenceArea, 644
numberOfValuesPerDataset, 622 backgroundAttributes, 645
paint, 623 expandingDirections, 645
paintDataValueText, 623 frameAttributes, 645
paintDataValueTexts, 624 geometry, 645
paintEvent, 624 innerRect, 645
paintMarker, 625 intersects, 646, 647
paintMarkers, 627 isEmpty, 647
pen, 627, 628 maximumSize, 647
percentMode, 628 minimumSize, 647
pieAttributes, 628, 629 mParent, 655
polarCoordinatePlane, 629 mParentLayout, 655
propertiesChanged, 629 paint, 647
relativeThickness, 629 paintAll, 648
resize, 630 paintBackground, 648
resizeEvent, 630 paintCtx, 649
RingDiagram, 612 paintFrame, 650
scrollTo, 630 paintIntoRect, 650
setAllowOverlappingDataValueTexts, 630 positionHasChanged, 651
setAntiAliasing, 630 realFont, 651
setAttributesModel, 631 realFontSize, 651
setAttributesModelRootIndex, 631 removeFromParentLayout, 651
setBrush, 632 setAutoReferenceArea, 651

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


842 INDEX

setBackgroundAttributes, 652 setParentLayout, 667


setFrameAttributes, 652 setParentWidget, 667
setGeometry, 652 setText, 667
setParentLayout, 652 setTextAttributes, 667
setParentWidget, 653 sizeHint, 668
setText, 653 sizeHintChanged, 668
setTextAttributes, 653 text, 668
sizeHint, 654 textAttributes, 669
sizeHintChanged, 654 TextLayoutItem, 662
text, 654 KDChart::ThreeDBarAttributes, 670
TextArea, 644 KDChart::ThreeDBarAttributes
textAttributes, 654 ∼ThreeDBarAttributes, 670
KDChart::TextAttributes, 656 angle, 671
KDChart::TextAttributes depth, 671
∼TextAttributes, 657 isEnabled, 671
autoRotate, 657 operator!=, 671
autoShrink, 657 operator=, 672
font, 657 operator==, 672
fontSize, 657 setAngle, 672
hasAbsoluteFontSize, 657 setDepth, 673
isVisible, 657 setEnabled, 673
minimalFontSize, 658 setUseShadowColors, 673
operator!=, 658 ThreeDBarAttributes, 670
operator=, 658 useShadowColors, 673
operator==, 658 validDepth, 673
pen, 658 KDChart::ThreeDLineAttributes, 675
rotation, 658 KDChart::ThreeDLineAttributes
setAutoRotate, 658 ∼ThreeDLineAttributes, 675
setAutoShrink, 658 depth, 676
setFont, 659 isEnabled, 676
setFontSize, 659 lineXRotation, 676
setMinimalFontSize, 659 lineYRotation, 676
setPen, 659 operator!=, 677
setRotation, 659 operator=, 677
setVisible, 659 operator==, 677
TextAttributes, 657 setDepth, 678
KDChart::TextLayoutItem, 661 setEnabled, 678
KDChart::TextLayoutItem setLineXRotation, 678
autoReferenceArea, 663 setLineYRotation, 678
expandingDirections, 663 ThreeDLineAttributes, 675
geometry, 663 validDepth, 678
intersects, 663, 664 KDChart::ThreeDPieAttributes, 680
isEmpty, 664 KDChart::ThreeDPieAttributes
maximumSize, 664 ∼ThreeDPieAttributes, 680
minimumSize, 664 depth, 681
mParent, 669 isEnabled, 681
mParentLayout, 669 operator!=, 681
paint, 665 operator=, 681
paintCtx, 665 operator==, 682
realFont, 665 setDepth, 682
realFontSize, 666 setEnabled, 682
removeFromParentLayout, 666 setUseShadowColors, 682
setAutoReferenceArea, 666 ThreeDPieAttributes, 680
setGeometry, 666 useShadowColors, 683

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


INDEX 843

validDepth, 683 setDataset, 698, 699


KDChart::VerticalLineLayoutItem, 684 setGlobalLeadingBottom, 699
KDChart::VerticalLineLayoutItem setGlobalLeadingLeft, 699
expandingDirections, 685 setGlobalLeadingRight, 700
geometry, 685 setGlobalLeadingTop, 700
isEmpty, 685 setSubType, 700
maximumSize, 685 Stacked, 692
minimumSize, 685 SubType, 692
mParent, 687 subType, 701, 702
mParentLayout, 687 takeHeaderFooter, 701
paint, 685 takeLegend, 701
paintCtx, 686 top, 703
removeFromParentLayout, 686 type, 702
setGeometry, 686 Widget, 692
setParentLayout, 686 KDChart::ZoomParameters, 704
setParentWidget, 686 KDChart::ZoomParameters
sizeHint, 687 xCenter, 704
sizeHintChanged, 687 xFactor, 704
VerticalLineLayoutItem, 684 yCenter, 704
KDChart::Widget, 689 yFactor, 704
∼Widget, 692 ZoomParameters, 704
addHeaderFooter, 693 KDCHART_DATA_VALUE_AUTO_DIGITS
addLegend, 693 KDChartDataValueAttributes.cpp, 751
allHeadersFooters, 694 KDCHART_DECLARE_DERIVED_-
allLegends, 694 DIAGRAM
Bar, 692 KDChartGlobal.h, 759
barDiagram, 694 KDCHART_DECLARE_PRIVATE_BASE_-
bottom, 702 POLYMORPHIC
ChartType, 692 KDChartGlobal.h, 760
coordinatePlane, 694 KDCHART_DECLARE_PRIVATE_BASE_-
diagram, 695 POLYMORPHIC_QWIDGET
firstHeaderFooter, 695 KDChartGlobal.h, 760
globalLeadingBottom, 695 KDCHART_DECLARE_PRIVATE_BASE_-
globalLeadingLeft, 695 VALUE
globalLeadingRight, 696 KDChartGlobal.h, 760
globalLeadingTop, 696 KDCHART_DECLARE_PRIVATE_DERIVED
legend, 696 KDChartGlobal.h, 761
Line, 692 KDCHART_DECLARE_PRIVATE_-
lineDiagram, 696 DERIVED_PARENT
Normal, 692 KDChartGlobal.h, 761
NoType, 692 KDCHART_DECLARE_PRIVATE_-
Percent, 692 DERIVED_QWIDGET
Pie, 692 KDChartGlobal.h, 761
pieDiagram, 697 KDCHART_DECLARE_SWAP_BASE
Polar, 692 KDChartGlobal.h, 761
polarDiagram, 697 KDCHART_DECLARE_SWAP_DERIVED
Q_SLOTS, 702 KDChartGlobal.h, 761
replaceHeaderFooter, 697 KDCHART_DECLARE_SWAP_-
replaceLegend, 698 SPECIALISATION
resetData, 698 KDChartGlobal.h, 761
right, 702 KDCHART_DECLARE_SWAP_-
Ring, 692 SPECIALISATION_DERIVED
ringDiagram, 698 KDChartGlobal.h, 762
Rows, 692 KDCHART_DERIVED_PRIVATE_FOOTER

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


844 INDEX

KDChartGlobal.h, 762 operator<<, 734


KDCHART_IMPL_DERIVED_DIAGRAM KDChartBackgroundAttributes.h, 735
KDChartGlobal.h, 762 KDChartBackgroundAttributes.h
KDCHART_IMPL_DERIVED_PLANE operator<<, 735
KDChartGlobal.h, 762 Q_DECLARE_TYPEINFO, 735
KDChartAbstractArea.cpp, 707 KDChartBarAttributes.cpp, 736
KDChartAbstractArea.h, 708 KDChartBarAttributes.cpp
KDChartAbstractAreaBase.cpp, 709 d, 736
KDChartAbstractAreaBase.cpp KDChartBarAttributes.h, 737
attributes, 709 KDChartBarDiagram.cpp, 738
d, 709 KDChartBarDiagram.cpp
KDChartAbstractAreaBase.h, 713 d, 738
KDChartAbstractAreaWidget.cpp, 714 KDChartBarDiagram.h, 739
KDChartAbstractAreaWidget.cpp KDChartCartesianAxis.cpp, 740
d, 714 KDChartCartesianAxis.cpp
KDChartAbstractAreaWidget.h, 715 d, 740
KDChartAbstractAxis.cpp, 716 ptr, 740
KDChartAbstractAxis.cpp KDChartCartesianAxis.h, 741
d, 716 KDChartCartesianCoordinatePlane.cpp, 742
KDChartAbstractAxis.h, 717 KDChartCartesianCoordinatePlane.cpp
KDChartAbstractCartesianDiagram.cpp, 718 d, 742
KDChartAbstractCartesianDiagram.cpp KDChartCartesianCoordinatePlane.h, 743
d, 718 KDChartChart.cpp, 744
KDChartAbstractCartesianDiagram.h, 719 KDChartChart.cpp
KDChartAbstractCoordinatePlane.cpp, 720 ADD_VBOX_WITH_LEGENDS, 744
KDChartAbstractCoordinatePlane.cpp d, 745
d, 720 findOrCreateHBoxLayoutByObjectName,
KDChartAbstractCoordinatePlane.h, 721 745
KDChartAbstractDiagram.cpp, 722 findOrCreateLayoutByObjectName, 745
KDChartAbstractDiagram.cpp findOrCreateVBoxLayoutByObjectName,
d, 722 745
KDChartAbstractDiagram.h, 723 KDChartChart.h, 746
KDChartAbstractPieDiagram.cpp, 724 KDChartDatasetProxyModel.cpp, 747
KDChartAbstractPieDiagram.cpp KDChartDatasetProxyModel.h, 748
d, 724 KDChartDatasetSelector.cpp, 749
KDChartAbstractPieDiagram.h, 725 KDChartDatasetSelector.h, 750
KDChartAbstractPolarDiagram.cpp, 726 KDChartDataValueAttributes.cpp, 751
KDChartAbstractPolarDiagram.cpp KDChartDataValueAttributes.cpp
d, 726 d, 751
KDChartAbstractPolarDiagram.h, 727 KDCHART_DATA_VALUE_AUTO_-
KDChartAbstractProxyModel.cpp, 728 DIGITS, 751
KDChartAbstractProxyModel.h, 729 operator<<, 751
KDChartAbstractThreeDAttributes.cpp, 730 KDChartDataValueAttributes.h, 753
KDChartAbstractThreeDAttributes.cpp KDChartDataValueAttributes.h
d, 730 operator<<, 753
operator<<, 730 Q_DECLARE_TYPEINFO, 753
KDChartAbstractThreeDAttributes.h, 731 KDChartDiagramObserver.cpp, 754
KDChartAbstractThreeDAttributes.h KDChartDiagramObserver.h, 755
operator<<, 731 KDChartEnums, 390
KDChartAttributesModel.cpp, 732 GranularitySequence_10_20, 392
KDChartAttributesModel.h, 733 GranularitySequence_10_50, 392
KDChartBackgroundAttributes.cpp, 734 GranularitySequence_25_50, 392
KDChartBackgroundAttributes.cpp GranularitySequenceIrregular, 392
d, 734 LayoutJustOverwrite, 395

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


INDEX 845

LayoutPolicyRotate, 395 KDCHART_DECLARE_PRIVATE_-


LayoutPolicyShiftHorizontally, 395 BASE_POLYMORPHIC, 760
LayoutPolicyShiftVertically, 395 KDCHART_DECLARE_PRIVATE_-
LayoutPolicyShrinkFontSize, 395 BASE_POLYMORPHIC_-
MeasureCalculationModeAbsolute, 393 QWIDGET, 760
MeasureCalculationModeAuto, 393 KDCHART_DECLARE_PRIVATE_-
MeasureCalculationModeAutoArea, 393 BASE_VALUE, 760
MeasureCalculationModeAutoOrientation, KDCHART_DECLARE_PRIVATE_-
393 DERIVED, 761
MeasureCalculationModeRelative, 393 KDCHART_DECLARE_PRIVATE_-
MeasureOrientationAuto, 394 DERIVED_PARENT, 761
MeasureOrientationHorizontal, 394 KDCHART_DECLARE_PRIVATE_-
MeasureOrientationMaximum, 394 DERIVED_QWIDGET, 761
MeasureOrientationMinimum, 394 KDCHART_DECLARE_SWAP_BASE,
MeasureOrientationVertical, 394 761
PositionCenter, 394 KDCHART_DECLARE_SWAP_-
PositionEast, 394 DERIVED, 761
PositionNorth, 394 KDCHART_DECLARE_SWAP_-
PositionNorthEast, 394 SPECIALISATION, 761
PositionNorthWest, 394 KDCHART_DECLARE_SWAP_-
PositionSouth, 394 SPECIALISATION_DERIVED,
PositionSouthEast, 394 762
PositionSouthWest, 394 KDCHART_DERIVED_PRIVATE_-
PositionUnknown, 394 FOOTER, 762
PositionWest, 394 KDCHART_IMPL_DERIVED_-
KDChartEnums DIAGRAM, 762
GranularitySequence, 392 KDCHART_IMPL_DERIVED_PLANE,
granularitySequenceToString, 396 762
layoutPolicyToString, 396 KDChartGridAttributes.cpp, 764
MeasureCalculationMode, 392 KDChartGridAttributes.cpp
measureCalculationModeToString, 396 d, 764
MeasureOrientation, 393 operator<<, 764
MeasureOrientationToString, 397 KDChartGridAttributes.h, 765
PositionValue, 394 KDChartGridAttributes.h
stringToGranularitySequence, 397 operator<<, 765
stringToLayoutPolicy, 398 Q_DECLARE_TYPEINFO, 765
stringToMeasureCalculationMode, 398 KDChartHeaderFooter.cpp, 766
stringToMeasureOrientation, 398 KDChartHeaderFooter.cpp
TextLayoutPolicy, 395 d, 766
KDChartEnums.h, 756 KDChartHeaderFooter.h, 767
KDChartFrameAttributes.cpp, 757 KDChartLayoutItems.cpp, 768
KDChartFrameAttributes.cpp KDChartLayoutItems.cpp
d, 757 PI, 768
operator<<, 757 KDChartLayoutItems.h, 769
KDChartFrameAttributes.h, 758 KDChartLegend.cpp, 770
KDChartFrameAttributes.h KDChartLegend.cpp
operator<<, 758 d, 770
Q_DECLARE_TYPEINFO, 758 KDChartLegend.h, 771
KDChartGlobal.h, 759 KDChartLineAttributes.cpp, 772
KDChartGlobal.h KDChartLineAttributes.cpp
__kdab__dereference_for_methodcall, 763 d, 772
KDAB_SET_OBJECT_NAME, 759 operator<<, 772
KDCHART_DECLARE_DERIVED_- KDChartLineAttributes.h, 773
DIAGRAM, 759 KDChartLineAttributes.h

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


846 INDEX

operator<<, 773 maxPositionValue, 795


Q_DECLARE_TYPEINFO, 773 operator<<, 794
KDChartLineDiagram.cpp, 774 staticPositionCenter, 795
KDChartLineDiagram.cpp staticPositionEast, 795
d, 774 staticPositionNames, 795
KDChartLineDiagram.h, 775 staticPositionNorth, 795
KDChartMarkerAttributes.cpp, 776 staticPositionNorthEast, 795
KDChartMarkerAttributes.cpp staticPositionNorthWest, 795
d, 776 staticPositionSouth, 795
operator<<, 776 staticPositionSouthEast, 796
KDChartMarkerAttributes.h, 777 staticPositionSouthWest, 796
KDChartMarkerAttributes.h staticPositionUnknown, 796
operator<<, 777 staticPositionWest, 796
Q_DECLARE_TYPEINFO, 777 KDChartPosition.h, 797
KDChartMeasure.cpp, 778 KDChartPosition.h
KDChartMeasure.cpp operator<<, 797
operator<<, 778 Q_DECLARE_TYPEINFO, 797
KDChartMeasure.h, 779 KDChartRelativePosition.cpp, 798
KDChartMeasure.h KDChartRelativePosition.cpp
operator<<, 779 d, 798
KDChartPaintContext.cpp, 780 operator<<, 798
KDChartPaintContext.cpp KDChartRelativePosition.h, 799
d, 780 KDChartRelativePosition.h
KDChartPaintContext.h, 781 operator<<, 799
KDChartPalette.cpp, 782 Q_DECLARE_TYPEINFO, 799
KDChartPalette.cpp KDChartRingDiagram.cpp, 800
d, 782 KDChartRingDiagram.cpp
makeDefaultPalette, 782 d, 800
makeRainbowPalette, 782 KDChartRingDiagram.h, 801
makeSubduedPalette, 783 KDChartTextArea.cpp, 802
KDChartPalette.h, 784 KDChartTextArea.h, 803
KDChartPieAttributes.cpp, 785 KDChartTextAttributes.cpp, 804
KDChartPieAttributes.cpp KDChartTextAttributes.cpp
d, 785 d, 804
operator<<, 785 operator<<, 804
KDChartPieAttributes.h, 786 KDChartTextAttributes.h, 805
KDChartPieAttributes.h KDChartTextAttributes.h
operator<<, 786 operator<<, 805
Q_DECLARE_TYPEINFO, 786 Q_DECLARE_TYPEINFO, 805
KDChartPieDiagram.cpp, 787 KDChartThreeDBarAttributes.cpp, 806
KDChartPieDiagram.cpp KDChartThreeDBarAttributes.cpp
buildReferenceRect, 787 d, 806
d, 787 operator<<, 806
KDChartPieDiagram.h, 789 KDChartThreeDBarAttributes.h, 807
KDChartPolarCoordinatePlane.cpp, 790 KDChartThreeDBarAttributes.h
KDChartPolarCoordinatePlane.cpp operator<<, 807
d, 790 Q_DECLARE_TYPEINFO, 807
KDChartPolarCoordinatePlane.h, 791 KDChartThreeDLineAttributes.cpp, 808
KDChartPolarDiagram.cpp, 792 KDChartThreeDLineAttributes.cpp
KDChartPolarDiagram.cpp d, 808
d, 792 operator<<, 808
KDChartPolarDiagram.h, 793 KDChartThreeDLineAttributes.h, 809
KDChartPosition.cpp, 794 KDChartThreeDLineAttributes.h
KDChartPosition.cpp operator<<, 809

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


INDEX 847

Q_DECLARE_TYPEINFO, 809 KDChartEnums, 396


KDChartThreeDPieAttributes.cpp, 810 Left
KDChartThreeDPieAttributes.cpp KDChart::CartesianAxis, 268
d, 810 Legend
operator<<, 810 KDChart::Legend, 404
KDChartThreeDPieAttributes.h, 811 legend
KDChartThreeDPieAttributes.h KDChart::Chart, 332
operator<<, 811 KDChart::Widget, 696
Q_DECLARE_TYPEINFO, 811 LegendList
KDChartWidget.cpp, 812 KDChart, 19
KDChartWidget.cpp legends
d, 812 KDChart::Chart, 333
isCartesian, 813 Line
isPolar, 813 KDChart::Widget, 692
SET_SUB_TYPE, 812 Linear
TEST_SUB_TYPE, 813 KDChart::AbstractCoordinatePlane, 96
KDChartWidget.h, 814 KDChart::CartesianCoordinatePlane, 297
KDChartZoomParameters.h, 815 KDChart::PolarCoordinatePlane, 533
KDTextDocument, 400 LineAttributes, 21
KDTextDocument, 400 KDChart::LineAttributes, 429
KDTextDocument lineAttributes
∼KDTextDocument, 400 KDChart::LineDiagram, 448, 449
KDTextDocument, 400 LineAttributesRole
minimumSizeHint, 401 KDChart, 19
sizeHint, 401 LineDiagram
KDTextDocument.cpp, 816 KDChart::LineDiagram, 436
KDTextDocument.h, 817 lineDiagram
KDChart::Widget, 696
labels LineType
KDChart::AbstractAxis, 55 KDChart::LineDiagram, 436
KDChart::CartesianAxis, 273 lineXRotation
layoutDiagrams KDChart::ThreeDLineAttributes, 676
KDChart::AbstractCoordinatePlane, 101 lineYRotation
KDChart::CartesianCoordinatePlane, 306 KDChart::ThreeDLineAttributes, 676
KDChart::PolarCoordinatePlane, 540 Logarithmic
LayoutJustOverwrite KDChart::AbstractCoordinatePlane, 96
KDChartEnums, 395 KDChart::CartesianCoordinatePlane, 297
layoutPlanes KDChart::PolarCoordinatePlane, 533
KDChart::AbstractCartesianDiagram, 76
KDChart::AbstractCoordinatePlane, 101 makeDefaultPalette
KDChart::BarDiagram, 242 KDChartPalette.cpp, 782
KDChart::CartesianAxis, 273 makeRainbowPalette
KDChart::CartesianCoordinatePlane, 308 KDChartPalette.cpp, 782
KDChart::LineDiagram, 448 makeSubduedPalette
KDChart::PolarCoordinatePlane, 541 KDChartPalette.cpp, 783
LayoutPolicyRotate mapFromSource
KDChartEnums, 395 KDChart::AbstractProxyModel, 204
LayoutPolicyShiftHorizontally KDChart::AttributesModel, 214
KDChartEnums, 395 KDChart::DatasetProxyModel, 348
LayoutPolicyShiftVertically mappingDisabled
KDChartEnums, 395 KDChart::DatasetSelectorWidget, 352
LayoutPolicyShrinkFontSize mapToSource
KDChartEnums, 395 KDChart::AbstractProxyModel, 205
layoutPolicyToString KDChart::AttributesModel, 215

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


848 INDEX

KDChart::DatasetProxyModel, 348 KDChartEnums, 393


Marker1Pixel MeasureCalculationModeAuto
KDChart::MarkerAttributes, 474 KDChartEnums, 393
Marker4Pixels MeasureCalculationModeAutoArea
KDChart::MarkerAttributes, 474 KDChartEnums, 393
MarkerAttributes, 22 MeasureCalculationModeAutoOrientation
KDChart::MarkerAttributes, 474 KDChartEnums, 393
markerAttributes MeasureCalculationModeRelative
KDChart::DataValueAttributes, 357 KDChartEnums, 393
KDChart::Legend, 412 measureCalculationModeToString
MarkerCircle KDChartEnums, 396
KDChart::MarkerAttributes, 474 MeasureOrientation
markerColor KDChartEnums, 393
KDChart::MarkerAttributes, 474 MeasureOrientationAuto
MarkerCross KDChartEnums, 394
KDChart::MarkerAttributes, 474 MeasureOrientationHorizontal
MarkerDiamond KDChartEnums, 394
KDChart::MarkerAttributes, 474 MeasureOrientationMaximum
MarkerFastCross KDChartEnums, 394
KDChart::MarkerAttributes, 474 MeasureOrientationMinimum
MarkerLayoutItem KDChartEnums, 394
KDChart::MarkerLayoutItem, 476 MeasureOrientationToString
MarkerRing KDChartEnums, 397
KDChart::MarkerAttributes, 474 MeasureOrientationVertical
markerSize KDChartEnums, 394
KDChart::MarkerAttributes, 474 minimalFontSize
MarkerSquare KDChart::TextAttributes, 658
KDChart::MarkerAttributes, 474 minimumSize
MarkerStyle KDChart::AbstractCoordinatePlane, 102
KDChart::MarkerAttributes, 474 KDChart::CartesianAxis, 275
markerStyle KDChart::CartesianCoordinatePlane, 308
KDChart::MarkerAttributes, 474 KDChart::HeaderFooter, 375
MarkerStylesMap KDChart::HorizontalLineLayoutItem, 386
KDChart::MarkerAttributes, 473 KDChart::MarkerLayoutItem, 477
markerStylesMap KDChart::PolarCoordinatePlane, 541
KDChart::MarkerAttributes, 474 KDChart::TextArea, 647
maximumSize KDChart::TextLayoutItem, 664
KDChart::AbstractCoordinatePlane, 101 KDChart::VerticalLineLayoutItem, 685
KDChart::CartesianAxis, 273 minimumSizeHint
KDChart::CartesianCoordinatePlane, 308 KDChart::AbstractCoordinatePlane, 102
KDChart::HeaderFooter, 375 KDChart::CartesianCoordinatePlane, 309
KDChart::HorizontalLineLayoutItem, 386 KDChart::PolarCoordinatePlane, 541
KDChart::MarkerLayoutItem, 477 KDTextDocument, 401
KDChart::PolarCoordinatePlane, 541 MissingValuesAreBridged
KDChart::TextArea, 647 KDChart::LineAttributes, 429
KDChart::TextLayoutItem, 664 MissingValuesHideSegments
KDChart::VerticalLineLayoutItem, 685 KDChart::LineAttributes, 429
maxPositionValue MissingValuesPolicy
KDChartPosition.cpp, 795 KDChart::LineAttributes, 428
Measure missingValuesPolicy
KDChart::Measure, 481, 482 KDChart::LineAttributes, 429
MeasureCalculationMode MissingValuesPolicyIgnored
KDChartEnums, 392 KDChart::LineAttributes, 429
MeasureCalculationModeAbsolute MissingValuesShownAsZero

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


INDEX 849

KDChart::LineAttributes, 429 names


modelData KDChart::Position, 594
KDChart::AttributesModel, 215 needLayoutPlanes
modelsChanged KDChart::AbstractCoordinatePlane, 102
KDChart::AbstractCartesianDiagram, 77 KDChart::CartesianCoordinatePlane, 309
KDChart::AbstractDiagram, 126 KDChart::PolarCoordinatePlane, 542
KDChart::AbstractPieDiagram, 157 needRelayout
KDChart::AbstractPolarDiagram, 189 KDChart::AbstractCoordinatePlane, 102
KDChart::BarDiagram, 242 KDChart::CartesianCoordinatePlane, 309
KDChart::LineDiagram, 449 KDChart::PolarCoordinatePlane, 542
KDChart::PieDiagram, 508 needUpdate
KDChart::PolarDiagram, 571 KDChart::AbstractCoordinatePlane, 102
KDChart::RingDiagram, 622 KDChart::CartesianCoordinatePlane, 309
moveCursor KDChart::PolarCoordinatePlane, 542
KDChart::AbstractCartesianDiagram, 77 negativePosition
KDChart::AbstractDiagram, 126 KDChart::DataValueAttributes, 357
KDChart::AbstractPieDiagram, 157 Normal
KDChart::AbstractPolarDiagram, 189 KDChart::BarDiagram, 230
KDChart::BarDiagram, 243 KDChart::LineDiagram, 436
KDChart::LineDiagram, 449 KDChart::Widget, 692
KDChart::PieDiagram, 508 North
KDChart::PolarDiagram, 571 KDChart::Position, 597
KDChart::RingDiagram, 622 NorthEast
mParent KDChart::Position, 597
KDChart::AbstractArea, 36 NorthWest
KDChart::AbstractAxis, 62 KDChart::Position, 597
KDChart::AbstractCoordinatePlane, 113 NoType
KDChart::AbstractLayoutItem, 143 KDChart::Widget, 692
KDChart::CartesianAxis, 293 numberOfAbscissaSegments
KDChart::CartesianCoordinatePlane, 325 KDChart::AbstractCartesianDiagram, 77
KDChart::HeaderFooter, 384 KDChart::BarDiagram, 243
KDChart::HorizontalLineLayoutItem, 388 KDChart::LineDiagram, 449
KDChart::MarkerLayoutItem, 480 numberOfGridRings
KDChart::PolarCoordinatePlane, 555 KDChart::AbstractPieDiagram, 158
KDChart::TextArea, 655 KDChart::AbstractPolarDiagram, 189
KDChart::TextLayoutItem, 669 KDChart::PieDiagram, 508
KDChart::VerticalLineLayoutItem, 687 KDChart::PolarDiagram, 571
mParentLayout KDChart::RingDiagram, 622
KDChart::AbstractArea, 37 numberOfOrdinateSegments
KDChart::AbstractAxis, 62 KDChart::AbstractCartesianDiagram, 77
KDChart::AbstractCoordinatePlane, 113 KDChart::BarDiagram, 243
KDChart::AbstractLayoutItem, 143 KDChart::LineDiagram, 450
KDChart::CartesianAxis, 293 numberOfValuesPerDataset
KDChart::CartesianCoordinatePlane, 325 KDChart::AbstractPieDiagram, 158
KDChart::HeaderFooter, 384 KDChart::AbstractPolarDiagram, 189
KDChart::HorizontalLineLayoutItem, 388 KDChart::PieDiagram, 509
KDChart::MarkerLayoutItem, 480 KDChart::PolarDiagram, 571
KDChart::PolarCoordinatePlane, 555 KDChart::RingDiagram, 622
KDChart::TextArea, 655
KDChart::TextLayoutItem, 669 observedBy
KDChart::VerticalLineLayoutItem, 687 KDChart::AbstractAxis, 55
KDChart::CartesianAxis, 275
name on_cbReverseColumns_stateChanged
KDChart::Position, 594 KDChart::DatasetSelectorWidget, 352

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


850 INDEX

on_cbReverseRows_stateChanged KDChartThreeDBarAttributes.cpp, 806


KDChart::DatasetSelectorWidget, 353 KDChartThreeDBarAttributes.h, 807
on_groupBox_toggled KDChartThreeDLineAttributes.cpp, 808
KDChart::DatasetSelectorWidget, 353 KDChartThreeDLineAttributes.h, 809
on_sbColumnCount_valueChanged KDChartThreeDPieAttributes.cpp, 810
KDChart::DatasetSelectorWidget, 353 KDChartThreeDPieAttributes.h, 811
on_sbRowCount_valueChanged operator=
KDChart::DatasetSelectorWidget, 353 KDChart::AbstractThreeDAttributes, 207
on_sbStartRow_valueChanged KDChart::BackgroundAttributes, 220
KDChart::DatasetSelectorWidget, 353 KDChart::BarAttributes, 223
operator!= KDChart::DataValueAttributes, 357
KDChart::AbstractThreeDAttributes, 207 KDChart::FrameAttributes, 364
KDChart::BackgroundAttributes, 220 KDChart::GridAttributes, 367
KDChart::BarAttributes, 223 KDChart::LineAttributes, 429
KDChart::DataDimension, 343 KDChart::MarkerAttributes, 475
KDChart::DataValueAttributes, 357 KDChart::Measure, 483
KDChart::FrameAttributes, 364 KDChart::Palette, 489
KDChart::GridAttributes, 367 KDChart::PieAttributes, 492
KDChart::LineAttributes, 429 KDChart::RelativePosition, 607
KDChart::MarkerAttributes, 475 KDChart::TextAttributes, 658
KDChart::Measure, 483 KDChart::ThreeDBarAttributes, 672
KDChart::PieAttributes, 492 KDChart::ThreeDLineAttributes, 677
KDChart::Position, 595 KDChart::ThreeDPieAttributes, 681
KDChart::RelativePosition, 607 operator==
KDChart::TextAttributes, 658 KDChart::AbstractThreeDAttributes, 207
KDChart::ThreeDBarAttributes, 671 KDChart::BackgroundAttributes, 220
KDChart::ThreeDLineAttributes, 677 KDChart::BarAttributes, 223
KDChart::ThreeDPieAttributes, 681 KDChart::DataDimension, 343
operator<< KDChart::DataValueAttributes, 358
KDChartAbstractThreeDAttributes.cpp, KDChart::FrameAttributes, 364
730 KDChart::GridAttributes, 367
KDChartAbstractThreeDAttributes.h, 731 KDChart::LineAttributes, 429
KDChartBackgroundAttributes.cpp, 734 KDChart::MarkerAttributes, 475
KDChartBackgroundAttributes.h, 735 KDChart::Measure, 484
KDChartDataValueAttributes.cpp, 751 KDChart::PieAttributes, 492
KDChartDataValueAttributes.h, 753 KDChart::Position, 595
KDChartFrameAttributes.cpp, 757 KDChart::RelativePosition, 607
KDChartFrameAttributes.h, 758 KDChart::TextAttributes, 658
KDChartGridAttributes.cpp, 764 KDChart::ThreeDBarAttributes, 672
KDChartGridAttributes.h, 765 KDChart::ThreeDLineAttributes, 677
KDChartLineAttributes.cpp, 772 KDChart::ThreeDPieAttributes, 682
KDChartLineAttributes.h, 773 Option
KDChartMarkerAttributes.cpp, 776 KDChart::Position, 591
KDChartMarkerAttributes.h, 777 orientation
KDChartMeasure.cpp, 778 KDChart::Legend, 412
KDChartMeasure.h, 779
KDChartPieAttributes.cpp, 785 padding
KDChartPieAttributes.h, 786 KDChart::FrameAttributes, 364
KDChartPosition.cpp, 794 paint
KDChartPosition.h, 797 KDChart::AbstractArea, 32
KDChartRelativePosition.cpp, 798 KDChart::AbstractAreaWidget, 45
KDChartRelativePosition.h, 799 KDChart::AbstractAxis, 55
KDChartTextAttributes.cpp, 804 KDChart::AbstractCartesianDiagram, 77
KDChartTextAttributes.h, 805 KDChart::AbstractCoordinatePlane, 102

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


INDEX 851

KDChart::AbstractDiagram, 127 KDChart::MarkerLayoutItem, 478


KDChart::AbstractLayoutItem, 141 KDChart::PolarCoordinatePlane, 544
KDChart::AbstractPieDiagram, 158 KDChart::TextArea, 649
KDChart::AbstractPolarDiagram, 189 KDChart::TextLayoutItem, 665
KDChart::BarDiagram, 243 KDChart::VerticalLineLayoutItem, 686
KDChart::CartesianAxis, 276 paintDataValueText
KDChart::CartesianCoordinatePlane, 309 KDChart::AbstractCartesianDiagram, 77
KDChart::Chart, 333 KDChart::AbstractDiagram, 127
KDChart::HeaderFooter, 375 KDChart::AbstractPieDiagram, 158
KDChart::HorizontalLineLayoutItem, 386 KDChart::AbstractPolarDiagram, 189
KDChart::Legend, 412 KDChart::BarDiagram, 247
KDChart::LineDiagram, 450 KDChart::LineDiagram, 453
KDChart::MarkerLayoutItem, 477 KDChart::PieDiagram, 512
KDChart::PieDiagram, 509 KDChart::PolarDiagram, 572
KDChart::PolarCoordinatePlane, 542 KDChart::RingDiagram, 623
KDChart::PolarDiagram, 571 paintDataValueTexts
KDChart::RingDiagram, 623 KDChart::AbstractCartesianDiagram, 78
KDChart::TextArea, 647 KDChart::AbstractDiagram, 128
KDChart::TextLayoutItem, 665 KDChart::AbstractPieDiagram, 159
KDChart::VerticalLineLayoutItem, 685 KDChart::AbstractPolarDiagram, 190
paintAll KDChart::BarDiagram, 248
KDChart::AbstractArea, 32 KDChart::LineDiagram, 454
KDChart::AbstractAreaWidget, 46 KDChart::PieDiagram, 513
KDChart::AbstractAxis, 55 KDChart::PolarDiagram, 573
KDChart::AbstractCoordinatePlane, 103 KDChart::RingDiagram, 624
KDChart::CartesianAxis, 276 painter
KDChart::CartesianCoordinatePlane, 310 KDChart::PaintContext, 486
KDChart::HeaderFooter, 376 paintEvent
KDChart::Legend, 413 KDChart::AbstractAreaWidget, 47
KDChart::PolarCoordinatePlane, 543 KDChart::CartesianCoordinatePlane, 312
KDChart::TextArea, 648 KDChart::Chart, 335
paintBackground KDChart::Legend, 415
KDChart::AbstractArea, 33 KDChart::LineDiagram, 455
KDChart::AbstractAreaBase, 40 KDChart::PieDiagram, 513
KDChart::AbstractAreaWidget, 46 KDChart::PolarCoordinatePlane, 544
KDChart::AbstractAxis, 56 KDChart::PolarDiagram, 573
KDChart::AbstractCoordinatePlane, 103 KDChart::RingDiagram, 624
KDChart::CartesianAxis, 277 paintFrame
KDChart::CartesianCoordinatePlane, 311 KDChart::AbstractArea, 34
KDChart::HeaderFooter, 376 KDChart::AbstractAreaBase, 41
KDChart::Legend, 414 KDChart::AbstractAreaWidget, 47
KDChart::PolarCoordinatePlane, 543 KDChart::AbstractAxis, 57
KDChart::TextArea, 648 KDChart::AbstractCoordinatePlane, 104
PaintContext, 23 KDChart::CartesianAxis, 285
KDChart::PaintContext, 486 KDChart::CartesianCoordinatePlane, 312
paintCtx KDChart::HeaderFooter, 377
KDChart::AbstractArea, 33 KDChart::Legend, 415
KDChart::AbstractAxis, 57 KDChart::PolarCoordinatePlane, 545
KDChart::AbstractCoordinatePlane, 104 KDChart::TextArea, 650
KDChart::AbstractLayoutItem, 141 paintIntoRect
KDChart::CartesianAxis, 278 KDChart::AbstractArea, 34
KDChart::CartesianCoordinatePlane, 312 KDChart::AbstractAreaWidget, 48
KDChart::HeaderFooter, 377 KDChart::AbstractAxis, 58
KDChart::HorizontalLineLayoutItem, 387 KDChart::AbstractCoordinatePlane, 105

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


852 INDEX

KDChart::CartesianAxis, 286 KDChart::BarDiagram, 250, 251


KDChart::CartesianCoordinatePlane, 313 KDChart::FrameAttributes, 364
KDChart::HeaderFooter, 378 KDChart::Legend, 416
KDChart::Legend, 415 KDChart::LineDiagram, 457, 458
KDChart::PolarCoordinatePlane, 545 KDChart::MarkerAttributes, 475
KDChart::TextArea, 650 KDChart::PieDiagram, 516
paintMarker KDChart::PolarDiagram, 577
KDChart::AbstractCartesianDiagram, 78, KDChart::RingDiagram, 627, 628
79 KDChart::TextAttributes, 658
KDChart::AbstractDiagram, 128 Percent
KDChart::AbstractPieDiagram, 159, 160 KDChart::BarDiagram, 230
KDChart::AbstractPolarDiagram, 191 KDChart::LineDiagram, 436
KDChart::BarDiagram, 248 KDChart::Widget, 692
KDChart::LineDiagram, 455 percentMode
KDChart::PieDiagram, 513, 514 KDChart::AbstractCartesianDiagram, 82
KDChart::PolarDiagram, 574 KDChart::AbstractDiagram, 131
KDChart::RingDiagram, 625 KDChart::AbstractPieDiagram, 163
paintMarkers KDChart::AbstractPolarDiagram, 194
KDChart::AbstractCartesianDiagram, 81 KDChart::BarDiagram, 251
KDChart::AbstractDiagram, 130 KDChart::LineDiagram, 458
KDChart::AbstractPieDiagram, 162 KDChart::PieDiagram, 517
KDChart::AbstractPolarDiagram, 193 KDChart::PolarDiagram, 577
KDChart::BarDiagram, 250 KDChart::RingDiagram, 628
KDChart::LineDiagram, 457 PI
KDChart::PieDiagram, 515 KDChartLayoutItems.cpp, 768
KDChart::PolarDiagram, 576 Pie
KDChart::RingDiagram, 627 KDChart::Widget, 692
paintPolarMarkers PieAttributes
KDChart::PolarDiagram, 576 KDChart::PieAttributes, 491
Palette, 24 pieAttributes
KDChart::Palette, 489 KDChart::AbstractPieDiagram, 163
PaletteType KDChart::PieDiagram, 517
KDChart::AttributesModel, 210 KDChart::RingDiagram, 628, 629
paletteType PieAttributesRole
KDChart::AttributesModel, 215 KDChart, 20
PaletteTypeDefault PieDiagram
KDChart::AttributesModel, 210 KDChart::PieDiagram, 498
PaletteTypeRainbow pieDiagram
KDChart::AttributesModel, 210 KDChart::Widget, 697
PaletteTypeSubdued pixmap
KDChart::AttributesModel, 210 KDChart::BackgroundAttributes, 220
parent pixmapMode
KDChart::AbstractCoordinatePlane, 105 KDChart::BackgroundAttributes, 220
KDChart::AbstractProxyModel, 205 Polar
KDChart::AttributesModel, 215 KDChart::Widget, 692
KDChart::CartesianCoordinatePlane, 313 PolarCoordinatePlane
KDChart::DatasetProxyModel, 349 KDChart::PolarCoordinatePlane, 533
KDChart::PolarCoordinatePlane, 545 polarCoordinatePlane
pen KDChart::AbstractPieDiagram, 164
KDChart::AbstractCartesianDiagram, 81, KDChart::AbstractPolarDiagram, 194
82 KDChart::PieDiagram, 518
KDChart::AbstractDiagram, 131 KDChart::PolarDiagram, 578
KDChart::AbstractPieDiagram, 162 KDChart::RingDiagram, 629
KDChart::AbstractPolarDiagram, 193, 194 PolarDiagram

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


INDEX 853

KDChart::PolarDiagram, 561 printableNames


polarDiagram KDChart::Position, 596
KDChart::Widget, 697 propertiesChanged
Position KDChart::AbstractCartesianDiagram, 82
KDChart::CartesianAxis, 268 KDChart::AbstractCoordinatePlane, 106
KDChart::Position, 592 KDChart::AbstractDiagram, 132
position KDChart::AbstractPieDiagram, 164
KDChart::CartesianAxis, 286 KDChart::AbstractPolarDiagram, 194
KDChart::HeaderFooter, 378 KDChart::BarDiagram, 251
KDChart::Legend, 416 KDChart::CartesianCoordinatePlane, 314
PositionCenter KDChart::Legend, 417
KDChartEnums, 394 KDChart::LineDiagram, 458
positionChanged KDChart::PieDiagram, 518
KDChart::HeaderFooter, 378 KDChart::PolarCoordinatePlane, 546
PositionEast KDChart::PolarDiagram, 578
KDChartEnums, 394 KDChart::RingDiagram, 629
positionHasChanged ptr
KDChart::AbstractArea, 35 KDChartCartesianAxis.cpp, 740
KDChart::AbstractAreaBase, 41
KDChart::AbstractAreaWidget, 48 Q_DECLARE_TYPEINFO
KDChart::AbstractAxis, 58 KDChartBackgroundAttributes.h, 735
KDChart::AbstractCoordinatePlane, 106 KDChartDataValueAttributes.h, 753
KDChart::CartesianAxis, 286 KDChartFrameAttributes.h, 758
KDChart::CartesianCoordinatePlane, 313 KDChartGridAttributes.h, 765
KDChart::HeaderFooter, 379 KDChartLineAttributes.h, 773
KDChart::Legend, 416 KDChartMarkerAttributes.h, 777
KDChart::PolarCoordinatePlane, 546 KDChartPieAttributes.h, 786
KDChart::TextArea, 651 KDChartPosition.h, 797
PositionNorth KDChartRelativePosition.h, 799
KDChartEnums, 394 KDChartTextAttributes.h, 805
PositionNorthEast KDChartThreeDBarAttributes.h, 807
KDChartEnums, 394 KDChartThreeDLineAttributes.h, 809
PositionNorthWest KDChartThreeDPieAttributes.h, 811
KDChartEnums, 394 Q_SLOTS
PositionSouth KDChart::AbstractAxis, 62
KDChartEnums, 394 KDChart::AbstractCoordinatePlane, 113
PositionSouthEast KDChart::CartesianAxis, 293
KDChartEnums, 394 KDChart::CartesianCoordinatePlane, 325
PositionSouthWest KDChart::DatasetProxyModel, 351
KDChartEnums, 394 KDChart::DatasetSelectorWidget, 354
PositionUnknown KDChart::DiagramObserver, 363
KDChartEnums, 394 KDChart::Legend, 427
PositionValue KDChart::PolarCoordinatePlane, 556
KDChartEnums, 394 KDChart::Widget, 702
PositionWest QAbstractItemView, 598
KDChartEnums, 394 QAbstractProxyModel, 599
positivePosition QFrame, 600
KDChart::DataValueAttributes, 358 QLayoutItem, 601
powerOfTenDivisor QObject, 602
KDChart::DataValueAttributes, 358 QSortFilterProxyModel, 603
prefix QTextDocument, 604
KDChart::DataValueAttributes, 358 QWidget, 605
printableName
KDChart::Position, 595 rainbowPalette

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


854 INDEX

KDChart::Palette, 489 KDChart::MarkerLayoutItem, 478


realFont KDChart::PolarCoordinatePlane, 547
KDChart::HeaderFooter, 379 KDChart::TextArea, 651
KDChart::TextArea, 651 KDChart::TextLayoutItem, 666
KDChart::TextLayoutItem, 665 KDChart::VerticalLineLayoutItem, 686
realFontSize replaceCoordinatePlane
KDChart::HeaderFooter, 379 KDChart::Chart, 335
KDChart::TextArea, 651 replaceDiagram
KDChart::TextLayoutItem, 666 KDChart::AbstractCoordinatePlane, 107
rectangle KDChart::CartesianCoordinatePlane, 315
KDChart::PaintContext, 486 KDChart::Legend, 418
referenceArea KDChart::PolarCoordinatePlane, 547
KDChart::Legend, 417 replaceHeaderFooter
KDChart::Measure, 484 KDChart::Chart, 336
KDChart::RelativePosition, 607 KDChart::Widget, 697
referenceCoordinatePlane replaceLegend
KDChart::AbstractCoordinatePlane, 106 KDChart::Chart, 336
KDChart::CartesianCoordinatePlane, 314 KDChart::Widget, 698
KDChart::PolarCoordinatePlane, 546 resetData
referenceDiagram KDChart::Widget, 698
KDChart::AbstractCartesianDiagram, 82 resetDiagram
KDChart::BarDiagram, 252 KDChart::Legend, 418
KDChart::LineDiagram, 459 resetGridAttributes
referenceDiagramOffset KDChart::CartesianCoordinatePlane, 315
KDChart::AbstractCartesianDiagram, 83 KDChart::PolarCoordinatePlane, 548
KDChart::BarDiagram, 252 resetTexts
KDChart::LineDiagram, 459 KDChart::Legend, 418
referenceOrientation resetTitleTextAttributes
KDChart::Measure, 484 KDChart::CartesianAxis, 287
referencePosition resize
KDChart::RelativePosition, 607 KDChart::AbstractCartesianDiagram, 83
RelativePosition, 25 KDChart::AbstractDiagram, 132
KDChart::RelativePosition, 606 KDChart::AbstractPieDiagram, 164
relativeThickness KDChart::AbstractPolarDiagram, 195
KDChart::RingDiagram, 629 KDChart::BarDiagram, 252
relayout KDChart::LineDiagram, 459
KDChart::AbstractCoordinatePlane, 106 KDChart::PieDiagram, 518
KDChart::CartesianCoordinatePlane, 314 KDChart::PolarDiagram, 578
KDChart::PolarCoordinatePlane, 547 KDChart::RingDiagram, 630
removeBrush resizeEvent
KDChart::Palette, 489 KDChart::BarDiagram, 252
removeDiagram KDChart::Chart, 337
KDChart::Legend, 417 KDChart::Legend, 419
removeDiagrams KDChart::LineDiagram, 459
KDChart::Legend, 417 KDChart::PieDiagram, 518
removeFromParentLayout KDChart::PolarCoordinatePlane, 548
KDChart::AbstractArea, 35 KDChart::PolarDiagram, 578
KDChart::AbstractAxis, 58 KDChart::RingDiagram, 630
KDChart::AbstractCoordinatePlane, 107 Right
KDChart::AbstractLayoutItem, 142 KDChart::CartesianAxis, 268
KDChart::CartesianAxis, 287 right
KDChart::CartesianCoordinatePlane, 314 KDChart::Widget, 702
KDChart::HeaderFooter, 379 Ring
KDChart::HorizontalLineLayoutItem, 387 KDChart::Widget, 692

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


INDEX 855

RingDiagram setAttributesModel
KDChart::RingDiagram, 612 KDChart::AbstractCartesianDiagram, 84
ringDiagram KDChart::AbstractDiagram, 133
KDChart::Widget, 698 KDChart::AbstractPieDiagram, 165
rotateCircularLabels KDChart::AbstractPolarDiagram, 196
KDChart::PolarDiagram, 578 KDChart::BarDiagram, 253
rotation KDChart::LineDiagram, 460
KDChart::RelativePosition, 607 KDChart::PieDiagram, 519
KDChart::TextAttributes, 658 KDChart::PolarDiagram, 579
rowCount KDChart::RingDiagram, 631
KDChart::AttributesModel, 216 setAttributesModelRootIndex
Rows KDChart::AbstractCartesianDiagram, 85
KDChart::BarDiagram, 230 KDChart::AbstractDiagram, 133
KDChart::Widget, 692 KDChart::AbstractPieDiagram, 166
KDChart::AbstractPolarDiagram, 196
scrollTo KDChart::BarDiagram, 254
KDChart::AbstractCartesianDiagram, 83 KDChart::LineDiagram, 461
KDChart::AbstractDiagram, 132 KDChart::PieDiagram, 520
KDChart::AbstractPieDiagram, 164 KDChart::PolarDiagram, 580
KDChart::AbstractPolarDiagram, 195 KDChart::RingDiagram, 631
KDChart::BarDiagram, 252 setAutoReferenceArea
KDChart::LineDiagram, 459 KDChart::HeaderFooter, 379
KDChart::PieDiagram, 518 KDChart::TextArea, 651
KDChart::PolarDiagram, 579 KDChart::TextLayoutItem, 666
KDChart::RingDiagram, 630 setAutoRotate
sequence KDChart::TextAttributes, 658
KDChart::DataDimension, 344 setAutoShrink
SET_SUB_TYPE KDChart::TextAttributes, 658
KDChartWidget.cpp, 812 setAxesCalcModes
setAlignment KDChart::CartesianCoordinatePlane, 316
KDChart::Legend, 419 setAxesCalcModeX
KDChart::RelativePosition, 607 KDChart::CartesianCoordinatePlane, 316
setAllowOverlappingDataValueTexts setAxesCalcModeY
KDChart::AbstractCartesianDiagram, 83 KDChart::CartesianCoordinatePlane, 316
KDChart::AbstractDiagram, 132 setBackgroundAttributes
KDChart::AbstractPieDiagram, 164 KDChart::AbstractArea, 35
KDChart::AbstractPolarDiagram, 195 KDChart::AbstractAreaBase, 41
KDChart::BarDiagram, 253 KDChart::AbstractAreaWidget, 48
KDChart::LineDiagram, 460 KDChart::AbstractAxis, 59
KDChart::PieDiagram, 519 KDChart::AbstractCoordinatePlane, 108
KDChart::PolarDiagram, 579 KDChart::CartesianAxis, 287
KDChart::RingDiagram, 630 KDChart::CartesianCoordinatePlane, 317
setAngle KDChart::DataValueAttributes, 358
KDChart::ThreeDBarAttributes, 672 KDChart::HeaderFooter, 380
setAntiAliasing KDChart::Legend, 419
KDChart::AbstractCartesianDiagram, 84 KDChart::PolarCoordinatePlane, 548
KDChart::AbstractDiagram, 132 KDChart::TextArea, 652
KDChart::AbstractPieDiagram, 165 setBarAttributes
KDChart::AbstractPolarDiagram, 195 KDChart::BarDiagram, 254, 255
KDChart::BarDiagram, 253 setBarGapFactor
KDChart::LineDiagram, 460 KDChart::BarAttributes, 223
KDChart::PieDiagram, 519 setBrush
KDChart::PolarDiagram, 579 KDChart::AbstractCartesianDiagram, 85
KDChart::RingDiagram, 630 KDChart::AbstractDiagram, 134

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


856 INDEX

KDChart::AbstractPieDiagram, 166 KDChart::LineDiagram, 463


KDChart::AbstractPolarDiagram, 196, 197 KDChart::PieDiagram, 521
KDChart::BackgroundAttributes, 220 KDChart::PolarDiagram, 582
KDChart::BarDiagram, 255 KDChart::RingDiagram, 633
KDChart::Legend, 419 setDatasetRowDescriptionVector
KDChart::LineDiagram, 461, 462 KDChart::DatasetProxyModel, 350
KDChart::PieDiagram, 520, 521 setDataValueAttributes
KDChart::PolarDiagram, 580, 581 KDChart::AbstractCartesianDiagram, 87
KDChart::RingDiagram, 632 KDChart::AbstractDiagram, 135, 136
setBrushesFromDiagram KDChart::AbstractPieDiagram, 168
KDChart::Legend, 420 KDChart::AbstractPolarDiagram, 198, 199
setCalculationMode KDChart::BarDiagram, 257
KDChart::Measure, 484 KDChart::LineDiagram, 463, 464
setColor KDChart::PieDiagram, 522
KDChart::Legend, 420 KDChart::PolarDiagram, 582, 583
setCoordinatePlane KDChart::RingDiagram, 633, 634
KDChart::AbstractCartesianDiagram, 85 setDecimalDigits
KDChart::AbstractDiagram, 134 KDChart::DataValueAttributes, 358
KDChart::AbstractPieDiagram, 167 setDefaultColors
KDChart::AbstractPolarDiagram, 197 KDChart::Legend, 420
KDChart::BarDiagram, 255 setDepth
KDChart::LineDiagram, 462 KDChart::AbstractThreeDAttributes, 208
KDChart::PaintContext, 486 KDChart::ThreeDBarAttributes, 673
KDChart::PieDiagram, 521 KDChart::ThreeDLineAttributes, 678
KDChart::PolarDiagram, 581 KDChart::ThreeDPieAttributes, 682
KDChart::RingDiagram, 632 setDiagram
setCoordinatePlaneLayout KDChart::Legend, 421
KDChart::Chart, 337 setDisplayArea
setData KDChart::LineAttributes, 429
KDChart::AttributesModel, 216 setDrawSolidExcessArrows
setDataBoundariesDirty KDChart::BarAttributes, 223
KDChart::AbstractCartesianDiagram, 86 setEnabled
KDChart::AbstractDiagram, 135 KDChart::AbstractThreeDAttributes, 208
KDChart::AbstractPieDiagram, 167 KDChart::ThreeDBarAttributes, 673
KDChart::AbstractPolarDiagram, 198 KDChart::ThreeDLineAttributes, 678
KDChart::BarDiagram, 256 KDChart::ThreeDPieAttributes, 682
KDChart::LineDiagram, 462 setExplode
KDChart::PieDiagram, 521 KDChart::PieAttributes, 493
KDChart::PolarDiagram, 581 setExplodeFactor
KDChart::RingDiagram, 633 KDChart::PieAttributes, 493
setDataLabel setFixedBarWidth
KDChart::DataValueAttributes, 358 KDChart::BarAttributes, 223
setDataset setFixedDataValueGap
KDChart::Widget, 698, 699 KDChart::BarAttributes, 223
setDatasetColumnDescriptionVector setFixedValueBlockGap
KDChart::DatasetProxyModel, 349 KDChart::BarAttributes, 223
setDatasetDescriptionVectors setFont
KDChart::DatasetProxyModel, 349 KDChart::TextAttributes, 659
setDatasetDimension setFontSize
KDChart::AbstractCartesianDiagram, 86 KDChart::TextAttributes, 659
KDChart::AbstractDiagram, 135 setFrameAttributes
KDChart::AbstractPieDiagram, 167 KDChart::AbstractArea, 35
KDChart::AbstractPolarDiagram, 198 KDChart::AbstractAreaBase, 42
KDChart::BarDiagram, 256 KDChart::AbstractAreaWidget, 49

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


INDEX 857

KDChart::AbstractAxis, 59 setGridVisible
KDChart::AbstractCoordinatePlane, 108 KDChart::GridAttributes, 367
KDChart::CartesianAxis, 287 setGroupGapFactor
KDChart::CartesianCoordinatePlane, 317 KDChart::BarAttributes, 223
KDChart::DataValueAttributes, 358 setHeaderData
KDChart::HeaderFooter, 380 KDChart::AttributesModel, 216
KDChart::Legend, 421 setHorizontalPadding
KDChart::PolarCoordinatePlane, 549 KDChart::RelativePosition, 607
KDChart::TextArea, 652 setHorizontalRange
setGeometry KDChart::CartesianCoordinatePlane, 319
KDChart::AbstractAxis, 59 setIsometricScaling
KDChart::AbstractCoordinatePlane, 108 KDChart::CartesianCoordinatePlane, 319
KDChart::CartesianAxis, 288 setLabels
KDChart::CartesianCoordinatePlane, 317 KDChart::AbstractAxis, 59
KDChart::HeaderFooter, 380 KDChart::CartesianAxis, 288
KDChart::HorizontalLineLayoutItem, 387 setLineAttributes
KDChart::MarkerLayoutItem, 478 KDChart::LineDiagram, 464, 465
KDChart::PolarCoordinatePlane, 549 setLineXRotation
KDChart::TextArea, 652 KDChart::ThreeDLineAttributes, 678
KDChart::TextLayoutItem, 666 setLineYRotation
KDChart::VerticalLineLayoutItem, 686 KDChart::ThreeDLineAttributes, 678
setGlobalGridAttributes setMarkerAttributes
KDChart::AbstractCoordinatePlane, 108 KDChart::DataValueAttributes, 359
KDChart::CartesianCoordinatePlane, 318 KDChart::Legend, 421
KDChart::PolarCoordinatePlane, 549 setMarkerColor
setGlobalLeading KDChart::MarkerAttributes, 475
KDChart::Chart, 337 setMarkerSize
setGlobalLeadingBottom KDChart::MarkerAttributes, 475
KDChart::Chart, 338 setMarkerStyle
KDChart::Widget, 699 KDChart::MarkerAttributes, 475
setGlobalLeadingLeft setMarkerStylesMap
KDChart::Chart, 338 KDChart::MarkerAttributes, 475
KDChart::Widget, 699 setMinimalFontSize
setGlobalLeadingRight KDChart::TextAttributes, 659
KDChart::Chart, 338 setMissingValuesPolicy
KDChart::Widget, 700 KDChart::LineAttributes, 429
setGlobalLeadingTop setModel
KDChart::Chart, 339 KDChart::AbstractCartesianDiagram, 88
KDChart::Widget, 700 KDChart::AbstractDiagram, 136
setGranularity KDChart::AbstractPieDiagram, 169
KDChart::AbstractPieDiagram, 169 KDChart::AbstractPolarDiagram, 199
KDChart::PieDiagram, 523 KDChart::BarDiagram, 258
KDChart::RingDiagram, 634 KDChart::LineDiagram, 465
setGridAttributes KDChart::PieDiagram, 523
KDChart::CartesianCoordinatePlane, 318 KDChart::PolarDiagram, 583
KDChart::PolarCoordinatePlane, 550 KDChart::RingDiagram, 635
setGridGranularitySequence setModelData
KDChart::GridAttributes, 367 KDChart::AttributesModel, 217
setGridPen setNeedRebuild
KDChart::GridAttributes, 367 KDChart::Legend, 421
setGridStepWidth setNegativePosition
KDChart::GridAttributes, 367 KDChart::DataValueAttributes, 359
setGridSubStepWidth setOrientation
KDChart::GridAttributes, 367 KDChart::Legend, 422

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


858 INDEX

setPadding KDChart::AbstractCartesianDiagram, 89
KDChart::FrameAttributes, 365 KDChart::AbstractDiagram, 137
setPainter KDChart::AbstractPieDiagram, 170
KDChart::PaintContext, 486 KDChart::AbstractPolarDiagram, 200
setPaletteType KDChart::BarDiagram, 259
KDChart::AttributesModel, 217 KDChart::LineDiagram, 466
setParent KDChart::PieDiagram, 524
KDChart::AbstractCoordinatePlane, 109 KDChart::PolarDiagram, 584
KDChart::CartesianCoordinatePlane, 319 KDChart::RingDiagram, 636
KDChart::HeaderFooter, 380 setPieAttributes
KDChart::PolarCoordinatePlane, 550 KDChart::AbstractPieDiagram, 170
setParentLayout KDChart::PieDiagram, 524, 525
KDChart::AbstractArea, 35 KDChart::RingDiagram, 636
KDChart::AbstractAxis, 60 setPixmap
KDChart::AbstractCoordinatePlane, 109 KDChart::BackgroundAttributes, 220
KDChart::AbstractLayoutItem, 142 setPixmapMode
KDChart::CartesianAxis, 288 KDChart::BackgroundAttributes, 220
KDChart::CartesianCoordinatePlane, 320 setPosition
KDChart::HeaderFooter, 381 KDChart::CartesianAxis, 289
KDChart::HorizontalLineLayoutItem, 387 KDChart::HeaderFooter, 381
KDChart::MarkerLayoutItem, 479 KDChart::Legend, 422
KDChart::PolarCoordinatePlane, 551 setPositivePosition
KDChart::TextArea, 652 KDChart::DataValueAttributes, 359
KDChart::TextLayoutItem, 667 setPowerOfTenDivisor
KDChart::VerticalLineLayoutItem, 686 KDChart::DataValueAttributes, 359
setParentWidget setPrefix
KDChart::AbstractArea, 36 KDChart::DataValueAttributes, 359
KDChart::AbstractAxis, 60 setRainbowColors
KDChart::AbstractCoordinatePlane, 109 KDChart::Legend, 422
KDChart::AbstractLayoutItem, 142 setRectangle
KDChart::CartesianAxis, 288 KDChart::PaintContext, 486
KDChart::CartesianCoordinatePlane, 320 setReferenceArea
KDChart::HeaderFooter, 381 KDChart::Legend, 423
KDChart::HorizontalLineLayoutItem, 387 KDChart::Measure, 484
KDChart::MarkerLayoutItem, 479 KDChart::RelativePosition, 607
KDChart::PolarCoordinatePlane, 551 setReferenceCoordinatePlane
KDChart::TextArea, 653 KDChart::AbstractCoordinatePlane, 110
KDChart::TextLayoutItem, 667 KDChart::CartesianCoordinatePlane, 320
KDChart::VerticalLineLayoutItem, 686 KDChart::PolarCoordinatePlane, 551
setPen setReferenceDiagram
KDChart::AbstractCartesianDiagram, 88 KDChart::AbstractCartesianDiagram, 89
KDChart::AbstractDiagram, 137 KDChart::BarDiagram, 259
KDChart::AbstractPieDiagram, 169, 170 KDChart::LineDiagram, 466
KDChart::AbstractPolarDiagram, 199, 200 setReferenceOrientation
KDChart::BarDiagram, 258 KDChart::Measure, 485
KDChart::FrameAttributes, 365 setReferencePosition
KDChart::Legend, 422 KDChart::RelativePosition, 607
KDChart::LineDiagram, 465, 466 setRelativeMode
KDChart::MarkerAttributes, 475 KDChart::Measure, 485
KDChart::PieDiagram, 524 setRelativeThickness
KDChart::PolarDiagram, 583, 584 KDChart::RingDiagram, 636
KDChart::RingDiagram, 635, 636 setRootIndex
KDChart::TextAttributes, 659 KDChart::AbstractCartesianDiagram, 89
setPercentMode KDChart::AbstractDiagram, 138

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


INDEX 859

KDChart::AbstractPieDiagram, 171 setSuffix


KDChart::AbstractPolarDiagram, 200 KDChart::DataValueAttributes, 359
KDChart::BarDiagram, 259 setText
KDChart::LineDiagram, 466 KDChart::HeaderFooter, 381
KDChart::PieDiagram, 525 KDChart::Legend, 425
KDChart::PolarDiagram, 584 KDChart::TextArea, 653
KDChart::RingDiagram, 637 KDChart::TextLayoutItem, 667
setRotateCircularLabels setTextAttributes
KDChart::PolarDiagram, 585 KDChart::AbstractAxis, 60
setRotation KDChart::CartesianAxis, 289
KDChart::RelativePosition, 607 KDChart::DataValueAttributes, 359
KDChart::TextAttributes, 659 KDChart::HeaderFooter, 382
setSelection KDChart::Legend, 425
KDChart::AbstractCartesianDiagram, 89 KDChart::TextArea, 653
KDChart::AbstractDiagram, 138 KDChart::TextLayoutItem, 667
KDChart::AbstractPieDiagram, 171 setThreeDBarAttributes
KDChart::AbstractPolarDiagram, 201 KDChart::BarDiagram, 259, 260
KDChart::BarDiagram, 259 setThreeDLineAttributes
KDChart::LineDiagram, 467 KDChart::LineDiagram, 467
KDChart::PieDiagram, 525 setThreeDPieAttributes
KDChart::PolarDiagram, 585 KDChart::AbstractPieDiagram, 171, 172
KDChart::RingDiagram, 637 KDChart::PieDiagram, 525, 526
setShortLabels KDChart::RingDiagram, 637, 638
KDChart::AbstractAxis, 60 setTitleText
KDChart::CartesianAxis, 289 KDChart::CartesianAxis, 290
setShowDelimitersAtPosition KDChart::Legend, 425
KDChart::PolarDiagram, 585 setTitleTextAttributes
setShowInfinite KDChart::CartesianAxis, 290
KDChart::DataValueAttributes, 359 KDChart::Legend, 425
setShowLabelsAtPosition setTransparency
KDChart::PolarDiagram, 585 KDChart::LineAttributes, 429
setShowLines setType
KDChart::Legend, 423 KDChart::BarDiagram, 260
setSourceColumnCount KDChart::HeaderFooter, 382
KDChart::DatasetSelectorWidget, 354 KDChart::LineDiagram, 468
setSourceModel setUseFixedBarWidth
KDChart::AttributesModel, 217 KDChart::BarAttributes, 223
KDChart::DatasetProxyModel, 350 setUseFixedDataValueGap
setSourceRootIndex KDChart::BarAttributes, 223
KDChart::DatasetProxyModel, 350 setUseFixedValueBlockGap
setSpacing KDChart::BarAttributes, 223
KDChart::Legend, 423 setUseShadowColors
setStartPosition KDChart::ThreeDBarAttributes, 673
KDChart::AbstractPieDiagram, 171 KDChart::ThreeDPieAttributes, 682
KDChart::PieDiagram, 525 setValue
KDChart::RingDiagram, 637 KDChart::Measure, 485
setSubduedColors setVerticalPadding
KDChart::Legend, 424 KDChart::RelativePosition, 607
setSubGridPen setVerticalRange
KDChart::GridAttributes, 367 KDChart::CartesianCoordinatePlane, 320
setSubGridVisible setVisible
KDChart::GridAttributes, 367 KDChart::BackgroundAttributes, 220
setSubType KDChart::DataValueAttributes, 360
KDChart::Widget, 700 KDChart::FrameAttributes, 365

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


860 INDEX

KDChart::Legend, 425 KDChart::PolarCoordinatePlane, 553


KDChart::MarkerAttributes, 475 KDChart::TextArea, 654
KDChart::TextAttributes, 659 KDChart::TextLayoutItem, 668
setZeroDegreePosition KDChart::VerticalLineLayoutItem, 687
KDChart::PolarDiagram, 585 sizePolicy
setZeroLinePen KDChart::AbstractCoordinatePlane, 111
KDChart::GridAttributes, 367 KDChart::CartesianCoordinatePlane, 322
setZoomCenter KDChart::PolarCoordinatePlane, 553
KDChart::AbstractCoordinatePlane, 110 slotAttributesChanged
KDChart::CartesianCoordinatePlane, 321 KDChart::DiagramObserver, 362
KDChart::PolarCoordinatePlane, 551 slotDataChanged
setZoomFactorX KDChart::DiagramObserver, 363
KDChart::AbstractCoordinatePlane, 110 slotModelsChanged
KDChart::CartesianCoordinatePlane, 321 KDChart::DiagramObserver, 363
KDChart::PolarCoordinatePlane, 552 South
setZoomFactorY KDChart::Position, 597
KDChart::AbstractCoordinatePlane, 110 SouthEast
KDChart::CartesianCoordinatePlane, 322 KDChart::Position, 597
KDChart::PolarCoordinatePlane, 552 SouthWest
shortLabels KDChart::Position, 597
KDChart::AbstractAxis, 61 spacing
KDChart::CartesianAxis, 290 KDChart::Legend, 426
showDelimitersAtPosition Stacked
KDChart::PolarDiagram, 586 KDChart::BarDiagram, 230
showInfinite KDChart::LineDiagram, 436
KDChart::DataValueAttributes, 360 KDChart::Widget, 692
showLabelsAtPosition start
KDChart::PolarDiagram, 586 KDChart::DataDimension, 344
showLines startPosition
KDChart::Legend, 426 KDChart::AbstractPieDiagram, 172
size KDChart::PieDiagram, 526
KDChart::Palette, 490 KDChart::RingDiagram, 638
sizeHint staticPositionCenter
KDChart::AbstractCoordinatePlane, 111 KDChartPosition.cpp, 795
KDChart::CartesianAxis, 291 staticPositionEast
KDChart::CartesianCoordinatePlane, 322 KDChartPosition.cpp, 795
KDChart::HeaderFooter, 382 staticPositionNames
KDChart::HorizontalLineLayoutItem, 388 KDChartPosition.cpp, 795
KDChart::MarkerLayoutItem, 479 staticPositionNorth
KDChart::PolarCoordinatePlane, 552 KDChartPosition.cpp, 795
KDChart::TextArea, 654 staticPositionNorthEast
KDChart::TextLayoutItem, 668 KDChartPosition.cpp, 795
KDChart::VerticalLineLayoutItem, 687 staticPositionNorthWest
KDTextDocument, 401 KDChartPosition.cpp, 795
sizeHintChanged staticPositionSouth
KDChart::AbstractArea, 36 KDChartPosition.cpp, 795
KDChart::AbstractAxis, 61 staticPositionSouthEast
KDChart::AbstractCoordinatePlane, 111 KDChartPosition.cpp, 796
KDChart::AbstractLayoutItem, 142 staticPositionSouthWest
KDChart::CartesianAxis, 291 KDChartPosition.cpp, 796
KDChart::CartesianCoordinatePlane, 322 staticPositionUnknown
KDChart::HeaderFooter, 383 KDChartPosition.cpp, 796
KDChart::HorizontalLineLayoutItem, 388 staticPositionWest
KDChart::MarkerLayoutItem, 479 KDChartPosition.cpp, 796

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


INDEX 861

stepWidth KDChart::HeaderFooter, 383


KDChart::DataDimension, 344 KDChart::Legend, 426
stringToGranularitySequence KDChart::TextArea, 654
KDChartEnums, 397 KDChart::TextLayoutItem, 669
stringToLayoutPolicy TextLayoutItem
KDChartEnums, 398 KDChart::TextLayoutItem, 662
stringToMeasureCalculationMode TextLayoutPolicy
KDChartEnums, 398 KDChartEnums, 395
stringToMeasureOrientation ThreeDAttributesRole
KDChartEnums, 398 KDChart, 19
subduedPalette ThreeDBarAttributes
KDChart::Palette, 490 KDChart::ThreeDBarAttributes, 670
subGridPen threeDBarAttributes
KDChart::GridAttributes, 367 KDChart::BarDiagram, 261, 262
subStepWidth ThreeDBarAttributesRole
KDChart::DataDimension, 344 KDChart, 20
SubType threeDItemDepth
KDChart::Widget, 692 KDChart::AbstractCartesianDiagram, 90
subType KDChart::BarDiagram, 262
KDChart::Widget, 701, 702 KDChart::LineDiagram, 469
suffix ThreeDLineAttributes
KDChart::DataValueAttributes, 360 KDChart::ThreeDLineAttributes, 675
threeDLineAttributes
takeAxis KDChart::LineDiagram, 469, 470
KDChart::AbstractCartesianDiagram, 89 ThreeDLineAttributesRole
KDChart::BarDiagram, 261 KDChart, 19
KDChart::LineDiagram, 468 ThreeDPieAttributes
takeCoordinatePlane KDChart::ThreeDPieAttributes, 680
KDChart::Chart, 339 threeDPieAttributes
takeDiagram KDChart::AbstractPieDiagram, 172, 173
KDChart::AbstractCoordinatePlane, 111 KDChart::PieDiagram, 526, 527
KDChart::CartesianCoordinatePlane, 323 KDChart::RingDiagram, 638, 639
KDChart::PolarCoordinatePlane, 553 ThreeDPieAttributesRole
takeHeaderFooter KDChart, 20
KDChart::Chart, 340 tickLength
KDChart::Widget, 701 KDChart::CartesianAxis, 291
takeLegend titleText
KDChart::Chart, 340 KDChart::CartesianAxis, 292
KDChart::Widget, 701 KDChart::Legend, 427
TEST_SUB_TYPE titleTextAttributes
KDChartWidget.cpp, 813 KDChart::CartesianAxis, 292
text KDChart::Legend, 427
KDChart::HeaderFooter, 383 Top
KDChart::Legend, 426 KDChart::CartesianAxis, 268
KDChart::TextArea, 654 top
KDChart::TextLayoutItem, 668 KDChart::Widget, 703
TextArea translate
KDChart::TextArea, 644 KDChart::AbstractCoordinatePlane, 112
TextAttributes, 26 KDChart::CartesianCoordinatePlane, 323
KDChart::TextAttributes, 657 KDChart::PolarCoordinatePlane, 554
textAttributes translatePolar
KDChart::AbstractAxis, 61 KDChart::PolarCoordinatePlane, 554
KDChart::CartesianAxis, 291 transparency
KDChart::DataValueAttributes, 360 KDChart::LineAttributes, 429

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


862 INDEX

type KDChart::LineDiagram, 471


KDChart::BarDiagram, 262 KDChart::PieDiagram, 528
KDChart::HeaderFooter, 384 KDChart::PolarDiagram, 587
KDChart::LineDiagram, 470 KDChart::RingDiagram, 640
KDChart::Widget, 702
validDepth
Ui, 27 KDChart::AbstractThreeDAttributes, 208
Unknown KDChart::ThreeDBarAttributes, 673
KDChart::Position, 597 KDChart::ThreeDLineAttributes, 678
update KDChart::ThreeDPieAttributes, 683
KDChart::AbstractCartesianDiagram, 90 value
KDChart::AbstractDiagram, 138 KDChart::Measure, 485
KDChart::AbstractPieDiagram, 173 KDChart::Position, 596
KDChart::AbstractPolarDiagram, 201 valueForCell
KDChart::BarDiagram, 263 KDChart::AbstractCartesianDiagram, 91
KDChart::LineDiagram, 470 KDChart::AbstractDiagram, 139
KDChart::PieDiagram, 527 KDChart::AbstractPieDiagram, 174
KDChart::PolarDiagram, 586 KDChart::AbstractPolarDiagram, 202
KDChart::RingDiagram, 639 KDChart::BarDiagram, 263
useDefaultColors KDChart::LineDiagram, 471
KDChart::AbstractCartesianDiagram, 90 KDChart::PieDiagram, 528
KDChart::AbstractDiagram, 138 KDChart::PolarDiagram, 587
KDChart::AbstractPieDiagram, 173 KDChart::RingDiagram, 640
KDChart::AbstractPolarDiagram, 201 valueForCellTesting
KDChart::BarDiagram, 263 KDChart::LineDiagram, 471
KDChart::LineDiagram, 470 valueTotals
KDChart::PieDiagram, 527 KDChart::AbstractPieDiagram, 174
KDChart::PolarDiagram, 586 KDChart::AbstractPolarDiagram, 202
KDChart::RingDiagram, 639 KDChart::PieDiagram, 528
useFixedBarWidth KDChart::PolarDiagram, 587
KDChart::BarAttributes, 223 KDChart::RingDiagram, 640
useFixedDataValueGap VerticalLineLayoutItem
KDChart::BarAttributes, 223 KDChart::VerticalLineLayoutItem, 684
useFixedValueBlockGap verticalOffset
KDChart::BarAttributes, 223 KDChart::AbstractCartesianDiagram, 91
useRainbowColors KDChart::AbstractDiagram, 139
KDChart::AbstractCartesianDiagram, 90 KDChart::AbstractPieDiagram, 174
KDChart::AbstractDiagram, 138 KDChart::AbstractPolarDiagram, 202
KDChart::AbstractPieDiagram, 173 KDChart::BarDiagram, 264
KDChart::AbstractPolarDiagram, 201 KDChart::LineDiagram, 472
KDChart::BarDiagram, 263 KDChart::PieDiagram, 529
KDChart::LineDiagram, 470 KDChart::PolarDiagram, 588
KDChart::PieDiagram, 528 KDChart::RingDiagram, 641
KDChart::PolarDiagram, 586 verticalPadding
KDChart::RingDiagram, 639 KDChart::RelativePosition, 607
useShadowColors verticalRange
KDChart::ThreeDBarAttributes, 673 KDChart::CartesianCoordinatePlane, 324
KDChart::ThreeDPieAttributes, 683 visualRect
useSubduedColors KDChart::AbstractCartesianDiagram, 91
KDChart::AbstractCartesianDiagram, 91 KDChart::AbstractDiagram, 139
KDChart::AbstractDiagram, 139 KDChart::AbstractPieDiagram, 174
KDChart::AbstractPieDiagram, 174 KDChart::AbstractPolarDiagram, 202
KDChart::AbstractPolarDiagram, 201 KDChart::BarDiagram, 264
KDChart::BarDiagram, 263 KDChart::LineDiagram, 472

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen


INDEX 863

KDChart::PieDiagram, 529
KDChart::PolarDiagram, 588
KDChart::RingDiagram, 641
visualRegionForSelection
KDChart::AbstractCartesianDiagram, 92
KDChart::AbstractDiagram, 140
KDChart::AbstractPieDiagram, 175
KDChart::AbstractPolarDiagram, 203
KDChart::BarDiagram, 264
KDChart::LineDiagram, 472
KDChart::PieDiagram, 529
KDChart::PolarDiagram, 588
KDChart::RingDiagram, 641

West
KDChart::Position, 597
Widget
KDChart::Widget, 692

xCenter
KDChart::ZoomParameters, 704
xFactor
KDChart::ZoomParameters, 704

yCenter
KDChart::ZoomParameters, 704
yFactor
KDChart::ZoomParameters, 704

zeroDegreePosition
KDChart::PolarDiagram, 588
zeroLinePen
KDChart::GridAttributes, 367
zoomCenter
KDChart::AbstractCoordinatePlane, 112
KDChart::CartesianCoordinatePlane, 324
KDChart::PolarCoordinatePlane, 554
zoomFactorX
KDChart::AbstractCoordinatePlane, 112
KDChart::CartesianCoordinatePlane, 324
KDChart::PolarCoordinatePlane, 555
zoomFactorY
KDChart::AbstractCoordinatePlane, 113
KDChart::CartesianCoordinatePlane, 324
KDChart::PolarCoordinatePlane, 555
ZoomParameters
KDChart::ZoomParameters, 704

Generated on Fri Sep 29 03:56:34 2006 for KD Chart 2 by Doxygen

S-ar putea să vă placă și