I’m new to QT. I used following code to add a button in to a QGraphicScene
QGraphicsScene* scene = new QGraphicsScene;
QPushButton *btnuser = new QPushButton();
btnuser->resize(32, 32);
btnuser->setGeometry(QRect(QPoint(50, 50),QSize(32, 32)));
btnuser->setText("1");
btnuser->setAccessibleName("1");
connect(btnuser, SIGNAL( clicked() ), this, SLOT( on_btnProcess_clicked() ) );
scene->addWidget(btnuser);
But in the output there is a rectangle behind the button. How can I remove that?
I solved this problem by setting minimum width and height.
Then I set the same width and height for the button in setGeometry method