From bc8467a5b11783bb8d31257a3651a7d8497e835e 2017-12-07 15:13:52 From: Thibaud Rabillard Date: 2017-12-07 15:13:52 Subject: [PATCH] Merge branch 'feature/CataloguesBasicGui' into develop --- diff --git a/app/src/MainWindow.cpp b/app/src/MainWindow.cpp index 0831198..c96666f 100644 --- a/app/src/MainWindow.cpp +++ b/app/src/MainWindow.cpp @@ -22,6 +22,7 @@ #include "MainWindow.h" #include "ui_MainWindow.h" +#include #include #include #include @@ -60,7 +61,8 @@ public: : m_LastOpenLeftInspectorSize{}, m_LastOpenRightInspectorSize{}, m_GeneralSettingsWidget{new SqpSettingsGeneralWidget{mainWindow}}, - m_SettingsDialog{new SqpSettingsDialog{mainWindow}} + m_SettingsDialog{new SqpSettingsDialog{mainWindow}}, + m_CatalogExplorer{new CatalogueExplorer{mainWindow}} { } @@ -70,6 +72,8 @@ public: SqpSettingsGeneralWidget *m_GeneralSettingsWidget; /// Settings dialog. MainWindow has the ownership SqpSettingsDialog *m_SettingsDialog; + /// Catalogue dialog. MainWindow has the ownership + CatalogueExplorer *m_CatalogExplorer; }; MainWindow::MainWindow(QWidget *parent) @@ -189,6 +193,7 @@ MainWindow::MainWindow(QWidget *parent) auto timeWidget = new TimeWidget{}; mainToolBar->addWidget(timeWidget); + // Interaction modes auto actionPointerMode = new QAction{QIcon(":/icones/pointer.png"), "Move", this}; actionPointerMode->setCheckable(true); actionPointerMode->setChecked(sqpApp->plotsInteractionMode() @@ -234,6 +239,7 @@ MainWindow::MainWindow(QWidget *parent) mainToolBar->addAction(actionZonesMode); mainToolBar->addSeparator(); + // Cursors auto btnCursor = new QToolButton{this}; btnCursor->setIcon(QIcon(":/icones/cursor.png")); btnCursor->setText("Cursor"); @@ -288,6 +294,11 @@ MainWindow::MainWindow(QWidget *parent) cursorModeActionGroup->addAction(horizontalCursorAction); cursorModeActionGroup->addAction(crossCursorAction); + // Catalog + mainToolBar->addSeparator(); + mainToolBar->addAction(QIcon(":/icones/catalogue.png"), "Catalogues", + [this]() { impl->m_CatalogExplorer->show(); }); + // //////// // // Settings // // //////// // diff --git a/app/ui/MainWindow.ui b/app/ui/MainWindow.ui index 79fbee1..61ed24e 100644 --- a/app/ui/MainWindow.ui +++ b/app/ui/MainWindow.ui @@ -132,7 +132,7 @@ 0 0 800 - 28 + 21 diff --git a/gui/include/Catalogue/CatalogueEventsWidget.h b/gui/include/Catalogue/CatalogueEventsWidget.h new file mode 100644 index 0000000..deae927 --- /dev/null +++ b/gui/include/Catalogue/CatalogueEventsWidget.h @@ -0,0 +1,31 @@ +#ifndef SCIQLOP_CATALOGUEEVENTSWIDGET_H +#define SCIQLOP_CATALOGUEEVENTSWIDGET_H + +#include +#include + +namespace Ui { +class CatalogueEventsWidget; +} + +class CatalogueEventsWidget : public QWidget { + Q_OBJECT + +signals: + void eventSelected(const QString &event); + +public: + explicit CatalogueEventsWidget(QWidget *parent = 0); + virtual ~CatalogueEventsWidget(); + +public slots: + void populateWithCatalogue(const QString &catalogue); + +private: + Ui::CatalogueEventsWidget *ui; + + class CatalogueEventsWidgetPrivate; + spimpl::unique_impl_ptr impl; +}; + +#endif // SCIQLOP_CATALOGUEEVENTSWIDGET_H diff --git a/gui/include/Catalogue/CatalogueExplorer.h b/gui/include/Catalogue/CatalogueExplorer.h new file mode 100644 index 0000000..0e433f2 --- /dev/null +++ b/gui/include/Catalogue/CatalogueExplorer.h @@ -0,0 +1,21 @@ +#ifndef SCIQLOP_CATALOGUEEXPLORER_H +#define SCIQLOP_CATALOGUEEXPLORER_H + +#include + +namespace Ui { +class CatalogueExplorer; +} + +class CatalogueExplorer : public QDialog { + Q_OBJECT + +public: + explicit CatalogueExplorer(QWidget *parent = 0); + virtual ~CatalogueExplorer(); + +private: + Ui::CatalogueExplorer *ui; +}; + +#endif // SCIQLOP_CATALOGUEEXPLORER_H diff --git a/gui/include/Catalogue/CatalogueInspectorWidget.h b/gui/include/Catalogue/CatalogueInspectorWidget.h new file mode 100644 index 0000000..b78fd55 --- /dev/null +++ b/gui/include/Catalogue/CatalogueInspectorWidget.h @@ -0,0 +1,32 @@ +#ifndef SCIQLOP_CATALOGUEINSPECTORWIDGET_H +#define SCIQLOP_CATALOGUEINSPECTORWIDGET_H + +#include + +namespace Ui { +class CatalogueInspectorWidget; +} + +class CatalogueInspectorWidget : public QWidget { + Q_OBJECT + +public: + explicit CatalogueInspectorWidget(QWidget *parent = 0); + virtual ~CatalogueInspectorWidget(); + + /// Enum matching the pages inside the stacked widget + enum class Page { Empty, CatalogueProperties, EventProperties }; + + Page currentPage() const; + + void setEvent(const QString &event); + void setCatalogue(const QString &catalogue); + +public slots: + void showPage(Page page); + +private: + Ui::CatalogueInspectorWidget *ui; +}; + +#endif // SCIQLOP_CATALOGUEINSPECTORWIDGET_H diff --git a/gui/include/Catalogue/CatalogueSideBarWidget.h b/gui/include/Catalogue/CatalogueSideBarWidget.h new file mode 100644 index 0000000..b9855dd --- /dev/null +++ b/gui/include/Catalogue/CatalogueSideBarWidget.h @@ -0,0 +1,31 @@ +#ifndef SCIQLOP_CATALOGUESIDEBARWIDGET_H +#define SCIQLOP_CATALOGUESIDEBARWIDGET_H + +#include +#include +#include + +namespace Ui { +class CatalogueSideBarWidget; +} + +class CatalogueSideBarWidget : public QWidget { + Q_OBJECT + +signals: + void catalogueSelected(const QString &catalogue); + void allEventsSelected(); + void trashSelected(); + +public: + explicit CatalogueSideBarWidget(QWidget *parent = 0); + virtual ~CatalogueSideBarWidget(); + +private: + Ui::CatalogueSideBarWidget *ui; + + class CatalogueSideBarWidgetPrivate; + spimpl::unique_impl_ptr impl; +}; + +#endif // SCIQLOP_CATALOGUESIDEBARWIDGET_H diff --git a/gui/meson.build b/gui/meson.build index 6e63bb2..55e755d 100644 --- a/gui/meson.build +++ b/gui/meson.build @@ -19,7 +19,11 @@ gui_moc_headers = [ 'include/Visualization/VisualizationDragWidget.h', 'include/Visualization/ColorScaleEditor.h', 'include/Actions/SelectionZoneAction.h', - 'include/Visualization/VisualizationMultiZoneSelectionDialog.h' + 'include/Visualization/VisualizationMultiZoneSelectionDialog.h', + 'include/Catalogue/CatalogueExplorer.h', + 'include/Catalogue/CatalogueEventsWidget.h', + 'include/Catalogue/CatalogueSideBarWidget.h', + 'include/Catalogue/CatalogueInspectorWidget.h' ] gui_ui_files = [ @@ -36,7 +40,11 @@ gui_ui_files = [ 'ui/Visualization/VisualizationWidget.ui', 'ui/Visualization/VisualizationZoneWidget.ui', 'ui/Visualization/ColorScaleEditor.ui', - 'ui/Visualization/VisualizationMultiZoneSelectionDialog.ui' + 'ui/Visualization/VisualizationMultiZoneSelectionDialog.ui', + 'ui/Catalogue/CatalogueExplorer.ui', + 'ui/Catalogue/CatalogueEventsWidget.ui', + 'ui/Catalogue/CatalogueSideBarWidget.ui', + 'ui/Catalogue/CatalogueInspectorWidget.ui' ] gui_qresources = ['resources/sqpguiresources.qrc'] @@ -91,7 +99,11 @@ gui_sources = [ 'src/Actions/SelectionZoneAction.cpp', 'src/Actions/ActionsGuiController.cpp', 'src/Visualization/VisualizationActionManager.cpp', - 'src/Visualization/VisualizationMultiZoneSelectionDialog.cpp' + 'src/Visualization/VisualizationMultiZoneSelectionDialog.cpp', + 'src/Catalogue/CatalogueExplorer.cpp', + 'src/Catalogue/CatalogueEventsWidget.cpp', + 'src/Catalogue/CatalogueSideBarWidget.cpp', + 'src/Catalogue/CatalogueInspectorWidget.cpp' ] gui_inc = include_directories(['include']) diff --git a/gui/resources/icones/add.png b/gui/resources/icones/add.png new file mode 100644 index 0000000000000000000000000000000000000000..80f19899046ea04c581bc61d2dfc602e61a940fd GIT binary patch literal 1956 zc$@*G2V3}wP)?u_ z%mwOz=~)4cW_1g=n$_RHpFn?BJ-`5P*GefYk&!ka1Qq}rfL34~um+eN(ck(PI1O|I zUBFMk#fbivQi7Sli@-;~IpChK&I0>^Em_-?2$&9R1HJ^VBOmlq8UnrmUS^_sQ39|W zcpvx+`QTQnD?kUZEOf6VoD8rTID&i-!%`>EMl$+bk>LS5fM1ahSXBBM*p60&JT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RV-ZLWd!9imkw}t{=~wdl(!VwgxD;oDF1Bi05W? zx+0^>pg6DXkkgen3@=(%Sb8xy`LwsTf*CfvK*mkR3!H(QnHLBzdZxiRBdFZrLGvzV z0dLvAj`Ra?z~0 oi@xQrjXF^D`|=qSuqJOmqix-Svr4nnK-r(c)78&qol`;+0KS6Q!vFvP literal 0 Hc$@icones/drag.png icones/cursor.png icones/pointer.png + icones/catalogue.png + icones/add.png + icones/remove.png + icones/chart.png + icones/allEvents.png + icones/trash.png + icones/database.png diff --git a/gui/src/Catalogue/CatalogueEventsWidget.cpp b/gui/src/Catalogue/CatalogueEventsWidget.cpp new file mode 100644 index 0000000..3fe0065 --- /dev/null +++ b/gui/src/Catalogue/CatalogueEventsWidget.cpp @@ -0,0 +1,100 @@ +#include "Catalogue/CatalogueEventsWidget.h" +#include "ui_CatalogueEventsWidget.h" + +#include + +struct CatalogueEventsWidget::CatalogueEventsWidgetPrivate { + void addEventItem(const QStringList &data, QTableWidget *tableWidget); + + enum class Column { Event, TStart, TEnd, Tags, Product, NbColumn }; + QStringList columnNames() { return QStringList{"Event", "TStart", "TEnd", "Tags", "Product"}; } +}; + + +CatalogueEventsWidget::CatalogueEventsWidget(QWidget *parent) + : QWidget(parent), + ui(new Ui::CatalogueEventsWidget), + impl{spimpl::make_unique_impl()} +{ + ui->setupUi(this); + + connect(ui->btnTime, &QToolButton::clicked, [this](auto checked) { + if (checked) { + ui->btnChart->setChecked(false); + } + }); + + connect(ui->btnChart, &QToolButton::clicked, [this](auto checked) { + if (checked) { + ui->btnTime->setChecked(false); + } + }); + + connect(ui->tableWidget, &QTableWidget::cellClicked, [this](auto row, auto column) { + auto event = ui->tableWidget->item(row, 0)->text(); + emit this->eventSelected(event); + }); + + connect(ui->tableWidget, &QTableWidget::currentItemChanged, + [this](auto current, auto previous) { + if (current && current->row() >= 0) { + auto event = ui->tableWidget->item(current->row(), 0)->text(); + emit this->eventSelected(event); + } + }); + + connect(ui->tableWidget, &QTableWidget::itemSelectionChanged, [this]() { + auto selection = ui->tableWidget->selectedRanges(); + auto isNotMultiSelection + = selection.isEmpty() || (selection.count() == 1 && selection.first().rowCount() == 1); + ui->btnChart->setEnabled(isNotMultiSelection); + ui->btnTime->setEnabled(isNotMultiSelection); + }); + + Q_ASSERT(impl->columnNames().count() == (int)CatalogueEventsWidgetPrivate::Column::NbColumn); + ui->tableWidget->setColumnCount((int)CatalogueEventsWidgetPrivate::Column::NbColumn); + ui->tableWidget->setHorizontalHeaderLabels(impl->columnNames()); + ui->tableWidget->horizontalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents); + ui->tableWidget->horizontalHeader()->setSectionResizeMode(0, QHeaderView::Stretch); + ui->tableWidget->horizontalHeader()->setSortIndicatorShown(true); +} + +CatalogueEventsWidget::~CatalogueEventsWidget() +{ + delete ui; +} + +void CatalogueEventsWidget::populateWithCatalogue(const QString &catalogue) +{ + ui->tableWidget->clearContents(); + ui->tableWidget->setRowCount(0); + + // TODO + impl->addEventItem( + {catalogue + " - Event 1", "12/12/2012 12:12", "12/12/2042 12:52", "cloud", "mfi/b_gse42"}, + ui->tableWidget); + impl->addEventItem( + {catalogue + " - Event 2", "12/12/2012 12:10", "12/12/2042 12:42", "Acloud", "mfi/b_gse1"}, + ui->tableWidget); + impl->addEventItem( + {catalogue + " - Event 3", "12/12/2012 12:22", "12/12/2042 12:12", "Gcloud", "mfi/b_gse2"}, + ui->tableWidget); + impl->addEventItem( + {catalogue + " - Event 4", "12/12/2012 12:00", "12/12/2042 12:62", "Bcloud", "mfi/b_gse3"}, + ui->tableWidget); +} + +void CatalogueEventsWidget::CatalogueEventsWidgetPrivate::addEventItem(const QStringList &data, + QTableWidget *tableWidget) +{ + tableWidget->setSortingEnabled(false); + auto row = tableWidget->rowCount(); + tableWidget->setRowCount(row + 1); + + for (auto i = 0; i < (int)Column::NbColumn; ++i) { + auto item = new QTableWidgetItem(data.value(i)); + item->setFlags(Qt::ItemIsEnabled | Qt::ItemIsSelectable); + tableWidget->setItem(row, i, item); + } + tableWidget->setSortingEnabled(true); +} diff --git a/gui/src/Catalogue/CatalogueExplorer.cpp b/gui/src/Catalogue/CatalogueExplorer.cpp new file mode 100644 index 0000000..c286298 --- /dev/null +++ b/gui/src/Catalogue/CatalogueExplorer.cpp @@ -0,0 +1,22 @@ +#include "Catalogue/CatalogueExplorer.h" +#include "ui_CatalogueExplorer.h" + +CatalogueExplorer::CatalogueExplorer(QWidget *parent) + : QDialog(parent, Qt::Dialog | Qt::WindowMinMaxButtonsHint | Qt::WindowCloseButtonHint), + ui(new Ui::CatalogueExplorer) +{ + ui->setupUi(this); + + connect(ui->catalogues, &CatalogueSideBarWidget::catalogueSelected, [this](auto name) { + ui->inspector->setCatalogue(name); + ui->events->populateWithCatalogue(name); + }); + + connect(ui->events, &CatalogueEventsWidget::eventSelected, + [this](auto name) { ui->inspector->setEvent(name); }); +} + +CatalogueExplorer::~CatalogueExplorer() +{ + delete ui; +} diff --git a/gui/src/Catalogue/CatalogueInspectorWidget.cpp b/gui/src/Catalogue/CatalogueInspectorWidget.cpp new file mode 100644 index 0000000..5cb782e --- /dev/null +++ b/gui/src/Catalogue/CatalogueInspectorWidget.cpp @@ -0,0 +1,36 @@ +#include "Catalogue/CatalogueInspectorWidget.h" +#include "ui_CatalogueInspectorWidget.h" + +CatalogueInspectorWidget::CatalogueInspectorWidget(QWidget *parent) + : QWidget(parent), ui(new Ui::CatalogueInspectorWidget) +{ + ui->setupUi(this); + showPage(Page::Empty); +} + +CatalogueInspectorWidget::~CatalogueInspectorWidget() +{ + delete ui; +} + +void CatalogueInspectorWidget::showPage(CatalogueInspectorWidget::Page page) +{ + ui->stackedWidget->setCurrentIndex(static_cast(page)); +} + +CatalogueInspectorWidget::Page CatalogueInspectorWidget::currentPage() const +{ + return static_cast(ui->stackedWidget->currentIndex()); +} + +void CatalogueInspectorWidget::setEvent(const QString &event) +{ + showPage(Page::EventProperties); + ui->leEventName->setText(event); +} + +void CatalogueInspectorWidget::setCatalogue(const QString &catalogue) +{ + showPage(Page::CatalogueProperties); + ui->leCatalogueName->setText(catalogue); +} diff --git a/gui/src/Catalogue/CatalogueSideBarWidget.cpp b/gui/src/Catalogue/CatalogueSideBarWidget.cpp new file mode 100644 index 0000000..f5ade50 --- /dev/null +++ b/gui/src/Catalogue/CatalogueSideBarWidget.cpp @@ -0,0 +1,101 @@ +#include "Catalogue/CatalogueSideBarWidget.h" +#include "ui_CatalogueSideBarWidget.h" + +constexpr auto ALL_EVENT_ITEM_TYPE = QTreeWidgetItem::UserType; +constexpr auto TRASH_ITEM_TYPE = QTreeWidgetItem::UserType + 1; +constexpr auto CATALOGUE_ITEM_TYPE = QTreeWidgetItem::UserType + 2; +constexpr auto DATABASE_ITEM_TYPE = QTreeWidgetItem::UserType + 3; + + +struct CatalogueSideBarWidget::CatalogueSideBarWidgetPrivate { + void configureTreeWidget(QTreeWidget *treeWidget); + QTreeWidgetItem *addDatabaseItem(const QString &name, QTreeWidget *treeWidget); + void addCatalogueItem(const QString &name, QTreeWidgetItem *parentDatabaseItem); +}; + +CatalogueSideBarWidget::CatalogueSideBarWidget(QWidget *parent) + : QWidget(parent), + ui(new Ui::CatalogueSideBarWidget), + impl{spimpl::make_unique_impl()} +{ + ui->setupUi(this); + impl->configureTreeWidget(ui->treeWidget); + + auto emitSelection = [this](auto item) { + switch (item->type()) { + case CATALOGUE_ITEM_TYPE: + emit this->catalogueSelected(item->text(0)); + break; + case ALL_EVENT_ITEM_TYPE: + emit this->allEventsSelected(); + break; + case TRASH_ITEM_TYPE: + emit this->trashSelected(); + break; + case DATABASE_ITEM_TYPE: + default: + break; + } + }; + + connect(ui->treeWidget, &QTreeWidget::itemClicked, emitSelection); + connect(ui->treeWidget, &QTreeWidget::currentItemChanged, emitSelection); +} + +CatalogueSideBarWidget::~CatalogueSideBarWidget() +{ + delete ui; +} + +void CatalogueSideBarWidget::CatalogueSideBarWidgetPrivate::configureTreeWidget( + QTreeWidget *treeWidget) +{ + auto allEventsItem = new QTreeWidgetItem({"All Events"}, ALL_EVENT_ITEM_TYPE); + allEventsItem->setIcon(0, QIcon(":/icones/allEvents.png")); + treeWidget->addTopLevelItem(allEventsItem); + + auto trashItem = new QTreeWidgetItem({"Trash"}, TRASH_ITEM_TYPE); + trashItem->setIcon(0, QIcon(":/icones/trash.png")); + treeWidget->addTopLevelItem(trashItem); + + auto separator = new QFrame(treeWidget); + separator->setFrameShape(QFrame::HLine); + + auto separatorItem = new QTreeWidgetItem(); + separatorItem->setFlags(Qt::NoItemFlags); + treeWidget->addTopLevelItem(separatorItem); + treeWidget->setItemWidget(separatorItem, 0, separator); + + // Test + auto db = addDatabaseItem("Database 1", treeWidget); + addCatalogueItem("Catalogue 1", db); + addCatalogueItem("Catalogue 2", db); + addCatalogueItem("Catalogue 3", db); + addCatalogueItem("Catalogue 4", db); + + auto db2 = addDatabaseItem("Database 2", treeWidget); + addCatalogueItem("Catalogue A", db2); + addCatalogueItem("Catalogue B", db2); + addCatalogueItem("Catalogue C", db2); + + treeWidget->expandAll(); +} + +QTreeWidgetItem * +CatalogueSideBarWidget::CatalogueSideBarWidgetPrivate::addDatabaseItem(const QString &name, + QTreeWidget *treeWidget) +{ + auto databaseItem = new QTreeWidgetItem({name}, DATABASE_ITEM_TYPE); + databaseItem->setIcon(0, QIcon(":/icones/database.png")); + treeWidget->addTopLevelItem(databaseItem); + + return databaseItem; +} + +void CatalogueSideBarWidget::CatalogueSideBarWidgetPrivate::addCatalogueItem( + const QString &name, QTreeWidgetItem *parentDatabaseItem) +{ + auto catalogueItem = new QTreeWidgetItem({name}, CATALOGUE_ITEM_TYPE); + catalogueItem->setIcon(0, QIcon(":/icones/catalogue.png")); + parentDatabaseItem->addChild(catalogueItem); +} diff --git a/gui/src/Visualization/VisualizationSelectionZoneItem.cpp b/gui/src/Visualization/VisualizationSelectionZoneItem.cpp index 2e5c5b2..4d06164 100644 --- a/gui/src/Visualization/VisualizationSelectionZoneItem.cpp +++ b/gui/src/Visualization/VisualizationSelectionZoneItem.cpp @@ -142,9 +142,7 @@ VisualizationSelectionZoneItem::VisualizationSelectionZoneItem(QCustomPlot *plot setColor(QColor(DEFAULT_COLOR)); } -VisualizationSelectionZoneItem::~VisualizationSelectionZoneItem() -{ -} +VisualizationSelectionZoneItem::~VisualizationSelectionZoneItem() {} VisualizationGraphWidget *VisualizationSelectionZoneItem::parentGraphWidget() const noexcept { diff --git a/gui/ui/Catalogue/CatalogueEventsWidget.ui b/gui/ui/Catalogue/CatalogueEventsWidget.ui new file mode 100644 index 0000000..171698e --- /dev/null +++ b/gui/ui/Catalogue/CatalogueEventsWidget.ui @@ -0,0 +1,139 @@ + + + CatalogueEventsWidget + + + + 0 + 0 + 566 + 258 + + + + Form + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + + + + + :/icones/add.png:/icones/add.png + + + true + + + + + + + - + + + + :/icones/remove.png:/icones/remove.png + + + true + + + + + + + Qt::Vertical + + + + + + + T + + + + :/icones/time.png:/icones/time.png + + + true + + + true + + + + + + + G + + + + :/icones/chart.png:/icones/chart.png + + + true + + + true + + + + + + + Qt::Vertical + + + + + + + false + + + + + + + + + true + + + QAbstractItemView::SelectRows + + + false + + + false + + + 25 + + + + + + + + diff --git a/gui/ui/Catalogue/CatalogueExplorer.ui b/gui/ui/Catalogue/CatalogueExplorer.ui new file mode 100644 index 0000000..bb906a5 --- /dev/null +++ b/gui/ui/Catalogue/CatalogueExplorer.ui @@ -0,0 +1,83 @@ + + + CatalogueExplorer + + + + 0 + 0 + 755 + 481 + + + + Catalogue Explorer + + + + + + Qt::Horizontal + + + + + 1 + 0 + + + + + + + 3 + 0 + + + + Qt::Vertical + + + + + 0 + 5 + + + + + + + 0 + 2 + + + + + + + + + + + CatalogueSideBarWidget + QWidget +
Catalogue/CatalogueSideBarWidget.h
+ 1 +
+ + CatalogueEventsWidget + QWidget +
Catalogue/CatalogueEventsWidget.h
+ 1 +
+ + CatalogueInspectorWidget + QWidget +
Catalogue/CatalogueInspectorWidget.h
+ 1 +
+
+ + +
diff --git a/gui/ui/Catalogue/CatalogueInspectorWidget.ui b/gui/ui/Catalogue/CatalogueInspectorWidget.ui new file mode 100644 index 0000000..909c3e8 --- /dev/null +++ b/gui/ui/Catalogue/CatalogueInspectorWidget.ui @@ -0,0 +1,214 @@ + + + CatalogueInspectorWidget + + + + 0 + 0 + 400 + 300 + + + + Form + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + QFrame::Box + + + QFrame::Sunken + + + 1 + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 1 + + + + + + + + Name + + + + + + + + + + Author + + + + + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + 10 + 75 + true + + + + Catalogue Properties + + + + + + + + + + + + + + TStart + + + + + + + Tags + + + + + + + Product + + + + + + + + + + Tend + + + + + + + + + + Mission + + + + + + + + + + Name + + + + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + 10 + 75 + true + + + + Event Properties + + + + + + + + + + + + + + + diff --git a/gui/ui/Catalogue/CatalogueSideBarWidget.ui b/gui/ui/Catalogue/CatalogueSideBarWidget.ui new file mode 100644 index 0000000..ca3e22d --- /dev/null +++ b/gui/ui/Catalogue/CatalogueSideBarWidget.ui @@ -0,0 +1,90 @@ + + + CatalogueSideBarWidget + + + + 0 + 0 + 330 + 523 + + + + Form + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + + + + + :/icones/add.png:/icones/add.png + + + true + + + + + + + - + + + + :/icones/remove.png:/icones/remove.png + + + true + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + false + + + + 1 + + + + + + + + +