Released version 6.1.3
This commit is contained in:
		
				commit
				
					
						a94503cb82
					
				
			
		
					 1885 changed files with 276310 additions and 0 deletions
				
			
		
							
								
								
									
										42
									
								
								examples/simpleplot/simpleplot.cpp
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										42
									
								
								examples/simpleplot/simpleplot.cpp
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,42 @@
 | 
			
		|||
#include <qapplication.h>
 | 
			
		||||
#include <qwt_plot.h>
 | 
			
		||||
#include <qwt_plot_curve.h>
 | 
			
		||||
#include <qwt_plot_grid.h>
 | 
			
		||||
#include <qwt_symbol.h>
 | 
			
		||||
#include <qwt_legend.h>
 | 
			
		||||
 | 
			
		||||
int main( int argc, char **argv )
 | 
			
		||||
{
 | 
			
		||||
    QApplication a( argc, argv );
 | 
			
		||||
 | 
			
		||||
    QwtPlot plot;
 | 
			
		||||
    plot.setTitle( "Plot Demo" );
 | 
			
		||||
    plot.setCanvasBackground( Qt::white );
 | 
			
		||||
    plot.setAxisScale( QwtPlot::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 a.exec();
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										16
									
								
								examples/simpleplot/simpleplot.pro
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										16
									
								
								examples/simpleplot/simpleplot.pro
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,16 @@
 | 
			
		|||
################################################################
 | 
			
		||||
# Qwt Widget Library
 | 
			
		||||
# Copyright (C) 1997   Josef Wilgen
 | 
			
		||||
# Copyright (C) 2002   Uwe Rathmann
 | 
			
		||||
#
 | 
			
		||||
# This library is free software; you can redistribute it and/or
 | 
			
		||||
# modify it under the terms of the Qwt License, Version 1.0
 | 
			
		||||
################################################################
 | 
			
		||||
 | 
			
		||||
include( $${PWD}/../examples.pri )
 | 
			
		||||
 | 
			
		||||
TARGET       = simpleplot
 | 
			
		||||
 | 
			
		||||
SOURCES = \
 | 
			
		||||
    simpleplot.cpp
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue