Exemplo n.º 1
0
void ScalePicker::mouseDblClicked(const QwtScaleWidget *scale, const QPoint &pos)
{
	if (scaleRect(scale).contains(pos) ) 
		emit axisDblClicked(scale->alignment());
	else
	{// Click on the title
		switch(scale->alignment())   
		{
			case QwtScaleDraw::LeftScale:
				{
					emit yAxisTitleDblClicked();
					break;
				}
			case QwtScaleDraw::RightScale:
				{
					emit rightAxisTitleDblClicked();
					break;
				}
			case QwtScaleDraw::BottomScale:
				{
					emit xAxisTitleDblClicked();
					break;
				}
			case QwtScaleDraw::TopScale:
				{
					emit topAxisTitleDblClicked();
					break;
				}
		}
	}
}
Exemplo n.º 2
0
void ScalePicker::mouseDblClicked(const QwtScaleWidget *scale, const QPoint &pos)
{
	if (titleRect(scale).contains(pos))
		emit axisTitleDblClicked();
	else if (scaleRect(scale).contains(pos))
        emit axisDblClicked(scale->alignment());
}
Exemplo n.º 3
0
void ScalePicker::mouseDblClicked(const QwtScale *scale, const QPoint &pos) 
{
QRect rect = scaleRect(scale);

int margin = 2; // pixels tolerance
rect.setRect(rect.x() - margin, rect.y() - margin, rect.width() + 2 * margin, rect.height() +  2 * margin);

if ( rect.contains(pos) ) 
	{
	emit axisDblClicked(scale->position());
	}
else
	{// Click on the title
    switch(scale->position())   
        {
        case QwtScale::Left:
            {
			emit yAxisTitleDblClicked();
            break;
            }
        case QwtScale::Right:
            {
			emit rightAxisTitleDblClicked();
            break;
            }
        case QwtScale::Bottom:
            {
			emit xAxisTitleDblClicked();
            break;
            }
        case QwtScale::Top:
            {
			emit topAxisTitleDblClicked();
            break;
            }
		}
	}
}