j->setColumnWidth (0, 450);
j->setColumnWidth (1, 50);
j->setColumnWidth (2, 55);
j->setColumnWidth (3, 320);
j->setColumnWidth (4, 310);
j
->setHorizontalHeaderLabels
(QString ("Sub-tasks;Time alloted;% complete;What's pending?;Reasons for the lag").
split(";"));
for (int i = 0; i < 1000; i++)
{
p[i].addItem ("20");
p[i].addItem ("30");
p[i].addItem ("40");
}
for (int i = 0; i < 1000; i++)
j->setCellWidget (i, 1, &p[i]);
for (int i = 0; i < 1000; i++)
{
p1[i].addItem ("0");
p1[i].addItem ("10");
p1[i].addItem ("20");
p1[i].addItem ("30");
p1[i].addItem ("40");
p1[i].addItem ("50");
p1[i].addItem ("60");
p1[i].addItem ("70");
p1[i].addItem ("80");
p1[i].addItem ("90");
p1[i].addItem ("100");
}
for (int i = 0; i < 1000; i++)
j->setCellWidget (i, 2, &p1[i]);
QTableWidget *j = new QTableWidget (1000, 5, centralWidget);
j->setColumnWidth (0, 450);
j->setColumnWidth (1, 50);
j->setColumnWidth (2, 55);
j->setColumnWidth (3, 320);
j->setColumnWidth (4, 310);
j->setHorizontalHeaderLabels (QString ("Sub-tasks;Time alloted;% complete;What's pending?;Reasons for the lag").split(";"));
QComboBox *p = new QComboBox [1000];
for (int i = 0; i < 1000; i++)
{
p[i].addItem ("20");
p[i].addItem ("30");
p[i].addItem ("40");
}
for (int i = 0; i < 1000; i++)
j->setCellWidget (i, 1, &p[i]);
QComboBox *p1 = new QComboBox [1000];
for (int i = 0; i < 1000; i++)
{
p1[i].addItem ("0");
p1[i].addItem ("10");
p1[i].addItem ("20");
p1[i].addItem ("30");
p1[i].addItem ("40");
p1[i].addItem ("50");
p1[i].addItem ("60");
p1[i].addItem ("70");
p1[i].addItem ("80");
p1[i].addItem ("90");
p1[i].addItem ("100");
}
for (int i = 0; i < 1000; i++)
j->setCellWidget (i, 2, &p1[i]);
To copy to clipboard, switch view to plain text mode
Bookmarks