#include "TestQwtPlot.h"
#include "TestQwtPlot.moc"
#include <QtGui/QMenu>
#include <QtGui/QMenuBar>
#include <QtGui/QAction>
#include <qwt/qwt_plot.h>
#include <qwt/qwt_scale_engine.h>
#include <qwt/qwt_data.h>
#include <qwt/qwt_plot_curve.h>
TestQwtPlot::TestQwtPlot()
{
double x[5] = {1,2,3,4,5};
curve1->setData ( qwtArray );
curve1->attach( plot );
plot->replot();
log->setText( "Logarithmic scale" );
lin->setText( "Linear scale" );
setCentralWidget(plot);
a->setText( "Quit" );
connect(a, SIGNAL(triggered()), SLOT(close()) );
connect(lin, SIGNAL(triggered()), SLOT(on_lin_triggered()));
connect(log, SIGNAL(triggered()), SLOT(on_log_triggered()));
QMenu * m
= menuBar
()->addMenu
( "File" );
m->addAction( a );
m->addAction( log );
m->addAction( lin );
}
TestQwtPlot::~TestQwtPlot()
{}
void TestQwtPlot::on_lin_triggered(){
plot
->setAxisScaleEngine
(QwtPlot::yLeft, linScale
);
plot
->setAxisScaleEngine
(QwtPlot::xBottom, linScale
);
plot->replot();
}
void TestQwtPlot::on_log_triggered(){
plot
->setAxisScaleEngine
(QwtPlot::yLeft, logScale
);
plot
->setAxisScaleEngine
(QwtPlot::xBottom, logScale
);
plot->replot();
}
#include "TestQwtPlot.h"
#include "TestQwtPlot.moc"
#include <QtGui/QMenu>
#include <QtGui/QMenuBar>
#include <QtGui/QAction>
#include <qwt/qwt_plot.h>
#include <qwt/qwt_scale_engine.h>
#include <qwt/qwt_data.h>
#include <qwt/qwt_plot_curve.h>
TestQwtPlot::TestQwtPlot()
{
plot = new QwtPlot(this);
linScale = new QwtLinearScaleEngine();
logScale = new QwtLog10ScaleEngine();
double x[5] = {1,2,3,4,5};
QwtArrayData qwtArray ( x, x, 5 );
QwtPlotCurve *curve1 = new QwtPlotCurve ( "Curve 1" );
curve1->setData ( qwtArray );
curve1->attach( plot );
plot->replot();
QAction* log = new QAction(this);
QAction* lin = new QAction(this);
log->setText( "Logarithmic scale" );
lin->setText( "Linear scale" );
setCentralWidget(plot);
QAction* a = new QAction(this);
a->setText( "Quit" );
connect(a, SIGNAL(triggered()), SLOT(close()) );
connect(lin, SIGNAL(triggered()), SLOT(on_lin_triggered()));
connect(log, SIGNAL(triggered()), SLOT(on_log_triggered()));
QMenu * m = menuBar()->addMenu( "File" );
m->addAction( a );
m->addAction( log );
m->addAction( lin );
}
TestQwtPlot::~TestQwtPlot()
{}
void TestQwtPlot::on_lin_triggered(){
plot->setAxisScaleEngine(QwtPlot::yLeft, linScale);
plot->setAxisScaleEngine(QwtPlot::xBottom, linScale);
plot->replot();
}
void TestQwtPlot::on_log_triggered(){
plot->setAxisScaleEngine(QwtPlot::yLeft, logScale);
plot->setAxisScaleEngine(QwtPlot::xBottom, logScale);
plot->replot();
}
To copy to clipboard, switch view to plain text mode
#0 0x0000000000000021 in ?? ()
#1 0x00007ffff6b943b2 in QwtPlot::setAxisScaleEngine(int, QwtScaleEngine*) () from /usr/lib64/libqwt.so.5
#2 0x0000000000403838 in TestQwtPlot::on_lin_triggered (this=0x7fffffffd200) at /home/gudlaugu/projects/TestQwtPlot/TestQwtPlot.cpp:44
#3 0x00000000004049d8 in TestQwtPlot::qt_metacall (this=0x7fffffffd200, _c=QMetaObject::InvokeMetaMethod, _id=1, _a=0x7fffffffa9f0) at /home/gudlaugu/projects/TestQwtPlot/build/TestQwtPlot.moc:69
#4 0x00007ffff7affee2 in QMetaObject::activate (sender=0x887370, from_signal_index=<value optimized out>, to_signal_index=6, argv=0x0) at kernel/qobject.cpp:3113
#5 0x00007ffff6f86a37 in QAction::triggered (this=0x749d10, _t1=false) at .moc/release-shared/moc_qaction.cpp:236
#6 0x00007ffff6f87eb0 in QAction::activate (this=0x887370, event=<value optimized out>) at kernel/qaction.cpp:1167
#7 0x00007ffff7370ddd in QMenuPrivate::activateCausedStack (this=0x82ba90, causedStack=@0x7fffffffab10, action=0x887370, action_e=QAction::Trigger, self=true) at widgets/qmenu.cpp:967
#8 0x00007ffff7376dde in QMenuPrivate::activateAction (this=0x82ba90, action=0x887370, action_e=QAction::Trigger, self=true) at widgets/qmenu.cpp:1060
#9 0x00007ffff6fdda3d in QWidget::event (this=0x72f5a0, event=0x7fffffffb2d0) at kernel/qwidget.cpp:7554
#10 0x00007ffff737962b in QMenu::event (this=0x72f5a0, e=0x7fffffffb2d0) at widgets/qmenu.cpp:2358
#11 0x00007ffff6f8ca4d in QApplicationPrivate::notify_helper (this=0x6072e0, receiver=0x72f5a0, e=0x7fffffffb2d0) at kernel/qapplication.cpp:4065
#12 0x00007ffff6f9543a in QApplication::notify (this=<value optimized out>, receiver=0x72f5a0, e=0x7fffffffb2d0) at kernel/qapplication.cpp:3767
#13 0x00007ffff7aeb15c in QCoreApplication::notifyInternal (this=0x7fffffffd240, receiver=0x72f5a0, event=0x7fffffffb2d0) at kernel/qcoreapplication.cpp:610
#14 0x00007ffff6f94688 in QApplicationPrivate::sendMouseEvent (receiver=0x72f5a0, event=0x7fffffffb2d0, alienWidget=0x0, nativeWidget=0x72f5a0, buttonDown=<value optimized out>, lastMouseReceiver=@0x7ffff799ff30)
at ../../src/corelib/kernel/qcoreapplication.h:216
#15 0x00007ffff6ffe644 in QETWidget::translateMouseEvent (this=0x72f5a0, event=<value optimized out>) at kernel/qapplication_x11.cpp:4343
#16 0x00007ffff6ffd4f5 in QApplication::x11ProcessEvent (this=0x7fffffffd240, event=0x7fffffffce50) at kernel/qapplication_x11.cpp:3550
#17 0x00007ffff7024854 in x11EventSourceDispatch (s=0x610340, callback=0, user_data=0x0) at kernel/qguieventdispatcher_glib.cpp:146
#18 0x00007ffff57970fb in g_main_context_dispatch () from /usr/lib64/libglib-2.0.so.0
#19 0x00007ffff579a8cd in ?? () from /usr/lib64/libglib-2.0.so.0
#20 0x00007ffff579aa8b in g_main_context_iteration () from /usr/lib64/libglib-2.0.so.0
#21 0x00007ffff7b1456c in QEventDispatcherGlib::processEvents (this=0x60c430, flags=<value optimized out>) at kernel/qeventdispatcher_glib.cpp:407
#22 0x00007ffff7023fdf in QGuiEventDispatcherGlib::processEvents (this=0x749d10, flags=<value optimized out>) at kernel/qguieventdispatcher_glib.cpp:202
#23 0x00007ffff7ae99e2 in QEventLoop::processEvents (this=<value optimized out>, flags={i = -11968}) at kernel/qeventloop.cpp:149
#24 0x00007ffff7ae9db4 in QEventLoop::exec (this=0x7fffffffd180, flags={i = -11888}) at kernel/qeventloop.cpp:201
#25 0x00007ffff7aec0a4 in QCoreApplication::exec () at kernel/qcoreapplication.cpp:888
#26 0x0000000000404cb7 in main (argc=1, argv=0x7fffffffd338) at /home/gudlaugu/projects/TestQwtPlot/main.cpp:10
#0 0x0000000000000021 in ?? ()
#1 0x00007ffff6b943b2 in QwtPlot::setAxisScaleEngine(int, QwtScaleEngine*) () from /usr/lib64/libqwt.so.5
#2 0x0000000000403838 in TestQwtPlot::on_lin_triggered (this=0x7fffffffd200) at /home/gudlaugu/projects/TestQwtPlot/TestQwtPlot.cpp:44
#3 0x00000000004049d8 in TestQwtPlot::qt_metacall (this=0x7fffffffd200, _c=QMetaObject::InvokeMetaMethod, _id=1, _a=0x7fffffffa9f0) at /home/gudlaugu/projects/TestQwtPlot/build/TestQwtPlot.moc:69
#4 0x00007ffff7affee2 in QMetaObject::activate (sender=0x887370, from_signal_index=<value optimized out>, to_signal_index=6, argv=0x0) at kernel/qobject.cpp:3113
#5 0x00007ffff6f86a37 in QAction::triggered (this=0x749d10, _t1=false) at .moc/release-shared/moc_qaction.cpp:236
#6 0x00007ffff6f87eb0 in QAction::activate (this=0x887370, event=<value optimized out>) at kernel/qaction.cpp:1167
#7 0x00007ffff7370ddd in QMenuPrivate::activateCausedStack (this=0x82ba90, causedStack=@0x7fffffffab10, action=0x887370, action_e=QAction::Trigger, self=true) at widgets/qmenu.cpp:967
#8 0x00007ffff7376dde in QMenuPrivate::activateAction (this=0x82ba90, action=0x887370, action_e=QAction::Trigger, self=true) at widgets/qmenu.cpp:1060
#9 0x00007ffff6fdda3d in QWidget::event (this=0x72f5a0, event=0x7fffffffb2d0) at kernel/qwidget.cpp:7554
#10 0x00007ffff737962b in QMenu::event (this=0x72f5a0, e=0x7fffffffb2d0) at widgets/qmenu.cpp:2358
#11 0x00007ffff6f8ca4d in QApplicationPrivate::notify_helper (this=0x6072e0, receiver=0x72f5a0, e=0x7fffffffb2d0) at kernel/qapplication.cpp:4065
#12 0x00007ffff6f9543a in QApplication::notify (this=<value optimized out>, receiver=0x72f5a0, e=0x7fffffffb2d0) at kernel/qapplication.cpp:3767
#13 0x00007ffff7aeb15c in QCoreApplication::notifyInternal (this=0x7fffffffd240, receiver=0x72f5a0, event=0x7fffffffb2d0) at kernel/qcoreapplication.cpp:610
#14 0x00007ffff6f94688 in QApplicationPrivate::sendMouseEvent (receiver=0x72f5a0, event=0x7fffffffb2d0, alienWidget=0x0, nativeWidget=0x72f5a0, buttonDown=<value optimized out>, lastMouseReceiver=@0x7ffff799ff30)
at ../../src/corelib/kernel/qcoreapplication.h:216
#15 0x00007ffff6ffe644 in QETWidget::translateMouseEvent (this=0x72f5a0, event=<value optimized out>) at kernel/qapplication_x11.cpp:4343
#16 0x00007ffff6ffd4f5 in QApplication::x11ProcessEvent (this=0x7fffffffd240, event=0x7fffffffce50) at kernel/qapplication_x11.cpp:3550
#17 0x00007ffff7024854 in x11EventSourceDispatch (s=0x610340, callback=0, user_data=0x0) at kernel/qguieventdispatcher_glib.cpp:146
#18 0x00007ffff57970fb in g_main_context_dispatch () from /usr/lib64/libglib-2.0.so.0
#19 0x00007ffff579a8cd in ?? () from /usr/lib64/libglib-2.0.so.0
#20 0x00007ffff579aa8b in g_main_context_iteration () from /usr/lib64/libglib-2.0.so.0
#21 0x00007ffff7b1456c in QEventDispatcherGlib::processEvents (this=0x60c430, flags=<value optimized out>) at kernel/qeventdispatcher_glib.cpp:407
#22 0x00007ffff7023fdf in QGuiEventDispatcherGlib::processEvents (this=0x749d10, flags=<value optimized out>) at kernel/qguieventdispatcher_glib.cpp:202
#23 0x00007ffff7ae99e2 in QEventLoop::processEvents (this=<value optimized out>, flags={i = -11968}) at kernel/qeventloop.cpp:149
#24 0x00007ffff7ae9db4 in QEventLoop::exec (this=0x7fffffffd180, flags={i = -11888}) at kernel/qeventloop.cpp:201
#25 0x00007ffff7aec0a4 in QCoreApplication::exec () at kernel/qcoreapplication.cpp:888
#26 0x0000000000404cb7 in main (argc=1, argv=0x7fffffffd338) at /home/gudlaugu/projects/TestQwtPlot/main.cpp:10
To copy to clipboard, switch view to plain text mode
Bookmarks