MCPcopy Create free account
hub / github.com/Linloir/GraphBuilder / Init

Method Init

mycanvas.cpp:145–432  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

143}
144
145void MyCanvas::Init(){
146 /* Create info widget */
147 infoWidget = new QWidget(this);
148 mainLayout->addWidget(infoWidget);
149 mainLayout->setStretch(0, 7);
150 mainLayout->setStretch(1, 3);
151 infoWidget->setMinimumWidth(250);
152 infoWidget->setMaximumWidth(500);
153
154 //Set basic layout
155 QVBoxLayout *infoLayout = new QVBoxLayout(infoWidget);
156 infoWidget->setLayout(infoLayout);
157 infoLayout->setContentsMargins(10, 0, 0, 0);
158 infoLayout->setAlignment(Qt::AlignTop);
159
160 QFont titleFont = QFont("Corbel", 20);
161
162 QWidget *upper = new QWidget(infoWidget);
163 QVBoxLayout *upperLayout = new QVBoxLayout(upper);
164 upper->setLayout(upperLayout);
165 upperLayout->setContentsMargins(0, 0, 0, 0);
166 upper->setContentsMargins(0, 0, 0, 0);
167 pageName = new QLabel(infoWidget);
168 pageName->setText("INFO");
169 pageName->setFont(titleFont);
170 pageName->setAlignment(Qt::AlignLeft | Qt::AlignTop);
171 pageName->setStyleSheet("color:#2c2c2c");
172 QWidget *upperSplitter = new QWidget(upper);
173 upperSplitter->setFixedSize(30, 6);
174 upperSplitter->setStyleSheet("background-color:#3c3c3c;border-radius:3px;");
175 upperLayout->addWidget(pageName);
176 upperLayout->addWidget(upperSplitter);
177
178 QWidget *lower = new QWidget(infoWidget);
179 QVBoxLayout *lowerLayout = new QVBoxLayout(lower);
180 lower->setLayout(lowerLayout);
181 lowerLayout->setContentsMargins(0, 0, 0, 0);
182 QLabel *logLabel = new QLabel(lower);
183 logLabel->setText("LOG");
184 logLabel->setFont(titleFont);
185 logLabel->setAlignment(Qt::AlignLeft | Qt::AlignTop);
186 logLabel->setStyleSheet("color:#2c2c2c");
187 QWidget *lowerSplitter = new QWidget(lower);
188 lowerSplitter->setFixedSize(30, 6);
189 lowerSplitter->setStyleSheet("background-color:#3c3c3c;border-radius:3px;");
190 ScrollAreaCustom *logDisplay = new ScrollAreaCustom(lower);
191 logDisplay->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
192 lowerLayout->addWidget(logLabel);
193 lowerLayout->addWidget(lowerSplitter);
194 lowerLayout->addWidget(logDisplay);
195
196 infoLayout->addWidget(upper);
197 infoLayout->addWidget(lower);
198
199 //Add specific items and connections
200 //Default page
201 QWidget *defInfoPage = new QWidget(infoWidget);
202 QVBoxLayout *defInfoLayout = new QVBoxLayout(defInfoPage);

Callers

nothing calls this directly

Calls 15

addWidgetMethod · 0.80
setValueMethod · 0.80
setValidatorMethod · 0.80
TextMethod · 0.80
selectedVexMethod · 0.80
weightTextMethod · 0.80
selectedArcMethod · 0.80
stVexMethod · 0.80
edVexMethod · 0.80
SetWeightMethod · 0.80
reverseDirectionMethod · 0.80
DelArcMethod · 0.80

Tested by

no test coverage detected