##// 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>
@@ -44,13 +44,19 MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), m_Ui(new Ui::Main
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();
@@ -33,12 +33,57
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>
@@ -52,18 +97,82
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>
@@ -78,13 +187,22
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