being more const aware
This commit is contained in:
parent
ec61c11ab6
commit
85642665d4
|
@ -345,13 +345,13 @@ bool MainItem::eventFilter( QObject* object, QEvent* event )
|
|||
}
|
||||
}
|
||||
|
||||
bool MainItem::gestureFilter( QQuickItem* item, QEvent* event )
|
||||
bool MainItem::gestureFilter( const QQuickItem* item, const QEvent* event )
|
||||
{
|
||||
auto& recognizer = m_panRecognizer;
|
||||
|
||||
if( event->type() == QEvent::MouseButtonPress )
|
||||
{
|
||||
const auto mouseEvent = static_cast< QMouseEvent* >( event );
|
||||
auto mouseEvent = static_cast< const QMouseEvent* >( event );
|
||||
|
||||
if( ( item != this ) || ( recognizer.timeout() < 0 ) )
|
||||
{
|
||||
|
|
|
@ -74,7 +74,7 @@ class MainItem : public QskControl
|
|||
|
||||
protected:
|
||||
bool eventFilter(QObject* obj, QEvent* event) override final;
|
||||
bool gestureFilter( QQuickItem*, QEvent* ) override final;
|
||||
bool gestureFilter( const QQuickItem*, const QEvent* ) override final;
|
||||
void gestureEvent( QskGestureEvent* ) override final;
|
||||
|
||||
private:
|
||||
|
|
|
@ -809,7 +809,7 @@ bool QskControl::childMouseEventFilter( QQuickItem* item, QEvent* event )
|
|||
return d_func()->maybeGesture( item, event );
|
||||
}
|
||||
|
||||
bool QskControl::gestureFilter( QQuickItem*, QEvent* )
|
||||
bool QskControl::gestureFilter( const QQuickItem*, const QEvent* )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -196,7 +196,7 @@ class QSK_EXPORT QskControl : public QskQuickItem, public QskSkinnable
|
|||
void hoverLeaveEvent( QHoverEvent* ) override;
|
||||
|
||||
bool childMouseEventFilter( QQuickItem*, QEvent* ) override;
|
||||
virtual bool gestureFilter( QQuickItem*, QEvent* );
|
||||
virtual bool gestureFilter( const QQuickItem*, const QEvent* );
|
||||
|
||||
void itemChange( ItemChange, const ItemChangeData& ) override;
|
||||
void geometryChange( const QRectF&, const QRectF& ) override;
|
||||
|
|
|
@ -309,7 +309,7 @@ QSizeF QskControlPrivate::explicitSizeHint( Qt::SizeHint whichHint ) const
|
|||
return QSizeF();
|
||||
}
|
||||
|
||||
bool QskControlPrivate::maybeGesture( QQuickItem* child, QEvent* event )
|
||||
bool QskControlPrivate::maybeGesture( const QQuickItem* child, const QEvent* event )
|
||||
{
|
||||
Q_Q( QskControl );
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@ class QskControlPrivate : public QskQuickItemPrivate
|
|||
void implicitSizeChanged() override final;
|
||||
void layoutConstraintChanged() override final;
|
||||
|
||||
bool maybeGesture( QQuickItem*, QEvent* );
|
||||
bool maybeGesture( const QQuickItem*, const QEvent* );
|
||||
|
||||
QskPlacementPolicy::Policy placementPolicy( bool visible ) const noexcept;
|
||||
void setPlacementPolicy( bool visible, QskPlacementPolicy::Policy );
|
||||
|
|
|
@ -295,7 +295,7 @@ QskGestureRecognizer::State QskGestureRecognizer::state() const
|
|||
}
|
||||
|
||||
bool QskGestureRecognizer::processEvent(
|
||||
QQuickItem* item, QEvent* event, bool blockReplayedEvents )
|
||||
const QQuickItem* item, const QEvent* event, bool blockReplayedEvents )
|
||||
{
|
||||
if ( m_data->isReplayingEvents && blockReplayedEvents )
|
||||
{
|
||||
|
@ -331,7 +331,7 @@ bool QskGestureRecognizer::processEvent(
|
|||
if ( buttons == Qt::NoButton )
|
||||
buttons = watchedItem->acceptedMouseButtons();
|
||||
|
||||
auto mouseEvent = static_cast< QMouseEvent* >( event );
|
||||
auto mouseEvent = static_cast< const QMouseEvent* >( event );
|
||||
if ( !( buttons & mouseEvent->button() ) )
|
||||
return false;
|
||||
|
||||
|
@ -383,7 +383,7 @@ bool QskGestureRecognizer::processEvent(
|
|||
{
|
||||
case QEvent::MouseButtonPress:
|
||||
{
|
||||
auto mouseEvent = static_cast< QMouseEvent* >( event );
|
||||
auto mouseEvent = static_cast< const QMouseEvent* >( event );
|
||||
m_data->pendingEvents += qskClonedMouseEvent( mouseEvent );
|
||||
|
||||
pressEvent( mouseEvent );
|
||||
|
@ -392,7 +392,7 @@ bool QskGestureRecognizer::processEvent(
|
|||
|
||||
case QEvent::MouseMove:
|
||||
{
|
||||
auto mouseEvent = static_cast< QMouseEvent* >( event );
|
||||
auto mouseEvent = static_cast< const QMouseEvent* >( event );
|
||||
m_data->pendingEvents += qskClonedMouseEvent( mouseEvent );
|
||||
|
||||
moveEvent( mouseEvent );
|
||||
|
@ -401,7 +401,7 @@ bool QskGestureRecognizer::processEvent(
|
|||
|
||||
case QEvent::MouseButtonRelease:
|
||||
{
|
||||
auto mouseEvent = static_cast< QMouseEvent* >( event );
|
||||
auto mouseEvent = static_cast< const QMouseEvent* >( event );
|
||||
m_data->pendingEvents += qskClonedMouseEvent( mouseEvent );
|
||||
|
||||
if ( m_data->state == Pending )
|
||||
|
|
|
@ -41,7 +41,7 @@ class QSK_EXPORT QskGestureRecognizer
|
|||
// timestamp, when the Idle state had been left
|
||||
ulong timestamp() const;
|
||||
|
||||
bool processEvent( QQuickItem*, QEvent*, bool blockReplayedEvents = true );
|
||||
bool processEvent( const QQuickItem*, const QEvent*, bool blockReplayedEvents = true );
|
||||
|
||||
void reject();
|
||||
void accept();
|
||||
|
|
|
@ -446,7 +446,7 @@ void QskScrollBox::wheelEvent( QWheelEvent* event )
|
|||
|
||||
#endif
|
||||
|
||||
bool QskScrollBox::gestureFilter( QQuickItem* item, QEvent* event )
|
||||
bool QskScrollBox::gestureFilter( const QQuickItem* item, const QEvent* event )
|
||||
{
|
||||
if ( event->type() == QEvent::MouseButtonPress )
|
||||
{
|
||||
|
@ -501,7 +501,7 @@ bool QskScrollBox::gestureFilter( QQuickItem* item, QEvent* event )
|
|||
its parent, finally ending up here for a second time.
|
||||
*/
|
||||
|
||||
const auto mouseEvent = static_cast< QMouseEvent* >( event );
|
||||
auto mouseEvent = static_cast< const QMouseEvent* >( event );
|
||||
if ( recognizer.hasProcessedBefore( mouseEvent ) )
|
||||
{
|
||||
/*
|
||||
|
|
|
@ -73,7 +73,7 @@ class QSK_EXPORT QskScrollBox : public QskControl
|
|||
virtual QPointF scrollOffset( const QWheelEvent* ) const;
|
||||
#endif
|
||||
|
||||
bool gestureFilter( QQuickItem*, QEvent* ) override;
|
||||
bool gestureFilter( const QQuickItem*, const QEvent* ) override;
|
||||
void setScrollableSize( const QSizeF& );
|
||||
|
||||
private:
|
||||
|
|
Loading…
Reference in New Issue