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

Method selectCanvas

mainwindow.cpp:279–298  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

277}
278
279void MainWindow::selectCanvas(MyCanvas *canvas){
280 if(!curCanvas){
281 ui->displayLayout->removeWidget(defaultPage);
282 defaultPage->hide();
283 ui->displayLayout->addWidget(canvas);
284 canvas->show();
285 }
286 else{
287 ui->displayLayout->removeWidget(curCanvas);
288 curCanvas->hide();
289 ui->displayLayout->addWidget(canvas);
290 canvas->show();
291 }
292 curCanvas = canvas;
293 canvas->settingPage()->setParent(ui->mainWidget);
294 curSettingsPage = canvas->settingPage();
295 canvasTitle->setText(curCanvas->name());
296 canvasTitle->setMaximumWidth(QFontMetrics(QFont("Corbel Light", 24)).size(Qt::TextSingleLine, canvasTitle->text()).width() + 10);
297 canvasDesc->setText(curCanvas->description());
298}
299
300void MainWindow::deleteCanvas(MyCanvas *canvas){
301 int index = canvasList.indexOf(canvas);

Callers

nothing calls this directly

Calls 6

removeWidgetMethod · 0.80
addWidgetMethod · 0.80
settingPageMethod · 0.80
nameMethod · 0.80
descriptionMethod · 0.80
setTextMethod · 0.45

Tested by

no test coverage detected