##// END OF EJS Templates
Creation and styling SidePaneWidget
perrinel -
r57:e3d0d86d21a2
parent child
Show More
@@ -0,0 +1,27
1 #ifndef SCIQLOP_SQPSIDEPANE_H
2 #define SCIQLOP_SQPSIDEPANE_H
3
4 #include <QWidget>
5
6 namespace Ui {
7 class SqpSidePane;
8 } // Ui
9
10 class QToolBar;
11
12 class SqpSidePane : public QWidget {
13 Q_OBJECT
14
15 public:
16 explicit SqpSidePane(QWidget *parent = 0);
17 virtual ~SqpSidePane();
18
19 QToolBar *sidePane();
20
21 private:
22 Ui::SqpSidePane *ui;
23
24 QToolBar *m_SidePaneToolbar;
25 };
26
27 #endif // SCIQLOP_ SQPSIDEPANE_H
@@ -0,0 +1,47
1 #include "sidepane/SqpSidePane.h"
2 #include "ui_SqpSidePane.h"
3
4 #include <QAction>
5 #include <QLayout>
6 #include <QToolBar>
7
8 namespace {
9 static const QString SQPSIDEPANESTYLESHEET
10 = "QToolBar {"
11 " background: qlineargradient(x1: 0, y1: 0, x2: 1, y2: 0,"
12 " stop: 0.0 #5a5a5a,"
13 " stop: 1.0 #414141);"
14 " border: none;"
15 " border-left: 1px solid #424242;"
16 "border-right: 1px solid #393939;"
17 " }"
18
19 " QToolButton {"
20 "background: none;"
21 "border: none;"
22 " }";
23 }
24
25 SqpSidePane::SqpSidePane(QWidget *parent) : QWidget(parent), ui(new Ui::SqpSidePane)
26 {
27 QVBoxLayout *sidePaneLayout = new QVBoxLayout(this);
28 sidePaneLayout->setContentsMargins(0, 0, 0, 0);
29 this->setLayout(sidePaneLayout);
30
31 ui->setupUi(this);
32 m_SidePaneToolbar = new QToolBar(this);
33 m_SidePaneToolbar->setOrientation(Qt::Vertical);
34 sidePaneLayout->addWidget(m_SidePaneToolbar);
35
36 m_SidePaneToolbar->setStyleSheet(SQPSIDEPANESTYLESHEET);
37 }
38
39 SqpSidePane::~SqpSidePane()
40 {
41 delete ui;
42 }
43
44 QToolBar *SqpSidePane::sidePane()
45 {
46 return m_SidePaneToolbar;
47 }
@@ -0,0 +1,21
1 <ui version="4.0">
2 <author/>
3 <comment/>
4 <exportmacro/>
5 <class>SqpSidePane</class>
6 <widget name="SqpSidePane" class="QWidget">
7 <property name="geometry">
8 <rect>
9 <x>0</x>
10 <y>0</y>
11 <width>400</width>
12 <height>300</height>
13 </rect>
14 </property>
15 <property name="windowTitle">
16 <string>Form</string>
17 </property>
18 </widget>
19 <pixmapfunction/>
20 <connections/>
21 </ui>
@@ -1,112 +1,118
1 /*------------------------------------------------------------------------------
1 /*------------------------------------------------------------------------------
2 -- This file is a part of the SciQLop Software
2 -- This file is a part of the SciQLop Software
3 -- Copyright (C) 2017, Plasma Physics Laboratory - CNRS
3 -- Copyright (C) 2017, Plasma Physics Laboratory - CNRS
4 --
4 --
5 -- This program is free software; you can redistribute it and/or modify
5 -- This program is free software; you can redistribute it and/or modify
6 -- it under the terms of the GNU General Public License as published by
6 -- it under the terms of the GNU General Public License as published by
7 -- the Free Software Foundation; either version 2 of the License, or
7 -- the Free Software Foundation; either version 2 of the License, or
8 -- (at your option) any later version.
8 -- (at your option) any later version.
9 --
9 --
10 -- This program is distributed in the hope that it will be useful,
10 -- This program is distributed in the hope that it will be useful,
11 -- but WITHOUT ANY WARRANTY; without even the implied warranty of
11 -- but WITHOUT ANY WARRANTY; without even the implied warranty of
12 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 -- GNU General Public License for more details.
13 -- GNU General Public License for more details.
14 --
14 --
15 -- You should have received a copy of the GNU General Public License
15 -- You should have received a copy of the GNU General Public License
16 -- along with this program; if not, write to the Free Software
16 -- along with this program; if not, write to the Free Software
17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 -------------------------------------------------------------------------------*/
18 -------------------------------------------------------------------------------*/
19 /*-- Author : Alexis Jeandet
19 /*-- Author : Alexis Jeandet
20 -- Mail : alexis.jeandet@member.fsf.org
20 -- Mail : alexis.jeandet@member.fsf.org
21 ----------------------------------------------------------------------------*/
21 ----------------------------------------------------------------------------*/
22 #include "MainWindow.h"
22 #include "MainWindow.h"
23 #include "ui_MainWindow.h"
23 #include "ui_MainWindow.h"
24 #include <QAction>
24 #include <QAction>
25 #include <QDate>
25 #include <QDate>
26 #include <QDateTime>
26 #include <QDateTime>
27 #include <QDir>
27 #include <QDir>
28 #include <QFileDialog>
28 #include <QFileDialog>
29 //#include <omp.h>
29 //#include <omp.h>
30 //#include <network/filedownloader.h>
30 //#include <network/filedownloader.h>
31 //#include <qlopdatabase.h>
31 //#include <qlopdatabase.h>
32 //#include <qlopsettings.h>
32 //#include <qlopsettings.h>
33 //#include <qlopgui.h>
33 //#include <qlopgui.h>
34 //#include <spacedata.h>
34 //#include <spacedata.h>
35 //#include "qlopcore.h"
35 //#include "qlopcore.h"
36 //#include "qlopcodecmanager.h"
36 //#include "qlopcodecmanager.h"
37 //#include "cdfcodec.h"
37 //#include "cdfcodec.h"
38 //#include "amdatxtcodec.h"
38 //#include "amdatxtcodec.h"
39 //#include <qlopplotmanager.h>
39 //#include <qlopplotmanager.h>
40 #include <QAction>
40 #include <QAction>
41 #include <QToolBar>
41 #include <QToolBar>
42 #include <memory.h>
42 #include <memory.h>
43 MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), m_Ui(new Ui::MainWindow)
43 MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), m_Ui(new Ui::MainWindow)
44 {
44 {
45 m_Ui->setupUi(this);
45 m_Ui->setupUi(this);
46
46
47 QToolBar *actionToolbar = new QToolBar(this);
47 auto leftSidePane = m_Ui->leftInspectorSidePane->sidePane();
48 actionToolbar->setOrientation(Qt::Vertical);
48 leftSidePane->addAction("ACTION L1");
49 actionToolbar->addAction("ACTION");
49 leftSidePane->addAction("ACTION L2");
50 actionToolbar->addAction("ACTION 2");
50 leftSidePane->addAction("ACTION L3");
51 actionToolbar->addAction("ACTION 3");
52 m_Ui->leftInspectorSidePane->layout()->addWidget(actionToolbar);
53
51
52 auto rightSidePane = m_Ui->rightInspectorSidePane->sidePane();
53 rightSidePane->addAction("ACTION R1");
54 rightSidePane->addAction("ACTION R2");
55 rightSidePane->addAction("ACTION R3");
56
57 this->menuBar()->addAction("File");
58 auto mainToolBar = this->addToolBar("MainToolBar");
59 mainToolBar->addAction("A1");
54 /* QLopGUI::registerMenuBar(menuBar());
60 /* QLopGUI::registerMenuBar(menuBar());
55 this->setWindowIcon(QIcon(":/sciqlopLOGO.svg"));
61 this->setWindowIcon(QIcon(":/sciqlopLOGO.svg"));
56 this->m_progressWidget = new QWidget();
62 this->m_progressWidget = new QWidget();
57 this->m_progressLayout = new QVBoxLayout(this->m_progressWidget);
63 this->m_progressLayout = new QVBoxLayout(this->m_progressWidget);
58 this->m_progressWidget->setLayout(this->m_progressLayout);
64 this->m_progressWidget->setLayout(this->m_progressLayout);
59 this->m_progressWidget->setWindowModality(Qt::WindowModal);
65 this->m_progressWidget->setWindowModality(Qt::WindowModal);
60 m_progressThreadIds = (int*) malloc(OMP_THREADS*sizeof(int));
66 m_progressThreadIds = (int*) malloc(OMP_THREADS*sizeof(int));
61 for(int i=0;i<OMP_THREADS;i++)
67 for(int i=0;i<OMP_THREADS;i++)
62 {
68 {
63 this->m_progress.append(new QProgressBar(this->m_progressWidget));
69 this->m_progress.append(new QProgressBar(this->m_progressWidget));
64 this->m_progress.last()->setMinimum(0);
70 this->m_progress.last()->setMinimum(0);
65 this->m_progress.last()->setMaximum(100);
71 this->m_progress.last()->setMaximum(100);
66 this->m_progressLayout->addWidget(this->m_progress.last());
72 this->m_progressLayout->addWidget(this->m_progress.last());
67 this->m_progressWidget->hide();
73 this->m_progressWidget->hide();
68 this->m_progressThreadIds[i] = -1;
74 this->m_progressThreadIds[i] = -1;
69 }
75 }
70 this->m_progressWidget->setWindowTitle("Loading File");
76 this->m_progressWidget->setWindowTitle("Loading File");
71 const QList<QLopService*>ServicesToLoad=QList<QLopService*>()
77 const QList<QLopService*>ServicesToLoad=QList<QLopService*>()
72 << QLopCore::self()
78 << QLopCore::self()
73 << QLopPlotManager::self()
79 << QLopPlotManager::self()
74 << QLopCodecManager::self()
80 << QLopCodecManager::self()
75 << FileDownloader::self()
81 << FileDownloader::self()
76 << QLopDataBase::self()
82 << QLopDataBase::self()
77 << SpaceData::self();
83 << SpaceData::self();
78
84
79 CDFCodec::registerToManager();
85 CDFCodec::registerToManager();
80 AMDATXTCodec::registerToManager();
86 AMDATXTCodec::registerToManager();
81
87
82
88
83 for(int i=0;i<ServicesToLoad.count();i++)
89 for(int i=0;i<ServicesToLoad.count();i++)
84 {
90 {
85 qDebug()<<ServicesToLoad.at(i)->serviceName();
91 qDebug()<<ServicesToLoad.at(i)->serviceName();
86 ServicesToLoad.at(i)->initialize(); //must be called before getGUI
92 ServicesToLoad.at(i)->initialize(); //must be called before getGUI
87 QDockWidget* wdgt=ServicesToLoad.at(i)->getGUI();
93 QDockWidget* wdgt=ServicesToLoad.at(i)->getGUI();
88 if(wdgt)
94 if(wdgt)
89 {
95 {
90 wdgt->setAllowedAreas(Qt::AllDockWidgetAreas);
96 wdgt->setAllowedAreas(Qt::AllDockWidgetAreas);
91 this->addDockWidget(Qt::TopDockWidgetArea,wdgt);
97 this->addDockWidget(Qt::TopDockWidgetArea,wdgt);
92 }
98 }
93 PythonQt::self()->getMainModule().addObject(ServicesToLoad.at(i)->serviceName(),(QObject*)ServicesToLoad.at(i));
99 PythonQt::self()->getMainModule().addObject(ServicesToLoad.at(i)->serviceName(),(QObject*)ServicesToLoad.at(i));
94 }*/
100 }*/
95 }
101 }
96
102
97 MainWindow::~MainWindow()
103 MainWindow::~MainWindow()
98 {
104 {
99 }
105 }
100
106
101
107
102 void MainWindow::changeEvent(QEvent *e)
108 void MainWindow::changeEvent(QEvent *e)
103 {
109 {
104 QMainWindow::changeEvent(e);
110 QMainWindow::changeEvent(e);
105 switch (e->type()) {
111 switch (e->type()) {
106 case QEvent::LanguageChange:
112 case QEvent::LanguageChange:
107 m_Ui->retranslateUi(this);
113 m_Ui->retranslateUi(this);
108 break;
114 break;
109 default:
115 default:
110 break;
116 break;
111 }
117 }
112 }
118 }
@@ -1,90 +1,208
1 <?xml version="1.0" encoding="UTF-8"?>
1 <?xml version="1.0" encoding="UTF-8"?>
2 <ui version="4.0">
2 <ui version="4.0">
3 <class>MainWindow</class>
3 <class>MainWindow</class>
4 <widget class="QMainWindow" name="MainWindow">
4 <widget class="QMainWindow" name="MainWindow">
5 <property name="geometry">
5 <property name="geometry">
6 <rect>
6 <rect>
7 <x>0</x>
7 <x>0</x>
8 <y>0</y>
8 <y>0</y>
9 <width>800</width>
9 <width>800</width>
10 <height>600</height>
10 <height>600</height>
11 </rect>
11 </rect>
12 </property>
12 </property>
13 <property name="windowTitle">
13 <property name="windowTitle">
14 <string>QLop</string>
14 <string>QLop</string>
15 </property>
15 </property>
16 <property name="dockNestingEnabled">
16 <property name="dockNestingEnabled">
17 <bool>true</bool>
17 <bool>true</bool>
18 </property>
18 </property>
19 <widget class="QWidget" name="centralWidget">
19 <widget class="QWidget" name="centralWidget">
20 <property name="enabled">
20 <property name="enabled">
21 <bool>true</bool>
21 <bool>true</bool>
22 </property>
22 </property>
23 <property name="sizePolicy">
23 <property name="sizePolicy">
24 <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
24 <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
25 <horstretch>0</horstretch>
25 <horstretch>0</horstretch>
26 <verstretch>0</verstretch>
26 <verstretch>0</verstretch>
27 </sizepolicy>
27 </sizepolicy>
28 </property>
28 </property>
29 <property name="maximumSize">
29 <property name="maximumSize">
30 <size>
30 <size>
31 <width>16777215</width>
31 <width>16777215</width>
32 <height>16777215</height>
32 <height>16777215</height>
33 </size>
33 </size>
34 </property>
34 </property>
35 <layout class="QHBoxLayout" name="horizontalLayout">
35 <layout class="QHBoxLayout" name="horizontalLayout">
36 <property name="spacing">
37 <number>3</number>
38 </property>
39 <property name="leftMargin">
40 <number>0</number>
41 </property>
42 <property name="topMargin">
43 <number>0</number>
44 </property>
45 <property name="rightMargin">
46 <number>0</number>
47 </property>
48 <property name="bottomMargin">
49 <number>0</number>
50 </property>
36 <item>
51 <item>
37 <widget class="QWidget" name="leftInspectorWidget" native="true">
52 <widget class="QWidget" name="leftInspectorWidget" native="true">
38 <layout class="QHBoxLayout" name="horizontalLayout_2">
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>
39 <item>
69 <item>
40 <widget class="QWidget" name="widget" native="true">
70 <widget class="QWidget" name="widget" native="true">
41 <layout class="QVBoxLayout" name="verticalLayout">
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>
42 <item>
87 <item>
43 <widget class="QWidget" name="dateSourceWidget" native="true"/>
88 <widget class="QWidget" name="dateSourceWidget" native="true"/>
44 </item>
89 </item>
45 <item>
90 <item>
46 <widget class="QWidget" name="dateTimeWidget" native="true"/>
91 <widget class="QWidget" name="dateTimeWidget" native="true"/>
47 </item>
92 </item>
48 <item>
93 <item>
49 <widget class="QWidget" name="variableInspectorWidget" native="true"/>
94 <widget class="QWidget" name="variableInspectorWidget" native="true"/>
50 </item>
95 </item>
51 </layout>
96 </layout>
52 </widget>
97 </widget>
53 </item>
98 </item>
54 <item>
99 <item>
55 <widget class="QWidget" name="leftInspectorSidePane" native="true">
100 <widget class="SqpSidePane" name="leftInspectorSidePane" native="true">
56 <layout class="QVBoxLayout" name="verticalLayout_2"/>
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>
57 </widget>
118 </widget>
58 </item>
119 </item>
59 </layout>
120 </layout>
60 </widget>
121 </widget>
61 </item>
122 </item>
62 <item>
123 <item>
63 <widget class="QWidget" name="viewWidget" native="true"/>
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>
143 </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"/>
64 </item>
167 </item>
65 <item>
168 <item>
66 <widget class="QWidget" name="rightInspectorWidget" native="true"/>
169 <widget class="QWidget" name="catalogWidget" native="true"/>
170 </item>
171 </layout>
172 </widget>
173 </item>
174 </layout>
175 </widget>
67 </item>
176 </item>
68 </layout>
177 </layout>
69 </widget>
178 </widget>
70 <widget class="QMenuBar" name="menuBar">
179 <widget class="QMenuBar" name="menuBar">
71 <property name="geometry">
180 <property name="geometry">
72 <rect>
181 <rect>
73 <x>0</x>
182 <x>0</x>
74 <y>0</y>
183 <y>0</y>
75 <width>800</width>
184 <width>800</width>
76 <height>26</height>
185 <height>26</height>
77 </rect>
186 </rect>
78 </property>
187 </property>
79 </widget>
188 </widget>
80 <widget class="QStatusBar" name="statusBar"/>
189 <widget class="QStatusBar" name="statusBar"/>
81 <action name="actionIndex_Viewer">
82 <property name="text">
83 <string>Index Viewer</string>
84 </property>
85 </action>
86 </widget>
190 </widget>
87 <layoutdefault spacing="6" margin="11"/>
191 <layoutdefault spacing="6" margin="11"/>
192 <customwidgets>
193 <customwidget>
194 <class>VisualizationWidget</class>
195 <extends>QWidget</extends>
196 <header location="global">visualization/VisualizationWidget.h</header>
197 <container>1</container>
198 </customwidget>
199 <customwidget>
200 <class>SqpSidePane</class>
201 <extends>QWidget</extends>
202 <header location="global">sidepane/SqpSidePane.h</header>
203 <container>1</container>
204 </customwidget>
205 </customwidgets>
88 <resources/>
206 <resources/>
89 <connections/>
207 <connections/>
90 </ui>
208 </ui>
General Comments 8
Under Review
author

Auto status change to "Under Review"

Approved
author

Status change > Approved

Under Review
author

Pull request updated. Auto status change to "Under Review"

Changed commits:
  * 1 added
  * 0 removed

Changed files:
  * M core/CMakeLists.txt
Approved
author

Status change > Approved

You need to be logged in to leave comments. Login now