本文整理汇总了C++中Label::addLeaf方法的典型用法代码示例。如果您正苦于以下问题:C++ Label::addLeaf方法的具体用法?C++ Label::addLeaf怎么用?C++ Label::addLeaf使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Label
的用法示例。
在下文中一共展示了Label::addLeaf方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: useDefaultData
void CO::useDefaultData()
{
//TODO before adding default data, remove/delete the current one (if any)
// Default manufacturers
foreach(QString name, Manufacturer::defaultNames())
m_manufacturers.append(new Manufacturer(name, this));
// Default packages
foreach(QString name, Package::defaultNames())
m_packages.append(new Package(name, this));
// Default labels
Label *top;
top = new Label(tr("Transistor"));
top->addLeaf(new Label(tr("BJT"), top));
top->addLeaf(new Label(tr("MOS"), top));
top->addLeaf(new Label(tr("JFET"), top));
top->addLeaf(new Label(tr("IGBT"), top));
m_topLabels.append(top);
top = new Label(tr("Diode"));
top->addLeaf(new Label(tr("Fast Recovery"), top));
top->addLeaf(new Label(tr("Zener"), top));
top->addLeaf(new Label(tr("LED"), top));
m_topLabels.append(top);
top = new Label(tr("Resistor"));
m_topLabels.append(top);
top = new Label(tr("Capacitor"));
m_topLabels.append(top);
top = new Label(tr("Inductor"));
m_topLabels.append(top);
top = new Label(tr("Microcontroller"));
top->addLeaf(new Label(tr("PIC"), top));
top->addLeaf(new Label(tr("ATmega"), top));
top->addLeaf(new Label(tr("MSP430"), top));
m_topLabels.append(top);
top = new Label(tr("Sensor"));
top->addLeaf(new Label(tr("Accelerometer"), top));
top->addLeaf(new Label(tr("Gyroscope"), top));
top->addLeaf(new Label(tr("Humidity"), top));
top->addLeaf(new Label(tr("Temperature"), top));
top->addLeaf(new Label(tr("Pressure"), top));
top->addLeaf(new Label(tr("Light"), top));
top->addLeaf(new Label(tr("Current"), top));
m_topLabels.append(top);
top = new Label(tr("Data Converter"));
top->addLeaf(new Label(tr("A/D"), top));
top->addLeaf(new Label(tr("D/A"), top));
m_topLabels.append(top);
top = new Label(tr("Interface"));
top->addLeaf(new Label(tr("USB"), top));
top->addLeaf(new Label(tr("I2C"), top));
m_topLabels.append(top);
top = new Label(tr("Supply"));
top->addLeaf(new Label(tr("LDO")));
top->addLeaf(new Label(tr("Buck-Boost")));
m_topLabels.append(top);
top = new Label(tr("Memory"));
top->addLeaf(new Label(tr("EEPROM"), top));
top->addLeaf(new Label(tr("SRAM"), top));
m_topLabels.append(top);
}