Line data Source code
1 : /// Including QT Headers
2 : #include <QVBoxLayout>
3 : /// Including Schema Editor
4 : #include "dbe/SchemaTab.hpp"
5 :
6 0 : dbse::SchemaTab::SchemaTab ( QWidget * parent )
7 0 : : QWidget ( parent )
8 : {
9 : /// Generating view/schema
10 0 : GraphView = new QGraphicsView();
11 0 : GraphScene = new SchemaGraphicsScene(this);
12 0 : GraphView->setScene ( GraphScene );
13 0 : GraphView->centerOn ( 0, 0 );
14 : /// Adjusting layout
15 0 : QVBoxLayout * TabLayout = new QVBoxLayout ( this );
16 0 : TabLayout->addWidget ( GraphView );
17 0 : }
18 :
19 0 : dbse::SchemaGraphicsScene * dbse::SchemaTab::GetScene() const
20 : {
21 0 : return GraphScene;
22 : }
23 :
24 0 : QGraphicsView * dbse::SchemaTab::GetView() const
25 : {
26 0 : return GraphView;
27 : }
28 :
29 0 : void dbse::SchemaTab::setName(const QString& name) {
30 0 : m_name = name;
31 0 : }
32 :
33 0 : void dbse::SchemaTab::setFileName(const QString& name) {
34 0 : m_file_name = name;
35 0 : }
36 :
37 0 : QString dbse::SchemaTab::getFileName() {
38 0 : if (m_file_name == "") {
39 0 : QString fn = "./";
40 0 : fn.append(m_name);
41 : //fn.append(".view");
42 : return fn;
43 0 : }
44 : else {
45 0 : return m_file_name;
46 : }
47 : }
48 :
49 0 : dbse::SchemaTab::~SchemaTab() = default;
|