##// END OF EJS Templates
Adding metatype declarations in qml plugin for Qt5...
Adding metatype declarations in qml plugin for Qt5 Not sure why they are needed for Qt5. Definetly NOT needed for Qt4.

File last commit:

r2102:f689de612f59
r2257:b97c592cff78
Show More
main.cpp
70 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
pie: change the order of parameters when creating slices to be more intuitive
r1206 series->append("Jane", 1);
series->append("Joe", 2);
series->append("Andy", 3);
series->append("Barbara", 4);
series->append("Axel", 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
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]
Jani Honkonen
more coding style fixes for examples...
r2102 QChart *chart = new QChart();
Michal Klocek
Uninfy examples , updated public API changes
r747 chart->addSeries(series);
chart->setTitle("Simple piechart example");
Marek Rosa
Added simple donut chart example docs
r1842 chart->legend()->hide();
Michal Klocek
Uninfy examples , updated public API changes
r747 //![3]
Jani Honkonen
Pie doc updates
r880
Michal Klocek
Uninfy examples , updated public API changes
r747 //![4]
Jani Honkonen
more coding style fixes for examples...
r2102 QChartView *chartView = new QChartView(chart);
Michal Klocek
Uninfy examples , updated public API changes
r747 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();
}