##// END OF EJS Templates
Creates the data source widget...
Alexandre Leroux -
r82:8a7c6c676eea
parent child
Show More
@@ -0,0 +1,25
1 #ifndef SCIQLOP_DATASOURCEWIDGET_H
2 #define SCIQLOP_DATASOURCEWIDGET_H
3
4 #include <Common/spimpl.h>
5
6 #include <QWidget>
7
8 class DataSourceItem;
9
10 /**
11 * @brief The DataSourceWidget handles the graphical representation (as a tree) of the data sources
12 * attached to SciQlop.
13 */
14 class DataSourceWidget : public QWidget {
15 Q_OBJECT
16
17 public:
18 explicit DataSourceWidget(QWidget *parent = 0);
19
20 private:
21 class DataSourceWidgetPrivate;
22 spimpl::unique_impl_ptr<DataSourceWidgetPrivate> impl;
23 };
24
25 #endif // SCIQLOP_DATASOURCEWIDGET_H
@@ -0,0 +1,36
1 #include <DataSource/DataSourceWidget.h>
2
3 #include <ui_DataSourceWidget.h>
4
5 #include <DataSource/DataSourceItem.h>
6 #include <DataSource/DataSourceTreeWidgetItem.h>
7
8 namespace {
9
10 /// Number of columns displayed in the tree
11 const auto TREE_NB_COLUMNS = 1;
12
13 /// Header labels for the tree
14 const auto TREE_HEADER_LABELS = QStringList{QObject::tr("Name")};
15
16 } // namespace
17
18 class DataSourceWidget::DataSourceWidgetPrivate {
19 public:
20 explicit DataSourceWidgetPrivate(DataSourceWidget &widget)
21 : m_Ui{std::make_unique<Ui::DataSourceWidget>()}
22 {
23 m_Ui->setupUi(&widget);
24
25 // Set tree properties
26 m_Ui->treeWidget->setColumnCount(TREE_NB_COLUMNS);
27 m_Ui->treeWidget->setHeaderLabels(TREE_HEADER_LABELS);
28 }
29
30 std::unique_ptr<Ui::DataSourceWidget> m_Ui;
31 };
32
33 DataSourceWidget::DataSourceWidget(QWidget *parent)
34 : QWidget{parent}, impl{spimpl::make_unique_impl<DataSourceWidgetPrivate>(*this)}
35 {
36 }
@@ -0,0 +1,24
1 <?xml version="1.0" encoding="UTF-8"?>
2 <ui version="4.0">
3 <class>DataSourceWidget</class>
4 <widget class="QWidget" name="DataSourceWidget">
5 <property name="geometry">
6 <rect>
7 <x>0</x>
8 <y>0</y>
9 <width>400</width>
10 <height>300</height>
11 </rect>
12 </property>
13 <property name="windowTitle">
14 <string>Data sources</string>
15 </property>
16 <layout class="QGridLayout" name="gridLayout">
17 <item row="0" column="0">
18 <widget class="QTreeWidget" name="treeWidget"/>
19 </item>
20 </layout>
21 </widget>
22 <resources/>
23 <connections/>
24 </ui>
@@ -1,208 +1,214
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">
36 <property name="spacing">
37 <number>3</number>
37 <number>3</number>
38 </property>
38 </property>
39 <property name="leftMargin">
39 <property name="leftMargin">
40 <number>0</number>
40 <number>0</number>
41 </property>
41 </property>
42 <property name="topMargin">
42 <property name="topMargin">
43 <number>0</number>
43 <number>0</number>
44 </property>
44 </property>
45 <property name="rightMargin">
45 <property name="rightMargin">
46 <number>0</number>
46 <number>0</number>
47 </property>
47 </property>
48 <property name="bottomMargin">
48 <property name="bottomMargin">
49 <number>0</number>
49 <number>0</number>
50 </property>
50 </property>
51 <item>
51 <item>
52 <widget class="QWidget" name="leftInspectorWidget" native="true">
52 <widget class="QWidget" name="leftInspectorWidget" native="true">
53 <layout class="QHBoxLayout" name="horizontalLayout_2">
53 <layout class="QHBoxLayout" name="horizontalLayout_2">
54 <property name="spacing">
54 <property name="spacing">
55 <number>3</number>
55 <number>3</number>
56 </property>
56 </property>
57 <property name="leftMargin">
57 <property name="leftMargin">
58 <number>0</number>
58 <number>0</number>
59 </property>
59 </property>
60 <property name="topMargin">
60 <property name="topMargin">
61 <number>0</number>
61 <number>0</number>
62 </property>
62 </property>
63 <property name="rightMargin">
63 <property name="rightMargin">
64 <number>0</number>
64 <number>0</number>
65 </property>
65 </property>
66 <property name="bottomMargin">
66 <property name="bottomMargin">
67 <number>0</number>
67 <number>0</number>
68 </property>
68 </property>
69 <item>
69 <item>
70 <widget class="QWidget" name="widget" native="true">
70 <widget class="QWidget" name="widget" native="true">
71 <layout class="QVBoxLayout" name="verticalLayout">
71 <layout class="QVBoxLayout" name="verticalLayout">
72 <property name="spacing">
72 <property name="spacing">
73 <number>3</number>
73 <number>3</number>
74 </property>
74 </property>
75 <property name="leftMargin">
75 <property name="leftMargin">
76 <number>0</number>
76 <number>0</number>
77 </property>
77 </property>
78 <property name="topMargin">
78 <property name="topMargin">
79 <number>0</number>
79 <number>0</number>
80 </property>
80 </property>
81 <property name="rightMargin">
81 <property name="rightMargin">
82 <number>0</number>
82 <number>0</number>
83 </property>
83 </property>
84 <property name="bottomMargin">
84 <property name="bottomMargin">
85 <number>0</number>
85 <number>0</number>
86 </property>
86 </property>
87 <item>
87 <item>
88 <widget class="QWidget" name="dateSourceWidget" native="true"/>
88 <widget class="DataSourceWidget" name="dataSourceWidget" native="true"/>
89 </item>
89 </item>
90 <item>
90 <item>
91 <widget class="QWidget" name="dateTimeWidget" native="true"/>
91 <widget class="QWidget" name="dateTimeWidget" native="true"/>
92 </item>
92 </item>
93 <item>
93 <item>
94 <widget class="QWidget" name="variableInspectorWidget" native="true"/>
94 <widget class="QWidget" name="variableInspectorWidget" native="true"/>
95 </item>
95 </item>
96 </layout>
96 </layout>
97 </widget>
97 </widget>
98 </item>
98 </item>
99 <item>
99 <item>
100 <widget class="SqpSidePane" name="leftInspectorSidePane" native="true">
100 <widget class="SqpSidePane" name="leftInspectorSidePane" native="true">
101 <layout class="QVBoxLayout" name="verticalLayout_2">
101 <layout class="QVBoxLayout" name="verticalLayout_2">
102 <property name="spacing">
102 <property name="spacing">
103 <number>3</number>
103 <number>3</number>
104 </property>
104 </property>
105 <property name="leftMargin">
105 <property name="leftMargin">
106 <number>0</number>
106 <number>0</number>
107 </property>
107 </property>
108 <property name="topMargin">
108 <property name="topMargin">
109 <number>0</number>
109 <number>0</number>
110 </property>
110 </property>
111 <property name="rightMargin">
111 <property name="rightMargin">
112 <number>0</number>
112 <number>0</number>
113 </property>
113 </property>
114 <property name="bottomMargin">
114 <property name="bottomMargin">
115 <number>0</number>
115 <number>0</number>
116 </property>
116 </property>
117 </layout>
117 </layout>
118 </widget>
118 </widget>
119 </item>
119 </item>
120 </layout>
120 </layout>
121 </widget>
121 </widget>
122 </item>
122 </item>
123 <item>
123 <item>
124 <widget class="VisualizationWidget" name="view" native="true"/>
124 <widget class="VisualizationWidget" name="view" native="true"/>
125 </item>
125 </item>
126 <item>
126 <item>
127 <widget class="QWidget" name="rightInspectorWidget" native="true">
127 <widget class="QWidget" name="rightInspectorWidget" native="true">
128 <layout class="QHBoxLayout" name="horizontalLayout_3">
128 <layout class="QHBoxLayout" name="horizontalLayout_3">
129 <property name="spacing">
129 <property name="spacing">
130 <number>3</number>
130 <number>3</number>
131 </property>
131 </property>
132 <property name="leftMargin">
132 <property name="leftMargin">
133 <number>0</number>
133 <number>0</number>
134 </property>
134 </property>
135 <property name="topMargin">
135 <property name="topMargin">
136 <number>0</number>
136 <number>0</number>
137 </property>
137 </property>
138 <property name="rightMargin">
138 <property name="rightMargin">
139 <number>0</number>
139 <number>0</number>
140 </property>
140 </property>
141 <property name="bottomMargin">
141 <property name="bottomMargin">
142 <number>0</number>
142 <number>0</number>
143 </property>
143 </property>
144 <item>
144 <item>
145 <widget class="SqpSidePane" name="rightInspectorSidePane" native="true"/>
145 <widget class="SqpSidePane" name="rightInspectorSidePane" native="true"/>
146 </item>
146 </item>
147 <item>
147 <item>
148 <widget class="QWidget" name="widget_2" native="true">
148 <widget class="QWidget" name="widget_2" native="true">
149 <layout class="QVBoxLayout" name="verticalLayout_3">
149 <layout class="QVBoxLayout" name="verticalLayout_3">
150 <property name="spacing">
150 <property name="spacing">
151 <number>3</number>
151 <number>3</number>
152 </property>
152 </property>
153 <property name="leftMargin">
153 <property name="leftMargin">
154 <number>0</number>
154 <number>0</number>
155 </property>
155 </property>
156 <property name="topMargin">
156 <property name="topMargin">
157 <number>0</number>
157 <number>0</number>
158 </property>
158 </property>
159 <property name="rightMargin">
159 <property name="rightMargin">
160 <number>0</number>
160 <number>0</number>
161 </property>
161 </property>
162 <property name="bottomMargin">
162 <property name="bottomMargin">
163 <number>0</number>
163 <number>0</number>
164 </property>
164 </property>
165 <item>
165 <item>
166 <widget class="QWidget" name="commonPropertyInspectorWidget" native="true"/>
166 <widget class="QWidget" name="commonPropertyInspectorWidget" native="true"/>
167 </item>
167 </item>
168 <item>
168 <item>
169 <widget class="QWidget" name="catalogWidget" native="true"/>
169 <widget class="QWidget" name="catalogWidget" native="true"/>
170 </item>
170 </item>
171 </layout>
171 </layout>
172 </widget>
172 </widget>
173 </item>
173 </item>
174 </layout>
174 </layout>
175 </widget>
175 </widget>
176 </item>
176 </item>
177 </layout>
177 </layout>
178 </widget>
178 </widget>
179 <widget class="QMenuBar" name="menuBar">
179 <widget class="QMenuBar" name="menuBar">
180 <property name="geometry">
180 <property name="geometry">
181 <rect>
181 <rect>
182 <x>0</x>
182 <x>0</x>
183 <y>0</y>
183 <y>0</y>
184 <width>800</width>
184 <width>800</width>
185 <height>26</height>
185 <height>26</height>
186 </rect>
186 </rect>
187 </property>
187 </property>
188 </widget>
188 </widget>
189 <widget class="QStatusBar" name="statusBar"/>
189 <widget class="QStatusBar" name="statusBar"/>
190 </widget>
190 </widget>
191 <layoutdefault spacing="6" margin="11"/>
191 <layoutdefault spacing="6" margin="11"/>
192 <customwidgets>
192 <customwidgets>
193 <customwidget>
193 <customwidget>
194 <class>VisualizationWidget</class>
194 <class>VisualizationWidget</class>
195 <extends>QWidget</extends>
195 <extends>QWidget</extends>
196 <header location="global">visualization/VisualizationWidget.h</header>
196 <header location="global">visualization/VisualizationWidget.h</header>
197 <container>1</container>
197 <container>1</container>
198 </customwidget>
198 </customwidget>
199 <customwidget>
199 <customwidget>
200 <class>SqpSidePane</class>
200 <class>SqpSidePane</class>
201 <extends>QWidget</extends>
201 <extends>QWidget</extends>
202 <header location="global">sidepane/SqpSidePane.h</header>
202 <header location="global">sidepane/SqpSidePane.h</header>
203 <container>1</container>
203 <container>1</container>
204 </customwidget>
204 </customwidget>
205 <customwidget>
206 <class>DataSourceWidget</class>
207 <extends>QWidget</extends>
208 <header location="global">DataSource/DataSourceWidget.h</header>
209 <container>1</container>
210 </customwidget>
205 </customwidgets>
211 </customwidgets>
206 <resources/>
212 <resources/>
207 <connections/>
213 <connections/>
208 </ui>
214 </ui>
General Comments 0
You need to be logged in to leave comments. Login now