当前位置: 首页>>代码示例>>C++>>正文


C++ Label::addLeaf方法代码示例

本文整理汇总了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);
}
开发者ID:ALeggeUp,项目名称:Component-Organizer,代码行数:73,代码来源:co.cpp


注:本文中的Label::addLeaf方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。