Changeset 9383 in ntrip for trunk/BNC/qwt/qwt_plot_panner.cpp
- Timestamp:
- Mar 19, 2021, 9:15:03 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/qwt/qwt_plot_panner.cpp
r8127 r9383 15 15 #include <qstyle.h> 16 16 #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 17 28 18 29 static QBitmap qwtBorderMask( const QWidget *canvas, const QSize &size ) 19 30 { 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 20 41 const QRect r( 0, 0, size.width(), size.height() ); 21 42 22 43 QPainterPath borderPath; 23 44 24 ( void )QMetaObject::invokeMethod( 45 ( void )QMetaObject::invokeMethod( 25 46 const_cast< QWidget *>( canvas ), "borderPath", Qt::DirectConnection, 26 47 Q_RETURN_ARG( QPainterPath, borderPath ), Q_ARG( QRect, r ) ); … … 31 52 return QBitmap(); 32 53 54 #if QT_VERSION >= 0x050000 55 QBitmap mask( size * pixelRatio ); 56 mask.setDevicePixelRatio( pixelRatio ); 57 #else 33 58 QBitmap mask( size ); 59 #endif 34 60 mask.fill( Qt::color0 ); 35 61 … … 40 66 } 41 67 68 #if QT_VERSION >= 0x050000 69 QImage image( size * pixelRatio, QImage::Format_ARGB32_Premultiplied ); 70 image.setDevicePixelRatio( pixelRatio ); 71 #else 42 72 QImage image( size, QImage::Format_ARGB32_Premultiplied ); 73 #endif 43 74 image.fill( Qt::color0 ); 44 75 … … 63 94 const QVariant frameWidth = canvas->property( "frameWidth" ); 64 95 65 if ( borderRadius.type() == QVariant::Double 96 if ( borderRadius.type() == QVariant::Double 66 97 && frameWidth.type() == QVariant::Int ) 67 98 { 68 99 const double br = borderRadius.toDouble(); 69 100 const int fw = frameWidth.toInt(); 70 101 71 102 if ( br > 0.0 && fw > 0 ) 72 103 { … … 114 145 d_data = new PrivateData(); 115 146 116 connect( this, SIGNAL( panned( int, int )),117 SLOT( moveCanvas( int, int )) );147 connect( this, SIGNAL(panned(int,int)), 148 SLOT(moveCanvas(int,int)) ); 118 149 } 119 150 … … 256 287 */ 257 288 QPixmap QwtPlotPanner::grab() const 258 { 289 { 259 290 const QWidget *cv = canvas(); 260 291 if ( cv && cv->inherits( "QGLWidget" ) ) … … 272 303 273 304 return QwtPanner::grab(); 274 } 275 305 } 306
Note:
See TracChangeset
for help on using the changeset viewer.