##// END OF EJS Templates
BarSeries - renamed internal model getter to modelInternal. Some smaller changes to other files to have in headers forward declarations for model related members instead of include
BarSeries - renamed internal model getter to modelInternal. Some smaller changes to other files to have in headers forward declarations for model related members instead of include

File last commit:

r830:b345b831b8c1
r877:26b0fc7673b6
Show More
main.cpp
65 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
rename functions add() -> append()
r796 series->append(1, "Slice 1");
series->append(2, "Slice 2");
series->append(3, "Slice 3");
series->append(4, "Slice 4");
series->append(5, "Slice 5");
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
Add custom slice color & explode & visible label in basic piechart example.
r713 QPieSlice *slice = series->slices().first();
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]
//![3]
QChart* chart = new QChart();
chart->addSeries(series);
chart->setTitle("Simple piechart example");
//![3]
//![4]
QChartView* chartView = new QChartView(chart);
chartView->setRenderHint(QPainter::Antialiasing);
//![4]
//![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
Added piechart example
r128 return a.exec();
}