wei wei | 1 Jun 21:12 2007
Picon

How to decide the scale ratio when using rubberband?

Hi my friends:
I am using Qwt5.0.1 and right now I have a problem.
In my application, I need the rubberband feature. I want to draw some circles on the canvas. I think I can use setSymbol(SymbolStyle::Ellipse) to draw this circles on the plot canvas.
But I also need these circles to be scaled simultaneously when I rubberband the QwtPlot. This is not supported in Qwt.
Of course, I can call the setSymbol() again after rubberband giving these circle symbols a bigger size.However I want to these circles not only to become bigger but also have a rational bigger size. In another words, these circles' rational size are decided by the ratio of rubberband's size to the canvas's size.
 
And also I noticed that, when I rubberband, in the QwtPlotZoomer::end(), the X scale and Y scale are changed by their own ratio respectively. Thus I couldn't decide which ratio should be used in recalling the setSymbol() in order to give these circles a new bigger size.
 
So can I make the X scale and Y scale be changed using an identical ratio,?(no matter how I rubberband)
 
I really need you help. Any suggestion is welcome.
Thanks a lot. 

雅虎免费邮箱3.5G容量,20M附件!
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
qwt-interest mailing list
qwt-interest <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/qwt-interest
Cypher | 2 Jun 01:37 2007
Picon

Sonagram Widget

Hi Uwe, all,

Have you / anyone made an approach to realize a sonagram widget in Qt
for displaying FFTs ?

Cuz I am onto that. Id appreciate any ideas. My idea was using OpenGl
for it due to performance reasons.

Greets Phil

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
Cypher | 2 Jun 01:39 2007
Picon

Re: How to decide the scale ratio when using rubberband?

How about subclasing the PlotZoomer adn overwriting the end() ?

On 6/1/07, wei wei <w_lufei2000 <at> yahoo.com.cn> wrote:
> Hi my friends:
> I am using Qwt5.0.1 and right now I have a problem.
> In my application, I need the rubberband feature. I want to draw some
> circles on the canvas. I think I can use setSymbol(SymbolStyle::Ellipse) to
> draw this circles on the plot canvas.
> But I also need these circles to be scaled simultaneously when I rubberband
> the QwtPlot. This is not supported in Qwt.
> Of course, I can call the setSymbol() again after rubberband giving these
> circle symbols a bigger size.However I want to these circles not only to
> become bigger but also have a rational bigger size. In another words, these
> circles' rational size are decided by the ratio of rubberband's size to the
> canvas's size.
>
> And also I noticed that, when I rubberband, in the QwtPlotZoomer::end(), the
> X scale and Y scale are changed by their own ratio respectively. Thus I
> couldn't decide which ratio should be used in recalling the setSymbol() in
> order to give these circles a new bigger size.
>
> So can I make the X scale and Y scale be changed using an identical
> ratio,?(no matter how I rubberband)
>
> I really need you help. Any suggestion is welcome.
> Thanks a lot.
>
>  ________________________________
>  雅虎免费邮箱3.5G容量,20M附件!
>
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2 express and take
> control of your XML. No limits. Just data. Click to get it now.
> http://sourceforge.net/powerbar/db2/
> _______________________________________________
> qwt-interest mailing list
> qwt-interest <at> lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/qwt-interest
>
>
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
qwt-interest mailing list
qwt-interest <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/qwt-interest
wei wei | 5 Jun 04:48 2007
Picon

Problem with QwtLegend and QwtLegendItem

Hello my friends
I'm using Qwt5.0.1 and Qt 3.5.5. I have two questions.
 
The first is about the QwtLegend and QwtLegendItem. I have read the documents of Qwt. But I can't figure out what is the QwtLegend/QwtLegendItem's job.(Maybe because of my poor English) And I also do not understand the relationship between QwtLegend/QwtLegendItem and the QwtPlotItem.
Is there anybody can explain to me about the QwtLegend/QwtLegendItem in more details? In the "ealtime_plot" example, is there any QwtLegend be used?
 
My second question is: I draw some symbols on the QwtPlot. All of these symbols are belong to the same QwtPlotCurve. And then I want these symbols to respond to the mouse click/move event. For examle, I click one of these symbols, holding down the right button of the mouse and move it. Then all of these symbols should move as the result of the mousemove event, untill the mouse button is released.
 
Any suggestion is welcom! I need your help so much. Thanks a lot.
Best regards.

抢注雅虎免费邮箱3.5G容量,20M附件!
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
qwt-interest mailing list
qwt-interest <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/qwt-interest
Johannes Winkelmann | 6 Jun 16:36 2007
Picon
Picon

Aligning multiple plots

Hi,

I'm currently writing an application which is supposed to display 
multiple simultaneously recorded signals. For this, I'm looking for a 
way to display multiple QwtPlot Widgets perfectly aligned. Now since the 
data ranges are very different, I end up with misaligned plots, as the 
scale labels have different widths.

I'd appreciate if someone could point me in the right direction to 
achieve this. I've attached a small Qt4 application and a screen shot of 
it to illustrate the issue.

Thanks in advance,
Johannes Winkelmann
-- 
Wearable Computing Lab.
Electronics Laboratory (IfE), H96

http://www.ife.ee.ethz.ch
#include <QApplication>
#include <QBoxLayout>

#include <qwt_plot.h>
#include <qwt_plot_curve.h>

int main(int argc, char** argv)
{
    QApplication app(argc, argv);
    QWidget parent;

    double x[100], y1[100], y2[100];

    QwtPlotCurve *curve1 = new QwtPlotCurve("Curve 1");
    QwtPlotCurve *curve2 = new QwtPlotCurve("Curve 2");
    for (int i = 0; i < 100; ++i) {
	x[i] = i;
	y1[i] = sin(i/10.0);
	y2[i] = y1[i] * 10000;
    }

    QwtPlot* plot1 = new QwtPlot(QwtText("c1"), &parent);
    curve1->setData(x, y1, 100);
    curve1->attach(plot1);

    QwtPlot* plot2 = new QwtPlot(QwtText("c2"), &parent);
    curve2->setData(x, y2, 100);
    curve2->attach(plot2);

    QVBoxLayout *layout = new QVBoxLayout;
    layout->addWidget(plot1);
    layout->addWidget(plot2);
    parent.setLayout(layout);
		      
    plot1->replot();
    plot2->replot();

    parent.resize(300, 200);
    parent.show();

    return app.exec();
}
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
qwt-interest mailing list
qwt-interest <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/qwt-interest
Uwe Rathmann | 6 Jun 17:31 2007
Picon

Re: adjustSize() problems after setLegendPosition()

On Tuesday 29 May 2007 01:54, lingfa Yang wrote:
> Every time when I set a new LegendPosition, I call adjustSize():
> if(plotLayout()->legendPosition() != pos)
> {
>     plotLayout()->setLegendPosition(pos);
>     this->adjustSize();
> }

You have to reinsert the legend, if you want to change its position using 
QwtPlot::insertLegend. You can reinsert a legend, although it is already 
inserted. 

I know, this API is not my best one,
Uwe

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
Uwe Rathmann | 6 Jun 17:47 2007
Picon

Re: setLegendPosition() does not associate with changing layout of legendItem.

On Tuesday 29 May 2007 05:40, lingfa Yang wrote:

> Actually, most often people put legend on right-top corner inside the
> canvas if there is enough space (not overlap with curves). It seems Qwt
> library does not support this, right?
> I actually prefer a free legend position, which allow user to specify.

You could use QwtLegend::ExternalLegend as position and move the legend on top 
of the canvas manually.

Uwe

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
Uwe Rathmann | 6 Jun 17:44 2007
Picon

Re: setLegendPosition() does not associate with changing layout of legendItem.

On Tuesday 29 May 2007 05:26, lingfa Yang wrote:

> Bottom and Top legends prefer a horizontal item layout, and Left and
> Right legends prefer a vertical item layout.
> Both work well if they are inserted before adding QwtPlotCurves.
> But, later, if one decides to change the position, for example, from
> BottomLegend to RightLegend, the horizontal layout does not
> automatically switch to vertical one, which I think it should.
> Otherwise, it just looks not good.

See my previous answer: use QwtPlot::insertLegend to change the position of 
the legend.

> The other minor question is is it possible to draw a tight box around
> legend items, instead of a wide/long box the same width/height with the
> canvas?

QwtLegend is a QFrame, so your question is in fact, if you can have a layout, 
where the legend is resized to its minimum size only.

Hm, maybe you could overload QwtPlot::updateLayout this way:

virtual void YourPlot::updateLayout()
{
    QwtPlot::updateLayout();

    const QRect legendRect = legend()->geometry();
    const QRect hint = legend()->sizeHint();

    // ... calculate the geometry you like

    legend()->setGeometry(...);
}

Uwe

    
}

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
Uwe Rathmann | 6 Jun 18:01 2007
Picon

Re: Sonagram Widget

On Saturday 02 June 2007 01:37, Cypher wrote:

> Have you / anyone made an approach to realize a sonagram widget in Qt
> for displaying FFTs ?

Do you have raster data (like in a spectrogram) to display - or are these 
unsorted x,y,z-samples, where x, y are the positions on the scales and z is 
mapped to a color ?

> Cuz I am onto that. Id appreciate any ideas. My idea was using OpenGl
> for it due to performance reasons.

What are your performance reasons - do you need to display several images per 
second ?

Uwe

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
Uwe Rathmann | 6 Jun 18:16 2007
Picon

Re: Aligning multiple plots

On Wednesday 06 June 2007 16:36, Johannes Winkelmann wrote:

> I'm currently writing an application which is supposed to display
> multiple simultaneously recorded signals. For this, I'm looking for a
> way to display multiple QwtPlot Widgets perfectly aligned. Now since the
> data ranges are very different, I end up with misaligned plots, as the
> scale labels have different widths.

To be honest I'm a bit tired (not your fault, it is a Qwt problem) of this 
question. To help myself I already started with a plot matrix example, that 
will include a class PlotMatrix that can be copied into application code. As 
soon as I'm happy with it, it will be included in the library.

But it will take some time until it is usable.

> I'd appreciate if someone could point me in the right direction to
> achieve this. I've attached a small Qt4 application and a screen shot of
> it to illustrate the issue.

For your situation of vertical plots there is an easy solution. The code below 
is from the new example ( you have only one column, so forget the col 
parameter ):

void PlotMatrix::alignVAxis(int col, int axis)
{
    if ( axis != QwtPlot::yLeft && axis != QwtPlot::yRight )
        return;

    int maxExtent = 0;
    for ( int row = 0; row < numRows(); row++ )
    {
        QwtPlot *p = plot(row, col);
        if ( p )
        {
            QwtScaleWidget *scaleWidget = p->axisWidget(axis);

            QwtScaleDraw *sd = scaleWidget->scaleDraw();
            sd->setMinimumExtent(0);

            const int extent = sd->extent(
                QPen(Qt::black, scaleWidget->penWidth()),
                scaleWidget->font() );
            if ( extent > maxExtent )
                maxExtent = extent;
        }
    }
    for ( int row = 0; row < numRows(); row++ )
    {
        QwtPlot *p = plot(row, col);
        if ( p )
        {
            QwtScaleWidget *scaleWidget = p->axisWidget(axis);
            scaleWidget->scaleDraw()->setMinimumExtent(maxExtent);
        }
    }
}

HTH,
Uwe

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/

Gmane