MCPcopy Create free account
hub / github.com/c3d/tao3D / addExample

Method addExample

tao/examples_menu.cpp:48–64  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

46
47
48void ExamplesMenu::addExample(QString caption, QString path, QString tip)
49// ----------------------------------------------------------------------------
50// Add an entry to the menu, linking to a particular document
51// ----------------------------------------------------------------------------
52{
53 // If path is relative, prepend the templates directory
54 if (!path.contains("://") && !QFileInfo(path).isAbsolute())
55 path = QCoreApplication::applicationDirPath() + "/templates/" + path;
56
57 QAction * action = new QAction(caption, this);
58 action->setData(QVariant(path));
59 if (tip != "")
60 action->setToolTip(tip);
61 connect(action, SIGNAL(triggered()), this, SLOT(actionTriggered()));
62
63 addAction(action);
64}
65
66
67void ExamplesMenu::actionTriggered()

Callers 1

foreachFunction · 0.80

Calls 1

containsMethod · 0.45

Tested by

no test coverage detected