Skip to content

Instantly share code, notes, and snippets.

@dacresni
Created August 1, 2012 16:53
Show Gist options
  • Save dacresni/3228695 to your computer and use it in GitHub Desktop.
Save dacresni/3228695 to your computer and use it in GitHub Desktop.
this qt code crashes
void MainWindow::on_actionAddTable_triggered()
{
//add table
QTableWidget* newTable = new QTableWidget( 3, 3);
newTable->setHorizontalHeaderLabels(QStringList()<<"1"<<"2"<<"3");
newTable->setVerticalHeaderLabels(QStringList()<<"A"<<"B"<<"C");
qDebug() <<" table labled";
// row mod(26) = letter
QWidget * thisPage = pageStack->currentWidget();
QGraphicsView * thePage = dynamic_cast<QGraphicsView*>(thisPage);
QGraphicsScene * thisScene = thePage->scene();
qDebug() << "scene aquired ";
QFocusFrame * tableProxy = new QFocusFrame(newTable);
qDebug() << "new frame";
thisScene->addWidget( newTable);
qDebug() <<"table added";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment