##// END OF EJS Templates
Add button on the SidePane widgets to open left or right inspectors
perrinel -
r101:9678ebc27091
parent child
Show More
1 NO CONTENT: new file 100755, binary diff hidden
@@ -0,0 +1,5
1 <RCC>
2 <qresource prefix="/">
3 <file>icones/openInspector.png</file>
4 </qresource>
5 </RCC>
@@ -1,60 +1,65
1 1 /*------------------------------------------------------------------------------
2 2 -- This file is a part of the SciQLop Software
3 3 -- Copyright (C) 2017, Plasma Physics Laboratory - CNRS
4 4 --
5 5 -- This program is free software; you can redistribute it and/or modify
6 6 -- it under the terms of the GNU General Public License as published by
7 7 -- the Free Software Foundation; either version 2 of the License, or
8 8 -- (at your option) any later version.
9 9 --
10 10 -- This program is distributed in the hope that it will be useful,
11 11 -- but WITHOUT ANY WARRANTY; without even the implied warranty of
12 12 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 13 -- GNU General Public License for more details.
14 14 --
15 15 -- You should have received a copy of the GNU General Public License
16 16 -- along with this program; if not, write to the Free Software
17 17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 18 -------------------------------------------------------------------------------*/
19 19 /*-- Author : Alexis Jeandet
20 20 -- Mail : alexis.jeandet@member.fsf.org
21 21 ----------------------------------------------------------------------------*/
22 22 #ifndef SCIQLOP_MAINWINDOW_H
23 23 #define SCIQLOP_MAINWINDOW_H
24 24
25 25 #include <QListWidgetItem>
26 #include <QLoggingCategory>
26 27 #include <QMainWindow>
27 28 #include <QProgressBar>
28 29 #include <QProgressDialog>
29 30 #include <QThread>
30 31 #include <QVBoxLayout>
31 32 #include <QWidget>
32 //#include "../Core/qlopservice.h"
33 //#include "../Core/qlopgui.h"
33
34 #include <Common/spimpl.h>
34 35
35 36 #include <memory>
36 37
38 Q_DECLARE_LOGGING_CATEGORY(LOG_MainWindow)
39
37 40 namespace Ui {
38 41 class MainWindow;
39 42 } // namespace Ui
40 43
41 44
42 45 class MainWindow : public QMainWindow {
43 46 Q_OBJECT
44 47
45 48 public:
46 49 explicit MainWindow(QWidget *parent = 0);
47 50 virtual ~MainWindow();
48 51 public slots:
49 52
50 53 protected:
51 54 void changeEvent(QEvent *e);
52 55
53 56 private:
54 57 std::unique_ptr<Ui::MainWindow> m_Ui;
55 58 // QWidget *m_progressWidget;
56 59 // QVBoxLayout *m_progressLayout;
57 60 // QList<QLopService*> m_qlopServices;
61 class MainWindowPrivate;
62 spimpl::unique_impl_ptr<MainWindowPrivate> impl;
58 63 };
59 64
60 65 #endif // SCIQLOP_MAINWINDOW_H
@@ -1,128 +1,212
1 1 /*------------------------------------------------------------------------------
2 2 -- This file is a part of the SciQLop Software
3 3 -- Copyright (C) 2017, Plasma Physics Laboratory - CNRS
4 4 --
5 5 -- This program is free software; you can redistribute it and/or modify
6 6 -- it under the terms of the GNU General Public License as published by
7 7 -- the Free Software Foundation; either version 2 of the License, or
8 8 -- (at your option) any later version.
9 9 --
10 10 -- This program is distributed in the hope that it will be useful,
11 11 -- but WITHOUT ANY WARRANTY; without even the implied warranty of
12 12 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 13 -- GNU General Public License for more details.
14 14 --
15 15 -- You should have received a copy of the GNU General Public License
16 16 -- along with this program; if not, write to the Free Software
17 17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 18 -------------------------------------------------------------------------------*/
19 19 /*-- Author : Alexis Jeandet
20 20 -- Mail : alexis.jeandet@member.fsf.org
21 21 ----------------------------------------------------------------------------*/
22 22 #include "MainWindow.h"
23 23 #include "ui_MainWindow.h"
24 24
25 25 #include <DataSource/DataSourceController.h>
26 26 #include <DataSource/DataSourceWidget.h>
27 #include <SidePane/SqpSidePane.h>
27 28 #include <SqpApplication.h>
28 29
29 30 #include <QAction>
30 31 #include <QDate>
31 32 #include <QDateTime>
32 33 #include <QDir>
33 34 #include <QFileDialog>
35 #include <QToolBar>
36 #include <memory.h>
37
34 38 //#include <omp.h>
35 39 //#include <network/filedownloader.h>
36 40 //#include <qlopdatabase.h>
37 41 //#include <qlopsettings.h>
38 42 //#include <qlopgui.h>
39 43 //#include <spacedata.h>
40 44 //#include "qlopcore.h"
41 45 //#include "qlopcodecmanager.h"
42 46 //#include "cdfcodec.h"
43 47 //#include "amdatxtcodec.h"
44 48 //#include <qlopplotmanager.h>
45 #include <QAction>
46 #include <QToolBar>
47 #include <memory.h>
48 MainWindow::MainWindow(QWidget *parent) : QMainWindow{parent}, m_Ui{new Ui::MainWindow}
49
50 #include "iostream"
51
52 Q_LOGGING_CATEGORY(LOG_MainWindow, "MainWindow")
53
54 class MainWindow::MainWindowPrivate {
55 public:
56 QSize m_LastOpenLeftInspectorSize;
57 QSize m_LastOpenRightInspectorSize;
58 };
59
60 MainWindow::MainWindow(QWidget *parent)
61 : QMainWindow{parent},
62 m_Ui{new Ui::MainWindow},
63 impl{spimpl::make_unique_impl<MainWindowPrivate>()}
49 64 {
50 65 m_Ui->setupUi(this);
51 66
52 auto leftSidePane = m_Ui->leftInspectorSidePane->sidePane();
53 leftSidePane->addAction("ACTION L1");
54 leftSidePane->addAction("ACTION L2");
55 leftSidePane->addAction("ACTION L3");
67
68 m_Ui->splitter->setCollapsible(1, false);
69 m_Ui->splitter->setCollapsible(3, false);
70 // Lambda that defines what's happened when clicking on the leftSidePaneInspector open button
71 auto openLeftInspector = [&](bool checked) {
72
73 // Update of the last opened geometry
74 if (checked) {
75 impl->m_LastOpenLeftInspectorSize = m_Ui->leftMainInspectorWidget->size();
76 }
77
78 auto startSize = impl->m_LastOpenLeftInspectorSize;
79 auto endSize = startSize;
80 endSize.setWidth(0);
81
82 QList<int> currentSizes = m_Ui->splitter->sizes();
83 if (checked) {
84 // adjust sizes individually here, e.g.
85 currentSizes[0] -= impl->m_LastOpenLeftInspectorSize.width();
86 currentSizes[2] += impl->m_LastOpenLeftInspectorSize.width();
87 m_Ui->splitter->setSizes(currentSizes);
88 }
89 else {
90 // adjust sizes individually here, e.g.
91 currentSizes[0] += impl->m_LastOpenLeftInspectorSize.width();
92 currentSizes[2] -= impl->m_LastOpenLeftInspectorSize.width();
93 m_Ui->splitter->setSizes(currentSizes);
94 }
95
96 };
97
98 // Lambda that defines what's happened when clicking on the SidePaneInspector open button
99 auto openRightInspector = [&](bool checked) {
100
101 // Update of the last opened geometry
102 if (checked) {
103 impl->m_LastOpenRightInspectorSize = m_Ui->rightMainInspectorWidget->size();
104 }
105
106 auto startSize = impl->m_LastOpenRightInspectorSize;
107 auto endSize = startSize;
108 endSize.setWidth(0);
109
110 QList<int> currentSizes = m_Ui->splitter->sizes();
111 if (checked) {
112 // adjust sizes individually here, e.g.
113 currentSizes[4] -= impl->m_LastOpenRightInspectorSize.width();
114 currentSizes[2] += impl->m_LastOpenRightInspectorSize.width();
115 m_Ui->splitter->setSizes(currentSizes);
116 }
117 else {
118 // adjust sizes individually here, e.g.
119 currentSizes[4] += impl->m_LastOpenRightInspectorSize.width();
120 currentSizes[2] -= impl->m_LastOpenRightInspectorSize.width();
121 m_Ui->splitter->setSizes(currentSizes);
122 }
123
124 };
125
126
127 QToolBar *leftSidePane = m_Ui->leftInspectorSidePane->sidePane();
128 auto openLeftInspectorAction = leftSidePane->addAction(
129 QIcon{
130 ":/icones/openInspector.png",
131 },
132 "ACTION L1", openLeftInspector);
133
134 openLeftInspectorAction->setCheckable(true);
56 135
57 136 auto rightSidePane = m_Ui->rightInspectorSidePane->sidePane();
58 rightSidePane->addAction("ACTION R1");
59 rightSidePane->addAction("ACTION R2");
60 rightSidePane->addAction("ACTION R3");
137 auto openRightInspectorAction = rightSidePane->addAction(
138 QIcon{
139 ":/icones/openInspector.png",
140 },
141 "ACTION L1", openRightInspector);
142
143 openRightInspectorAction->setCheckable(true);
144
61 145
62 146 this->menuBar()->addAction("File");
63 147 auto mainToolBar = this->addToolBar("MainToolBar");
64 148 mainToolBar->addAction("A1");
65 149
66 150 // Widgets / controllers connections
67 151 connect(&sqpApp->dataSourceController(), SIGNAL(dataSourceItemSet(DataSourceItem *)),
68 152 m_Ui->dataSourceWidget, SLOT(addDataSource(DataSourceItem *)));
69 153
70 154 /* QLopGUI::registerMenuBar(menuBar());
71 155 this->setWindowIcon(QIcon(":/sciqlopLOGO.svg"));
72 156 this->m_progressWidget = new QWidget();
73 157 this->m_progressLayout = new QVBoxLayout(this->m_progressWidget);
74 158 this->m_progressWidget->setLayout(this->m_progressLayout);
75 159 this->m_progressWidget->setWindowModality(Qt::WindowModal);
76 160 m_progressThreadIds = (int*) malloc(OMP_THREADS*sizeof(int));
77 161 for(int i=0;i<OMP_THREADS;i++)
78 162 {
79 163 this->m_progress.append(new QProgressBar(this->m_progressWidget));
80 164 this->m_progress.last()->setMinimum(0);
81 165 this->m_progress.last()->setMaximum(100);
82 166 this->m_progressLayout->addWidget(this->m_progress.last());
83 167 this->m_progressWidget->hide();
84 168 this->m_progressThreadIds[i] = -1;
85 169 }
86 170 this->m_progressWidget->setWindowTitle("Loading File");
87 171 const QList<QLopService*>ServicesToLoad=QList<QLopService*>()
88 172 << QLopCore::self()
89 173 << QLopPlotManager::self()
90 174 << QLopCodecManager::self()
91 175 << FileDownloader::self()
92 176 << QLopDataBase::self()
93 177 << SpaceData::self();
94 178
95 179 CDFCodec::registerToManager();
96 180 AMDATXTCodec::registerToManager();
97 181
98 182
99 183 for(int i=0;i<ServicesToLoad.count();i++)
100 184 {
101 185 qDebug()<<ServicesToLoad.at(i)->serviceName();
102 186 ServicesToLoad.at(i)->initialize(); //must be called before getGUI
103 187 QDockWidget* wdgt=ServicesToLoad.at(i)->getGUI();
104 188 if(wdgt)
105 189 {
106 190 wdgt->setAllowedAreas(Qt::AllDockWidgetAreas);
107 191 this->addDockWidget(Qt::TopDockWidgetArea,wdgt);
108 192 }
109 193 PythonQt::self()->getMainModule().addObject(ServicesToLoad.at(i)->serviceName(),(QObject*)ServicesToLoad.at(i));
110 194 }*/
111 195 }
112 196
113 197 MainWindow::~MainWindow()
114 198 {
115 199 }
116 200
117 201
118 202 void MainWindow::changeEvent(QEvent *e)
119 203 {
120 204 QMainWindow::changeEvent(e);
121 205 switch (e->type()) {
122 206 case QEvent::LanguageChange:
123 207 m_Ui->retranslateUi(this);
124 208 break;
125 209 default:
126 210 break;
127 211 }
128 212 }
@@ -1,214 +1,158
1 1 <?xml version="1.0" encoding="UTF-8"?>
2 2 <ui version="4.0">
3 3 <class>MainWindow</class>
4 4 <widget class="QMainWindow" name="MainWindow">
5 5 <property name="geometry">
6 6 <rect>
7 7 <x>0</x>
8 8 <y>0</y>
9 9 <width>800</width>
10 10 <height>600</height>
11 11 </rect>
12 12 </property>
13 13 <property name="windowTitle">
14 14 <string>QLop</string>
15 15 </property>
16 16 <property name="dockNestingEnabled">
17 17 <bool>true</bool>
18 18 </property>
19 19 <widget class="QWidget" name="centralWidget">
20 20 <property name="enabled">
21 21 <bool>true</bool>
22 22 </property>
23 23 <property name="sizePolicy">
24 24 <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
25 25 <horstretch>0</horstretch>
26 26 <verstretch>0</verstretch>
27 27 </sizepolicy>
28 28 </property>
29 29 <property name="maximumSize">
30 30 <size>
31 31 <width>16777215</width>
32 32 <height>16777215</height>
33 33 </size>
34 34 </property>
35 35 <layout class="QHBoxLayout" name="horizontalLayout">
36 36 <property name="spacing">
37 <number>3</number>
37 <number>0</number>
38 38 </property>
39 39 <property name="leftMargin">
40 40 <number>0</number>
41 41 </property>
42 42 <property name="topMargin">
43 43 <number>0</number>
44 44 </property>
45 45 <property name="rightMargin">
46 46 <number>0</number>
47 47 </property>
48 48 <property name="bottomMargin">
49 49 <number>0</number>
50 50 </property>
51 51 <item>
52 <widget class="QWidget" name="leftInspectorWidget" native="true">
53 <layout class="QHBoxLayout" name="horizontalLayout_2">
54 <property name="spacing">
55 <number>3</number>
56 </property>
57 <property name="leftMargin">
58 <number>0</number>
59 </property>
60 <property name="topMargin">
61 <number>0</number>
62 </property>
63 <property name="rightMargin">
64 <number>0</number>
65 </property>
66 <property name="bottomMargin">
67 <number>0</number>
68 </property>
69 <item>
70 <widget class="QWidget" name="widget" native="true">
71 <layout class="QVBoxLayout" name="verticalLayout">
72 <property name="spacing">
73 <number>3</number>
74 </property>
75 <property name="leftMargin">
76 <number>0</number>
77 </property>
78 <property name="topMargin">
79 <number>0</number>
80 </property>
81 <property name="rightMargin">
82 <number>0</number>
83 </property>
84 <property name="bottomMargin">
85 <number>0</number>
86 </property>
87 <item>
88 <widget class="DataSourceWidget" name="dataSourceWidget" native="true"/>
89 </item>
90 <item>
91 <widget class="QWidget" name="dateTimeWidget" native="true"/>
92 </item>
93 <item>
94 <widget class="QWidget" name="variableInspectorWidget" native="true"/>
95 </item>
96 </layout>
97 </widget>
98 </item>
99 <item>
100 <widget class="SqpSidePane" name="leftInspectorSidePane" native="true">
101 <layout class="QVBoxLayout" name="verticalLayout_2">
102 <property name="spacing">
103 <number>3</number>
104 </property>
105 <property name="leftMargin">
106 <number>0</number>
107 </property>
108 <property name="topMargin">
109 <number>0</number>
110 </property>
111 <property name="rightMargin">
112 <number>0</number>
113 </property>
114 <property name="bottomMargin">
115 <number>0</number>
116 </property>
117 </layout>
118 </widget>
119 </item>
120 </layout>
121 </widget>
122 </item>
123 <item>
124 <widget class="VisualizationWidget" name="view" native="true"/>
125 </item>
126 <item>
127 <widget class="QWidget" name="rightInspectorWidget" native="true">
128 <layout class="QHBoxLayout" name="horizontalLayout_3">
129 <property name="spacing">
130 <number>3</number>
131 </property>
132 <property name="leftMargin">
133 <number>0</number>
134 </property>
135 <property name="topMargin">
136 <number>0</number>
137 </property>
138 <property name="rightMargin">
139 <number>0</number>
140 </property>
141 <property name="bottomMargin">
142 <number>0</number>
52 <widget class="QSplitter" name="splitter">
53 <property name="orientation">
54 <enum>Qt::Horizontal</enum>
55 </property>
56 <widget class="QWidget" name="leftMainInspectorWidget" native="true">
57 <layout class="QVBoxLayout" name="verticalLayout">
58 <property name="spacing">
59 <number>0</number>
60 </property>
61 <property name="leftMargin">
62 <number>0</number>
63 </property>
64 <property name="topMargin">
65 <number>0</number>
66 </property>
67 <property name="rightMargin">
68 <number>0</number>
69 </property>
70 <property name="bottomMargin">
71 <number>0</number>
72 </property>
73 <item>
74 <widget class="DataSourceWidget" name="dataSourceWidget" native="true"/>
75 </item>
76 <item>
77 <widget class="QWidget" name="dateTimeWidget" native="true"/>
78 </item>
79 <item>
80 <widget class="QWidget" name="variableInspectorWidget" native="true"/>
81 </item>
82 </layout>
83 </widget>
84 <widget class="SqpSidePane" name="leftInspectorSidePane" native="true"/>
85 <widget class="VisualizationWidget" name="view" native="true">
86 <property name="sizePolicy">
87 <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
88 <horstretch>0</horstretch>
89 <verstretch>0</verstretch>
90 </sizepolicy>
143 91 </property>
144 <item>
145 <widget class="SqpSidePane" name="rightInspectorSidePane" native="true"/>
146 </item>
147 <item>
148 <widget class="QWidget" name="widget_2" native="true">
149 <layout class="QVBoxLayout" name="verticalLayout_3">
150 <property name="spacing">
151 <number>3</number>
152 </property>
153 <property name="leftMargin">
154 <number>0</number>
155 </property>
156 <property name="topMargin">
157 <number>0</number>
158 </property>
159 <property name="rightMargin">
160 <number>0</number>
161 </property>
162 <property name="bottomMargin">
163 <number>0</number>
164 </property>
165 <item>
166 <widget class="QWidget" name="commonPropertyInspectorWidget" native="true"/>
167 </item>
168 <item>
169 <widget class="QWidget" name="catalogWidget" native="true"/>
170 </item>
171 </layout>
172 </widget>
173 </item>
174 </layout>
92 </widget>
93 <widget class="SqpSidePane" name="rightInspectorSidePane" native="true"/>
94 <widget class="QWidget" name="rightMainInspectorWidget" native="true">
95 <layout class="QVBoxLayout" name="verticalLayout_3">
96 <property name="spacing">
97 <number>0</number>
98 </property>
99 <property name="leftMargin">
100 <number>0</number>
101 </property>
102 <property name="topMargin">
103 <number>0</number>
104 </property>
105 <property name="rightMargin">
106 <number>0</number>
107 </property>
108 <property name="bottomMargin">
109 <number>0</number>
110 </property>
111 <item>
112 <widget class="QWidget" name="commonPropertyInspectorWidget" native="true"/>
113 </item>
114 <item>
115 <widget class="DataSourceWidget" name="catalogWidget" native="true"/>
116 </item>
117 </layout>
118 </widget>
175 119 </widget>
176 120 </item>
177 121 </layout>
178 122 </widget>
179 123 <widget class="QMenuBar" name="menuBar">
180 124 <property name="geometry">
181 125 <rect>
182 126 <x>0</x>
183 127 <y>0</y>
184 128 <width>800</width>
185 <height>26</height>
129 <height>28</height>
186 130 </rect>
187 131 </property>
188 132 </widget>
189 133 <widget class="QStatusBar" name="statusBar"/>
190 134 </widget>
191 135 <layoutdefault spacing="6" margin="11"/>
192 136 <customwidgets>
193 137 <customwidget>
194 138 <class>VisualizationWidget</class>
195 139 <extends>QWidget</extends>
196 140 <header location="global">Visualization/VisualizationWidget.h</header>
197 141 <container>1</container>
198 142 </customwidget>
199 143 <customwidget>
200 144 <class>SqpSidePane</class>
201 145 <extends>QWidget</extends>
202 146 <header location="global">SidePane/SqpSidePane.h</header>
203 147 <container>1</container>
204 148 </customwidget>
205 149 <customwidget>
206 150 <class>DataSourceWidget</class>
207 151 <extends>QWidget</extends>
208 152 <header location="global">DataSource/DataSourceWidget.h</header>
209 153 <container>1</container>
210 154 </customwidget>
211 155 </customwidgets>
212 156 <resources/>
213 157 <connections/>
214 158 </ui>
@@ -1,47 +1,54
1 1 #include "SidePane/SqpSidePane.h"
2 2 #include "ui_SqpSidePane.h"
3 3
4 4 #include <QAction>
5 5 #include <QLayout>
6 6 #include <QToolBar>
7 7
8 8 namespace {
9 9 static const QString SQPSIDEPANESTYLESHEET
10 10 = "QToolBar {"
11 11 " background: qlineargradient(x1: 0, y1: 0, x2: 1, y2: 0,"
12 12 " stop: 0.0 #5a5a5a,"
13 13 " stop: 1.0 #414141);"
14 14 " border: none;"
15 15 " border-left: 1px solid #424242;"
16 16 "border-right: 1px solid #393939;"
17 17 " }"
18 18
19 19 " QToolButton {"
20 20 "background: none;"
21 21 "border: none;"
22 22 " }";
23 23 }
24 24
25 25 SqpSidePane::SqpSidePane(QWidget *parent) : QWidget{parent}, ui{new Ui::SqpSidePane}
26 26 {
27 QVBoxLayout *sidePaneLayout = new QVBoxLayout(this);
28 sidePaneLayout->setContentsMargins(0, 0, 0, 0);
29 this->setLayout(sidePaneLayout);
27 // QVBoxLayout *sidePaneLayout = new QVBoxLayout(this);
28 // sidePaneLayout->setContentsMargins(0, 0, 0, 0);
29 // this->setLayout(sidePaneLayout);
30 30
31 31 ui->setupUi(this);
32 m_SidePaneToolbar = new QToolBar(this);
32 m_SidePaneToolbar = new QToolBar();
33 33 m_SidePaneToolbar->setOrientation(Qt::Vertical);
34 sidePaneLayout->addWidget(m_SidePaneToolbar);
34 this->layout()->addWidget(m_SidePaneToolbar);
35 35
36 36 m_SidePaneToolbar->setStyleSheet(SQPSIDEPANESTYLESHEET);
37
38 this->setStyleSheet(
39 " QWidget {"
40 "background: red;"
41
42 "border: 1px;"
43 " }");
37 44 }
38 45
39 46 SqpSidePane::~SqpSidePane()
40 47 {
41 48 delete ui;
42 49 }
43 50
44 51 QToolBar *SqpSidePane::sidePane()
45 52 {
46 53 return m_SidePaneToolbar;
47 54 }
@@ -1,43 +1,43
1 1 #include "Visualization/VisualizationWidget.h"
2 2 #include "Visualization/VisualizationTabWidget.h"
3 3 #include "ui_VisualizationWidget.h"
4 4
5 5 #include <QDebug>
6 6 #include <QToolButton>
7 7
8 8 #include "iostream"
9 9
10 10 Q_LOGGING_CATEGORY(LOG_VisualizationWidget, "VisualizationWidget")
11 11
12 12 VisualizationWidget::VisualizationWidget(QWidget *parent)
13 13 : QWidget{parent}, ui{new Ui::VisualizationWidget}
14 14 {
15 15 ui->setupUi(this);
16 16
17 17 auto addTabViewButton = new QToolButton{ui->tabWidget};
18 18 addTabViewButton->setText(tr("Add View"));
19 19 addTabViewButton->setCursor(Qt::ArrowCursor);
20 20 addTabViewButton->setAutoRaise(true);
21 21 ui->tabWidget->setCornerWidget(addTabViewButton, Qt::TopRightCorner);
22 22
23 auto addTabView = [&](bool checked) {
23 auto addTabView = [&]() {
24 24 auto index = ui->tabWidget->addTab(new VisualizationTabWidget(ui->tabWidget),
25 25 QString("View %1").arg(ui->tabWidget->count() + 1));
26 26 qCInfo(LOG_VisualizationWidget()) << tr("add the tab of index %1").arg(index);
27 27 };
28 28
29 29 auto removeTabView = [&](int index) {
30 30 ui->tabWidget->removeTab(index);
31 31 qCInfo(LOG_VisualizationWidget()) << tr("remove the tab of index %1").arg(index);
32 32 };
33 33
34 34 ui->tabWidget->setTabsClosable(true);
35 35
36 36 connect(addTabViewButton, &QToolButton::clicked, addTabView);
37 37 connect(ui->tabWidget, &QTabWidget::tabCloseRequested, removeTabView);
38 38 }
39 39
40 40 VisualizationWidget::~VisualizationWidget()
41 41 {
42 42 delete ui;
43 43 }
@@ -1,24 +1,42
1 1 <?xml version="1.0" encoding="UTF-8"?>
2 2 <ui version="4.0">
3 3 <class>DataSourceWidget</class>
4 4 <widget class="QWidget" name="DataSourceWidget">
5 5 <property name="geometry">
6 6 <rect>
7 7 <x>0</x>
8 8 <y>0</y>
9 9 <width>400</width>
10 10 <height>300</height>
11 11 </rect>
12 12 </property>
13 13 <property name="windowTitle">
14 14 <string>Data sources</string>
15 15 </property>
16 16 <layout class="QGridLayout" name="gridLayout">
17 <property name="topMargin">
18 <number>0</number>
19 </property>
20 <property name="rightMargin">
21 <number>0</number>
22 </property>
23 <property name="bottomMargin">
24 <number>0</number>
25 </property>
26 <property name="spacing">
27 <number>0</number>
28 </property>
17 29 <item row="0" column="0">
18 <widget class="QTreeWidget" name="treeWidget"/>
30 <widget class="QTreeWidget" name="treeWidget">
31 <column>
32 <property name="text">
33 <string notr="true">1</string>
34 </property>
35 </column>
36 </widget>
19 37 </item>
20 38 </layout>
21 39 </widget>
22 40 <resources/>
23 41 <connections/>
24 42 </ui>
@@ -1,21 +1,42
1 <?xml version="1.0" encoding="UTF-8"?>
1 2 <ui version="4.0">
2 <author/>
3 <comment/>
4 <exportmacro/>
5 3 <class>SqpSidePane</class>
6 <widget name="SqpSidePane" class="QWidget">
4 <widget class="QWidget" name="SqpSidePane">
7 5 <property name="geometry">
8 6 <rect>
9 7 <x>0</x>
10 8 <y>0</y>
11 <width>400</width>
12 <height>300</height>
9 <width>12</width>
10 <height>12</height>
13 11 </rect>
14 12 </property>
13 <property name="maximumSize">
14 <size>
15 <width>45</width>
16 <height>16777215</height>
17 </size>
18 </property>
15 19 <property name="windowTitle">
16 20 <string>Form</string>
17 21 </property>
22 <layout class="QVBoxLayout" name="verticalLayout_2">
23 <property name="spacing">
24 <number>0</number>
25 </property>
26 <property name="leftMargin">
27 <number>0</number>
28 </property>
29 <property name="topMargin">
30 <number>0</number>
31 </property>
32 <property name="rightMargin">
33 <number>0</number>
34 </property>
35 <property name="bottomMargin">
36 <number>0</number>
37 </property>
38 </layout>
18 39 </widget>
19 <pixmapfunction/>
40 <resources/>
20 41 <connections/>
21 42 </ui>
General Comments 0
You need to be logged in to leave comments. Login now