##// END OF EJS Templates
Catalog side bar
trabillard -
r1133:36b99d8a1584
parent child
Show More
1 NO CONTENT: new file 100644, binary diff hidden
1 NO CONTENT: new file 100644, binary diff hidden
@@ -1,21 +1,25
1 #ifndef CATALOGUESIDEBARWIDGET_H
2 #define CATALOGUESIDEBARWIDGET_H
1 #ifndef SCIQLOP_CATALOGUESIDEBARWIDGET_H
2 #define SCIQLOP_CATALOGUESIDEBARWIDGET_H
3 3
4 #include <Common/spimpl.h>
4 5 #include <QWidget>
5 6
6 7 namespace Ui {
7 8 class CatalogueSideBarWidget;
8 9 }
9 10
10 11 class CatalogueSideBarWidget : public QWidget {
11 12 Q_OBJECT
12 13
13 14 public:
14 15 explicit CatalogueSideBarWidget(QWidget *parent = 0);
15 ~CatalogueSideBarWidget();
16 virtual ~CatalogueSideBarWidget();
16 17
17 18 private:
18 19 Ui::CatalogueSideBarWidget *ui;
20
21 class CatalogueSideBarWidgetPrivate;
22 spimpl::unique_impl_ptr<CatalogueSideBarWidgetPrivate> impl;
19 23 };
20 24
21 #endif // CATALOGUESIDEBARWIDGET_H
25 #endif // SCIQLOP_CATALOGUESIDEBARWIDGET_H
@@ -1,26 +1,28
1 1 <RCC>
2 2 <qresource prefix="/">
3 3 <file>icones/dataSourceComponent.png</file>
4 4 <file>icones/dataSourceNode.png</file>
5 5 <file>icones/dataSourceProduct.png</file>
6 6 <file>icones/dataSourceRoot.png</file>
7 7 <file>icones/delete.png</file>
8 8 <file>icones/down.png</file>
9 9 <file>icones/openInspector.png</file>
10 10 <file>icones/next.png</file>
11 11 <file>icones/plot.png</file>
12 12 <file>icones/previous.png</file>
13 13 <file>icones/unplot.png</file>
14 14 <file>icones/up.png</file>
15 15 <file>icones/time.png</file>
16 16 <file>icones/zoom.png</file>
17 17 <file>icones/rectangle.png</file>
18 18 <file>icones/drag.png</file>
19 19 <file>icones/cursor.png</file>
20 20 <file>icones/pointer.png</file>
21 21 <file>icones/catalogue.png</file>
22 22 <file>icones/add.png</file>
23 23 <file>icones/remove.png</file>
24 24 <file>icones/chart.png</file>
25 <file>icones/allEvents.png</file>
26 <file>icones/trash.png</file>
25 27 </qresource>
26 28 </RCC>
@@ -1,13 +1,46
1 1 #include "Catalogue/CatalogueSideBarWidget.h"
2 2 #include "ui_CatalogueSideBarWidget.h"
3 3
4 auto ALL_EVENT_ITEM_TYPE = QTreeWidgetItem::UserType;
5 auto TRASH_ITEM_TYPE = QTreeWidgetItem::UserType + 1;
6 auto CATALOGUE_ITEM_TYPE = QTreeWidgetItem::UserType + 2;
7 auto DATABASE_ITEM_TYPE = QTreeWidgetItem::UserType + 3;
8
9
10 struct CatalogueSideBarWidget::CatalogueSideBarWidgetPrivate {
11 void configureTreeWidget(QTreeWidget *treeWidget);
12 };
13
4 14 CatalogueSideBarWidget::CatalogueSideBarWidget(QWidget *parent)
5 : QWidget(parent), ui(new Ui::CatalogueSideBarWidget)
15 : QWidget(parent),
16 ui(new Ui::CatalogueSideBarWidget),
17 impl{spimpl::make_unique_impl<CatalogueSideBarWidgetPrivate>()}
6 18 {
7 19 ui->setupUi(this);
20 impl->configureTreeWidget(ui->treeWidget);
8 21 }
9 22
10 23 CatalogueSideBarWidget::~CatalogueSideBarWidget()
11 24 {
12 25 delete ui;
13 26 }
27
28 void CatalogueSideBarWidget::CatalogueSideBarWidgetPrivate::configureTreeWidget(
29 QTreeWidget *treeWidget)
30 {
31 auto allEventsItem = new QTreeWidgetItem({"All Events"}, ALL_EVENT_ITEM_TYPE);
32 allEventsItem->setIcon(0, QIcon(":/icones/allEvents.png"));
33 treeWidget->addTopLevelItem(allEventsItem);
34
35 auto trashItem = new QTreeWidgetItem({"Trash"}, TRASH_ITEM_TYPE);
36 trashItem->setIcon(0, QIcon(":/icones/trash.png"));
37 treeWidget->addTopLevelItem(trashItem);
38
39 auto separator = new QFrame(treeWidget);
40 separator->setFrameShape(QFrame::HLine);
41
42 auto separatorItem = new QTreeWidgetItem();
43 separatorItem->setFlags(Qt::NoItemFlags);
44 treeWidget->addTopLevelItem(separatorItem);
45 treeWidget->setItemWidget(separatorItem, 0, separator);
46 }
@@ -1,56 +1,83
1 1 <?xml version="1.0" encoding="UTF-8"?>
2 2 <ui version="4.0">
3 3 <class>CatalogueExplorer</class>
4 4 <widget class="QDialog" name="CatalogueExplorer">
5 5 <property name="geometry">
6 6 <rect>
7 7 <x>0</x>
8 8 <y>0</y>
9 <width>775</width>
10 <height>512</height>
9 <width>755</width>
10 <height>481</height>
11 11 </rect>
12 12 </property>
13 13 <property name="windowTitle">
14 14 <string>Catalogue Explorer</string>
15 15 </property>
16 16 <layout class="QVBoxLayout" name="verticalLayout">
17 17 <item>
18 18 <widget class="QSplitter" name="horizontalSplitter">
19 19 <property name="orientation">
20 20 <enum>Qt::Horizontal</enum>
21 21 </property>
22 <widget class="CatalogueSideBarWidget" name="catalogues" native="true"/>
22 <widget class="CatalogueSideBarWidget" name="catalogues" native="true">
23 <property name="sizePolicy">
24 <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
25 <horstretch>1</horstretch>
26 <verstretch>0</verstretch>
27 </sizepolicy>
28 </property>
29 </widget>
23 30 <widget class="QSplitter" name="verticalSplitter">
31 <property name="sizePolicy">
32 <sizepolicy hsizetype="Preferred" vsizetype="Expanding">
33 <horstretch>3</horstretch>
34 <verstretch>0</verstretch>
35 </sizepolicy>
36 </property>
24 37 <property name="orientation">
25 38 <enum>Qt::Vertical</enum>
26 39 </property>
27 <widget class="CatalogueEventsWidget" name="events" native="true"/>
28 <widget class="CatalogueInspectorWidget" name="inspector" native="true"/>
40 <widget class="CatalogueEventsWidget" name="events" native="true">
41 <property name="sizePolicy">
42 <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
43 <horstretch>0</horstretch>
44 <verstretch>5</verstretch>
45 </sizepolicy>
46 </property>
47 </widget>
48 <widget class="CatalogueInspectorWidget" name="inspector" native="true">
49 <property name="sizePolicy">
50 <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
51 <horstretch>0</horstretch>
52 <verstretch>2</verstretch>
53 </sizepolicy>
54 </property>
55 </widget>
29 56 </widget>
30 57 </widget>
31 58 </item>
32 59 </layout>
33 60 </widget>
34 61 <customwidgets>
35 62 <customwidget>
36 63 <class>CatalogueSideBarWidget</class>
37 64 <extends>QWidget</extends>
38 65 <header>Catalogue/CatalogueSideBarWidget.h</header>
39 66 <container>1</container>
40 67 </customwidget>
41 68 <customwidget>
42 69 <class>CatalogueEventsWidget</class>
43 70 <extends>QWidget</extends>
44 71 <header>Catalogue/CatalogueEventsWidget.h</header>
45 72 <container>1</container>
46 73 </customwidget>
47 74 <customwidget>
48 75 <class>CatalogueInspectorWidget</class>
49 76 <extends>QWidget</extends>
50 77 <header>Catalogue/CatalogueInspectorWidget.h</header>
51 78 <container>1</container>
52 79 </customwidget>
53 80 </customwidgets>
54 81 <resources/>
55 82 <connections/>
56 83 </ui>
@@ -1,81 +1,90
1 1 <?xml version="1.0" encoding="UTF-8"?>
2 2 <ui version="4.0">
3 3 <class>CatalogueSideBarWidget</class>
4 4 <widget class="QWidget" name="CatalogueSideBarWidget">
5 5 <property name="geometry">
6 6 <rect>
7 7 <x>0</x>
8 8 <y>0</y>
9 9 <width>330</width>
10 10 <height>523</height>
11 11 </rect>
12 12 </property>
13 13 <property name="windowTitle">
14 14 <string>Form</string>
15 15 </property>
16 16 <layout class="QVBoxLayout" name="verticalLayout">
17 <property name="leftMargin">
18 <number>0</number>
19 </property>
20 <property name="topMargin">
21 <number>0</number>
22 </property>
23 <property name="rightMargin">
24 <number>0</number>
25 </property>
26 <property name="bottomMargin">
27 <number>0</number>
28 </property>
17 29 <item>
18 30 <layout class="QHBoxLayout" name="horizontalLayout">
19 31 <item>
20 32 <widget class="QToolButton" name="btnAdd">
21 33 <property name="text">
22 34 <string>+</string>
23 35 </property>
24 36 <property name="icon">
25 <iconset resource="../../resources/sqpguiresources.qrc">
37 <iconset>
26 38 <normaloff>:/icones/add.png</normaloff>:/icones/add.png</iconset>
27 39 </property>
28 40 <property name="autoRaise">
29 41 <bool>true</bool>
30 42 </property>
31 43 </widget>
32 44 </item>
33 45 <item>
34 46 <widget class="QToolButton" name="btnRemove">
35 47 <property name="text">
36 48 <string> - </string>
37 49 </property>
38 50 <property name="icon">
39 <iconset resource="../../resources/sqpguiresources.qrc">
51 <iconset>
40 52 <normaloff>:/icones/remove.png</normaloff>:/icones/remove.png</iconset>
41 53 </property>
42 54 <property name="autoRaise">
43 55 <bool>true</bool>
44 56 </property>
45 57 </widget>
46 58 </item>
47 59 <item>
48 60 <spacer name="horizontalSpacer">
49 61 <property name="orientation">
50 62 <enum>Qt::Horizontal</enum>
51 63 </property>
52 64 <property name="sizeHint" stdset="0">
53 65 <size>
54 66 <width>40</width>
55 67 <height>20</height>
56 68 </size>
57 69 </property>
58 70 </spacer>
59 71 </item>
60 72 </layout>
61 73 </item>
62 74 <item>
63 75 <widget class="QTreeWidget" name="treeWidget">
64 76 <attribute name="headerVisible">
65 77 <bool>false</bool>
66 78 </attribute>
67 79 <column>
68 80 <property name="text">
69 81 <string notr="true">1</string>
70 82 </property>
71 83 </column>
72 84 </widget>
73 85 </item>
74 86 </layout>
75 87 </widget>
76 <resources>
77 <include location="../../resources/sqpguiresources.qrc"/>
78 <include location="../../resources/sqpguiresources.qrc"/>
79 </resources>
88 <resources/>
80 89 <connections/>
81 90 </ui>
General Comments 3
Under Review
author

Auto status change to "Under Review"

Approved

Status change > Approved

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