##// END OF EJS Templates
fixed bug in category implementation. model now owns the category and sets
fixed bug in category implementation. model now owns the category and sets

File last commit:

r157:036a0ec8efe0
r173:5bd6f6e4373b
Show More
main.cpp
33 lines | 940 B | text/x-c | CppLexer
Jani Honkonen
Added piechart example
r128 #include <QtGui/QApplication>
#include <QMainWindow>
#include <cmath>
#include <qchartglobal.h>
Michal Klocek
Removes QChartWidget...
r136 #include <qchartview.h>
Jani Honkonen
Added piechart example
r128 #include <qpieseries.h>
QTCOMMERCIALCHART_USE_NAMESPACE
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
// Create widget and scatter series
Michal Klocek
Removes QChartWidget...
r136 QChartView *chartWidget = new QChartView();
Jani Honkonen
Added piechart example
r128 QPieSeries *series = qobject_cast<QPieSeries *>(chartWidget->createSeries(QChartSeries::SeriesTypePie));
Q_ASSERT(series);
// Add test data to the series
Jani Honkonen
Use signals from pieseries, visible hover and exploding slices
r157 series->add(QPieSlice(1, "test1", Qt::red, true));
Jani Honkonen
Pie chart refactoring
r142 series->add(QPieSlice(2, "test2", Qt::green));
series->add(QPieSlice(3, "test3", Qt::blue));
Jani Honkonen
Use signals from pieseries, visible hover and exploding slices
r157 series->add(QPieSlice(4, "test4", Qt::darkRed, true));
Jani Honkonen
Pie chart refactoring
r142 series->add(QPieSlice(5, "test5", Qt::darkGreen));
Jani Honkonen
Added piechart example
r128
// Use the chart widget as the central widget
QMainWindow w;
w.resize(640, 480);
w.setCentralWidget(chartWidget);
w.show();
return a.exec();
}