Please give me some suggestions I am stuck in this problem. I want to implement a set of QTextEdit in 2 columns and multiple rows. Initially my sheet(QWIdget) will be blank, There will be a button at the top when pressing this button, a QTextEdit should be added on the sheet at row=0, column=0. Then again when button pressed another QTextEdit should be added at row=0, column=1.
Then when again pressed QTextEdit will be added at row=1, column=0 Then when again pressed QTextEdit will be added at row=1, column=1.....and so on. QTextEdit size should be ½ of sheet width and ½ of sheet height. When resizing they should be resized accordingly. Please give me a working code so that I can compile and understand. Thanks a lot for any help. Please see my snippet. CSheet::CSheet(QWidget *parent):QWidget(parent) { addChartPB = new QPushButton("Add chart",this); addChartPB->setGeometry(5,5,100,25); addChartPB->setFixedSize(100,25); connect(addChartPB, SIGNAL(clicked()),this, SLOT(addChart())); addChartPB->show(); canvas = new QWIdget(this); canvas->setGeometry(5,35,width()-10,height()-40); canvas->show(); layoutV = new QVBoxLayout(this); layoutV->addWidget(addChartPB); layout->addWidget(canvas); setLayout(layoutV); gridLayout = new QGridLayout(canvas) canvas->setLayout(gridLayout); } CSheet::addChart() { //I don't know how should I implement the add button Please help... }
_______________________________________________ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest