Hi,
I'm trying to put 3 plots in a Dialog, one big on the left, and two other one above tho other on the right side.
But I don't know how, cause I can't find a way to use Layout with Plot.
Can you help me with this?
best regards, Ozzy
Hi,
I'm trying to put 3 plots in a Dialog, one big on the left, and two other one above tho other on the right side.
But I don't know how, cause I can't find a way to use Layout with Plot.
Can you help me with this?
best regards, Ozzy
There is nothing special with QwtPlot, when using it in QLayouts.
What did you try ?
Uwe
Hi Uwe,
thanks for your answer. I've tried something like this:
Qt Code:
setTitle( "Titel" ); plot->attach(this); double vx[vec.size()]; double vy[vec.size()]; for(uint i=0; i<vec.size(); i++) { vx[i]= i; vy[i]= vec[i]; } plot->setData(vx, vy, vec.size()); plot->attach(myPlot); layout->addWidget( myPlot ); replot();To copy to clipboard, switch view to plain text mode
But now there are two plot, and one is on top of the other, but a little bit shifted.
Can you help me with this?
Greetings from germany, Ozzy
Hi,
i guess I know whats wrong
Thats, why he paint the second graph. But what can I do? If I use something like QFrame, then repaint() is unknown...Qt Code:
To copy to clipboard, switch view to plain text mode
MfG, Ozzy
Ok, it works. But I'm interest, if theres a better way to go...
Ozzy
Last edited by wysota; 29th November 2007 at 13:26. Reason: Posts merged
Hello,
can you tell me, how did you manage to draw the plots within a QFrame?
I wanted to include the spectrogram example of qwt in my programm, but nothing is displayed there:
Qt Code:
ui_frame_for_plot = qFindChild<QFrame*>(this, "frame_for_plot"); Plot *d_plot; d_plot = new Plot(ui_frame_for_plot); d_plot->showSpectrogram(true);To copy to clipboard, switch view to plain text mode
How can I integrate a QwtPlot into another widget?
Thank you.
best regards,
Vitali
Ok, I have solved it myself by inserting the QwtPlot into a layout:
Qt Code:
// build object of class "Plot", which will plot the 2D surfaces d_plot = new Plot(); layout_plot->addWidget(d_plot); d_plot->showSpectrogram(true);To copy to clipboard, switch view to plain text mode
Now the plot is displayed.
Bookmarks