~ubuntu-branches/ubuntu/precise/koffice/precise

« back to all changes in this revision

Viewing changes to kchart/kdchart/examples/Zoom/Keyboard/main.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Riddell
  • Date: 2010-09-21 15:36:35 UTC
  • mfrom: (1.4.1 upstream) (60.2.11 maverick)
  • Revision ID: james.westby@ubuntu.com-20100921153635-6tejqkiro2u21ydi
Tags: 1:2.2.2-0ubuntu3
Add kubuntu_03_fix-crash-on-closing-sqlite-connection-2.2.2.diff and
kubuntu_04_support-large-memo-values-for-msaccess-2.2.2.diff as
recommended by upstream http://kexi-
project.org/wiki/wikiview/index.php@Kexi2.2_Patches.html#sqlite_stab
ility

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/****************************************************************************
2
 
 ** Copyright (C) 2006 Klarälvdalens Datakonsult AB.  All rights reserved.
3
 
 **
4
 
 ** This file is part of the KD Chart library.
5
 
 **
6
 
 ** This file may be used under the terms of the GNU General Public
7
 
 ** License versions 2.0 or 3.0 as published by the Free Software
8
 
 ** Foundation and appearing in the files LICENSE.GPL2 and LICENSE.GPL3
9
 
 ** included in the packaging of this file.  Alternatively you may (at
10
 
 ** your option) use any later version of the GNU General Public
11
 
 ** License if such license has been publicly approved by
12
 
 ** Klarälvdalens Datakonsult AB (or its successors, if any).
13
 
 ** 
14
 
 ** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
15
 
 ** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
16
 
 ** A PARTICULAR PURPOSE. Klarälvdalens Datakonsult AB reserves all rights
17
 
 ** not expressly granted herein.
18
 
 ** 
19
 
 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
20
 
 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
21
 
 **
22
 
 **********************************************************************/
23
 
 
24
 
#include <QApplication>
25
 
#include <KDChartWidget>
26
 
 
27
 
#include <QDebug>
28
 
#include <QVector>
29
 
 
30
 
#include "mainwindow.h"
31
 
 
32
 
using namespace KDChart;
33
 
 
34
 
int main( int argc, char** argv ) {
35
 
    QApplication app( argc, argv );
36
 
 
37
 
    MainWindow window;
38
 
 
39
 
    window.resize( 800, 600 );
40
 
 
41
 
    QVector< double > vec0;
42
 
    vec0.append( -5 );
43
 
    vec0.append( -4 );
44
 
    vec0.append( -3 );
45
 
    vec0.append( -2 );
46
 
    vec0.append( -1 );
47
 
    vec0.append( 0 );
48
 
    vec0.append( 1 );
49
 
    vec0.append( 2 );
50
 
    vec0.append( 3 );
51
 
    vec0.append( 4 );
52
 
    vec0.append( 5 );
53
 
    window.widget->setDataset( 0, vec0);
54
 
 
55
 
    QVector< double > vec1;
56
 
    vec1.append( 25 );
57
 
    vec1.append( 16 );
58
 
    vec1.append( 9 );
59
 
    vec1.append( 4 );
60
 
    vec1.append( 1 );
61
 
    vec1.append( 0 );
62
 
    vec1.append( 1 );
63
 
    vec1.append( 4 );
64
 
    vec1.append( 9 );
65
 
    vec1.append( 16 );
66
 
    vec1.append( 25 );
67
 
    window.widget->setDataset( 1, vec1 );
68
 
 
69
 
    QVector< double > vec2;
70
 
    vec2.append( -125 );
71
 
    vec2.append( -64 );
72
 
    vec2.append( -27 );
73
 
    vec2.append( -8 );
74
 
    vec2.append( -1 );
75
 
    vec2.append( 0 );
76
 
    vec2.append( 1 );
77
 
    vec2.append( 8 );
78
 
    vec2.append( 27 );
79
 
    vec2.append( 64 );
80
 
    vec2.append( 125 );
81
 
    window.widget->setDataset( 2, vec2 );
82
 
 
83
 
    window.widget->addHeaderFooter( "Zoom Example",
84
 
                                    HeaderFooter::Header, Position::NorthWest );
85
 
    window.widget->addHeaderFooter( "zoom in/out: PageDn / PageUp",
86
 
                                    HeaderFooter::Header, Position::North );
87
 
    window.widget->addHeaderFooter( "pan around: Left / Right / Up / Down",
88
 
                                    HeaderFooter::Header, Position::NorthEast );
89
 
    window.widget->addHeaderFooter( "SouthEast",
90
 
                                    HeaderFooter::Footer, Position::SouthEast );
91
 
    window.widget->addHeaderFooter( "South",
92
 
                                    HeaderFooter::Footer, Position::South );
93
 
    window.widget->addHeaderFooter( "SouthWest",
94
 
                                    HeaderFooter::Footer, Position::SouthWest );
95
 
 
96
 
    window.widget->addLegend( Position::East );
97
 
 
98
 
    //window.widget->setType( Widget::Polar );
99
 
 
100
 
    window.show();
101
 
 
102
 
    return app.exec();
103
 
}