ich versuch mich zurzeit in qwt einzuarbeiten... und schlage mich mit folgendem programm rum:
es soll 2 kurven plotten mehr nicht und das in der qt eclipse integration umgebung mit qwt.
wenn jemand wüsste wie man die fehler beheben kann, wär ich sehr dankbar.
hier das programm:
Code: Alles auswählen
#include <QtCore>
#include <QCoreApplication>
#include <QApplication>
#include <qapplication.h>
#include <qwt_plot.h>
#include <qwt_data.h>
#include <qwt_plot_marker.h>
#include <qwt_plot_curve.h>
#include <qwt_legend.h>
#include <qwt_text.h>
#include <qwt_math.h>
#include <iostream>
using namespace std;
class MyPlot : public QwtPlot
{
public:
MyPlot( QWidget *parent=0, char *name=0 ) : QwtPlot( parent, name )
{
// Show a title
setTitle( "This is an Example" );
// Show a legend at the bottom
setAutoLegend( true );
setLegendPos( Qwt::Bottom );
// Show the axes
setAxisTitle( xBottom, "x" );
setAxisTitle( yLeft, "y" );
// Insert two curves and get IDs for them
long cSin = insertCurve( "y = sin(x)" );
long cSign = insertCurve( "y = sign(sin(x))" );
// Calculate the data, 500 points each
const int points = 500;
double x[ points ];
double sn[ points ];
double sg[ points ];
for( int i=0; i<points; i++ )
{
x[i] = (3.0*3.14/double(points))*double(i);
sn[i] = 2.0*sin( x[i] );
sg[i] = (sn[i]>0)?1:((sn[i]<0)?-1:0);
}
// Copy the data to the plot
setCurveData( cSin, x, sn, points );
setCurveData( cSign, x, sg, points );
// Set the style of the curves
setCurvePen( cSin, QPen( blue ) );
setCurvePen( cSign, QPen( green, 3 ) );
// Show the plots
replot();
}
};
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
MyPlot p;
a.setMainWidget( &p );
p.show();
return a.exec();
}
Code: Alles auswählen
TEMPLATE = app
TARGET = z1
QT += core
HEADERS +=
SOURCES += main.cpp
FORMS +=
RESOURCES +=
CONFIG += console
LIBS += -L"C:/qwt/lib" -lqwt5 -lqwtd5
INCLUDEPATH += "C:/qwt/src"
DEFINES += QT_DLL / QWT_DLL
QWT_ROOT = C:/qwt
export LD_LIBRARY_PATH=C:/qwt/lib
nebenbei weis ich auch nicht warum er mir den debug error bringt, vieleicht kann da jemand was dau sagen
vielen dank