[Interest] Need help
Sujan Dasmahapatra
sdh at lmwindpower.com
Wed May 9 08:31:17 CEST 2012
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...
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20120509/97811e04/attachment.html>
More information about the Interest
mailing list