/*!
    Create and return the table used to visualize digital signals.
*/
QTableView* UiDigitalGenerator::createTable()
{
    // Deallocation: "Qt Object trees" (See UiMainWindow)
    QTableView* table = new QTableView(this);

    QItemSelectionModel* m = table->selectionModel();
    if (m != NULL) delete m;
    table->setModel(mSignals);

    // Deallocation: "Qt Object trees" (See UiMainWindow)
    DigitalDelegate* delegate = new DigitalDelegate(this);
    QAbstractItemDelegate* d = table->itemDelegate();
    if (d != NULL) delete d;
    table->setItemDelegate(delegate);

    table->resizeColumnsToContents();
    table->resizeRowsToContents();

    connect(table->selectionModel(),
            SIGNAL(selectionChanged(QItemSelection,QItemSelection)),
            this,
            SLOT(handleSelectionChanged(QItemSelection,QItemSelection)));


    return table;
}