Esempio n. 1
0
int
main(int argc, char * argv[])
{
    QApplication app(argc,argv);
    ShapeWidget shape;
    shape.show();
    return app.exec();
}
Esempio n. 2
0
void ShapePropertyWidget::addShape(int &index, qreal &x, const QString &shape, const QString &currentShape
                                   , bool &foundCurrentShape)
{
    ShapeWidget *shapeWidget = new ShapeWidget(index, this);
    shapeWidget->setGeometry(x, 0, 0, 0);
    mShapes << shapeWidget;
    shapeWidget->setShape(shape);

    if (!foundCurrentShape && shape == currentShape) {
        shapeWidget->addSelection();
        mSelectedShapeIndex = index;
        foundCurrentShape = true;
    }

    shapeWidget->show();
    connect(shapeWidget, &ShapeWidget::clicked, this, &ShapePropertyWidget::shapeClicked);
    ++index;
    x += 75.0;
}
bool ribi::operator==(const ShapeWidget& lhs,const ShapeWidget& rhs) noexcept
{
  return  lhs.GetGeometry() ==  rhs.GetGeometry()
    &&   *lhs.GetShape()    == *rhs.GetShape();
}