##// END OF EJS Templates
barchart pimpl part 1
barchart pimpl part 1

File last commit:

r892:7f4e2249f988
r934:284eb2f28726
Show More
main.cpp
69 lines | 1.8 KiB | text/x-c | CppLexer
Michal Klocek
Uninfy examples , updated public API changes
r747 /****************************************************************************
Jani Honkonen
Add/modify license headers
r830 **
** Copyright (C) 2012 Digia Plc
** All rights reserved.
** For any questions to Digia, please use contact form at http://qt.digia.com
**
** This file is part of the Qt Commercial Charts Add-on.
**
** $QT_BEGIN_LICENSE$
** Licensees holding valid Qt Commercial licenses may use this file in
** accordance with the Qt Commercial License Agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Digia.
**
** If you have questions regarding the use of this file, please use
** contact form at http://qt.digia.com
** $QT_END_LICENSE$
**
****************************************************************************/
Michal Klocek
Uninfy examples , updated public API changes
r747
#include <QApplication>
Jani Honkonen
Added piechart example
r128 #include <QMainWindow>
Michal Klocek
Uninfy examples , updated public API changes
r747 #include <QChartView>
#include <QPieSeries>
#include <QPieSlice>
Jani Honkonen
Added piechart example
r128
QTCOMMERCIALCHART_USE_NAMESPACE
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
Michal Klocek
Uninfy examples , updated public API changes
r747 //![1]
Jani Honkonen
Refactor pie (again). QPieSlice's now emit signals and no id's anymore. Just pointers in the interface.
r203 QPieSeries *series = new QPieSeries();
Jani Honkonen
Improving pie examples
r892 series->append(1, "Jane");
series->append(2, "Joe");
series->append(3, "Andy");
series->append(4, "Barbara");
series->append(5, "Axel");
Michal Klocek
Uninfy examples , updated public API changes
r747 //![1]
Jani Honkonen
Refactor pie (again). QPieSlice's now emit signals and no id's anymore. Just pointers in the interface.
r203
Michal Klocek
Uninfy examples , updated public API changes
r747 //![2]
Jani Honkonen
Improving pie examples
r892 QPieSlice *slice = series->slices().at(1);
Jani Honkonen
Add custom slice color & explode & visible label in basic piechart example.
r713 slice->setExploded();
slice->setLabelVisible();
Jani Honkonen
remove "slice" word from pen/brush setters/getters
r756 slice->setPen(QPen(Qt::darkGreen, 2));
slice->setBrush(Qt::green);
Michal Klocek
Uninfy examples , updated public API changes
r747 //![2]
Jani Honkonen
Pie doc updates
r880
Michal Klocek
Uninfy examples , updated public API changes
r747 //![3]
QChart* chart = new QChart();
chart->addSeries(series);
chart->setTitle("Simple piechart example");
//![3]
Jani Honkonen
Pie doc updates
r880
Michal Klocek
Uninfy examples , updated public API changes
r747 //![4]
QChartView* chartView = new QChartView(chart);
chartView->setRenderHint(QPainter::Antialiasing);
//![4]
Jani Honkonen
Pie doc updates
r880
Michal Klocek
Uninfy examples , updated public API changes
r747 //![5]
QMainWindow window;
Jani Honkonen
Refactor pie (again). QPieSlice's now emit signals and no id's anymore. Just pointers in the interface.
r203 window.setCentralWidget(chartView);
Michal Klocek
Uninfy examples , updated public API changes
r747 window.resize(400, 300);
Jani Honkonen
Refactor pie (again). QPieSlice's now emit signals and no id's anymore. Just pointers in the interface.
r203 window.show();
Michal Klocek
Uninfy examples , updated public API changes
r747 //![5]
Jani Honkonen
Pie doc updates
r880
Jani Honkonen
Added piechart example
r128 return a.exec();
}