hey there i tried putting in a seperate method as a slot to change the sze of the table but sometimes when i change the size, the program crashes - does anyone know why this happens? it only happens sometimes aswell and other times it works fine... heres my code for the slot below:
{
int tableSize = 0;
bool ok;
tr("Please enter number of nodes needed for network demands:"), 25, 0, 100, 1, &ok);
if(ok)
integerLabel->setText(tr("%1").arg(tableSize));
demands->setRowCount(tableSize);
demands->setColumnCount(tableSize);
}
void DemandsTab::changeSize(QTableWidgetItem *items)
{
int tableSize = 0;
QLabel *integerLabel = new QLabel(this);
bool ok;
tableSize = QInputDialog::getInteger(this, tr("Input box"),
tr("Please enter number of nodes needed for network demands:"), 25, 0, 100, 1, &ok);
if(ok)
integerLabel->setText(tr("%1").arg(tableSize));
demands->setRowCount(tableSize);
demands->setColumnCount(tableSize);
}
To copy to clipboard, switch view to plain text mode
Bookmarks