Mercurial > hg > svgui
comparison widgets/ModelDataTableDialog.cpp @ 398:80e279e4f9fe
* Add more data-editor support to various models
author | Chris Cannam |
---|---|
date | Thu, 12 Jun 2008 14:33:45 +0000 |
parents | 2c59b0cd176b |
children | 80c7dd3c8dce |
comparison
equal
deleted
inserted
replaced
397:2c59b0cd176b | 398:80e279e4f9fe |
---|---|
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 #include "data/model/TabularModel.h" |
20 #include "data/model/Model.h" | |
20 | 21 |
21 #include "CommandHistory.h" | 22 #include "CommandHistory.h" |
22 | 23 |
23 #include <QTableView> | 24 #include <QTableView> |
24 #include <QGridLayout> | 25 #include <QGridLayout> |
28 #include <QApplication> | 29 #include <QApplication> |
29 #include <QDesktopWidget> | 30 #include <QDesktopWidget> |
30 | 31 |
31 #include <iostream> | 32 #include <iostream> |
32 | 33 |
33 ModelDataTableDialog::ModelDataTableDialog(TabularModel *model, QWidget *parent) : | 34 ModelDataTableDialog::ModelDataTableDialog(TabularModel *model, QString title, QWidget *parent) : |
34 QMainWindow(parent) | 35 QMainWindow(parent) |
35 { | 36 { |
36 setWindowTitle(tr("Data Editor")); | 37 setWindowTitle(tr("Data Editor")); |
37 | 38 |
38 QToolBar *toolbar = addToolBar(tr("Toolbar")); | 39 QToolBar *toolbar = addToolBar(tr("Toolbar")); |
43 | 44 |
44 QGridLayout *grid = new QGridLayout; | 45 QGridLayout *grid = new QGridLayout; |
45 mainFrame->setLayout(grid); | 46 mainFrame->setLayout(grid); |
46 | 47 |
47 QGroupBox *box = new QGroupBox; | 48 QGroupBox *box = new QGroupBox; |
48 box->setTitle(tr("Layer Data")); | 49 if (title != "") { |
50 box->setTitle(title); | |
51 } else { | |
52 box->setTitle(tr("Data in Layer")); | |
53 } | |
49 grid->addWidget(box, 0, 0); | 54 grid->addWidget(box, 0, 0); |
50 grid->setRowStretch(0, 15); | 55 grid->setRowStretch(0, 15); |
51 | 56 |
52 QGridLayout *subgrid = new QGridLayout; | 57 QGridLayout *subgrid = new QGridLayout; |
53 box->setLayout(subgrid); | 58 box->setLayout(subgrid); |