Mercurial > hg > svgui
comparison widgets/ModelDataTableDialog.cpp @ 395:33c2f268c950
* reorganise tabular data editor model support
author | Chris Cannam |
---|---|
date | Wed, 11 Jun 2008 16:13:25 +0000 |
parents | 592d692b4f8b |
children | 2669267fb7ea |
comparison
equal
deleted
inserted
replaced
394:592d692b4f8b | 395:33c2f268c950 |
---|---|
14 */ | 14 */ |
15 | 15 |
16 #include "ModelDataTableDialog.h" | 16 #include "ModelDataTableDialog.h" |
17 | 17 |
18 #include "data/model/ModelDataTableModel.h" | 18 #include "data/model/ModelDataTableModel.h" |
19 #include "data/model/TabularModel.h" | |
19 | 20 |
20 #include "CommandHistory.h" | 21 #include "CommandHistory.h" |
21 | 22 |
22 #include <QTableView> | 23 #include <QTableView> |
23 #include <QGridLayout> | 24 #include <QGridLayout> |
27 #include <QApplication> | 28 #include <QApplication> |
28 #include <QDesktopWidget> | 29 #include <QDesktopWidget> |
29 | 30 |
30 #include <iostream> | 31 #include <iostream> |
31 | 32 |
32 ModelDataTableDialog::ModelDataTableDialog(Model *model, QWidget *parent) : | 33 ModelDataTableDialog::ModelDataTableDialog(TabularModel *model, QWidget *parent) : |
33 QDialog(parent) | 34 QDialog(parent) |
34 { | 35 { |
35 setWindowTitle(tr("Data Editor")); | 36 setWindowTitle(tr("Data Editor")); |
36 | 37 |
37 QGridLayout *grid = new QGridLayout; | 38 QGridLayout *grid = new QGridLayout; |
52 subgrid->addWidget(m_tableView); | 53 subgrid->addWidget(m_tableView); |
53 | 54 |
54 m_tableView->verticalHeader()->hide(); | 55 m_tableView->verticalHeader()->hide(); |
55 // m_tableView->horizontalHeader()->setResizeMode(QHeaderView::ResizeToContents); | 56 // m_tableView->horizontalHeader()->setResizeMode(QHeaderView::ResizeToContents); |
56 // m_tableView->setShowGrid(false); | 57 // m_tableView->setShowGrid(false); |
57 // m_tableView->setSortingEnabled(true); | 58 m_tableView->setSortingEnabled(true); |
58 | 59 |
59 m_table = new ModelDataTableModel(model); | 60 m_table = new ModelDataTableModel(model); |
60 m_tableView->setModel(m_table); | 61 m_tableView->setModel(m_table); |
61 | 62 |
62 connect(m_tableView, SIGNAL(clicked(const QModelIndex &)), | 63 connect(m_tableView, SIGNAL(clicked(const QModelIndex &)), |