Interface mockup 10

This commit is contained in:
Dion Moult
2026-05-07 14:12:27 +10:00
parent 359693c562
commit a340e6cf9a
11 changed files with 53 additions and 49 deletions
+7 -18
View File
@@ -35,13 +35,6 @@
namespace {
void clearLayout(QVBoxLayout* layout) {
while (auto* item = layout->takeAt(0)) {
if (auto* widget = item->widget()) widget->deleteLater();
delete item;
}
}
QWidget* makePropertySetPanel(const ifcinterface::panels::properties::PropertySet& property_set, QWidget* parent = nullptr) {
auto* group = new QGroupBox(property_set.title, parent);
group->setObjectName("propertySetBox");
@@ -131,15 +124,12 @@ QFrame* makeEntityBox(const ifcinterface::panels::properties::EntitySummary& ent
namespace ifcinterface::panels::properties {
PropertiesPanelWidget::PropertiesPanelWidget(QWidget* parent)
: QWidget(parent)
: components::Panel("Properties", nullptr, parent, false, true)
{
content_layout_ = new QVBoxLayout(this);
content_layout_->setContentsMargins(0, 0, 0, 0);
content_layout_->setSpacing(12);
}
void PropertiesPanelWidget::render(const PropertiesPanelState& state) {
clearLayout(content_layout_);
clearBodyWidgets();
QList<QWidget*> property_set_widgets;
for (const auto& property_set : state.property_sets) {
@@ -237,12 +227,11 @@ void PropertiesPanelWidget::render(const PropertiesPanelState& state) {
});
}
content_layout_->addWidget(entity_section);
content_layout_->addWidget(attributes_section);
content_layout_->addWidget(relationships_section);
content_layout_->addWidget(properties_section);
content_layout_->addWidget(quantities_section);
content_layout_->addStretch(1);
addBodyWidget(entity_section);
addBodyWidget(attributes_section);
addBodyWidget(relationships_section);
addBodyWidget(properties_section);
addBodyWidget(quantities_section);
}
} // namespace ifcinterface::panels::properties
+4 -6
View File
@@ -23,18 +23,17 @@
#include "Types.h"
#include <QString>
#include <QWidget>
#include "../../components/Panel.h"
#include <QString>
class QVBoxLayout;
class QLabel;
class QLineEdit;
class QToolButton;
namespace ifcinterface::components { class Section; }
namespace ifcinterface::panels::properties {
class PropertiesPanelWidget : public QWidget {
class PropertiesPanelWidget : public components::Panel {
Q_OBJECT
public:
explicit PropertiesPanelWidget(QWidget* parent = nullptr);
@@ -42,7 +41,6 @@ public:
void render(const PropertiesPanelState& state);
private:
QVBoxLayout* content_layout_ = nullptr;
bool attributes_expanded_ = true;
bool relationships_expanded_ = true;
bool properties_expanded_ = true;
@@ -26,17 +26,12 @@
#include <QHeaderView>
#include <QTreeWidget>
#include <QTreeWidgetItem>
#include <QVBoxLayout>
namespace ifcinterface::panels::spatial_hierarchy {
SpatialHierarchyPanelWidget::SpatialHierarchyPanelWidget(QWidget* parent)
: QWidget(parent)
: components::Panel("Spatial Hierarchy", nullptr, parent)
{
auto* layout = new QVBoxLayout(this);
layout->setContentsMargins(0, 0, 0, 0);
layout->setSpacing(0);
auto* section = new components::Section("", components::SectionHeaderMode::Hidden, this);
tree_ = new QTreeWidget(section);
@@ -51,7 +46,7 @@ SpatialHierarchyPanelWidget::SpatialHierarchyPanelWidget(QWidget* parent)
tree_->header()->resizeSection(1, 28);
tree_->header()->hide();
section->addBodyWidget(tree_);
layout->addWidget(section);
addBodyWidget(section);
connect(tree_, &QTreeWidget::itemClicked, this, [this](QTreeWidgetItem* item, int column) {
if (!item || column != 1) return;
@@ -23,14 +23,14 @@
#include "Types.h"
#include <QWidget>
#include "../../components/Panel.h"
class QTreeWidget;
class QTreeWidgetItem;
namespace ifcinterface::panels::spatial_hierarchy {
class SpatialHierarchyPanelWidget : public QWidget {
class SpatialHierarchyPanelWidget : public components::Panel {
Q_OBJECT
public:
explicit SpatialHierarchyPanelWidget(QWidget* parent = nullptr);