It looks like the crash is occuring in a slot that got called as a result of an item change in the QComboBox. Here's my method for the slot:
void CollectStats::check_lineup(int n)
{
QComboBox *changed_cell
= dynamic_cast<QComboBox
*>
(sender
());
changed_cell->setStyleSheet("QComboBox { background-color: white;font:16pt }");
for (int i=0;i<6;i++)
{
QComboBox *qp
= dynamic_cast<QComboBox
*>
(runOrder
->cellWidget
(0,i
));
if (sender() ==qp) continue;
if (qp->currentIndex()==n)
qp->setStyleSheet("QComboBox { background-color: red; font:16pt }");
else
qp->setStyleSheet("QComboBox { background-color: white; font:16pt }");
}
}
void CollectStats::check_lineup(int n)
{
QComboBox *changed_cell= dynamic_cast<QComboBox *>(sender());
changed_cell->setStyleSheet("QComboBox { background-color: white;font:16pt }");
for (int i=0;i<6;i++)
{
QComboBox *qp = dynamic_cast<QComboBox *>(runOrder->cellWidget(0,i));
if (sender() ==qp) continue;
if (qp->currentIndex()==n)
qp->setStyleSheet("QComboBox { background-color: red; font:16pt }");
else
qp->setStyleSheet("QComboBox { background-color: white; font:16pt }");
}
}
To copy to clipboard, switch view to plain text mode
It looks like it's dying on the
if (qp->currentIndex()==n)
if (qp->currentIndex()==n)
To copy to clipboard, switch view to plain text mode
I'm not sure how to print the stack trace from VS, so here are a couple of screen shots:
stack2.pngstack1.jpg
Thanks for the attention!
Found it,
Should be
for (int i=1;i<7;i++)
In the check_lineup method, after I eliminated the combobox in column 0.
I feel stupid, thanks for your extremely fast replies--it got me pointed in the right direction!
Dave Thomas
Bookmarks