Line data Source code
1 : // DUNE DAQ modification notice:
2 : // This file has been modified from the original ATLAS dbe source for the DUNE DAQ project.
3 : // Fork baseline commit: dbe-02-12-17 (2022-05-12).
4 : // Renamed since fork: yes (from src/SchemaEditor/SchemaTab.cpp to apps/SchemaEditor/SchemaTab.cpp).
5 :
6 : /// Including QT Headers
7 : #include <QVBoxLayout>
8 : /// Including Schema Editor
9 : #include "dbe/SchemaTab.hpp"
10 :
11 0 : dbse::SchemaTab::SchemaTab ( QWidget * parent )
12 0 : : QWidget ( parent )
13 : {
14 : /// Generating view/schema
15 0 : GraphView = new QGraphicsView();
16 0 : GraphScene = new SchemaGraphicsScene(this);
17 0 : GraphView->setScene ( GraphScene );
18 0 : GraphView->centerOn ( 0, 0 );
19 : /// Adjusting layout
20 0 : QVBoxLayout * TabLayout = new QVBoxLayout ( this );
21 0 : TabLayout->addWidget ( GraphView );
22 0 : }
23 :
24 0 : dbse::SchemaGraphicsScene * dbse::SchemaTab::GetScene() const
25 : {
26 0 : return GraphScene;
27 : }
28 :
29 0 : QGraphicsView * dbse::SchemaTab::GetView() const
30 : {
31 0 : return GraphView;
32 : }
33 :
34 0 : void dbse::SchemaTab::setName(const QString& name) {
35 0 : m_name = name;
36 0 : }
37 :
38 0 : void dbse::SchemaTab::setFileName(const QString& name) {
39 0 : m_file_name = name;
40 0 : }
41 :
42 0 : QString dbse::SchemaTab::getFileName() {
43 0 : if (m_file_name == "") {
44 0 : QString fn = "./";
45 0 : fn.append(m_name);
46 : //fn.append(".view");
47 : return fn;
48 0 : }
49 : else {
50 0 : return m_file_name;
51 : }
52 : }
53 :
54 0 : dbse::SchemaTab::~SchemaTab() = default;
|