##// END OF EJS Templates
minor documentation fixes for barchart
minor documentation fixes for barchart

File last commit:

r395:9f537617b108
r396:b9c9fb13c5b7
Show More
main.cpp
59 lines | 1.7 KiB | text/x-c | CppLexer
Tero Ahola
Added minimalistic scatter example
r123 #include <QtGui/QApplication>
#include <QMainWindow>
#include <qchartglobal.h>
Michal Klocek
Removes QChartWidget...
r136 #include <qchartview.h>
Tero Ahola
Added minimalistic scatter example
r123 #include <qscatterseries.h>
QTCOMMERCIALCHART_USE_NAMESPACE
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
Tero Ahola
Scatter series documentation; now uses snippets
r300 //! [1]
// Create chart view
Tero Ahola
QDoc to use style sheets...
r260 QChartView *chartView = new QChartView();
Tero Ahola
Fixed bug in setting chart theme...
r312 chartView->setChartTheme(QChart::ChartThemeIcy);
Tero Ahola
Scatter series marker visuals
r195 // Add scatter series with simple test data
Tero Ahola
added stream operator to scatter series
r180 QScatterSeries *scatter = new QScatterSeries();
Tero Ahola
Clicked, remove and clear to QScatterSeries
r394 *scatter << QPointF(0.5, 5.0) << QPointF(1.0, 4.5) << QPointF(1.0, 5.5) << QPointF(1.5, 5.0);
Tero Ahola
QDoc to use style sheets...
r260 // Chart takes ownership
chartView->addSeries(scatter);
Tero Ahola
Refactored chartwidgettest test data impl
r278 //! [1]
Tero Ahola
Replace to QScatterSeries
r395 // scatter->replace(0, QPointF(0.75, 5.0));
Tero Ahola
Added minimalistic scatter example
r123
Tero Ahola
Scatter series documentation; now uses snippets
r300 // And more
//! [3]
Tero Ahola
Fixing review findings in QScatterSeries
r358 *scatter << QPointF(2.0, 5.5) << QPointF(2.2, 5.4);
Tero Ahola
Scatter series documentation; now uses snippets
r300 //! [3]
Tero Ahola
Replace to QScatterSeries
r395 // Add another scatter series (re-use the previous pointer because the code used as snippets
// in the docs)
Tero Ahola
Scatter series marker visuals
r195 // - more data with random component
Tero Ahola
Scatter series documentation; now uses snippets
r300 scatter = new QScatterSeries();
Tero Ahola
Documenting QScatterSeries
r261 for (qreal i(0.0); i < 20; i += 0.15) {
Tero Ahola
Scatter series documentation; now uses snippets
r300 (*scatter) << QPointF(i + (qreal)(rand() % 100) / 100.0,
Tero Ahola
Scatter series marker visuals
r195 i + (qreal)(rand() % 100) / 100.0);
}
Tero Ahola
Scatter series documentation; now uses snippets
r300 //! [4]
Tero Ahola
Documenting QScatterSeries
r261 QBrush brush(QColor(255, 0, 0, 100), Qt::SolidPattern);
Tero Ahola
Fixing review findings in QScatterSeries
r358 scatter->setBrush(brush);
Tero Ahola
Scatter series documentation; now uses snippets
r300 //! [4]
//! [5]
Tero Ahola
Documenting QScatterSeries
r261 QPen pen(QColor(0, 255, 0, 80), 3);
Tero Ahola
Fixing review findings in QScatterSeries
r358 scatter->setPen(pen);
Tero Ahola
Scatter series documentation; now uses snippets
r300 //! [5]
//! [6]
Tero Ahola
Fixing review findings in QScatterSeries
r358 scatter->setShape(QScatterSeries::MarkerShapeRectangle);
Tero Ahola
Scatter series documentation; now uses snippets
r300 //! [6]
chartView->addSeries(scatter);
Tero Ahola
Added minimalistic scatter example
r123
// Use the chart widget as the central widget
QMainWindow w;
Tero Ahola
Clicked, remove and clear to QScatterSeries
r394 w.resize(400, 300);
Tero Ahola
QDoc to use style sheets...
r260 w.setCentralWidget(chartView);
Tero Ahola
Clicked, remove and clear to QScatterSeries
r394 w.setWindowFlags(Qt::FramelessWindowHint);
Tero Ahola
Added minimalistic scatter example
r123 w.show();
return a.exec();
}