Changeset 9383 in ntrip for trunk/BNC/qwt/qwt_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_panner.cpp

    r8127 r9383  
    129129   \param modifiers Keyboard modifiers
    130130*/
    131 void QwtPanner::setAbortKey( int key, 
     131void QwtPanner::setAbortKey( int key,
    132132    Qt::KeyboardModifiers modifiers )
    133133{
     
    137137
    138138//! Get the abort key and modifiers
    139 void QwtPanner::getAbortKey( int &key, 
     139void QwtPanner::getAbortKey( int &key,
    140140    Qt::KeyboardModifiers &modifiers ) const
    141141{
     
    248248   fill the empty spaces by the background of the parent widget.
    249249
    250    \param pe Paint event
    251 */
    252 void QwtPanner::paintEvent( QPaintEvent *pe )
     250   \param event Paint event
     251*/
     252void QwtPanner::paintEvent( QPaintEvent *event )
    253253{
    254254    int dx = d_data->pos.x() - d_data->initialPos.x();
    255255    int dy = d_data->pos.y() - d_data->initialPos.y();
    256256
    257     QRect r( 0, 0, d_data->pixmap.width(), d_data->pixmap.height() );
    258     r.moveCenter( QPoint( r.center().x() + dx, r.center().y() + dy ) );
    259 
    260     QPixmap pm( size() );
     257    QRectF r;
     258    r.setSize( d_data->pixmap.size() );
     259#if QT_VERSION >= 0x050000
     260    r.setSize( r.size() / d_data->pixmap.devicePixelRatio() );
     261#endif
     262    r.moveCenter( QPointF( r.center().x() + dx, r.center().y() + dy ) );
     263
     264    QPixmap pm = QwtPainter::backingStore( this, size() );
    261265    QwtPainter::fillPixmap( parentWidget(), pm );
    262266
     
    267271        QPixmap masked = d_data->pixmap;
    268272        masked.setMask( d_data->contentsMask );
    269         painter.drawPixmap( r, masked );
     273        painter.drawPixmap( r.toRect(), masked );
    270274    }
    271275    else
    272276    {
    273         painter.drawPixmap( r, d_data->pixmap );
     277        painter.drawPixmap( r.toRect(), d_data->pixmap );
    274278    }
    275279
     
    280284
    281285    painter.begin( this );
    282     painter.setClipRegion( pe->region() );
     286    painter.setClipRegion( event->region() );
    283287    painter.drawPixmap( 0, 0, pm );
    284288}
Note: See TracChangeset for help on using the changeset viewer.