You can simply add them as you would with any other control. I used Qt Designer to create the following:
class MyForm: public QMainWindow { private: QGraphicsView *graphicsView; QLineEdit *lineEdit; QPushButton *pushButton; QPushButton *pushButton_2; public: MyForm() { graphicsView = new QGraphicsView(this); graphicsView->setObjectName(QString::fromUtf8("graphicsView")); graphicsView->setGeometry(QRect(130, 90, 441, 191)); lineEdit = new QLineEdit(graphicsView); lineEdit->setObjectName(QString::fromUtf8("lineEdit")); lineEdit->setGeometry(QRect(160, 150, 113, 22)); pushButton = new QPushButton(graphicsView); pushButton->setObjectName(QString::fromUtf8("pushButton")); pushButton->setGeometry(QRect(280, 140, 115, 32)); pushButton_2 = new QPushButton(graphicsView); pushButton_2->setObjectName(QString::fromUtf8("pushButton_2")); pushButton_2->setGeometry(QRect(400, 140, 115, 32)); } };
source share