mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-23 20:14:05 +00:00
Fix one more crash under Qt 5.12
This commit is contained in:
parent
d62b2d61ba
commit
c3ff15f4d8
10
gestures.cc
10
gestures.cc
|
@ -45,7 +45,8 @@ QSwipeGesture::SwipeDirection getVerticalDirection( qreal angle )
|
|||
return QSwipeGesture::NoDirection;
|
||||
}
|
||||
|
||||
GDPinchGesture::GDPinchGesture() :
|
||||
GDPinchGesture::GDPinchGesture( QObject * parent ) :
|
||||
QGesture( parent ),
|
||||
isNewSequence( true )
|
||||
{
|
||||
}
|
||||
|
@ -55,7 +56,7 @@ QGesture * GDPinchGestureRecognizer::create( QObject * pTarget )
|
|||
if ( pTarget && pTarget->isWidgetType()) {
|
||||
static_cast< QWidget * >( pTarget )->setAttribute( Qt::WA_AcceptTouchEvents );
|
||||
}
|
||||
QGesture *pGesture = new GDPinchGesture;
|
||||
QGesture *pGesture = new GDPinchGesture( pTarget );
|
||||
return pGesture;
|
||||
}
|
||||
|
||||
|
@ -161,7 +162,8 @@ QGestureRecognizer::Result GDPinchGestureRecognizer::recognize( QGesture * state
|
|||
}
|
||||
|
||||
|
||||
GDSwipeGesture::GDSwipeGesture() :
|
||||
GDSwipeGesture::GDSwipeGesture( QObject * parent ) :
|
||||
QGesture( parent ),
|
||||
vertDirection( QSwipeGesture::NoDirection ),
|
||||
horizDirection( QSwipeGesture::NoDirection ),
|
||||
started( false )
|
||||
|
@ -173,7 +175,7 @@ QGesture * GDSwipeGestureRecognizer::create( QObject * pTarget )
|
|||
if ( pTarget && pTarget->isWidgetType() ) {
|
||||
static_cast< QWidget * >( pTarget )->setAttribute( Qt::WA_AcceptTouchEvents );
|
||||
}
|
||||
QGesture *pGesture = new GDSwipeGesture;
|
||||
QGesture *pGesture = new GDSwipeGesture( pTarget );
|
||||
return pGesture;
|
||||
}
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@ class GDPinchGestureRecognizer;
|
|||
class GDPinchGesture : public QGesture
|
||||
{
|
||||
public:
|
||||
GDPinchGesture();
|
||||
GDPinchGesture( QObject * parent );
|
||||
|
||||
bool isScaleChanged() const
|
||||
{ return scaleChanged; }
|
||||
|
@ -65,7 +65,7 @@ class GDSwipeGestureRecognizer;
|
|||
class GDSwipeGesture : public QGesture
|
||||
{
|
||||
public:
|
||||
GDSwipeGesture();
|
||||
GDSwipeGesture( QObject * parent );
|
||||
QSwipeGesture::SwipeDirection getHorizDirection() const
|
||||
{ return horizDirection; }
|
||||
QSwipeGesture::SwipeDirection getVertDirection() const
|
||||
|
|
|
@ -982,7 +982,7 @@ MainWindow::~MainWindow()
|
|||
#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
|
||||
ui.centralWidget->ungrabGesture( Gestures::GDPinchGestureType );
|
||||
ui.centralWidget->ungrabGesture( Gestures::GDSwipeGestureType );
|
||||
Gestures::unregisterRecognizers();
|
||||
// Gestures::unregisterRecognizers();
|
||||
#endif
|
||||
|
||||
// Close all tabs -- they should be destroyed before network managers
|
||||
|
|
Loading…
Reference in a new issue