Making simple plot in qt designer using qwt library
Hi!
I'm using Qt Designer and already have the qwt library and plugun's instaled!
How do i make a simple plot using QT designer, and qwtplot widget?
what i have to do? new slot's i think, but what i put there???
I can't find any manual that tell how to do it, in qt designer!
any help??!! Please!
Thanks best regards
Re: Making simple plot in qt designer using qwt library
Quote:
Originally Posted by toze3
I can't find any manual that tell how to do it, in qt designer!
You can't do it in the Qt Designer --- it's only an layout desiger, not IDE. You will have to write some code.
There are a lot of examples included in Qwt sources. Checkout ./examples/simple_plot and ./examples/bode.
Re: Making simple plot in qt designer using qwt library
Thanks!
I already see the examples, but i can't make anything with that!
If i use QT3 Designer, and in a form put a qwtplot plugin, my question is what i have to put in *.ui file to make it work!
it will be nice if sameone put here a simple example of how to do it a simple plot in qt designer using a qwtplot plugin
best regards
Re: Making simple plot in qt designer using qwt library
Exactly the same things, only you don't have to create the plot.
Here's an example from my program:
Code:
// setup axis
_ui.
plot->setAxisTitle
( QwtPlot::xBottom, tr
( "Wavelength [nm]" ) );
...
_xAxis
= _ui.
plot->axisWidget
( QwtPlot::xBottom );
...
_xAxis->installEventFilter( this );
...
// create data and attach it to the plot
_curve.setData( _data );
_curve.
setRenderHint( QwtPlotItem::RenderAntialiased );
_curve.attach( _ui.plot );
_ui.plot->replot();
// create value picker
_picker
->setSelectionFlags
( QwtPicker::PointSelection |
_picker
->setRubberBand
( QwtPicker::CrossRubberBand );
_picker
->setTrackerMode
( QwtPicker::AlwaysOn );
_picker
->setTrackerFont
( QFont( "Helvetica",
10,
QFont::Bold ) );
// create zoomer
_zoomer
->setSelectionFlags
( QwtPicker::DragSelection );
_zoomer
->setTrackerMode
( QwtPicker::AlwaysOff );
connect( _picker, SIGNAL( moved(const QPoint& ) ),
this, SLOT( cursorMoved( const QPoint& ) ) );
connect( _picker, SIGNAL( selected( const QwtDoublePoint& ) ),
this, SLOT( pointSelected( const QwtDoublePoint& ) ) );
...
I use Qt4, so I have to access the plot using "_ui.plot". In Qt3 you will have to skip the "ui." part.
Re: Making simple plot in qt designer using qwt library
hi,
i made a small app with qt desinger with a QwtPlot in it.
it's possible to do something like: :confused:
Code:
MainWindow
::MainWindow(QWidget *parent
)...
plot = new RandomPlot();
ui->qwtPlot = plot;
...
}
{
...
}
it compiles fine, but the plot isn't shown.
(i use qt4 and qwt 5.2.0)