Add files from zip
This commit is contained in:
48
examples/simpleplot/main.cpp
Normal file
48
examples/simpleplot/main.cpp
Normal file
@@ -0,0 +1,48 @@
|
||||
/*****************************************************************************
|
||||
* Qwt Examples - Copyright (C) 2002 Uwe Rathmann
|
||||
* This file may be used under the terms of the 3-clause BSD License
|
||||
*****************************************************************************/
|
||||
|
||||
#include <QwtPlot>
|
||||
#include <QwtPlotCurve>
|
||||
#include <QwtPlotGrid>
|
||||
#include <QwtSymbol>
|
||||
#include <QwtLegend>
|
||||
|
||||
#include <QApplication>
|
||||
|
||||
int main( int argc, char* argv[] )
|
||||
{
|
||||
QApplication app( argc, argv );
|
||||
|
||||
QwtPlot plot;
|
||||
plot.setTitle( "Plot Demo" );
|
||||
plot.setCanvasBackground( Qt::white );
|
||||
plot.setAxisScale( QwtAxis::YLeft, 0.0, 10.0 );
|
||||
plot.insertLegend( new QwtLegend() );
|
||||
|
||||
QwtPlotGrid* grid = new QwtPlotGrid();
|
||||
grid->attach( &plot );
|
||||
|
||||
QwtPlotCurve* curve = new QwtPlotCurve();
|
||||
curve->setTitle( "Some Points" );
|
||||
curve->setPen( Qt::blue, 4 ),
|
||||
curve->setRenderHint( QwtPlotItem::RenderAntialiased, true );
|
||||
|
||||
QwtSymbol* symbol = new QwtSymbol( QwtSymbol::Ellipse,
|
||||
QBrush( Qt::yellow ), QPen( Qt::red, 2 ), QSize( 8, 8 ) );
|
||||
curve->setSymbol( symbol );
|
||||
|
||||
QPolygonF points;
|
||||
points << QPointF( 0.0, 4.4 ) << QPointF( 1.0, 3.0 )
|
||||
<< QPointF( 2.0, 4.5 ) << QPointF( 3.0, 6.8 )
|
||||
<< QPointF( 4.0, 7.9 ) << QPointF( 5.0, 7.1 );
|
||||
curve->setSamples( points );
|
||||
|
||||
curve->attach( &plot );
|
||||
|
||||
plot.resize( 600, 400 );
|
||||
plot.show();
|
||||
|
||||
return app.exec();
|
||||
}
|
||||
12
examples/simpleplot/simpleplot.pro
Normal file
12
examples/simpleplot/simpleplot.pro
Normal file
@@ -0,0 +1,12 @@
|
||||
######################################################################
|
||||
# Qwt Examples - Copyright (C) 2002 Uwe Rathmann
|
||||
# This file may be used under the terms of the 3-clause BSD License
|
||||
######################################################################
|
||||
|
||||
include( $${PWD}/../examples.pri )
|
||||
|
||||
TARGET = simpleplot
|
||||
|
||||
SOURCES = \
|
||||
main.cpp
|
||||
|
||||
Reference in New Issue
Block a user