Exemplo n.º 1
0
PlotCurve::PlotCurve(const QString& name): QwtPlotCurve(name),
d_type(0),
d_plot_style(0),
d_x_offset(0.0),
d_y_offset(0.0)
{
    setPaintAttribute(PaintFiltered);
    setPaintAttribute(ClipPolygons);
	setCurveAttribute(QwtPlotCurve::Fitted, false);
}
/*! 
  \brief Constructor
  \param plot Parent plot widget
*/
QwtPlotCanvas::QwtPlotCanvas( QwtPlot *plot ):
    QFrame( plot )
{
    d_data = new PrivateData;

#ifndef QT_NO_CURSOR
    setCursor( Qt::CrossCursor );
#endif

    setAutoFillBackground( true );
    setPaintAttribute( QwtPlotCanvas::BackingStore, true );
    setPaintAttribute( QwtPlotCanvas::Opaque, true );
    setPaintAttribute( QwtPlotCanvas::HackStyledBackground, true );
}
Exemplo n.º 3
0
QwtPlotCanvas::QwtPlotCanvas( QwtPlot *plot ):
    QFrame( plot )
{
    d_data = new PrivateData;

    setAutoFillBackground( true );

#ifndef QT_NO_CURSOR
    setCursor( Qt::CrossCursor );
#endif

    setPaintAttribute( PaintCached, true );
    setPaintAttribute( PaintPacked, true );
}
Exemplo n.º 4
0
//! Constructor
QwtPolarCanvas::QwtPolarCanvas( QwtPolarPlot *plot ):
    QFrame( plot )
{
  d_data = new PrivateData;

#if QT_VERSION >= 0x040100
  setAutoFillBackground( false );
#endif

#if QT_VERSION < 0x040000
  setBackgroundMode( Qt::NoBackground );
#ifndef QT_NO_CURSOR
  setWFlags( Qt::WNoAutoErase );
  setCursor( Qt::crossCursor );
#endif
  setFocusPolicy( QWidget::WheelFocus );
#else
  setAttribute( Qt::WA_NoSystemBackground, true );
#ifndef QT_NO_CURSOR
  setCursor( Qt::CrossCursor );
#endif
  setFocusPolicy( Qt::WheelFocus );
#endif // >= 0x040000

  setPaintAttribute( PaintCached, true );
}
Exemplo n.º 5
0
QwtPlotCanvas::QwtPlotCanvas(QwtPlot *plot):
    QFrame(plot)
{
    d_data = new PrivateData;

#if QT_VERSION >= 0x040100
    setAutoFillBackground(true);
#endif

#if QT_VERSION < 0x040000
    setWFlags(Qt::WNoAutoErase);
#ifndef QT_NO_CURSOR
    setCursor(Qt::crossCursor);
#endif
#else
#ifndef QT_NO_CURSOR
    setCursor(Qt::CrossCursor);
#endif
#endif // >= 0x040000

    setPaintAttribute(PaintCached, true);
    setPaintAttribute(PaintPacked, true);
}
    Canvas( QwtPlot *plot = NULL ):
        QwtPlotCanvas( plot )
    {
        // The backing store is important, when working with widget
        // overlays ( f.e rubberbands for zooming ).
        // Here we don't have them and the internal
        // backing store of QWidget is good enough.

        setPaintAttribute( QwtPlotCanvas::BackingStore, false );
        setBorderRadius( 10 );

        if ( QwtPainter::isX11GraphicsSystem() )
        {
#if QT_VERSION < 0x050000
            // Even if not liked by the Qt development, Qt::WA_PaintOutsidePaintEvent
            // works on X11. This has a nice effect on the performance.

            setAttribute( Qt::WA_PaintOutsidePaintEvent, true );
#endif

            // Disabling the backing store of Qt improves the performance
            // for the direct painter even more, but the canvas becomes
            // a native window of the window system, receiving paint events
            // for resize and expose operations. Those might be expensive
            // when there are many points and the backing store of
            // the canvas is disabled. So in this application
            // we better don't disable both backing stores.

            if ( testPaintAttribute( QwtPlotCanvas::BackingStore ) )
            {
                setAttribute( Qt::WA_PaintOnScreen, true );
                setAttribute( Qt::WA_NoSystemBackground, true );
            }
        }

        setupPalette();
    }
Exemplo n.º 7
0
/*!
   Set the background brush

   \param brush Background brush
   \sa backgroundBrush(), setBorderPen()
*/
void QwtText::setBackgroundBrush( const QBrush &brush )
{
    d_data->backgroundBrush = brush;
    setPaintAttribute( PaintBackground );
}
Exemplo n.º 8
0
/*!
   Set the background pen

   \param pen Background pen
   \sa borderPen(), setBackgroundBrush()
*/
void QwtText::setBorderPen( const QPen &pen )
{
    d_data->borderPen = pen;
    setPaintAttribute( PaintBackground );
}
Exemplo n.º 9
0
/*!
   Set the pen color used for drawing the text.

   \param color Color
   \note Setting the color might have no effect, when
         the text contains control sequences for setting colors.
*/
void QwtText::setColor( const QColor &color )
{
    d_data->color = color;
    setPaintAttribute( PaintUsingTextColor );
}
Exemplo n.º 10
0
/*!
   Set the font.

   \param font Font
   \note Setting the font might have no effect, when
         the text contains control sequences for setting fonts.
*/
void QwtText::setFont( const QFont &font )
{
    d_data->font = font;
    setPaintAttribute( PaintUsingTextFont );
}