int main(int argc, char * argv[]) { QApplication app(argc,argv); ShapeWidget shape; shape.show(); return app.exec(); }
void ShapePropertyWidget::addShape(int &index, qreal &x, const QString &shape, const QString ¤tShape , 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; }