示例#1
0
int
main(int argc, char * argv[])
{
    QApplication app(argc,argv);
    ShapeWidget shape;
    shape.show();
    return app.exec();
}
示例#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;
}