-
Notifications
You must be signed in to change notification settings - Fork 26
Expand file tree
/
Copy pathOSInspectorView.cpp
More file actions
75 lines (61 loc) · 2.14 KB
/
OSInspectorView.cpp
File metadata and controls
75 lines (61 loc) · 2.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
/***********************************************************************************************************************
* OpenStudio(R), Copyright (c) OpenStudio Coalition and other contributors.
* See also https://openstudiocoalition.org/about/software_license/
***********************************************************************************************************************/
#include "OSInspectorView.hpp"
#include "ModelObjectItem.hpp"
#include <openstudio/model/Model.hpp>
#include <openstudio/model/Model_Impl.hpp>
#include <openstudio/model/ModelObject_Impl.hpp>
#include <openstudio/utilities/core/Assert.hpp>
#include <QStyleOption>
#include <QPainter>
#include <QVBoxLayout>
#include <QLabel>
#include <QPushButton>
#include <QStackedWidget>
#include <QScrollArea>
#include <QGraphicsView>
#include <QGraphicsScene>
#include <QButtonGroup>
#include <QResizeEvent>
#include <QTimer>
#include <QMouseEvent>
#include <QCalendarWidget>
#include <QGridLayout>
#include <QRadioButton>
#include <iostream>
namespace openstudio {
OSInspectorView::OSInspectorView(bool addScrollArea, QWidget* parent) : QWidget(parent) {
this->setObjectName("GrayWidget");
auto* outerVLayout = new QVBoxLayout();
outerVLayout->setContentsMargins(0, 0, 0, 0);
this->setLayout(outerVLayout);
m_stackedWidget = new QStackedWidget();
if (addScrollArea) {
auto* scrollArea = new QScrollArea();
scrollArea->setFrameStyle(QFrame::NoFrame);
scrollArea->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
scrollArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAsNeeded);
outerVLayout->addWidget(scrollArea);
scrollArea->setWidget(m_stackedWidget);
scrollArea->setWidgetResizable(true);
scrollArea->viewport()->setAutoFillBackground(false);
m_stackedWidget->setAutoFillBackground(false);
} else {
outerVLayout->addWidget(m_stackedWidget);
}
}
void OSInspectorView::clearSelection() {
onClearSelection();
}
void OSInspectorView::selectItem(OSItem* item) {
onSelectItem(item);
}
QStackedWidget* OSInspectorView::stackedWidget() const {
return m_stackedWidget;
}
void OSInspectorView::update() {
onUpdate();
}
} // namespace openstudio