当前位置: 首页>>代码示例>>C++>>正文


C++ QwtEventPattern::mouseMatch方法代码示例

本文整理汇总了C++中QwtEventPattern::mouseMatch方法的典型用法代码示例。如果您正苦于以下问题:C++ QwtEventPattern::mouseMatch方法的具体用法?C++ QwtEventPattern::mouseMatch怎么用?C++ QwtEventPattern::mouseMatch使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在QwtEventPattern的用法示例。


在下文中一共展示了QwtEventPattern::mouseMatch方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: switch

//! Transition
QList<QwtPickerMachine::Command> QwtPickerClickPointMachine::transition(
    const QwtEventPattern &eventPattern, const QEvent *e )
{
    QList<QwtPickerMachine::Command> cmdList;

    switch ( e->type() )
    {
        case QEvent::MouseButtonPress:
        {
            if ( eventPattern.mouseMatch(
                QwtEventPattern::MouseSelect1, ( const QMouseEvent * )e ) )
            {
                cmdList += Begin;
                cmdList += Append;
                cmdList += End;
            }
            break;
        }
        case QEvent::KeyPress:
        {
            if ( eventPattern.keyMatch(
                QwtEventPattern::KeySelect1, ( const QKeyEvent * )e ) )
            {
                cmdList += Begin;
                cmdList += Append;
                cmdList += End;
            }
            break;
        }
        default:
            break;
    }

    return cmdList;
}
开发者ID:BryanF1947,项目名称:GoldenCheetah,代码行数:36,代码来源:qwt_picker_machine.cpp

示例2: if

//! Transition
QList<QwtPickerMachine::Command> QwtPickerPolygonMachine::transition(
    const QwtEventPattern &eventPattern, const QEvent *e )
{
    QList<QwtPickerMachine::Command> cmdList;

    switch ( e->type() )
    {
        case QEvent::MouseButtonPress:
        {
            if ( eventPattern.mouseMatch(
                QwtEventPattern::MouseSelect1, ( const QMouseEvent * )e ) )
            {
                if ( state() == 0 )
                {
                    cmdList += Begin;
                    cmdList += Append;
                    cmdList += Append;
                    setState( 1 );
                }
                else
                {
                    cmdList += End;
                    setState( 0 );
                }
            }
            if ( eventPattern.mouseMatch(
                QwtEventPattern::MouseSelect2, ( const QMouseEvent * )e ) )
            {
                if ( state() == 1 )
                    cmdList += Append;
            }
            break;
        }
        case QEvent::MouseMove:
        case QEvent::Wheel:
        {
            if ( state() != 0 )
                cmdList += Move;
            break;
        }
        case QEvent::KeyPress:
        {
            if ( eventPattern.keyMatch(
                QwtEventPattern::KeySelect1, ( const QKeyEvent * )e ) )
            {
                if ( state() == 0 )
                {
                    cmdList += Begin;
                    cmdList += Append;
                    cmdList += Append;
                    setState( 1 );
                }
                else
                {
                    cmdList += End;
                    setState( 0 );
                }
            }
            else if ( eventPattern.keyMatch(
                QwtEventPattern::KeySelect2, ( const QKeyEvent * )e ) )
            {
                if ( state() == 1 )
                    cmdList += Append;
            }
            break;
        }
        default:
            break;
    }

    return cmdList;
}
开发者ID:BryanF1947,项目名称:GoldenCheetah,代码行数:73,代码来源:qwt_picker_machine.cpp

示例3: transition

  virtual QList<Command> transition(const QwtEventPattern& eventPattern, const QEvent* e)
	{
		QList<Command> cmdList;

		switch(e->type())
		{
			case QEvent::MouseButtonPress:
			{
				const QMouseEvent *mouseEvent = (QMouseEvent*)e;

				if(eventPattern.mouseMatch(QwtEventPattern::MouseSelect1, mouseEvent)
						|| (mouseEvent->button() == Qt::LeftButton && mouseEvent->modifiers() == Qt::ControlModifier)
						|| (mouseEvent->button() == Qt::LeftButton && mouseEvent->modifiers() == Qt::ShiftModifier))
				{
					if(state() == 0)
					{
						cmdList += Begin;
						cmdList += Append;
						cmdList += Append;
						setState(2);
					}

					if(mouseEvent->modifiers() == Qt::ControlModifier || mouseEvent->modifiers() == Qt::ShiftModifier)
						m_bAddToSelection = true;
					else 
						m_bAddToSelection = false;
				}
				break;
			}

			case QEvent::MouseMove:
			case QEvent::Wheel:
			{
				if ( state() != 0 )
					cmdList += Move;
				break;
			}

			case QEvent::MouseButtonRelease:
			{
				if ( state() == 2 )
				{
					cmdList += End;
					setState(0);
				}
				break;
			}

			case QEvent::KeyPress:
			{
				if(eventPattern.keyMatch(QwtEventPattern::KeySelect1, (const QKeyEvent *)e))
				{
					if ( state() == 0 )
					{
						cmdList += Begin;
						cmdList += Append;
						cmdList += Append;
						setState(2);
					}
					else
					{
						cmdList += End;
						setState(0);
					}
				}
				break;
			}

			default:
			break;
		}

		return cmdList;
	}
开发者ID:dparks1134,项目名称:Chameleon,代码行数:74,代码来源:OrdinationSelection.hpp

示例4: switch

//! Transition
QList<QwtPickerMachine::Command> QwtPickerDragLineMachine::transition(
    const QwtEventPattern &eventPattern, const QEvent *event )
{
    QList<QwtPickerMachine::Command> cmdList;

    switch( event->type() )
    {
        case QEvent::MouseButtonPress:
        {
            if ( eventPattern.mouseMatch( QwtEventPattern::MouseSelect1,
                static_cast<const QMouseEvent *>( event ) ) )
            {
                if ( state() == 0 )
                {
                    cmdList += Begin;
                    cmdList += Append;
                    cmdList += Append;
                    setState( 1 );
                }
            }
            break;
        }
        case QEvent::KeyPress:
        {
            if ( eventPattern.keyMatch( QwtEventPattern::KeySelect1,
                static_cast<const QKeyEvent *> ( event ) ) )
            {
                if ( state() == 0 )
                {
                    cmdList += Begin;
                    cmdList += Append;
                    cmdList += Append;
                    setState( 1 );
                }
                else
                {
                    cmdList += End;
                    setState( 0 );
                }
            }
            break;
        }
        case QEvent::MouseMove:
        case QEvent::Wheel:
        {
            if ( state() != 0 )
                cmdList += Move;

            break;
        }
        case QEvent::MouseButtonRelease:
        {
            if ( state() != 0 )
            {
                cmdList += End;
                setState( 0 );
            }
        }
        default:
            break;
    }

    return cmdList;
}
开发者ID:420174953,项目名称:qgroundcontrol,代码行数:65,代码来源:qwt_picker_machine.cpp


注:本文中的QwtEventPattern::mouseMatch方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。