#include <qwt_scale_widget.h>
#include <qwt_scale_engine.h>
ScaleTest
::ScaleTest(QWidget *parent, Qt
::WFlags flags
){
ui.setupUi(this);
// asigning the same values makes it crash
// scale->setScaleDiv( NULL, engine->divideScale( 0, 100, 6, 10, 10 ) );
// scale->setScaleDiv( NULL, engine->divideScale( 0, 100, 6, 10, 10 ) );
for( int i = 0; i < 100; i++ ){
scale->setScaleDiv( NULL, engine->divideScale( 0, i, 6, 10, 10 ) );
scale2->setScaleDiv( NULL, engine2->divideScale( 0, i, 6, 10, 10 ) );
}
scale->show();
}
#include <qwt_scale_widget.h>
#include <qwt_scale_engine.h>
ScaleTest::ScaleTest(QWidget *parent, Qt::WFlags flags)
: QMainWindow(parent, flags)
{
ui.setupUi(this);
QwtScaleWidget *scale = new QwtScaleWidget( QwtScaleDraw::BottomScale, this );
QwtScaleWidget *scale2 = new QwtScaleWidget( QwtScaleDraw::BottomScale, this );
QwtLinearScaleEngine *engine = new QwtLinearScaleEngine;
QwtLinearScaleEngine *engine2 = new QwtLinearScaleEngine;
// asigning the same values makes it crash
// scale->setScaleDiv( NULL, engine->divideScale( 0, 100, 6, 10, 10 ) );
// scale->setScaleDiv( NULL, engine->divideScale( 0, 100, 6, 10, 10 ) );
for( int i = 0; i < 100; i++ ){
scale->setScaleDiv( NULL, engine->divideScale( 0, i, 6, 10, 10 ) );
scale2->setScaleDiv( NULL, engine2->divideScale( 0, i, 6, 10, 10 ) );
}
scale->show();
}
To copy to clipboard, switch view to plain text mode
Bookmarks