Changeset 9383 in ntrip for trunk/BNC/qwt/qwt_plot_panner.cpp


Ignore:
Timestamp:
Mar 19, 2021, 9:15:03 AM (3 years ago)
Author:
stoecker
Message:

update to qwt verion 6.1.1 to fix build with newer Qt5

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/qwt/qwt_plot_panner.cpp

    r8127 r9383  
    1515#include <qstyle.h>
    1616#include <qstyleoption.h>
     17#include <qpainterpath.h>
     18
     19#if QT_VERSION >= 0x050000
     20#if QT_VERSION < 0x050100
     21#define QWT_USE_WINDOW_HANDLE 1
     22#endif
     23#endif
     24
     25#ifdef QWT_USE_WINDOW_HANDLE
     26#include <qwindow.h>
     27#endif
    1728
    1829static QBitmap qwtBorderMask( const QWidget *canvas, const QSize &size )
    1930{
     31#if QT_VERSION >= 0x050000
     32    qreal pixelRatio = 1.0;
     33
     34#ifdef QWT_USE_WINDOW_HANDLE
     35    pixelRatio = canvas->windowHandle()->devicePixelRatio();
     36#else
     37    pixelRatio = canvas->devicePixelRatio();
     38#endif
     39#endif
     40
    2041    const QRect r( 0, 0, size.width(), size.height() );
    2142
    2243    QPainterPath borderPath;
    2344
    24     ( void )QMetaObject::invokeMethod( 
     45    ( void )QMetaObject::invokeMethod(
    2546        const_cast< QWidget *>( canvas ), "borderPath", Qt::DirectConnection,
    2647        Q_RETURN_ARG( QPainterPath, borderPath ), Q_ARG( QRect, r ) );
     
    3152            return QBitmap();
    3253
     54#if QT_VERSION >= 0x050000
     55        QBitmap mask( size * pixelRatio );
     56        mask.setDevicePixelRatio( pixelRatio );
     57#else
    3358        QBitmap mask( size );
     59#endif
    3460        mask.fill( Qt::color0 );
    3561
     
    4066    }
    4167
     68#if QT_VERSION >= 0x050000
     69    QImage image( size * pixelRatio, QImage::Format_ARGB32_Premultiplied );
     70    image.setDevicePixelRatio( pixelRatio );
     71#else
    4272    QImage image( size, QImage::Format_ARGB32_Premultiplied );
     73#endif
    4374    image.fill( Qt::color0 );
    4475
     
    6394        const QVariant frameWidth = canvas->property( "frameWidth" );
    6495
    65         if ( borderRadius.type() == QVariant::Double 
     96        if ( borderRadius.type() == QVariant::Double
    6697            && frameWidth.type() == QVariant::Int )
    6798        {
    6899            const double br = borderRadius.toDouble();
    69100            const int fw = frameWidth.toInt();
    70        
     101
    71102            if ( br > 0.0 && fw > 0 )
    72103            {
     
    114145    d_data = new PrivateData();
    115146
    116     connect( this, SIGNAL( panned( int, int ) ),
    117         SLOT( moveCanvas( int, int ) ) );
     147    connect( this, SIGNAL(panned(int,int)),
     148        SLOT(moveCanvas(int,int)) );
    118149}
    119150
     
    256287 */
    257288QPixmap QwtPlotPanner::grab() const
    258 {   
     289{
    259290    const QWidget *cv = canvas();
    260291    if ( cv && cv->inherits( "QGLWidget" ) )
     
    272303
    273304    return QwtPanner::grab();
    274 }   
    275 
     305}
     306
Note: See TracChangeset for help on using the changeset viewer.