MCPcopy Create free account
hub / github.com/KDE/labplot / addAspectToProject

Method addAspectToProject

src/frontend/MainWin.cpp:2907–2923  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2905}
2906
2907void MainWin::addAspectToProject(AbstractAspect* aspect) {
2908 const QModelIndex& index = m_projectExplorer->currentIndex();
2909 if (index.isValid()) {
2910 auto* parent = static_cast<AbstractAspect*>(index.internalPointer());
2911#ifdef HAVE_MQTT
2912 // doesn't make sense to add a new MQTTClient to an existing MQTTClient or to any of its successors
2913 QString className = QLatin1String(parent->metaObject()->className());
2914 auto* clientAncestor = parent->ancestor<MQTTClient>();
2915 if (className == QLatin1String("MQTTClient"))
2916 parent = parent->parentAspect();
2917 else if (clientAncestor != nullptr)
2918 parent = clientAncestor->parentAspect();
2919#endif
2920 parent->folder()->addChild(aspect);
2921 } else
2922 m_project->addChild(aspect);
2923}
2924
2925void MainWin::settingsDialog() {
2926 auto* dlg = new SettingsDialog(this, m_defaultSystemLocale);

Callers 12

newFolderMethod · 0.95
newWorkbookMethod · 0.95
newDatapickerMethod · 0.95
newSpreadsheetMethod · 0.95
newMatrixMethod · 0.95
newWorksheetMethod · 0.95
newNotesMethod · 0.95
newNotebookMethod · 0.95
newFolderMethod · 0.80
importToMethod · 0.80
importToMethod · 0.80
newDataContainerMethod · 0.80

Calls 6

classNameMethod · 0.80
parentAspectMethod · 0.80
folderMethod · 0.80
currentIndexMethod · 0.45
isValidMethod · 0.45
addChildMethod · 0.45

Tested by

no test coverage detected