##// END OF EJS Templates
Removed setting scene rect in QChartView::resizeEvent
Removed setting scene rect in QChartView::resizeEvent

File last commit:

r713:964c794fe613
r739:6c5910e9d6f4
Show More
main.cpp
44 lines | 1021 B | text/x-c | CppLexer
Jani Honkonen
Added piechart example
r128 #include <QtGui/QApplication>
#include <QMainWindow>
#include <qchartglobal.h>
Michal Klocek
Removes QChartWidget...
r136 #include <qchartview.h>
Jani Honkonen
Added piechart example
r128 #include <qpieseries.h>
Jani Honkonen
Refactor pie (again). QPieSlice's now emit signals and no id's anymore. Just pointers in the interface.
r203 #include <qpieslice.h>
Jani Honkonen
Added piechart example
r128
QTCOMMERCIALCHART_USE_NAMESPACE
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
Jani Honkonen
Refactor pie (again). QPieSlice's now emit signals and no id's anymore. Just pointers in the interface.
r203 QMainWindow window;
Jani Honkonen
Add pie example to pie series doc. Also made the basic pie example real simple. Have to add separate examples for customization.
r341 QChartView* chartView = new QChartView(&window);
Jani Honkonen
Add custom slice color & explode & visible label in basic piechart example.
r713 chartView->setRenderHint(QPainter::Antialiasing);
chartView->setChartTitle("Simple pie chart");
Jani Honkonen
Add pie example to pie series doc. Also made the basic pie example real simple. Have to add separate examples for customization.
r341
//! [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
Add pie example to pie series doc. Also made the basic pie example real simple. Have to add separate examples for customization.
r341 series->add(1, "Slice 1");
Jani Honkonen
Refactor pie (again). QPieSlice's now emit signals and no id's anymore. Just pointers in the interface.
r203 series->add(2, "Slice 2");
series->add(3, "Slice 3");
series->add(4, "Slice 4");
series->add(5, "Slice 5");
Jani Honkonen
Add pie example to pie series doc. Also made the basic pie example real simple. Have to add separate examples for customization.
r341 //! [1]
Jani Honkonen
Refactor pie (again). QPieSlice's now emit signals and no id's anymore. Just pointers in the interface.
r203
Jani Honkonen
Add custom slice color & explode & visible label in basic piechart example.
r713 //! [2]
QPieSlice *slice = series->slices().first();
slice->setExploded();
slice->setLabelVisible();
slice->setSlicePen(QPen(Qt::darkGreen, 2));
slice->setSliceBrush(Qt::green);
//! [2]
chartView->addSeries(series);
Jani Honkonen
Refactor pie (again). QPieSlice's now emit signals and no id's anymore. Just pointers in the interface.
r203 window.setCentralWidget(chartView);
window.resize(600, 600);
window.show();
Jani Honkonen
Added piechart example
r128
return a.exec();
}