ich entwickle sowohl unter Linux (Fedora) als auch unter Windows XP. Unter Linux mit Qt 4.4.3 und Qwt 5.1.1 funktioniert der nachfolgende Code ohne Probleme. Unter Windows mit Qt 4.5 und Qwt 5.1.1 startet die Applikation und stürzt ab sobald man versucht zu zoomen.
Code: Alles auswählen
#include <QtGui>
#include <QApplication>
#include <qwt_plot.h>
#include <qwt_plot_curve.h>
#include <qwt_plot_canvas.h>
#include <qwt_plot_zoomer.h>
#include <qwt.h>
class MyPlot : public QwtPlot
{
public:
MyPlot( QWidget *parent=0) : QwtPlot( parent )
{
double x[11], y1[11];
// Show a title
setTitle( "This is an Example" );
// zooming
QwtPlotCanvas *canvas1 = canvas();
QwtPlotZoomer *canvas1Zoomer = new QwtPlotZoomer( QwtPlot::xBottom, QwtPlot::yLeft, canvas1 );
canvas1Zoomer->setSelectionFlags( QwtPicker::DragSelection );
canvas1Zoomer->setTrackerMode(QwtPicker::ActiveOnly);
// Show the axes
setAxisTitle( xBottom, "measurement number" );
setAxisTitle( yLeft, "values" );
QwtPlotCurve *curve1 = new QwtPlotCurve("Curve1");
for (int i=0; i<=10; i++)
{
x[i] = i;
y1[i] = i*2;
}
curve1->setData(x, y1, 10);
curve1->attach(this);
curve1->setStyle(QwtPlotCurve::CurveStyle(3));
curve1->setPen(QPen( Qt::blue, 2, Qt::SolidLine ));
// Show the plots
replot();
}
};
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
MyPlot p;
p.show();
return a.exec();
}
Program received signal SIGSEGV, Segmentation fault.
0x100127ce in QwtPicker::PickerWidget::updateMask (this=0x5009258)
at qwt_picker.cpp:133
133 if ( !parentWidget()->testAttribute(Qt::WA_PaintOnScreen) && Current language: auto; currently c++
Bei der Suche im Bugtracker von QtSoftware und Qwt bin ich auch nicht fündig geworden. Vielleicht habt ihr eine Idee.