blProjectNewFormWidgetFilterSingle::blProjectNewFormWidgetFilterSingle(QString title, int idx, QWidget *parent) :
    QWidget(parent)
{

    m_idx = idx;
    QGridLayout *layout = new QGridLayout;


    titleLabel = new QLabel("<b>" + title + ":</b>");
    blClickableIcon *closeButton = new blClickableIcon("theme/close.png", "", 16,16,2);
    connect(closeButton, SIGNAL(clicked()), this, SLOT(emitClose()));
    layout->addWidget(titleLabel, 0, 0, 1, 1, Qt::AlignRight);
    layout->addWidget(closeButton, 0, 1, 1, 1, Qt::AlignRight);

    QLabel *startLabel = new QLabel(tr("      Starts with"));
    startLineEdit = new QLineEdit;
    layout->addWidget(startLabel, 1, 0);
    layout->addWidget(startLineEdit, 1, 1);

    QLabel *containsLabel = new QLabel(tr("<i>and</i> Contains"));
    containsLineEdit = new QLineEdit;
    layout->addWidget(containsLabel, 2, 0);
    layout->addWidget(containsLineEdit, 2, 1);

    QLabel *endsLabel = new QLabel(tr("<i>and</i> Ends by"));
    endsLineEdit = new QLineEdit;
    layout->addWidget(endsLabel, 3, 0);
    layout->addWidget(endsLineEdit, 3, 1);

    this->setLayout(layout);
}
void SVGPathBuilder::emitSegment(const PathSegmentData& segment)
{
    switch (segment.command) {
    case PathSegClosePath:
        emitClose();
        break;
    case PathSegMoveToAbs:
        emitMoveTo(
            segment.targetPoint);
        break;
    case PathSegMoveToRel:
        emitMoveTo(
            m_currentPoint + segment.targetPoint);
        break;
    case PathSegLineToAbs:
        emitLineTo(
            segment.targetPoint);
        break;
    case PathSegLineToRel:
        emitLineTo(
            m_currentPoint + segment.targetPoint);
        break;
    case PathSegLineToHorizontalAbs:
        emitLineTo(
            FloatPoint(segment.targetPoint.x(), m_currentPoint.y()));
        break;
    case PathSegLineToHorizontalRel:
        emitLineTo(
            m_currentPoint + FloatSize(segment.targetPoint.x(), 0));
        break;
    case PathSegLineToVerticalAbs:
        emitLineTo(
            FloatPoint(m_currentPoint.x(), segment.targetPoint.y()));
        break;
    case PathSegLineToVerticalRel:
        emitLineTo(
            m_currentPoint + FloatSize(0, segment.targetPoint.y()));
        break;
    case PathSegCurveToQuadraticAbs:
        emitQuadTo(
            segment.point1,
            segment.targetPoint);
        break;
    case PathSegCurveToQuadraticRel:
        emitQuadTo(
            m_currentPoint + segment.point1,
            m_currentPoint + segment.targetPoint);
        break;
    case PathSegCurveToQuadraticSmoothAbs:
        emitSmoothQuadTo(
            segment.targetPoint);
        break;
    case PathSegCurveToQuadraticSmoothRel:
        emitSmoothQuadTo(
            m_currentPoint + segment.targetPoint);
        break;
    case PathSegCurveToCubicAbs:
        emitCubicTo(
            segment.point1,
            segment.point2,
            segment.targetPoint);
        break;
    case PathSegCurveToCubicRel:
        emitCubicTo(
            m_currentPoint + segment.point1,
            m_currentPoint + segment.point2,
            m_currentPoint + segment.targetPoint);
        break;
    case PathSegCurveToCubicSmoothAbs:
        emitSmoothCubicTo(
            segment.point2,
            segment.targetPoint);
        break;
    case PathSegCurveToCubicSmoothRel:
        emitSmoothCubicTo(
            m_currentPoint + segment.point2,
            m_currentPoint + segment.targetPoint);
        break;
    case PathSegArcAbs:
        emitArcTo(
            segment.targetPoint,
            toFloatSize(segment.arcRadii()),
            segment.arcAngle(),
            segment.largeArcFlag(),
            segment.sweepFlag());
        break;
    case PathSegArcRel:
        emitArcTo(
            m_currentPoint + segment.targetPoint,
            toFloatSize(segment.arcRadii()),
            segment.arcAngle(),
            segment.largeArcFlag(),
            segment.sweepFlag());
        break;
    default:
        ASSERT_NOT_REACHED();
    }

    m_lastCommand = segment.command;
}